Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)
Safe HaskellNone

Util.UF

Description

UntilFail list.

Synopsis

Documentation

data UntilFail err a Source #

This is a list, optionally terminated with an error.

Constructors

a :+ (UntilFail err a) infixr 9 
Done 
Fail err 

Instances

Instances details
Functor (UntilFail err) # 
Instance details

Defined in Util.UF

Methods

fmap :: (a -> b) -> UntilFail err a -> UntilFail err b #

(<$) :: a -> UntilFail err b -> UntilFail err a #

(Eq a, Eq err) => Eq (UntilFail err a) # 
Instance details

Defined in Util.UF

Methods

(==) :: UntilFail err a -> UntilFail err a -> Bool #

(/=) :: UntilFail err a -> UntilFail err a -> Bool #

(Show a, Show err) => Show (UntilFail err a) # 
Instance details

Defined in Util.UF

Methods

showsPrec :: Int -> UntilFail err a -> ShowS #

show :: UntilFail err a -> String #

showList :: [UntilFail err a] -> ShowS #

(Pretty.Pretty err, Pretty.Pretty a) => Pretty.Pretty (UntilFail err a) # 
Instance details

Defined in Util.UF

Methods

pretty :: UntilFail err a -> Text Source #

format :: UntilFail err a -> Doc Source #

formatList :: [UntilFail err a] -> Doc Source #

fromListFail :: [a] -> err -> UntilFail err a Source #

fromList :: [a] -> UntilFail err a Source #

singleton :: a -> UntilFail err a Source #

toList :: UntilFail err a -> ([a], Maybe err) Source #

map :: (a -> Either err b) -> UntilFail err a -> UntilFail err b Source #

concatMap :: (a -> UntilFail err b) -> UntilFail err a -> UntilFail err b Source #

process :: (a -> [a] -> (UntilFail err b, [a])) -> [a] -> UntilFail err b Source #

Like concatMap, but consume and produce a variable number of results.

A more precise type would end with Done [a].

processM :: Monad m => (a -> [a] -> m (UntilFail err b, [a])) -> [a] -> m (UntilFail err b) Source #