pnm-0.1.0.0: PNM image format header parsing and pretty printing

Portabilityportable
Stabilityprovisional
Maintainerclaude@mathr.co.uk
Safe HaskellSafe-Infered

Codec.PNM.Parse

Description

Lower-level functions for parsing PNM image format headers. Most users shouldn't need to import this module directly.

Synopsis

Documentation

data Parse p Source

The result of parsing.

Instances

Eq p => Eq (Parse p) 
Ord p => Ord (Parse p) 
Show p => Show (Parse p) 

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.

ht, space, cr, ff, vt, lf :: Word8Source

White space characters.

hash :: Word8Source

Comment start character.

d0, d9, d8, d7, d6, d5, d4, d3, d2, d1 :: Word8Source

Decimal digit characters.