TypeCompose-0.0: Type composition classes & instancesSource codeContentsIndex
Control.Compose
Portabilityportable
Stabilityexperimental
Maintainerconal@conal.net
Description
Various type constructor compositions and instances for them. References: [1] "Applicative Programming with Effects" http://www.soi.city.ac.uk/~ross/papers/Applicative.html
Synopsis
class Cofunctor acc where
cofmap :: (a -> b) -> acc b -> acc a
newtype Compose g f a = Comp {
unComp :: g (f a)
}
onComp :: (g (f a) -> g' (f' a')) -> Compose g f a -> Compose g' f' a'
newtype StaticArrow f (~>) a b = Static {
unStatic :: f (a ~> b)
}
newtype Flip (~>) b a = Flip (a ~> b)
newtype ArrowAp (~>) f a b = ArrowAp {
unArrowAp :: f a ~> f b
}
newtype App f a = App {
unApp :: f a
}
Documentation
class Cofunctor acc whereSource
Often useful for acceptors (consumers, sinks) of values.
Methods
cofmap :: (a -> b) -> acc b -> acc aSource
show/hide Instances
Arrow ~> => Cofunctor (Flip ~> b)
(Cofunctor g, Functor f) => Cofunctor (Compose g f)
newtype Compose g f a Source
Composition of type constructors: unary & unary. Called "g . f" in [1], section 5, but GHC won't parse that, nor will it parse any infix type operators in an export list. Haddock won't parse any type infixes at all.
Constructors
Comp
unComp :: g (f a)
show/hide Instances
onComp :: (g (f a) -> g' (f' a')) -> Compose g f a -> Compose g' f' a'Source
Apply a function within the Comp constructor.
newtype StaticArrow f (~>) a b Source
Composition of type constructors: unary with binary.
Constructors
Static
unStatic :: f (a ~> b)
show/hide Instances
newtype Flip (~>) b a Source
Flip type arguments
Constructors
Flip (a ~> b)
show/hide Instances
Arrow ~> => Cofunctor (Flip ~> b)
newtype ArrowAp (~>) f a b Source
Composition of type constructors: binary with unary.
Constructors
ArrowAp
unArrowAp :: f a ~> f b
show/hide Instances
newtype App f a Source
Type application
Constructors
App
unApp :: f a
show/hide Instances
(Applicative f, Monoid m) => Monoid (App f m)
Produced by Haddock version 2.3.0