opentheory-parser-1.160: Stream parsers

LicenseMIT
MaintainerJoe Leslie-Hurd <joe@gilith.com>
Stabilityprovisional
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

OpenTheory.Parser

Description

 

Documentation

newtype Parser a b Source

Constructors

Parser 

Fields

unParser :: a -> Stream a -> Maybe (b, Stream a)
 

token :: (a -> Maybe b) -> Parser a b Source

some :: (a -> Bool) -> Parser a a Source

apply :: Parser a b -> Stream a -> Maybe (b, Stream a) Source

mapPartial :: Parser a b -> (b -> Maybe c) -> Parser a c Source

filterParser :: Parser a b -> (b -> Bool) -> Parser a b Source

fold :: (a -> c -> Maybe (Either b c)) -> c -> Parser a b Source

foldN :: (a -> b -> Maybe b) -> Natural -> b -> Parser a b Source

mapParser :: Parser a b -> (b -> c) -> Parser a c Source

orelse :: Parser a b -> Parser a b -> Parser a b Source

pair :: Parser a b -> Parser a c -> Parser a (b, c) Source

parse :: Parser a b -> Stream a -> Stream b Source