X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FETag.hs;h=d607ad12db4d2fa22ec529a2f0456f9c7e4644f7;hb=1196f43ecedbb123515065f0440844864af906fb;hp=bdb1473786a001fa016f9e4b8440892c5220060f;hpb=175e14b3b144537644e65ca76f1fca5c56fd44e9;p=Lucu.git diff --git a/Network/HTTP/Lucu/ETag.hs b/Network/HTTP/Lucu/ETag.hs index bdb1473..d607ad1 100644 --- a/Network/HTTP/Lucu/ETag.hs +++ b/Network/HTTP/Lucu/ETag.hs @@ -1,4 +1,4 @@ --- #prune +{-# OPTIONS_HADDOCK prune #-} -- |Manipulation of entity tags. module Network.HTTP.Lucu.ETag @@ -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