Safe Haskell | None |
---|---|
Language | Haskell2010 |
- hadCRLF :: Word8 -> Word8 -> Maybe Word8
- consumeTillEndLine :: Parser ByteString
- isWhitespace :: Word8 -> Bool
- isConsequentHeaderLine :: Parser ByteString
- commentRemover :: Text -> Text
- findHeader :: Text -> [Header] -> Either ErrorMessage Header
- eitherToMaybe :: Either a b -> Maybe b
Documentation
hadCRLF :: Word8 -> Word8 -> Maybe Word8 Source #
If the previous character was a carriage return and the current is a line feed, stop parsing
consumeTillEndLine :: Parser ByteString Source #
Consumes a line until CRLF is hit
isWhitespace :: Word8 -> Bool Source #
Can a given character be regarded as a whitespace?
isConsequentHeaderLine :: Parser ByteString Source #
If the next line is a part of a previous header, parse it. Fail otherwise
commentRemover :: Text -> Text Source #
Remove a MIME header comment and return a header without the comment
findHeader :: Text -> [Header] -> Either ErrorMessage Header Source #
Given a header name, it will try to locate it in a list of headers, fail if it's not there
eitherToMaybe :: Either a b -> Maybe b Source #