X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FMIMEType%2FGuess.hs;h=3e3df1631b7af87c29012159681bc2474df5c10f;hb=ca338174155913a969808d7b20193973394e474e;hp=226e01483cb233ecf88be8b0e0871f71678e3058;hpb=2bb7a0baa35dadb5d36d3f9fa98bd242baabc6d1;p=Lucu.git diff --git a/Network/HTTP/Lucu/MIMEType/Guess.hs b/Network/HTTP/Lucu/MIMEType/Guess.hs index 226e014..3e3df16 100644 --- a/Network/HTTP/Lucu/MIMEType/Guess.hs +++ b/Network/HTTP/Lucu/MIMEType/Guess.hs @@ -17,7 +17,7 @@ module Network.HTTP.Lucu.MIMEType.Guess import Control.Applicative import qualified Data.Ascii as A import Data.Attoparsec.Char8 as P -import qualified Data.Attoparsec.Lazy as AL +import qualified Data.Attoparsec.Lazy as LP import qualified Data.ByteString.Lazy.Char8 as B import qualified Data.Map as M import Data.Map (Map) @@ -45,9 +45,9 @@ guessTypeByFileName !extMap !fpath parseExtMapFile ∷ FilePath → IO ExtMap parseExtMapFile fpath = do file ← B.readFile fpath - case AL.parse extMapP file of - AL.Done _ xs → return $ compile xs - AL.Fail _ _ e → fail ("Failed to parse: " ⧺ fpath ⧺ ": " ⧺ e) + case LP.parse extMapP file of + LP.Done _ xs → return $ compile xs + LP.Fail _ _ e → fail ("Failed to parse: " ⧺ fpath ⧺ ": " ⧺ e) extMapP ∷ Parser [ (MIMEType, [Text]) ] extMapP = do xs ← P.many (comment <|> validLine <|> emptyLine)