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

Util.EList

Description

EList is a stream of elements, which may either carry a value, or be some kind of metadata, and functions to process values and ignore the metadata.

Synopsis

Documentation

data Elt e a Source #

Constructors

Meta !e 
Elt !a 

Instances

Instances details
Bifunctor Elt Source # 
Instance details

Defined in Util.EList

Methods

bimap :: (a -> b) -> (c -> d) -> Elt a c -> Elt b d #

first :: (a -> b) -> Elt a c -> Elt b c #

second :: (b -> c) -> Elt a b -> Elt a c #

Foldable (Elt e) Source # 
Instance details

Defined in Util.EList

Methods

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

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

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

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

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

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

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

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

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

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

null :: Elt e a -> Bool #

length :: Elt e a -> Int #

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

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

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

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

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

Traversable (Elt e) Source # 
Instance details

Defined in Util.EList

Methods

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

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

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

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

Functor (Elt e) Source # 
Instance details

Defined in Util.EList

Methods

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

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

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

Defined in Util.EList

Methods

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

show :: Elt e a -> String #

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

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

Defined in Util.EList

Methods

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

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

metas :: [Elt e a] -> [e] Source #

elts :: [Elt e a] -> [a] Source #

partition :: [Elt e a] -> ([e], [a]) Source #

either :: (e -> b) -> (a -> b) -> Elt e a -> b Source #

fromEither :: Either e a -> Elt e a Source #

toEither :: Elt e a -> Either e a Source #

map :: (a -> b) -> [Elt e a] -> [Elt e b] Source #

mapM :: Applicative m => (a -> m b) -> [Elt e a] -> m [Elt e b] Source #

apply :: Applicative m => (a -> m (Elt e b)) -> Elt e a -> m (Elt e b) Source #

Like traverse, but the function can return Meta.

mapE :: (a -> Elt e b) -> [Elt e a] -> [Elt e b] Source #

Like map, except the function can also return Meta.

mapEM :: Applicative m => (a -> m (Elt e b)) -> [Elt e a] -> m [Elt e b] Source #

concatMapE :: (a -> [Elt e b]) -> [Elt e a] -> [Elt e b] Source #

concatMapEM :: Applicative m => (a -> m [Elt e b]) -> [Elt e a] -> m [Elt e b] Source #

mapAccumLE :: (state -> a -> (state, Elt e b)) -> state -> [Elt e a] -> (state, [Elt e b]) Source #

zip :: [a] -> [Elt e b] -> [Elt e (a, b)] Source #

zipPaddedSnd :: [a] -> [Elt e b] -> [Elt e (a, Maybe b)] Source #

zip3 :: [a] -> [b] -> [Elt e c] -> [Elt e (a, b, c)] Source #

zip4 :: [a] -> [b] -> [c] -> [Elt e d] -> [Elt e (a, b, c, d)] Source #

zipNexts :: [Elt e a] -> [Elt e (a, [a])] Source #