Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

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) Source # 
Instance details

Defined in Util.UF

Methods

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

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

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

Defined in Util.UF

Methods

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

show :: UntilFail err a -> String #

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

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

Defined in Util.UF

Methods

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

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

(Pretty.Pretty err, Pretty.Pretty a) => Pretty.Pretty (UntilFail err a) Source # 
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 #