Copyright | (C) 2012 Edward Kmett |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Stability | provisional |
Portability | GADTs, Rank2Types |
Safe Haskell | Safe |
Language | Haskell2010 |
Control.Alternative.Free
Description
Left distributive Alternative
functors for free, based on a design
by Stijn van Drongelen.
Documentation
newtype Alt (f :: Type -> Type) a #
Constructors
Alt | |
Fields
|
data AltF (f :: Type -> Type) a where #
Constructors
Ap :: forall (f :: Type -> Type) a1 a. f a1 -> Alt f (a1 -> a) -> AltF f a infixl 3 | |
Pure :: forall a (f :: Type -> Type). a -> AltF f a |
runAlt :: forall f g a. Alternative g => (forall x. f x -> g x) -> Alt f a -> g a #
Given a natural transformation from f
to g
, this gives a canonical monoidal natural transformation from
to Alt
fg
.