Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class HFunctor c => HApplicative c where
- newtype Transform f g a = Transform {
- runTransform :: f a -> g a
- hmapA :: HApplicative c => (forall a. f a -> g a) -> c f -> c g
- hliftA1 :: HApplicative c => (forall a. f a -> g a) -> c f -> c g
- hliftA3 :: HApplicative c => (forall a. f a -> g a -> h a -> i a) -> c f -> c g -> c h -> c i
Documentation
class HFunctor c => HApplicative c where Source #
A higher-order functor with application, providing operations to apply a
function of type (forall a. f a -> g a -> ...)
of arbitrary arity to
arguments of corresponding types f a
, g a
, ...
hpure :: (forall a. f a) -> c f Source #
Lift a proxy functor into the structure. If hunit
is specified instead,
a default definition is available. The following is expected to hold:
Lift a concrete proxy functor
into the structure.
Note that it is almost always better to define U1
instead and rely
on the default implementation of hpure
.
The following is expected to hold:hunit
hap :: c (Transform f g) -> c f -> c g Source #
Sequential application. It is hard to find the legitimate usecase for
this function; this is only provided for comparison with classic
class.Applicative
The default definition is via
. The following is expected to hold:hpair
hliftA2 :: (forall a. f a -> g a -> h a) -> c f -> c g -> c h Source #
Applies a binary function of type (forall a. f a -> g a -> h a)
to a
pair of arguments of types c f
and c g
,
yielding the result of type c h
.
If
is specified instead, a default definition is available.
The following is expected to hold:hap
Instances
newtype Transform f g a Source #
A newtype wrapper for natural transformations used in
definition.hap
Transform | |
|
hmapA :: HApplicative c => (forall a. f a -> g a) -> c f -> c g Source #
hliftA1 :: HApplicative c => (forall a. f a -> g a) -> c f -> c g Source #
hliftA3 :: HApplicative c => (forall a. f a -> g a -> h a -> i a) -> c f -> c g -> c h -> c i Source #
Applies a ternary natural transformation
to a triple of arguments behind an
.HApplicative