]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/MIMEType.hs
Fixed two bugs
[Lucu.git] / Network / HTTP / Lucu / MIMEType.hs
index 947cb004cc8fe62c57492decb78de60636d14567..a8f04377da6defab7c0ef546c7b969eabd43262f 100644 (file)
@@ -13,6 +13,7 @@ import qualified Data.ByteString.Lazy as B
 import           Network.HTTP.Lucu.Parser
 import           Network.HTTP.Lucu.Parser.Http
 import           Network.HTTP.Lucu.Utils
+import           Prelude hiding (min)
 
 -- |@'MIMEType' \"major\" \"minor\" [(\"name\", \"value\")]@
 -- represents \"major\/minor; name=value\".
@@ -46,11 +47,10 @@ instance Read MIMEType where
 -- exception for parse error.
 parseMIMEType :: String -> MIMEType
 parseMIMEType str = case parseStr mimeTypeP str of
-                      (Success t, r) -> if B.null r then
-                                            t
-                                        else
-                                            error ("unparsable MIME Type: " ++ str)
-                      _              -> error ("unparsable MIME Type: " ++ str)
+                      (# Success t, r #) -> if B.null r
+                                            then t
+                                            else error ("unparsable MIME Type: " ++ str)
+                      (# _        , _ #) -> error ("unparsable MIME Type: " ++ str)
 
 
 mimeTypeP :: Parser MIMEType