-- #prune
--- |Creation and comparison of entity tags.
+-- |Manipulation of entity tags.
module Network.HTTP.Lucu.ETag
( ETag(..)
, strongETag
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
++
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
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