Copyright | (c) Justin Le 2019 |
---|---|
License | BSD3 |
Maintainer | [email protected] |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Data.Functor.Contravariant.Divisible.Free
Description
Provides free structures for the various typeclasses of the Divisible
hierarchy.
Since: 0.3.0.0
Synopsis
- newtype Div (f :: Type -> Type) a where
- hoistDiv :: forall (f :: Type -> Type) (g :: Type -> Type). (f ~> g) -> Div f ~> Div g
- liftDiv :: f x -> Div f x
- runDiv :: forall (f :: Type -> Type) (g :: Type -> Type). Divisible g => (f ~> g) -> Div f ~> g
- divListF :: forall (f :: Type -> Type). Contravariant f => Div f ~> ListF f
- listFDiv :: forall (f :: Type -> Type) x. ListF f x -> Div f x
- newtype Div1 (f :: Type -> Type) a where
- hoistDiv1 :: forall (f :: Type -> Type) (g :: Type -> Type). (f ~> g) -> Div1 f ~> Div1 g
- liftDiv1 :: f x -> Div1 f x
- toDiv :: forall (f :: Type -> Type) x. Div1 f x -> Div f x
- runDiv1 :: forall (g :: Type -> Type) (f :: Type -> Type). Divise g => (f ~> g) -> Div1 f ~> g
- div1NonEmptyF :: forall (f :: Type -> Type). Contravariant f => Div1 f ~> NonEmptyF f
- nonEmptyFDiv1 :: forall (f :: Type -> Type) x. NonEmptyF f x -> Div1 f x
- data Dec (a :: Type -> Type) b where
- hoistDec :: forall (f :: Type -> Type) (g :: Type -> Type). (f ~> g) -> Dec f ~> Dec g
- liftDec :: f x -> Dec f x
- runDec :: forall (f :: Type -> Type) (g :: Type -> Type). Conclude g => (f ~> g) -> Dec f ~> g
- data Dec1 (a :: Type -> Type) b where
- hoistDec1 :: forall (f :: Type -> Type) (g :: Type -> Type). (f ~> g) -> Dec1 f ~> Dec1 g
- liftDec1 :: f x -> Dec1 f x
- toDec :: forall (f :: Type -> Type) a. Dec1 f a -> Dec f a
- runDec1 :: forall (g :: Type -> Type) (f :: Type -> Type). Decide g => (f ~> g) -> Dec1 f ~> g
Documentation
newtype Div (f :: Type -> Type) a Source #
The free Divisible
. Used to sequence multiple contravariant
consumers, splitting out the input across all consumers.
This type is essentially ListF
; the only reason why it has to exist
separately outside of ListF
is because the current typeclass hierarchy
isn't compatible with both the covariant Interpret
instance (requiring
Plus
) and the contravariant Interpret
instance (requiring
Divisible
).
The wrapping in Coyoneda
is also to provide a usable
Associative
instance for the contravariant
Day
.
Bundled Patterns
pattern Conquer :: Div f a | Pattern matching on an empty Before v0.3.3.0, this used to be the concrete constructor of |
pattern Divide :: forall a f b c. () => (a -> (b, c)) -> f b -> Div f c -> Div f a | Pattern matching on a non-empty Before v0.3.3.0, this used to be the concrete constructor of |
Instances
Inject Div Source # | |||||
FreeOf Divisible Div Source # | Since: 0.3.0.0 | ||||
Defined in Data.HFunctor.Final Associated Types
| |||||
HTraversable Div Source # | |||||
Defined in Data.Functor.Contravariant.Divisible.Free | |||||
HFunctor Div Source # | |||||
Divisible f => Interpret Div (f :: Type -> Type) Source # | |||||
Contravariant (Div f) Source # | |||||
Divisible (Div f) Source # | |||||
Divise (Div f) Source # | |||||
Inplicative (Div f) Source # | |||||
Defined in Data.Functor.Contravariant.Divisible.Free | |||||
Inply (Div f) Source # | |||||
Invariant (Div f) Source # | |||||
Defined in Data.Functor.Contravariant.Divisible.Free | |||||
type FreeFunctorBy Div Source # | |||||
Defined in Data.HFunctor.Final |
hoistDiv :: forall (f :: Type -> Type) (g :: Type -> Type). (f ~> g) -> Div f ~> Div g Source #
Map over the undering context in a Div
.
runDiv :: forall (f :: Type -> Type) (g :: Type -> Type). Divisible g => (f ~> g) -> Div f ~> g Source #
newtype Div1 (f :: Type -> Type) a Source #
The free Divise
: a non-empty version of Div
.
This type is essentially NonEmptyF
; the only reason why it has to exist
separately outside of NonEmptyF
is because the current typeclass
hierarchy isn't compatible with both the covariant Interpret
instance
(requiring Plus
) and the contravariant Interpret
instance (requiring
Divisible
).
The wrapping in Coyoneda
is also to provide a usable
Associative
instance for the contravariant
Day
.
Bundled Patterns
pattern Div1_ :: forall a f b c. () => (a -> (b, c)) -> f b -> Div f c -> Div1 f a | Pattern matching on a Before v0.3.3.0, this used to be the concrete constructor of Since: 0.3.3.0 |
Instances
Inject Div1 Source # | |||||
FreeOf Divise Div1 Source # | Since: 0.3.0.0 | ||||
Defined in Data.HFunctor.Final Associated Types
| |||||
HTraversable Div1 Source # | |||||
Defined in Data.Functor.Contravariant.Divisible.Free | |||||
HTraversable1 Div1 Source # | |||||
Defined in Data.Functor.Contravariant.Divisible.Free | |||||
HFunctor Div1 Source # | |||||
Divise f => Interpret Div1 (f :: Type -> Type) Source # | |||||
Contravariant (Div1 f) Source # | |||||
Divise (Div1 f) Source # | |||||
Inply (Div1 f) Source # | |||||
Invariant (Div1 f) Source # | |||||
Defined in Data.Functor.Contravariant.Divisible.Free | |||||
type FreeFunctorBy Div1 Source # | |||||
Defined in Data.HFunctor.Final |
hoistDiv1 :: forall (f :: Type -> Type) (g :: Type -> Type). (f ~> g) -> Div1 f ~> Div1 g Source #
Map over the underlying context in a Div1
.
runDiv1 :: forall (g :: Type -> Type) (f :: Type -> Type). Divise g => (f ~> g) -> Div1 f ~> g Source #
div1NonEmptyF :: forall (f :: Type -> Type). Contravariant f => Div1 f ~> NonEmptyF f Source #
data Dec (a :: Type -> Type) b where Source #
The free Decide
. Used to aggregate multiple possible consumers,
directing the input into an appropriate consumer.
Constructors
Lose :: forall b (a :: Type -> Type). (b -> Void) -> Dec a b | |
Choose :: forall b b1 c (a :: Type -> Type). (b -> Either b1 c) -> a b1 -> Dec a c -> Dec a b |
Instances
Inject Dec Source # | |||||
FreeOf Conclude Dec Source # | Since: 0.3.0.0 | ||||
Defined in Data.HFunctor.Final Associated Types
| |||||
HTraversable Dec Source # | |||||
Defined in Data.Functor.Contravariant.Divisible.Free | |||||
HFunctor Dec Source # | |||||
Conclude f => Interpret Dec (f :: Type -> Type) Source # | |||||
Contravariant (Dec f) Source # | |||||
Conclude (Dec f) Source # | |||||
Decide (Dec f) Source # | |||||
Inalt (Dec f) Source # | |||||
Inplus (Dec f) Source # | |||||
Invariant (Dec f) Source # | |||||
Defined in Data.Functor.Contravariant.Divisible.Free | |||||
type FreeFunctorBy Dec Source # | |||||
Defined in Data.HFunctor.Final |
hoistDec :: forall (f :: Type -> Type) (g :: Type -> Type). (f ~> g) -> Dec f ~> Dec g Source #
Map over the underlying context in a Dec
.
runDec :: forall (f :: Type -> Type) (g :: Type -> Type). Conclude g => (f ~> g) -> Dec f ~> g Source #
data Dec1 (a :: Type -> Type) b where Source #
Constructors
Dec1 :: forall b b1 c (a :: Type -> Type). (b -> Either b1 c) -> a b1 -> Dec a c -> Dec1 a b |
Instances
Inject Dec1 Source # | |||||
FreeOf Decide Dec1 Source # | Since: 0.3.0.0 | ||||
Defined in Data.HFunctor.Final Associated Types
| |||||
HTraversable Dec1 Source # | |||||
Defined in Data.Functor.Contravariant.Divisible.Free | |||||
HTraversable1 Dec1 Source # | |||||
Defined in Data.Functor.Contravariant.Divisible.Free | |||||
HFunctor Dec1 Source # | |||||
Decide f => Interpret Dec1 (f :: Type -> Type) Source # | |||||
Contravariant (Dec1 f) Source # | |||||
Decide (Dec1 f) Source # | |||||
Inalt (Dec1 f) Source # | |||||
Invariant (Dec1 f) Source # | |||||
Defined in Data.Functor.Contravariant.Divisible.Free | |||||
type FreeFunctorBy Dec1 Source # | |||||
Defined in Data.HFunctor.Final |
hoistDec1 :: forall (f :: Type -> Type) (g :: Type -> Type). (f ~> g) -> Dec1 f ~> Dec1 g Source #
Map over the undering context in a Dec1
.