| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Applicative.Free.Zero
Description
An applicative with left zero f is an Applicative
with polymorphic zero action which stops
all actions right to zero.
-- Type of zero action zero :: forall a. f a -- Left zero law zero <*> x === zero
This module provides the free Applicative with zero, ApZ,
like the free applicative Ap.
Synopsis
- data ApZ (f :: Type -> Type) a where
- liftApZ :: f a -> ApZ f a
- hoistApZ :: (forall x. f x -> g x) -> ApZ f a -> ApZ g a
- trap :: forall (f :: Type -> Type) a. ApZ f a -> ApZ f a -> ApZ f a
- foldApZ :: Applicative g => (forall r. f r -> g r) -> (forall r. g r) -> ApZ f a -> g a
- foldMaybeT :: Monad g => (forall r. f r -> g r) -> ApZ f a -> g (Maybe a)
- retract :: Alternative f => ApZ f a -> f a
Documentation
data ApZ (f :: Type -> Type) a where Source #
Free (applicative with left zero).
Constructors
| Pure :: forall a (f :: Type -> Type). a -> ApZ f a | |
| Zero :: forall (f :: Type -> Type) a. ApZ f a | |
| Ap :: forall (f :: Type -> Type) a1 a. f a1 -> ApZ f (a1 -> a) -> ApZ f a |
foldApZ :: Applicative g => (forall r. f r -> g r) -> (forall r. g r) -> ApZ f a -> g a Source #
retract :: Alternative f => ApZ f a -> f a Source #