Portability | portable |
---|---|
Stability | provisional |
Maintainer | claude@mathr.co.uk |
Safe Haskell | Safe-Infered |
Lower-level functions for parsing PNM image format headers. Most users shouldn't need to import this module directly.
- data Parse p
- rawChar :: ByteString -> Parse Word8
- char :: ByteString -> Parse Word8
- dropWhile :: (Word8 -> Bool) -> (ByteString -> Parse Word8) -> ByteString -> Parse ()
- takeUntil :: (Word8 -> Bool) -> (ByteString -> Parse Word8) -> ByteString -> Parse ByteString
- token :: ByteString -> Parse ByteString
- string :: ByteString -> ByteString -> Parse ()
- number :: ByteString -> Parse Integer
- decimal :: ByteString -> Maybe Integer
- oneSpace :: ByteString -> Parse ()
- str :: String -> ByteString
- isSpace, isEndComment, isStartComment, isDigit :: Word8 -> Bool
- ht, space, cr, ff, vt, lf :: Word8
- hash :: Word8
- d0, d9, d8, d7, d6, d5, d4, d3, d2, d1 :: Word8
- (++) :: ByteString -> ByteString -> ByteString
Documentation
The result of parsing.
rawChar :: ByteString -> Parse Word8Source
The next character.
char :: ByteString -> Parse Word8Source
The next non-comment character. Comments can occur in the middle of what might be considered tokens.
dropWhile :: (Word8 -> Bool) -> (ByteString -> Parse Word8) -> ByteString -> Parse ()Source
Drop input while a predicate holds.
takeUntil :: (Word8 -> Bool) -> (ByteString -> Parse Word8) -> ByteString -> Parse ByteStringSource
Take input until a predicate holds.
token :: ByteString -> Parse ByteStringSource
Parse a token.
string :: ByteString -> ByteString -> Parse ()Source
Parse a fixed string.
number :: ByteString -> Parse IntegerSource
Parse a positive decimal number.
decimal :: ByteString -> Maybe IntegerSource
Number conversion.
oneSpace :: ByteString -> Parse ()Source
Parse a single space.
str :: String -> ByteStringSource
Convert from a string. Crashes hard on non-ASCII input.
isSpace, isEndComment, isStartComment, isDigit :: Word8 -> BoolSource
Character classes.
(++) :: ByteString -> ByteString -> ByteStringSource
Alias for append
.