X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FETag.hs;h=158144cc5254677e59c5080d2636a80c7c6a3b2c;hb=3d017dd65ddede9a11c5b7a34a91e04340e67bc4;hp=856588364b7c1a73daa4c2d46c280feefa18bbf0;hpb=b340a77fa7bd051dd13a41d0a5b1ad30220bc6b6;p=Lucu.git diff --git a/Network/HTTP/Lucu/ETag.hs b/Network/HTTP/Lucu/ETag.hs index 8565883..158144c 100644 --- a/Network/HTTP/Lucu/ETag.hs +++ b/Network/HTTP/Lucu/ETag.hs @@ -1,6 +1,6 @@ -- #prune --- |Creation and comparison of entity tags. +-- |Manipulation of entity tags. module Network.HTTP.Lucu.ETag ( ETag(..) , strongETag @@ -12,17 +12,17 @@ module Network.HTTP.Lucu.ETag import Control.Monad import Network.HTTP.Lucu.Parser -import Network.HTTP.Lucu.Parser.Http +import Network.HTTP.Lucu.Parser.Http hiding (token) import Network.HTTP.Lucu.Utils -- |An entity tag is made of a weakness flag and a opaque string. data ETag = ETag { -- |The weakness flag. Weak tags looks like W\/\"blahblah\" and -- strong tags are like \"blahblah\". - etagIsWeak :: Bool + etagIsWeak :: !Bool -- |An opaque string. Only characters from 0x20 (sp) to 0x7e (~) -- are allowed. - , etagToken :: String + , etagToken :: !String } deriving (Eq) instance Show ETag where @@ -33,13 +33,13 @@ instance Show ETag where ++ quoteStr token --- |This is an equivalent to @'ETag' False@. If you want to generate --- an ETag from a file, try using +-- |This is equivalent to @'ETag' 'Prelude.False'@. If you want to +-- generate an ETag from a file, try using -- 'Network.HTTP.Lucu.StaticFile.generateETagFromFile'. strongETag :: String -> ETag strongETag = ETag False --- |This is an equivalent to @'ETag' True@. +-- |This is equivalent to @'ETag' 'Prelude.True'@. weakETag :: String -> ETag weakETag = ETag True @@ -52,7 +52,7 @@ eTagP = do isWeak <- option False (string "W/" >> return True) eTagListP :: Parser [ETag] eTagListP = allowEOF - $ do xs <- listOf eTagP - when (null xs) - $ fail "" - return xs + $! do xs <- listOf eTagP + when (null xs) + $ fail "" + return xs