2 | import Data.ByteString
13 | Interpolation Status where
14 | interpolate (MkStatus c m) = "\{show c} \{m}"
17 | Cast Status ByteString where
18 | cast = fromString . interpolate
22 | ok200 = MkStatus 200 "OK"
26 | created201 = MkStatus 201 "Created"
29 | accepted202 : Status
30 | accepted202 = MkStatus 202 "Accepted"
33 | noContent204 : Status
34 | noContent204 = MkStatus 204 "No Content"
37 | badRequest400 : Status
38 | badRequest400 = MkStatus 400 "Bad Request"
41 | unauthorized401 : Status
42 | unauthorized401 = MkStatus 401 "Unauthorized"
45 | forbidden403 : Status
46 | forbidden403 = MkStatus 403 "Forbidden"
49 | notFound404 : Status
50 | notFound404 = MkStatus 404 "Not Found"
53 | methodNotAllowed405 : Status
54 | methodNotAllowed405 = MkStatus 405 "Method Not Allowed"
57 | notAcceptable406 : Status
58 | notAcceptable406 = MkStatus 406 "Not Acceptable"
61 | conflict409 : Status
62 | conflict409 = MkStatus 409 "Conflict"
65 | contentTooLarge413 : Status
66 | contentTooLarge413 = MkStatus 413 "Content Too Large"
69 | unsupportedMediaType415 : Status
70 | unsupportedMediaType415 = MkStatus 415 "Unsupported Media Type"
73 | requestHeaderFieldsTooLarge431 : Status
74 | requestHeaderFieldsTooLarge431 = MkStatus 431 "Request Header Fields Too Large"
77 | internalServerError500 : Status
78 | internalServerError500 = MkStatus 500 "Internal Server Error"
81 | notImplemented501 : Status
82 | notImplemented501 = MkStatus 501 "Not Implemented"
85 | insufficientStorage507 : Status
86 | insufficientStorage507 = MkStatus 507 "Insufficient Storage"
89 | networkAuthenticationRequired511 : Status
90 | networkAuthenticationRequired511 = MkStatus 511 "Network Authentication Required"