--- #hide
module Network.HTTP.Lucu.Chunk
( chunkHeaderP -- Num a => Parser a
, chunkFooterP -- Parser ()
chunkHeaderP :: Num a => Parser a
chunkHeaderP = do hexLen <- many1 hexDigit
- extension
- crlf
+ _ <- extension
+ _ <- crlf
let [(len, _)] = readHex hexLen
return len
where
extension :: Parser ()
- extension = do many $ do char ';'
- token
- char '='
- token <|> quotedStr
- return ()
+ extension = many ( char ';' >>
+ token >>
+ char '=' >>
+ ( token <|> quotedStr )
+ )
+ >>
+ return ()
+{-# SPECIALIZE chunkHeaderP :: Parser Int #-}
chunkFooterP :: Parser ()