]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/MIMEType/Guess.hs
Use base64-bytestring instead of dataenc
[Lucu.git] / Network / HTTP / Lucu / MIMEType / Guess.hs
index d94711ac624cdfa9878243b55f46b1dbca61b223..39de37e07d68464b8029021f745e956fa236c036 100644 (file)
@@ -1,3 +1,7 @@
+{-# LANGUAGE
+    UnboxedTuples
+  , UnicodeSyntax
+  #-}
 -- |MIME Type guessing by a file extension. This is a poor man's way
 -- of guessing MIME Types. It is simple and fast.
 --
@@ -21,7 +25,6 @@ import           Network.HTTP.Lucu.MIMEType
 import           Network.HTTP.Lucu.Parser
 import           Network.HTTP.Lucu.Parser.Http
 import           Network.HTTP.Lucu.Utils
-import           System.IO
 
 -- |'Data.Map.Map' from extension to MIME Type.
 type ExtMap = Map String MIMEType
@@ -56,14 +59,14 @@ extMapP = do xs <- many (comment <|> validLine <|> emptyLine)
     where
       spc = oneOf " \t"
 
-      comment = do many spc
-                   char '#'
-                   many $ satisfy (/= '\n')
-                   return Nothing
+      comment = many spc >>
+                char '#' >>
+                ( many $ satisfy (/= '\n') ) >>
+                return Nothing
 
-      validLine = do many spc
+      validLine = do _    <- many spc
                      mime <- mimeTypeP
-                     many spc
+                     _    <- many spc
                      exts <- sepBy token (many spc)
                      return $ Just (mime, exts)