DoAndIfThenElse
, FlexibleContexts
, OverloadedStrings
+ , QuasiQuotes
, RecordWildCards
, ScopedTypeVariables
, UnicodeSyntax
import qualified Data.Text as T
import Network.HTTP.Lucu.Headers
import Network.HTTP.Lucu.MIMEParams
-import Network.HTTP.Lucu.MIMEType
+import Network.HTTP.Lucu.MIMEType (MIMEType)
+import qualified Network.HTTP.Lucu.MIMEType as MT
+import Network.HTTP.Lucu.MIMEType.TH
import Network.HTTP.Lucu.Parser
import Network.HTTP.Lucu.Parser.Http
import Prelude.Unicode
⧺ e
where
defaultCType ∷ MIMEType
- defaultCType = parseMIMEType "text/plain"
+ defaultCType = [mimeType| text/plain |]
partHeader ∷ Parser Headers
partHeader = crlf *> headers
Nothing
→ return Nothing
Just str
- → case parseOnly (finishOff mimeType) $ A.toByteString str of
+ → case parseOnly (finishOff MT.mimeType) $ A.toByteString str of
Right d → return $ Just d
Left err → throwError $ "malformed Content-Type: "
⧺ A.toString str