X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FMIMEType.hs;h=9f653230d3597ae298cdeec99fca07276242b9f6;hp=b41bbcd50f07b9857625e08ac7dda9107faef95a;hb=858129cb755aa09da2b7bd758efb8519f2c89103;hpb=5b255535f2c7d2a6d4622ad164b31e63746b906e diff --git a/Network/HTTP/Lucu/MIMEType.hs b/Network/HTTP/Lucu/MIMEType.hs index b41bbcd..9f65323 100644 --- a/Network/HTTP/Lucu/MIMEType.hs +++ b/Network/HTTP/Lucu/MIMEType.hs @@ -18,9 +18,9 @@ import Network.HTTP.Lucu.Utils -- |@'MIMEType' \"major\" \"minor\" [(\"name\", \"value\")]@ -- represents \"major\/minor; name=value\". data MIMEType = MIMEType { - mtMajor :: String - , mtMinor :: String - , mtParams :: [ (String, String) ] + mtMajor :: !String + , mtMinor :: !String + , mtParams :: ![ (String, String) ] } deriving (Eq) @@ -52,7 +52,8 @@ maj min -- |This operator appends a @(name, value)@ pair to a MIME Type. (<:>) :: MIMEType -> (String, String) -> MIMEType mt@(MIMEType _ _ params) <:> pair - = mt { + = pair `seq` + mt { mtParams = mtParams mt ++ [pair] } @@ -67,7 +68,7 @@ name <=> value = (name, value) mimeTypeP :: Parser MIMEType -mimeTypeP = allowEOF $ +mimeTypeP = allowEOF $! do maj <- token char '/' min <- token @@ -84,4 +85,4 @@ mimeTypeP = allowEOF $ return (name, value) mimeTypeListP :: Parser [MIMEType] -mimeTypeListP = allowEOF $ listOf mimeTypeP +mimeTypeListP = allowEOF $! listOf mimeTypeP