| Copyright | (c) Justin Le 2025 |
|---|---|
| License | BSD3 |
| Maintainer | justin@jle.im |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.HFunctor.Chain
Description
This module provides an Interpretable data type of "linked list of tensor applications".
The type , for any Chain t, is meant to be the same as Tensor t (the monoidal functor combinator for ListBy tt), and represents "zero or more" applications of f to t.
The type , for any Chain1 t, is meant to be the same as Associative t (the semigroupoidal functor combinator for NonEmptyBy tt) and represents "one or more" applications of f to t.
The advantage of using Chain and Chain1 over ListBy or NonEmptyBy is that they provide a universal interface for pattern matching and constructing such values, which may simplify working with new such functor combinators you might encounter.
Synopsis
- data Chain (t :: k -> (k1 -> Type) -> k1 -> Type) (i :: k1 -> Type) (f :: k) (a :: k1)
- foldChain :: forall {k} (t :: (k -> Type) -> (k -> Type) -> k -> Type) (i :: k -> Type) (f :: k -> Type) (g :: k -> Type). HBifunctor t => (i ~> g) -> (t f g ~> g) -> Chain t i f ~> g
- foldChainA :: forall {k} t h i g (f :: k -> Type) (a :: k). (HBifunctor t, Functor h) => (forall (x :: k). i x -> h (g x)) -> (forall (x :: k). t f (Comp h g) x -> h (g x)) -> Chain t i f a -> h (g a)
- unfoldChain :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (f :: Type -> Type) (g :: Type -> Type) (i :: Type -> Type). HBifunctor t => (g ~> (i :+: t f g)) -> g ~> Chain t i f
- unroll :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). Tensor t i => ListBy t f ~> Chain t i f
- reroll :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). Tensor t i => Chain t i f ~> ListBy t f
- unrolling :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). Tensor t i => ListBy t f <~> Chain t i f
- appendChain :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). Tensor t i => t (Chain t i f) (Chain t i f) ~> Chain t i f
- splittingChain :: forall {k1} {k2} (t :: k1 -> (k2 -> Type) -> k2 -> Type) (i :: k2 -> Type) (f :: k1) p (a :: k2). Profunctor p => p ((i :+: t f (Chain t i f)) a) ((i :+: t f (Chain t i f)) a) -> p (Chain t i f a) (Chain t i f a)
- toChain :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). Tensor t i => t f f ~> Chain t i f
- injectChain :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). Tensor t i => f ~> Chain t i f
- unconsChain :: forall {k1} {k2} (t :: k1 -> (k2 -> Type) -> k2 -> Type) (i :: k2 -> Type) (f :: k1) (x :: k2). Chain t i f x -> (i :+: t f (Chain t i f)) x
- data Chain1 (t :: (k -> Type) -> (k -> Type) -> k -> Type) (f :: k -> Type) (a :: k)
- foldChain1 :: forall {k} (t :: (k -> Type) -> (k -> Type) -> k -> Type) (f :: k -> Type) (g :: k -> Type). HBifunctor t => (f ~> g) -> (t f g ~> g) -> Chain1 t f ~> g
- foldChain1A :: forall {k} t h f g (a :: k). (HBifunctor t, Functor h) => (forall (x :: k). f x -> h (g x)) -> (forall (x :: k). t f (Comp h g) x -> h (g x)) -> Chain1 t f a -> h (g a)
- unfoldChain1 :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (f :: Type -> Type) (g :: Type -> Type). HBifunctor t => (g ~> (f :+: t f g)) -> g ~> Chain1 t f
- unrollingNE :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (f :: Type -> Type). (Associative t, FunctorBy t f) => NonEmptyBy t f <~> Chain1 t f
- unrollNE :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (f :: Type -> Type). (Associative t, FunctorBy t f) => NonEmptyBy t f ~> Chain1 t f
- rerollNE :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (f :: Type -> Type). Associative t => Chain1 t f ~> NonEmptyBy t f
- appendChain1 :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (f :: Type -> Type). (Associative t, FunctorBy t f) => t (Chain1 t f) (Chain1 t f) ~> Chain1 t f
- fromChain1 :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). Tensor t i => Chain1 t f ~> Chain t i f
- matchChain1 :: forall {k} (t :: (k -> Type) -> (k -> Type) -> k -> Type) (f :: k -> Type) (x :: k). Chain1 t f x -> (f :+: t f (Chain1 t f)) x
- toChain1 :: forall {k} (t :: (k -> Type) -> (k -> Type) -> k -> Type) (f :: k -> Type). HBifunctor t => t f f ~> Chain1 t f
- injectChain1 :: forall {k} f (t :: (k -> Type) -> (k -> Type) -> k -> Type) (x :: k). f x -> Chain1 t f x
- splittingChain1 :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). (Matchable t i, FunctorBy t f) => Chain1 t f <~> t f (Chain t i f)
- splitChain1 :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). Tensor t i => Chain1 t f ~> t f (Chain t i f)
- matchingChain :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). (Matchable t i, FunctorBy t f) => Chain t i f <~> (i :+: Chain1 t f)
- unmatchChain :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). Tensor t i => (i :+: Chain1 t f) ~> Chain t i f
Chain
data Chain (t :: k -> (k1 -> Type) -> k1 -> Type) (i :: k1 -> Type) (f :: k) (a :: k1) Source #
A useful construction that works like a "linked list" of t f applied to itself multiple times. That is, it contains t f f, t f (t f f), t f (t f (t f f)), etc, with f occuring zero or more times. It is meant to be the same as .ListBy t
If t is Tensor, then it means we can "collapse" this linked list into some final type (ListBy treroll), and also extract it back into a linked list (unroll).
So, a value of type is one of either:Chain t i f a
i a
f a
t f f a
t f (t f f) a
t f (t f (t f f)) a
- .. etc.
Note that this is exactly what an is supposed to be. Using ListBy tChain allows us to work with all s in a uniform way, with normal pattern matching and normal constructors.ListBy t
You can fully "collapse" a into an Chain t i ff with retract, if you have ; this could be considered a fundamental property of monoid-ness.MonoidIn t i f
Another way of thinking of this is that is the "free Chain t i". Given any functor MonoidIn t if, is a monoid in the monoidal category of endofunctors enriched by Chain t i ft. So, is the "free Chain Comp IdentityMonad", is the "free Chain Day IdentityApplicative", etc. You "lift" from f a to using Chain t i f ainject.
Note: this instance doesn't exist directly because of restrictions in typeclasses, but is implemented as
Tensort i =>MonoidIn(WrapHBFt) (WrapFi) (Chaint i f)
where pureT is Done and biretract is appendChain.
This construction is inspired by http://oleg.fi/gists/posts/2018-02-21-single-free.html
Instances
| HBifunctor t => HFunctor (Chain t i :: (k1 -> Type) -> k1 -> Type) Source # | |
| Tensor t i => Inject (Chain t i :: (Type -> Type) -> Type -> Type) Source # | |
| MonoidIn t i f => Interpret (Chain t i :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # | We can collapse and interpret an |
| (Tensor t i, FunctorBy t (Chain t i f)) => MonoidIn (WrapHBF t) (WrapF i) (Chain t i f) Source # |
|
| (Tensor t i, FunctorBy t (Chain t i f)) => SemigroupIn (WrapHBF t) (Chain t i f) Source # | We have to wrap |
| (Foldable i, Foldable (t f (Chain t i f))) => Foldable (Chain t i f) Source # | |
Defined in Data.HFunctor.Chain.Internal Methods fold :: Monoid m => Chain t i f m -> m # foldMap :: Monoid m => (a -> m) -> Chain t i f a -> m # foldMap' :: Monoid m => (a -> m) -> Chain t i f a -> m # foldr :: (a -> b -> b) -> b -> Chain t i f a -> b # foldr' :: (a -> b -> b) -> b -> Chain t i f a -> b # foldl :: (b -> a -> b) -> b -> Chain t i f a -> b # foldl' :: (b -> a -> b) -> b -> Chain t i f a -> b # foldr1 :: (a -> a -> a) -> Chain t i f a -> a # foldl1 :: (a -> a -> a) -> Chain t i f a -> a # toList :: Chain t i f a -> [a] # null :: Chain t i f a -> Bool # length :: Chain t i f a -> Int # elem :: Eq a => a -> Chain t i f a -> Bool # maximum :: Ord a => Chain t i f a -> a # minimum :: Ord a => Chain t i f a -> a # | |
| (Eq1 i, Eq1 (t f (Chain t i f))) => Eq1 (Chain t i f) Source # | |
| (Ord1 i, Ord1 (t f (Chain t i f))) => Ord1 (Chain t i f) Source # | |
Defined in Data.HFunctor.Chain.Internal | |
| (Functor i, Read1 (t f (Chain t i f)), Read1 i) => Read1 (Chain t i f) Source # | |
Defined in Data.HFunctor.Chain.Internal Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Chain t i f a) # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Chain t i f a] # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Chain t i f a) # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Chain t i f a] # | |
| (Show1 (t f (Chain t i f)), Show1 i) => Show1 (Chain t i f) Source # | |
| (Contravariant i, Contravariant (t f (Chain t i f))) => Contravariant (Chain t i f) Source # | |
| (Traversable i, Traversable (t f (Chain t i f))) => Traversable (Chain t i f) Source # | |
Defined in Data.HFunctor.Chain.Internal | |
| Applicative (Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f) Source # | |
Defined in Data.HFunctor.Chain Methods pure :: a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a # (<*>) :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f (a -> b) -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b # liftA2 :: (a -> b -> c) -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f c # (*>) :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b # (<*) :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a # | |
| Applicative (Chain Day Identity f) Source # |
|
Defined in Data.HFunctor.Chain Methods pure :: a -> Chain Day Identity f a # (<*>) :: Chain Day Identity f (a -> b) -> Chain Day Identity f a -> Chain Day Identity f b # liftA2 :: (a -> b -> c) -> Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f c # (*>) :: Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f b # (<*) :: Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f a # | |
| (Functor i, Functor (t f (Chain t i f))) => Functor (Chain t i f) Source # | |
| Monad (Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f) Source # |
|
Defined in Data.HFunctor.Chain Methods (>>=) :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> (a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b) -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b # (>>) :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b # return :: a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a # | |
| Divisible (Chain Day (Proxy :: Type -> Type) f) Source # |
Since: 0.3.0.0 |
| Conclude (Chain Night Not f) Source # |
Since: 0.3.0.0 |
| Decide (Chain Night Not f) Source # | Since: 0.3.0.0 |
| Divise (Chain Day (Proxy :: Type -> Type) f) Source # | Since: 0.3.0.0 |
Defined in Data.HFunctor.Chain Methods divise :: (a -> (b, c)) -> Chain Day (Proxy :: Type -> Type) f b -> Chain Day (Proxy :: Type -> Type) f c -> Chain Day (Proxy :: Type -> Type) f a Source # divised :: Chain Day (Proxy :: Type -> Type) f a -> Chain Day (Proxy :: Type -> Type) f b -> Chain Day (Proxy :: Type -> Type) f (a, b) Source # | |
| Inplicative (Chain Day Identity f) Source # | Since: 0.4.0.0 |
| Inply (Chain Day Identity f) Source # | Since: 0.4.0.0 |
| Inalt (Chain Night Not f) Source # | Since: 0.4.0.0 |
| Inplus (Chain Night Not f) Source # | Since: 0.4.0.0 |
| (Invariant i, Invariant (t f (Chain t i f))) => Invariant (Chain t i f) Source # | |
Defined in Data.HFunctor.Chain.Internal | |
| Functor f => Alt (Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f) Source # | |
Defined in Data.HFunctor.Chain Methods (<!>) :: Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a -> Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a -> Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a # some :: Applicative (Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f) => Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a -> Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f [a] # many :: Applicative (Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f) => Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a -> Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f [a] # | |
| Functor f => Alt (Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f) Source # | |
Defined in Data.HFunctor.Chain Methods (<!>) :: Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a -> Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a -> Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a # some :: Applicative (Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f) => Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a -> Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f [a] # many :: Applicative (Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f) => Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a -> Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f [a] # | |
| Apply (Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f) Source # | |
Defined in Data.HFunctor.Chain Methods (<.>) :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f (a -> b) -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b # (.>) :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b # (<.) :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a # liftF2 :: (a -> b -> c) -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f c # | |
| Apply (Chain Day Identity f) Source # | |
Defined in Data.HFunctor.Chain Methods (<.>) :: Chain Day Identity f (a -> b) -> Chain Day Identity f a -> Chain Day Identity f b # (.>) :: Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f b # (<.) :: Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f a # liftF2 :: (a -> b -> c) -> Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f c # | |
| Bind (Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f) Source # | |
Defined in Data.HFunctor.Chain Methods (>>-) :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> (a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b) -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b # join :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f (Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a) -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a # | |
| Functor f => Plus (Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f) Source # |
|
| Functor f => Plus (Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f) Source # |
|
| (Read (i a), Read (t f (Chain t i f) a)) => Read (Chain t i f a) Source # | |
| (Show (i a), Show (t f (Chain t i f) a)) => Show (Chain t i f a) Source # | |
| (Eq (i a), Eq (t f (Chain t i f) a)) => Eq (Chain t i f a) Source # | |
| (Ord (i a), Ord (t f (Chain t i f) a)) => Ord (Chain t i f a) Source # | |
Defined in Data.HFunctor.Chain.Internal Methods compare :: Chain t i f a -> Chain t i f a -> Ordering # (<) :: Chain t i f a -> Chain t i f a -> Bool # (<=) :: Chain t i f a -> Chain t i f a -> Bool # (>) :: Chain t i f a -> Chain t i f a -> Bool # (>=) :: Chain t i f a -> Chain t i f a -> Bool # | |
Arguments
| :: forall {k} t h i g (f :: k -> Type) (a :: k). (HBifunctor t, Functor h) | |
| => (forall (x :: k). i x -> h (g x)) | Handle |
| -> (forall (x :: k). t f (Comp h g) x -> h (g x)) | Handle |
| -> Chain t i f a | |
| -> h (g a) |
An "effectful" version of foldChain, weaving Applicative effects.
Since: 0.3.6.0
unfoldChain :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (f :: Type -> Type) (g :: Type -> Type) (i :: Type -> Type). HBifunctor t => (g ~> (i :+: t f g)) -> g ~> Chain t i f Source #
unroll :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). Tensor t i => ListBy t f ~> Chain t i f Source #
reroll :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). Tensor t i => Chain t i f ~> ListBy t f Source #
A type is supposed to represent the successive application of ListBy tts to itself. rerollNE takes an explicit Chain of applications of t to itself and rolls it back up into an .ListBy t
reroll=foldChainnilLBconsLB
Because t cannot be inferred from the input or output, you should call this with -XTypeApplications:
reroll@Comp::ChainCompIdentityf a ->Freef a
unrolling :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). Tensor t i => ListBy t f <~> Chain t i f Source #
A type is supposed to represent the successive application of ListBy tts to itself. The type is an actual concrete ADT that contains successive applications of Chain t i ft to itself, and you can pattern match on each layer.
unrolling states that the two types are isormorphic. Use unroll and reroll to convert between the two.
appendChain :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). Tensor t i => t (Chain t i f) (Chain t i f) ~> Chain t i f Source #
Chain is a monoid with respect to t: we can "combine" them in an associative way. The identity here is anything made with the Done constructor.
This is essentially biretract, but only requiring : it comes from the fact that Tensor t i is the "free Chain1 t i". MonoidIn t ipureT is Done.
Since: 0.1.1.0
splittingChain :: forall {k1} {k2} (t :: k1 -> (k2 -> Type) -> k2 -> Type) (i :: k2 -> Type) (f :: k1) p (a :: k2). Profunctor p => p ((i :+: t f (Chain t i f)) a) ((i :+: t f (Chain t i f)) a) -> p (Chain t i f a) (Chain t i f a) Source #
For completeness, an isomorphism between Chain and its two constructors, to match splittingLB.
Since: 0.3.0.0
toChain :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). Tensor t i => t f f ~> Chain t i f Source #
injectChain :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). Tensor t i => f ~> Chain t i f Source #
Create a singleton chain.
Since: 0.3.0.0
unconsChain :: forall {k1} {k2} (t :: k1 -> (k2 -> Type) -> k2 -> Type) (i :: k2 -> Type) (f :: k1) (x :: k2). Chain t i f x -> (i :+: t f (Chain t i f)) x Source #
An analogue of unconsLB: match one of the two constructors of a Chain.
Since: 0.3.0.0
Chain1
data Chain1 (t :: (k -> Type) -> (k -> Type) -> k -> Type) (f :: k -> Type) (a :: k) Source #
A useful construction that works like a "non-empty linked list" of t f applied to itself multiple times. That is, it contains t f f, t f (t f f), t f (t f (t f f)), etc, with f occuring one or more times. It is meant to be the same as .NonEmptyBy t
A is explicitly one of:Chain1 t f a
f a
t f f a
t f (t f f) a
t f (t f (t f f)) a
- .. etc
Note that this is exactly the description of . And that's "the point": for all instances of NonEmptyBy tAssociative, is isomorphic to Chain1 t (witnessed by NonEmptyBy tunrollingNE). That's big picture of NonEmptyBy: it's supposed to be a type that consists of all possible self-applications of f to t.
Chain1 gives you a way to work with all in a uniform way. Unlike for NonEmptyBy t in general, you can always explicitly /pattern match/ on a NonEmptyBy t fChain1 (with its two constructors) and do what you please with it. You can also construct Chain1 using normal constructors and functions.
You can convert in between and NonEmptyBy t f with Chain1 t funrollNE and rerollNE. You can fully "collapse" a into an Chain1 t ff with retract, if you have ; this could be considered a fundamental property of semigroup-ness.SemigroupIn t f
See Chain for a version that has an "empty" value.
Another way of thinking of this is that is the "free Chain1 t". Given any functor SemigroupIn tf, is a semigroup in the semigroupoidal category of endofunctors enriched by Chain1 t ft. So, is the "free Chain1 CompBind", is the "free Chain1 DayApply", etc. You "lift" from f a to using Chain1 t f ainject.
Note: this instance doesn't exist directly because of restrictions in typeclasses, but is implemented as
Associativet =>SemigroupIn(WrapHBFt) (Chain1t f)
where biretract is appendChain1.
You can fully "collapse" a into an Chain t i ff with retract, if you have ; this could be considered a fundamental property of monoid-ness.MonoidIn t i f
This construction is inspired by iteratees and machines.
Instances
| HBifunctor t => HFunctor (Chain1 t :: (k1 -> Type) -> k1 -> Type) Source # | |||||
| HBifunctor t => Inject (Chain1 t :: (k -> Type) -> k -> Type) Source # | |||||
| SemigroupIn t f => Interpret (Chain1 t :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # | |||||
| (Foldable f, Foldable (t f (Chain1 t f))) => Foldable (Chain1 t f) Source # | |||||
Defined in Data.HFunctor.Chain.Internal Methods fold :: Monoid m => Chain1 t f m -> m # foldMap :: Monoid m => (a -> m) -> Chain1 t f a -> m # foldMap' :: Monoid m => (a -> m) -> Chain1 t f a -> m # foldr :: (a -> b -> b) -> b -> Chain1 t f a -> b # foldr' :: (a -> b -> b) -> b -> Chain1 t f a -> b # foldl :: (b -> a -> b) -> b -> Chain1 t f a -> b # foldl' :: (b -> a -> b) -> b -> Chain1 t f a -> b # foldr1 :: (a -> a -> a) -> Chain1 t f a -> a # foldl1 :: (a -> a -> a) -> Chain1 t f a -> a # toList :: Chain1 t f a -> [a] # null :: Chain1 t f a -> Bool # length :: Chain1 t f a -> Int # elem :: Eq a => a -> Chain1 t f a -> Bool # maximum :: Ord a => Chain1 t f a -> a # minimum :: Ord a => Chain1 t f a -> a # | |||||
| (Eq1 f, Eq1 (t f (Chain1 t f))) => Eq1 (Chain1 t f) Source # | |||||
| (Ord1 f, Ord1 (t f (Chain1 t f))) => Ord1 (Chain1 t f) Source # | |||||
Defined in Data.HFunctor.Chain.Internal | |||||
| (Functor f, Read1 (t f (Chain1 t f)), Read1 f) => Read1 (Chain1 t f) Source # | |||||
Defined in Data.HFunctor.Chain.Internal Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Chain1 t f a) # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Chain1 t f a] # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Chain1 t f a) # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Chain1 t f a] # | |||||
| (Show1 (t f (Chain1 t f)), Show1 f) => Show1 (Chain1 t f) Source # | |||||
| (Contravariant f, Contravariant (t f (Chain1 t f))) => Contravariant (Chain1 t f) Source # | Since: 0.3.0.0 | ||||
| (Traversable f, Traversable (t f (Chain1 t f))) => Traversable (Chain1 t f) Source # | |||||
Defined in Data.HFunctor.Chain.Internal | |||||
| (Functor f, Functor (t f (Chain1 t f))) => Functor (Chain1 t f) Source # | |||||
| Contravariant f => Decide (Chain1 Night f) Source # |
Since: 0.3.0.0 | ||||
| Contravariant f => Divise (Chain1 Day f) Source # |
Since: 0.3.0.0 | ||||
| Invariant f => Inply (Chain1 Day f) Source # | Since: 0.4.0.0 | ||||
| Invariant f => Inalt (Chain1 Night f) Source # | Since: 0.4.0.0 | ||||
| (Invariant f, Invariant (t f (Chain1 t f))) => Invariant (Chain1 t f) Source # | Since: 0.3.0.0 | ||||
Defined in Data.HFunctor.Chain.Internal | |||||
| Functor f => Alt (Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) Source # |
| ||||
Defined in Data.HFunctor.Chain Methods (<!>) :: Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a # some :: Applicative (Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) => Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f [a] # many :: Applicative (Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) => Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f [a] # | |||||
| Functor f => Alt (Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) Source # |
| ||||
Defined in Data.HFunctor.Chain Methods (<!>) :: Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a # some :: Applicative (Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) => Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f [a] # many :: Applicative (Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) => Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f [a] # | |||||
| Functor f => Apply (Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) Source # | |||||
Defined in Data.HFunctor.Chain Methods (<.>) :: Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f (a -> b) -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f b # (.>) :: Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f b -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f b # (<.) :: Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f b -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a # liftF2 :: (a -> b -> c) -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f b -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f c # | |||||
| Functor f => Apply (Chain1 Day f) Source # |
| ||||
Defined in Data.HFunctor.Chain | |||||
| Functor f => Bind (Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) Source # |
| ||||
Defined in Data.HFunctor.Chain Methods (>>-) :: Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> (a -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f b) -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f b # join :: Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f (Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a) -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a # | |||||
| Generic (Chain1 t f a) Source # | |||||
Defined in Data.HFunctor.Chain.Internal Associated Types
| |||||
| (Read (f a), Read (t f (Chain1 t f) a)) => Read (Chain1 t f a) Source # | |||||
| (Show (f a), Show (t f (Chain1 t f) a)) => Show (Chain1 t f a) Source # | |||||
| (Eq (f a), Eq (t f (Chain1 t f) a)) => Eq (Chain1 t f a) Source # | |||||
| (Ord (f a), Ord (t f (Chain1 t f) a)) => Ord (Chain1 t f a) Source # | |||||
Defined in Data.HFunctor.Chain.Internal | |||||
| (Associative t, FunctorBy t f, FunctorBy t (Chain1 t f)) => SemigroupIn (WrapHBF t) (Chain1 t f) Source # |
| ||||
| type Rep (Chain1 t f a) Source # | |||||
Defined in Data.HFunctor.Chain.Internal type Rep (Chain1 t f a) = D1 ('MetaData "Chain1" "Data.HFunctor.Chain.Internal" "functor-combinators-0.4.1.4-LPxXTrKnRWxHbihjUbkalc" 'False) (C1 ('MetaCons "Done1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a))) :+: C1 ('MetaCons "More1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (t f (Chain1 t f) a)))) | |||||
Arguments
| :: forall {k} t h f g (a :: k). (HBifunctor t, Functor h) | |
| => (forall (x :: k). f x -> h (g x)) | handle |
| -> (forall (x :: k). t f (Comp h g) x -> h (g x)) | handle |
| -> Chain1 t f a | |
| -> h (g a) |
An "effectful" version of foldChain1, weaving Applicative effects.
Since: 0.3.6.0
unfoldChain1 :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (f :: Type -> Type) (g :: Type -> Type). HBifunctor t => (g ~> (f :+: t f g)) -> g ~> Chain1 t f Source #
unrollingNE :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (f :: Type -> Type). (Associative t, FunctorBy t f) => NonEmptyBy t f <~> Chain1 t f Source #
A type is supposed to represent the successive application of NonEmptyBy tts to itself. The type is an actual concrete ADT that contains successive applications of Chain1 t ft to itself, and you can pattern match on each layer.
unrollingNE states that the two types are isormorphic. Use unrollNE and rerollNE to convert between the two.
unrollNE :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (f :: Type -> Type). (Associative t, FunctorBy t f) => NonEmptyBy t f ~> Chain1 t f Source #
A type is supposed to represent the successive application of NonEmptyBy tts to itself. unrollNE makes that successive application explicit, buy converting it to a literal Chain1 of applications of t to itself.
unrollNE=unfoldChain1matchNE
rerollNE :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (f :: Type -> Type). Associative t => Chain1 t f ~> NonEmptyBy t f Source #
A type is supposed to represent the successive application of NonEmptyBy tts to itself. rerollNE takes an explicit Chain1 of applications of t to itself and rolls it back up into an .NonEmptyBy t
rerollNE=foldChain1injectconsNE
appendChain1 :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (f :: Type -> Type). (Associative t, FunctorBy t f) => t (Chain1 t f) (Chain1 t f) ~> Chain1 t f Source #
Chain1 is a semigroup with respect to t: we can "combine" them in an associative way.
This is essentially biretract, but only requiring : it comes from the fact that Associative t is the "free Chain1 t".SemigroupIn t
Since: 0.1.1.0
fromChain1 :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). Tensor t i => Chain1 t f ~> Chain t i f Source #
matchChain1 :: forall {k} (t :: (k -> Type) -> (k -> Type) -> k -> Type) (f :: k -> Type) (x :: k). Chain1 t f x -> (f :+: t f (Chain1 t f)) x Source #
For completeness, an isomorphism between Chain1 and its two constructors, to match matchNE.
Since: 0.3.0.0
toChain1 :: forall {k} (t :: (k -> Type) -> (k -> Type) -> k -> Type) (f :: k -> Type). HBifunctor t => t f f ~> Chain1 t f Source #
Convert a tensor value pairing two fs into a two-item Chain1. An analogue of toNonEmptyBy.
Since: 0.3.1.0
injectChain1 :: forall {k} f (t :: (k -> Type) -> (k -> Type) -> k -> Type) (x :: k). f x -> Chain1 t f x Source #
Create a singleton Chain1.
Since: 0.3.0.0
Matchable
splittingChain1 :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). (Matchable t i, FunctorBy t f) => Chain1 t f <~> t f (Chain t i f) Source #
splitChain1 :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). Tensor t i => Chain1 t f ~> t f (Chain t i f) Source #
The "forward" function representing splittingChain1. Provided here as a separate function because it does not require .Functor f
matchingChain :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). (Matchable t i, FunctorBy t f) => Chain t i f <~> (i :+: Chain1 t f) Source #
unmatchChain :: forall (t :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type). Tensor t i => (i :+: Chain1 t f) ~> Chain t i f Source #
The "reverse" function representing matchingChain. Provided here as a separate function because it does not require .Functor f
Orphan instances
| SemigroupIn t f => Interpret (Chain1 t :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # | |
| Tensor t i => Inject (Chain t i :: (Type -> Type) -> Type -> Type) Source # | |
| MonoidIn t i f => Interpret (Chain t i :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # | We can collapse and interpret an |
| Contravariant f => Decide (Chain1 Night f) Source # |
Since: 0.3.0.0 |
| Contravariant f => Divise (Chain1 Day f) Source # |
Since: 0.3.0.0 |
| Invariant f => Inply (Chain1 Day f) Source # | Since: 0.4.0.0 |
| Invariant f => Inalt (Chain1 Night f) Source # | Since: 0.4.0.0 |
| Functor f => Alt (Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) Source # |
|
Methods (<!>) :: Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a # some :: Applicative (Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) => Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f [a] # many :: Applicative (Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) => Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f [a] # | |
| Functor f => Alt (Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) Source # |
|
Methods (<!>) :: Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a # some :: Applicative (Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) => Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f [a] # many :: Applicative (Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) => Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f [a] # | |
| Functor f => Apply (Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) Source # | |
Methods (<.>) :: Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f (a -> b) -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f b # (.>) :: Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f b -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f b # (<.) :: Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f b -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a # liftF2 :: (a -> b -> c) -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f b -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f c # | |
| Functor f => Apply (Chain1 Day f) Source # |
|
| Functor f => Bind (Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) Source # |
|
Methods (>>-) :: Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a -> (a -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f b) -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f b # join :: Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f (Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a) -> Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f a # | |
| (Tensor t i, FunctorBy t (Chain t i f)) => MonoidIn (WrapHBF t) (WrapF i) (Chain t i f) Source # |
|
| (Associative t, FunctorBy t f, FunctorBy t (Chain1 t f)) => SemigroupIn (WrapHBF t) (Chain1 t f) Source # |
|
| (Tensor t i, FunctorBy t (Chain t i f)) => SemigroupIn (WrapHBF t) (Chain t i f) Source # | We have to wrap |
| Applicative (Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f) Source # | |
Methods pure :: a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a # (<*>) :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f (a -> b) -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b # liftA2 :: (a -> b -> c) -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f c # (*>) :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b # (<*) :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a # | |
| Applicative (Chain Day Identity f) Source # |
|
Methods pure :: a -> Chain Day Identity f a # (<*>) :: Chain Day Identity f (a -> b) -> Chain Day Identity f a -> Chain Day Identity f b # liftA2 :: (a -> b -> c) -> Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f c # (*>) :: Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f b # (<*) :: Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f a # | |
| Monad (Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f) Source # |
|
Methods (>>=) :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> (a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b) -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b # (>>) :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b # return :: a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a # | |
| Divisible (Chain Day (Proxy :: Type -> Type) f) Source # |
Since: 0.3.0.0 |
| Conclude (Chain Night Not f) Source # |
Since: 0.3.0.0 |
| Decide (Chain Night Not f) Source # | Since: 0.3.0.0 |
| Divise (Chain Day (Proxy :: Type -> Type) f) Source # | Since: 0.3.0.0 |
Methods divise :: (a -> (b, c)) -> Chain Day (Proxy :: Type -> Type) f b -> Chain Day (Proxy :: Type -> Type) f c -> Chain Day (Proxy :: Type -> Type) f a Source # divised :: Chain Day (Proxy :: Type -> Type) f a -> Chain Day (Proxy :: Type -> Type) f b -> Chain Day (Proxy :: Type -> Type) f (a, b) Source # | |
| Inplicative (Chain Day Identity f) Source # | Since: 0.4.0.0 |
| Inply (Chain Day Identity f) Source # | Since: 0.4.0.0 |
| Inalt (Chain Night Not f) Source # | Since: 0.4.0.0 |
| Inplus (Chain Night Not f) Source # | Since: 0.4.0.0 |
| Functor f => Alt (Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f) Source # | |
Methods (<!>) :: Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a -> Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a -> Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a # some :: Applicative (Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f) => Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a -> Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f [a] # many :: Applicative (Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f) => Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a -> Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f [a] # | |
| Functor f => Alt (Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f) Source # | |
Methods (<!>) :: Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a -> Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a -> Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a # some :: Applicative (Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f) => Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a -> Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f [a] # many :: Applicative (Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f) => Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f a -> Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f [a] # | |
| Apply (Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f) Source # | |
Methods (<.>) :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f (a -> b) -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b # (.>) :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b # (<.) :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a # liftF2 :: (a -> b -> c) -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f c # | |
| Apply (Chain Day Identity f) Source # | |
Methods (<.>) :: Chain Day Identity f (a -> b) -> Chain Day Identity f a -> Chain Day Identity f b # (.>) :: Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f b # (<.) :: Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f a # liftF2 :: (a -> b -> c) -> Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f c # | |
| Bind (Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f) Source # | |
Methods (>>-) :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a -> (a -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b) -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f b # join :: Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f (Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a) -> Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f a # | |
| Functor f => Plus (Chain (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f) Source # |
|
| Functor f => Plus (Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f) Source # |
|