Copyright | (c) Justin Le 2019 |
---|---|
License | BSD3 |
Maintainer | [email protected] |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Data.Functor.Apply.Free
Description
Synopsis
- data Ap1 (a :: Type -> Type) b where
- toAp :: forall (f :: Type -> Type) x. Ap1 f x -> Ap f x
- fromAp :: forall (f :: Type -> Type) x. Ap f x -> (Identity :+: Ap1 f) x
- liftAp1 :: f x -> Ap1 f x
- retractAp1 :: forall (f :: Type -> Type). Apply f => Ap1 f ~> f
- runAp1 :: forall (g :: Type -> Type) (f :: Type -> Type). Apply g => (f ~> g) -> Ap1 f ~> g
Documentation
data Ap1 (a :: Type -> Type) b where Source #
One or more f
s convolved with itself.
Essentially:
Ap1
f ~ f -- one f:+:
(f `Day'
f) -- two f's :+: (f `Day` f `Day` f) -- three f's :+: (f `Day` f `Day` f `Day` f) -- four f's :+: ... -- etc.
Useful if you want to promote an f
to a situation with "at least one
f
sequenced with itself".
Mostly useful for its HFunctor
and Interpret
instance, along with
its relationship with Ap
and Day
.
This is the free Apply
--- Basically a "non-empty" Ap
.
The construction here is based on Ap
, similar to now
NonEmpty
is built on list.
Bundled Patterns
pattern DayAp1 :: Day f (Ap f) a -> Ap1 f a | An |
Instances
HBind Ap1 Source # | |||||
Inject Ap1 Source # | |||||
FreeOf Apply Ap1 Source # | |||||
Defined in Data.HFunctor.Final Associated Types
| |||||
HTraversable Ap1 Source # | |||||
Defined in Data.Functor.Apply.Free | |||||
HTraversable1 Ap1 Source # | |||||
Defined in Data.Functor.Apply.Free | |||||
HFunctor Ap1 Source # | |||||
Apply f => Interpret Ap1 (f :: Type -> Type) Source # | |||||
Functor (Ap1 f) Source # | |||||
Invariant (Ap1 f) Source # | Since: 0.3.0.0 | ||||
Defined in Data.Functor.Apply.Free | |||||
Apply (Ap1 f) Source # | |||||
type FreeFunctorBy Ap1 Source # | |||||
Defined in Data.HFunctor.Final |