module Fold
(
Fold (Fold), NonemptyFold (NonemptyFold),
EffectfulFold (EffectfulFold), ShortcutFold (ShortcutFold),
ShortcutNonemptyFold (ShortcutNonemptyFold), Vitality (..), Will (..),
runFold, runNonemptyFold, runEffectfulFold,
element, notElement, find, lookup,
sum, product, mean, variance, standardDeviation,
index, findIndex, elementIndex,
null, length,
and, or, all, any,
maximum, minimum, maximumBy, minimumBy,
first, last,
magma, semigroup, monoid, effect, effectMonoid,
list, reverseList, nonemptyList, reverseNonemptyList,
emptyToNonempty, nonemptyToEmpty, pureToEffectful,
effectfulToPure, nonemptyToEffectful, effectfulToNonempty,
hoist,
duplicateFold, duplicateNonemptyFold, duplicateEffectfulFold,
)
where
import Fold.Effectful.Type
import Fold.Nonempty.Type
import Fold.Pure.Type
import Fold.Shortcut.Type
import Fold.ShortcutNonempty.Type
import Fold.Effectful.Examples.Interesting
import Fold.Nonempty.Examples.Interesting hiding (list, reverseList)
import Fold.Pure.Examples.Interesting
import Fold.Shortcut.Examples.Interesting
import Fold.ShortcutNonempty.Examples.Interesting
import Fold.Effectful.Utilities
import qualified Fold.Effectful.Conversion as ConvertTo.Effectful
import qualified Fold.Nonempty.Conversion as ConvertTo.Nonempty
import qualified Fold.Pure.Conversion as ConvertTo.Pure
import qualified Fold.Effectful as Effectful
import qualified Fold.Nonempty as Nonempty
import qualified Fold.Pure as Pure
import Control.Applicative (Applicative)
import Control.Monad (Monad)
import Data.Foldable (Foldable)
import Data.Functor.Identity (Identity)
import Data.List.NonEmpty (NonEmpty)
import Data.Maybe (Maybe)
runFold :: Foldable f => Fold a b -> f a -> b
runFold :: forall (f :: * -> *) a b. Foldable f => Fold a b -> f a -> b
runFold = forall (f :: * -> *) a b. Foldable f => Fold a b -> f a -> b
Pure.run
runNonemptyFold :: NonemptyFold a b -> NonEmpty a -> b
runNonemptyFold :: forall a b. NonemptyFold a b -> NonEmpty a -> b
runNonemptyFold = forall a b. NonemptyFold a b -> NonEmpty a -> b
Nonempty.run
runEffectfulFold :: Foldable f => Monad m => EffectfulFold m a b -> f a -> m b
runEffectfulFold :: forall (f :: * -> *) (m :: * -> *) a b.
(Foldable f, Monad m) =>
EffectfulFold m a b -> f a -> m b
runEffectfulFold = forall (f :: * -> *) (m :: * -> *) a b.
(Foldable f, Monad m) =>
EffectfulFold m a b -> f a -> m b
Effectful.run
emptyToNonempty :: Fold a b -> NonemptyFold a b
emptyToNonempty :: forall a b. Fold a b -> NonemptyFold a b
emptyToNonempty = forall a b. Fold a b -> NonemptyFold a b
ConvertTo.Nonempty.fold
effectfulToNonempty :: EffectfulFold Identity a b -> NonemptyFold a b
effectfulToNonempty :: forall a b. EffectfulFold Identity a b -> NonemptyFold a b
effectfulToNonempty = forall a b. EffectfulFold Identity a b -> NonemptyFold a b
ConvertTo.Nonempty.effectfulFold
nonemptyToEmpty :: NonemptyFold a b -> Fold a (Maybe b)
nonemptyToEmpty :: forall a b. NonemptyFold a b -> Fold a (Maybe b)
nonemptyToEmpty = forall a b. NonemptyFold a b -> Fold a (Maybe b)
ConvertTo.Pure.nonemptyFold
pureToEffectful :: Monad m => Fold a b -> EffectfulFold m a b
pureToEffectful :: forall (m :: * -> *) a b.
Monad m =>
Fold a b -> EffectfulFold m a b
pureToEffectful = forall (m :: * -> *) a b.
Monad m =>
Fold a b -> EffectfulFold m a b
ConvertTo.Effectful.fold
effectfulToPure :: EffectfulFold Identity a b -> Fold a b
effectfulToPure :: forall a b. EffectfulFold Identity a b -> Fold a b
effectfulToPure = forall a b. EffectfulFold Identity a b -> Fold a b
ConvertTo.Pure.effectfulFold
nonemptyToEffectful :: Monad m =>
NonemptyFold a b -> EffectfulFold m a (Maybe b)
nonemptyToEffectful :: forall (m :: * -> *) a b.
Monad m =>
NonemptyFold a b -> EffectfulFold m a (Maybe b)
nonemptyToEffectful = forall (m :: * -> *) a b.
Monad m =>
NonemptyFold a b -> EffectfulFold m a (Maybe b)
ConvertTo.Effectful.nonemptyFold
nonemptyList :: NonemptyFold a (NonEmpty a)
nonemptyList :: forall a. NonemptyFold a (NonEmpty a)
nonemptyList = forall a. NonemptyFold a (NonEmpty a)
Nonempty.list
reverseNonemptyList :: NonemptyFold a (NonEmpty a)
reverseNonemptyList :: forall a. NonemptyFold a (NonEmpty a)
reverseNonemptyList = forall a. NonemptyFold a (NonEmpty a)
Nonempty.reverseList
duplicateFold :: Fold a b -> Fold a (Fold a b)
duplicateFold :: forall a b. Fold a b -> Fold a (Fold a b)
duplicateFold = forall a b. Fold a b -> Fold a (Fold a b)
Pure.duplicate
duplicateNonemptyFold :: NonemptyFold a b -> NonemptyFold a (Fold a b)
duplicateNonemptyFold :: forall a b. NonemptyFold a b -> NonemptyFold a (Fold a b)
duplicateNonemptyFold = forall a b. NonemptyFold a b -> NonemptyFold a (Fold a b)
Nonempty.duplicate
duplicateEffectfulFold :: Applicative m => EffectfulFold m a b -> EffectfulFold m a (EffectfulFold m a b)
duplicateEffectfulFold :: forall (m :: * -> *) a b.
Applicative m =>
EffectfulFold m a b -> EffectfulFold m a (EffectfulFold m a b)
duplicateEffectfulFold = forall (m :: * -> *) a b.
Applicative m =>
EffectfulFold m a b -> EffectfulFold m a (EffectfulFold m a b)
Effectful.duplicate