gambler-0.1.0.0: Composable, streaming, and efficient left folds
Safe HaskellSafe-Inferred
LanguageGHC2021

Fold.Types

Synopsis

Documentation

data Fold a b Source #

Processes inputs of type a and results in a value of type b

Instances

Instances details
Applicative (Fold a) Source # 
Instance details

Defined in Fold.Pure.Type

Methods

pure :: a0 -> Fold a a0 #

(<*>) :: Fold a (a0 -> b) -> Fold a a0 -> Fold a b #

liftA2 :: (a0 -> b -> c) -> Fold a a0 -> Fold a b -> Fold a c #

(*>) :: Fold a a0 -> Fold a b -> Fold a b #

(<*) :: Fold a a0 -> Fold a b -> Fold a a0 #

Functor (Fold a) Source # 
Instance details

Defined in Fold.Pure.Type

Methods

fmap :: (a0 -> b) -> Fold a a0 -> Fold a b #

(<$) :: a0 -> Fold a b -> Fold a a0 #

Monoid b => Monoid (Fold a b) Source # 
Instance details

Defined in Fold.Pure.Type

Methods

mempty :: Fold a b #

mappend :: Fold a b -> Fold a b -> Fold a b #

mconcat :: [Fold a b] -> Fold a b #

Semigroup b => Semigroup (Fold a b) Source # 
Instance details

Defined in Fold.Pure.Type

Methods

(<>) :: Fold a b -> Fold a b -> Fold a b #

sconcat :: NonEmpty (Fold a b) -> Fold a b #

stimes :: Integral b0 => b0 -> Fold a b -> Fold a b #

data NonemptyFold a b Source #

Processes at least one input of type a and results in a value of type b

Instances

Instances details
Applicative (NonemptyFold a) Source # 
Instance details

Defined in Fold.Nonempty.Type

Methods

pure :: a0 -> NonemptyFold a a0 #

(<*>) :: NonemptyFold a (a0 -> b) -> NonemptyFold a a0 -> NonemptyFold a b #

liftA2 :: (a0 -> b -> c) -> NonemptyFold a a0 -> NonemptyFold a b -> NonemptyFold a c #

(*>) :: NonemptyFold a a0 -> NonemptyFold a b -> NonemptyFold a b #

(<*) :: NonemptyFold a a0 -> NonemptyFold a b -> NonemptyFold a a0 #

Functor (NonemptyFold a) Source # 
Instance details

Defined in Fold.Nonempty.Type

Methods

fmap :: (a0 -> b) -> NonemptyFold a a0 -> NonemptyFold a b #

(<$) :: a0 -> NonemptyFold a b -> NonemptyFold a a0 #

Monoid b => Monoid (NonemptyFold a b) Source # 
Instance details

Defined in Fold.Nonempty.Type

Semigroup b => Semigroup (NonemptyFold a b) Source # 
Instance details

Defined in Fold.Nonempty.Type

Methods

(<>) :: NonemptyFold a b -> NonemptyFold a b -> NonemptyFold a b #

sconcat :: NonEmpty (NonemptyFold a b) -> NonemptyFold a b #

stimes :: Integral b0 => b0 -> NonemptyFold a b -> NonemptyFold a b #

data EffectfulFold m a b Source #

Processes inputs of type a and results in an effectful value of type m b

Instances

Instances details
Applicative m => Applicative (EffectfulFold m a) Source # 
Instance details

Defined in Fold.Effectful.Type

Methods

pure :: a0 -> EffectfulFold m a a0 #

(<*>) :: EffectfulFold m a (a0 -> b) -> EffectfulFold m a a0 -> EffectfulFold m a b #

liftA2 :: (a0 -> b -> c) -> EffectfulFold m a a0 -> EffectfulFold m a b -> EffectfulFold m a c #

(*>) :: EffectfulFold m a a0 -> EffectfulFold m a b -> EffectfulFold m a b #

(<*) :: EffectfulFold m a a0 -> EffectfulFold m a b -> EffectfulFold m a a0 #

Functor m => Functor (EffectfulFold m a) Source # 
Instance details

Defined in Fold.Effectful.Type

Methods

fmap :: (a0 -> b) -> EffectfulFold m a a0 -> EffectfulFold m a b #

(<$) :: a0 -> EffectfulFold m a b -> EffectfulFold m a a0 #

(Monoid b, Monad m) => Monoid (EffectfulFold m a b) Source # 
Instance details

Defined in Fold.Effectful.Type

Methods

mempty :: EffectfulFold m a b #

mappend :: EffectfulFold m a b -> EffectfulFold m a b -> EffectfulFold m a b #

mconcat :: [EffectfulFold m a b] -> EffectfulFold m a b #

(Semigroup b, Monad m) => Semigroup (EffectfulFold m a b) Source # 
Instance details

Defined in Fold.Effectful.Type

Methods

(<>) :: EffectfulFold m a b -> EffectfulFold m a b -> EffectfulFold m a b #

sconcat :: NonEmpty (EffectfulFold m a b) -> EffectfulFold m a b #

stimes :: Integral b0 => b0 -> EffectfulFold m a b -> EffectfulFold m a b #

data ShortcutFold a b Source #

Processes inputs of type a, has the ability to halt midway through the stream, and results in a value of type b

Instances

Instances details
Applicative (ShortcutFold a) Source # 
Instance details

Defined in Fold.Shortcut.Type

Methods

pure :: a0 -> ShortcutFold a a0 #

(<*>) :: ShortcutFold a (a0 -> b) -> ShortcutFold a a0 -> ShortcutFold a b #

liftA2 :: (a0 -> b -> c) -> ShortcutFold a a0 -> ShortcutFold a b -> ShortcutFold a c #

(*>) :: ShortcutFold a a0 -> ShortcutFold a b -> ShortcutFold a b #

(<*) :: ShortcutFold a a0 -> ShortcutFold a b -> ShortcutFold a a0 #

Functor (ShortcutFold a) Source # 
Instance details

Defined in Fold.Shortcut.Type

Methods

fmap :: (a0 -> b) -> ShortcutFold a a0 -> ShortcutFold a b #

(<$) :: a0 -> ShortcutFold a b -> ShortcutFold a a0 #

Monoid b => Monoid (ShortcutFold a b) Source # 
Instance details

Defined in Fold.Shortcut.Type

Semigroup b => Semigroup (ShortcutFold a b) Source # 
Instance details

Defined in Fold.Shortcut.Type

Methods

(<>) :: ShortcutFold a b -> ShortcutFold a b -> ShortcutFold a b #

sconcat :: NonEmpty (ShortcutFold a b) -> ShortcutFold a b #

stimes :: Integral b0 => b0 -> ShortcutFold a b -> ShortcutFold a b #

data ShortcutNonemptyFold a b Source #

Processes at least one input of type a, has the ability to halt midway through the stream, and results in a value of type b

Instances

Instances details
Applicative (ShortcutNonemptyFold a) Source # 
Instance details

Defined in Fold.ShortcutNonempty.Type

Functor (ShortcutNonemptyFold a) Source # 
Instance details

Defined in Fold.ShortcutNonempty.Type

Methods

fmap :: (a0 -> b) -> ShortcutNonemptyFold a a0 -> ShortcutNonemptyFold a b #

(<$) :: a0 -> ShortcutNonemptyFold a b -> ShortcutNonemptyFold a a0 #

Monoid b => Monoid (ShortcutNonemptyFold a b) Source # 
Instance details

Defined in Fold.ShortcutNonempty.Type

Semigroup b => Semigroup (ShortcutNonemptyFold a b) Source # 
Instance details

Defined in Fold.ShortcutNonempty.Type