Copyright | (c) Justin Le 2019 |
---|---|
License | BSD3 |
Maintainer | justin@jle.im |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Provides free structures for the various typeclasses of the Divisible
hierarchy.
Since: 0.3.0.0
Synopsis
- data Div :: (Type -> Type) -> Type -> Type where
- hoistDiv :: forall f g. (f ~> g) -> Div f ~> Div g
- liftDiv :: f ~> Div f
- runDiv :: forall f g. Divisible g => (f ~> g) -> Div f ~> g
- divListF :: forall f. Contravariant f => Div f ~> ListF f
- listFDiv :: ListF f ~> Div f
- data Div1 :: (Type -> Type) -> Type -> Type where
- hoistDiv1 :: (f ~> g) -> Div1 f ~> Div1 g
- liftDiv1 :: f ~> Div1 f
- toDiv :: Div1 f a -> Div f a
- runDiv1 :: Divise g => (f ~> g) -> Div1 f ~> g
- div1NonEmptyF :: Contravariant f => Div1 f ~> NonEmptyF f
- nonEmptyFDiv1 :: NonEmptyF f ~> Div1 f
- data Dec :: (Type -> Type) -> Type -> Type where
- hoistDec :: forall f g. (f ~> g) -> Dec f ~> Dec g
- liftDec :: f ~> Dec f
- runDec :: forall f g. Conclude g => (f ~> g) -> Dec f ~> g
- data Dec1 :: (Type -> Type) -> Type -> Type where
- hoistDec1 :: forall f g. (f ~> g) -> Dec1 f ~> Dec1 g
- liftDec1 :: f ~> Dec1 f
- toDec :: Dec1 f a -> Dec f a
- runDec1 :: Decide g => (f ~> g) -> Dec1 f ~> g
Documentation
data Div :: (Type -> Type) -> Type -> Type where Source #
The free Divisible
. Used to sequence multiple contravariant
consumers, splitting out the input across all consumers.
Note that
is essentially Div
f
, or just ListF
(Coyoneda
f)
in the
case that ListF
ff
is already contravariant. However, this is left in here
because it can be more convenient to use if you are working with an
intermediate f
that isn't Contravariant
.
Instances
Inject Div Source # | |
FreeOf Divisible Div Source # | Since: 0.3.0.0 |
HFunctor Div Source # | |
Divisible f => Interpret Div (f :: Type -> Type) Source # | |
Contravariant (Div f) Source # | |
Divisible (Div f) Source # | |
Invariant (Div f) Source # | |
Defined in Data.Functor.Contravariant.Divisible.Free | |
Divise (Div f) Source # | |
type FreeFunctorBy Div Source # | |
Defined in Data.HFunctor.Final |
data Div1 :: (Type -> Type) -> Type -> Type where Source #
The free Divise
: a non-empty version of Div
.
Note that
is essentially Div1
f
, or just NonEmptyF
(Coyoneda
f)
in the
case that NonEmptyF
ff
is already contravariant. However, it can be more
convenient to use if you are working with an intermediate f
that isn't
Contravariant
.
Instances
Inject Div1 Source # | |
FreeOf Divise Div1 Source # | Since: 0.3.0.0 |
HFunctor Div1 Source # | |
Divise f => Interpret Div1 (f :: Type -> Type) Source # | |
Contravariant (Div1 f) Source # | |
Invariant (Div1 f) Source # | |
Defined in Data.Functor.Contravariant.Divisible.Free | |
Divise (Div1 f) Source # | |
type FreeFunctorBy Div1 Source # | |
Defined in Data.HFunctor.Final |
div1NonEmptyF :: Contravariant f => Div1 f ~> NonEmptyF f Source #
nonEmptyFDiv1 :: NonEmptyF f ~> Div1 f Source #
Div1
is isomorphic to NonEmptyF
for contravariant f
. This
witnesses one way of that isomorphism.
This direction is O(n), unlike div1NonEmptyF
.
data Dec :: (Type -> Type) -> Type -> Type where Source #
The free Decide
. Used to aggregate multiple possible consumers,
directing the input into an appropriate consumer.
Instances
Inject Dec Source # | |
FreeOf Conclude Dec Source # | Since: 0.3.0.0 |
HFunctor Dec Source # | |
Conclude f => Interpret Dec (f :: Type -> Type) Source # | |
Contravariant (Dec f) Source # | |
Invariant (Dec f) Source # | |
Defined in Data.Functor.Contravariant.Divisible.Free | |
Decide (Dec f) Source # | |
Conclude (Dec f) Source # | |
type FreeFunctorBy Dec Source # | |
Defined in Data.HFunctor.Final |
data Dec1 :: (Type -> Type) -> Type -> Type where Source #
Instances
Inject Dec1 Source # | |
FreeOf Decide Dec1 Source # | Since: 0.3.0.0 |
HFunctor Dec1 Source # | |
Decide f => Interpret Dec1 (f :: Type -> Type) Source # | |
Contravariant (Dec1 f) Source # | |
Invariant (Dec1 f) Source # | |
Defined in Data.Functor.Contravariant.Divisible.Free | |
Decide (Dec1 f) Source # | |
type FreeFunctorBy Dec1 Source # | |
Defined in Data.HFunctor.Final |
hoistDec1 :: forall f g. (f ~> g) -> Dec1 f ~> Dec1 g Source #
Map over the undering context in a Dec1
.