simple-parser-0.2.0: Simple parser combinators
Safe HaskellNone
LanguageHaskell2010

SimpleParser.Result

Synopsis

Documentation

data ParseResult e s a Source #

Strict pair of parse result and state at the time it was yielded.

Constructors

ParseResult 

Fields

Instances

Instances details
Functor (ParseResult e s) Source # 
Instance details

Defined in SimpleParser.Result

Methods

fmap :: (a -> b) -> ParseResult e s a -> ParseResult e s b #

(<$) :: a -> ParseResult e s b -> ParseResult e s a #

Foldable (ParseResult e s) Source # 
Instance details

Defined in SimpleParser.Result

Methods

fold :: Monoid m => ParseResult e s m -> m #

foldMap :: Monoid m => (a -> m) -> ParseResult e s a -> m #

foldMap' :: Monoid m => (a -> m) -> ParseResult e s a -> m #

foldr :: (a -> b -> b) -> b -> ParseResult e s a -> b #

foldr' :: (a -> b -> b) -> b -> ParseResult e s a -> b #

foldl :: (b -> a -> b) -> b -> ParseResult e s a -> b #

foldl' :: (b -> a -> b) -> b -> ParseResult e s a -> b #

foldr1 :: (a -> a -> a) -> ParseResult e s a -> a #

foldl1 :: (a -> a -> a) -> ParseResult e s a -> a #

toList :: ParseResult e s a -> [a] #

null :: ParseResult e s a -> Bool #

length :: ParseResult e s a -> Int #

elem :: Eq a => a -> ParseResult e s a -> Bool #

maximum :: Ord a => ParseResult e s a -> a #

minimum :: Ord a => ParseResult e s a -> a #

sum :: Num a => ParseResult e s a -> a #

product :: Num a => ParseResult e s a -> a #

Traversable (ParseResult e s) Source # 
Instance details

Defined in SimpleParser.Result

Methods

traverse :: Applicative f => (a -> f b) -> ParseResult e s a -> f (ParseResult e s b) #

sequenceA :: Applicative f => ParseResult e s (f a) -> f (ParseResult e s a) #

mapM :: Monad m => (a -> m b) -> ParseResult e s a -> m (ParseResult e s b) #

sequence :: Monad m => ParseResult e s (m a) -> m (ParseResult e s a) #

(Eq e, Eq a, Eq s) => Eq (ParseResult e s a) Source # 
Instance details

Defined in SimpleParser.Result

Methods

(==) :: ParseResult e s a -> ParseResult e s a -> Bool #

(/=) :: ParseResult e s a -> ParseResult e s a -> Bool #

(Show e, Show a, Show s) => Show (ParseResult e s a) Source # 
Instance details

Defined in SimpleParser.Result

Methods

showsPrec :: Int -> ParseResult e s a -> ShowS #

show :: ParseResult e s a -> String #

showList :: [ParseResult e s a] -> ShowS #

data ParseValue e a Source #

Strict Either for parse results.

Constructors

ParseError !e 
ParseSuccess !a 

Instances

Instances details
Functor (ParseValue e) Source # 
Instance details

Defined in SimpleParser.Result

Methods

fmap :: (a -> b) -> ParseValue e a -> ParseValue e b #

(<$) :: a -> ParseValue e b -> ParseValue e a #

Foldable (ParseValue e) Source # 
Instance details

Defined in SimpleParser.Result

Methods

fold :: Monoid m => ParseValue e m -> m #

foldMap :: Monoid m => (a -> m) -> ParseValue e a -> m #

foldMap' :: Monoid m => (a -> m) -> ParseValue e a -> m #

foldr :: (a -> b -> b) -> b -> ParseValue e a -> b #

foldr' :: (a -> b -> b) -> b -> ParseValue e a -> b #

foldl :: (b -> a -> b) -> b -> ParseValue e a -> b #

foldl' :: (b -> a -> b) -> b -> ParseValue e a -> b #

foldr1 :: (a -> a -> a) -> ParseValue e a -> a #

foldl1 :: (a -> a -> a) -> ParseValue e a -> a #

toList :: ParseValue e a -> [a] #

null :: ParseValue e a -> Bool #

length :: ParseValue e a -> Int #

elem :: Eq a => a -> ParseValue e a -> Bool #

maximum :: Ord a => ParseValue e a -> a #

minimum :: Ord a => ParseValue e a -> a #

sum :: Num a => ParseValue e a -> a #

product :: Num a => ParseValue e a -> a #

Traversable (ParseValue e) Source # 
Instance details

Defined in SimpleParser.Result

Methods

traverse :: Applicative f => (a -> f b) -> ParseValue e a -> f (ParseValue e b) #

sequenceA :: Applicative f => ParseValue e (f a) -> f (ParseValue e a) #

mapM :: Monad m => (a -> m b) -> ParseValue e a -> m (ParseValue e b) #

sequence :: Monad m => ParseValue e (m a) -> m (ParseValue e a) #

(Eq e, Eq a) => Eq (ParseValue e a) Source # 
Instance details

Defined in SimpleParser.Result

Methods

(==) :: ParseValue e a -> ParseValue e a -> Bool #

(/=) :: ParseValue e a -> ParseValue e a -> Bool #

(Show e, Show a) => Show (ParseValue e a) Source # 
Instance details

Defined in SimpleParser.Result

Methods

showsPrec :: Int -> ParseValue e a -> ShowS #

show :: ParseValue e a -> String #

showList :: [ParseValue e a] -> ShowS #

parseValue :: (e -> r) -> (a -> r) -> ParseValue e a -> r Source #