Copyright | (c) 2023 Yamada Ryo |
---|---|
License | MPL-2.0 (see the file LICENSE) |
Maintainer | ymdfield@outlook.jp |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
A Heftia carrier that can be used as a handler for effect systems based
on classy-effects
.
Synopsis
- newtype HeftiaUnion (h :: Signature -> (Type -> Type) -> Type -> Type) u (es :: [Signature]) f a = HeftiaUnion {
- runHeftiaUnion :: h (u es) f a
- type HeftiaEffects h u es f = EffectsVia EffectDataHandler (HeftiaUnion h u es f)
- unHeftiaEffects :: HeftiaEffects h u es f ~> h (u es) f
- heftiaEffects :: h (u es) f ~> HeftiaEffects h u es f
- newtype HeftiaUnionForSendIns handleHere h u es f a = HeftiaUnionForSendIns {
- runHeftiaUnionForSendIns :: HeftiaUnion h u es f a
- runElaborate :: (TransHeftia c h, HFunctor (u es), c f, UnionH u) => (u es f ~> f) -> HeftiaEffects h u es f ~> f
- runElaborateK :: (MonadTransHeftia h, HFunctor (u es), UnionH u, Monad m) => (a -> m r) -> (forall x. (x -> m r) -> u es (ContT r m) x -> m r) -> HeftiaEffects h u es m a -> m r
- runElaborateContT :: (MonadTransHeftia h, HFunctor (u es), UnionH u, Monad m) => (u es (ContT r m) ~> ContT r m) -> HeftiaEffects h u es m ~> ContT r m
- runElaborateT :: (MonadTransHeftia h, HFunctor (u es), UnionH u, MonadTrans t, Monad m, Monad (t m)) => (u es (t m) ~> t m) -> HeftiaEffects h u es m ~> t m
- elaborate :: (TransHeftia c h, HFunctor (u es), c f, UnionH u, c g) => (f ~> g) -> (u es g ~> g) -> HeftiaEffects h u es f ~> g
- interpretH :: (TransHeftia c h, UnionH u, HFunctor (u es), HFunctor (u (e ': es)), HFunctor e, c f) => (e (HeftiaEffects h u es f) ~> HeftiaEffects h u es f) -> HeftiaEffects h u (e ': es) f ~> HeftiaEffects h u es f
- reinterpretH :: (TransHeftia c h, UnionH u, HFunctor (u (e ': es)), HFunctor e, c f) => (e (HeftiaEffects h u (e ': es) f) ~> HeftiaEffects h u (e ': es) f) -> HeftiaEffects h u (e ': es) f ~> HeftiaEffects h u (e ': es) f
- transformAllH :: (TransHeftia c h, UnionH u, UnionH u', HFunctor (u es), HFunctor (u' es'), c f) => (forall g. u es g ~> u' es' g) -> HeftiaEffects h u es f ~> HeftiaEffects h u' es' f
- transformH :: forall e' e h u r f c. (TransHeftia c h, UnionH u, c f, HFunctor (u (e ': r)), HFunctor (u (e' ': r))) => (forall g. e g ~> e' g) -> HeftiaEffects h u (e ': r) f ~> HeftiaEffects h u (e' ': r) f
- untagH :: forall tag e h u r f c. (TransHeftia c h, UnionH u, c f, HFunctor (u (e ': r)), HFunctor (u (TagH e tag ': r))) => HeftiaEffects h u (TagH e tag ': r) f ~> HeftiaEffects h u (e ': r) f
- translate :: forall e' e h u r f c. (TransHeftia c h, UnionH u, HFunctor (u (e ': r)), HFunctor (u (e' ': r)), HFunctor e, HFunctor e', c f) => (e (HeftiaEffects h u (e' ': r) f) ~> e' (HeftiaEffects h u (e' ': r) f)) -> HeftiaEffects h u (e ': r) f ~> HeftiaEffects h u (e' ': r) f
- translateAll :: (TransHeftia c h, UnionH u, UnionH u', HFunctor (u es), HFunctor (u' es'), c f) => (u es (HeftiaEffects h u' es' f) ~> u' es' (HeftiaEffects h u' es' f)) -> HeftiaEffects h u es f ~> HeftiaEffects h u' es' f
- interposeH :: forall e h u es f c. (TransHeftia c h, UnionH u, MemberH u e es, HFunctor (u es), c f) => (e (HeftiaEffects h u es f) ~> HeftiaEffects h u es f) -> HeftiaEffects h u es f ~> HeftiaEffects h u es f
- interceptH :: forall e h u es f c. (TransHeftia c h, UnionH u, MemberH u e es, HFunctor (u es), HFunctor e, c f) => (e (HeftiaEffects h u es f) ~> e (HeftiaEffects h u es f)) -> HeftiaEffects h u es f ~> HeftiaEffects h u es f
- raiseH :: forall e hs h u f c. (TransHeftia c h, HFunctor (u hs), HFunctor (u (e ': hs)), c f, UnionH u) => HeftiaEffects h u hs f ~> HeftiaEffects h u (e ': hs) f
- raise2H :: forall e1 e2 hs h u f c. (TransHeftia c h, HFunctor (u hs), HFunctor (u (e1 ': (e2 ': hs))), c f, UnionH u) => HeftiaEffects h u hs f ~> HeftiaEffects h u (e1 ': (e2 ': hs)) f
- raise3H :: forall e1 e2 e3 hs h u f c. (TransHeftia c h, HFunctor (u hs), HFunctor (u (e1 ': (e2 ': (e3 ': hs)))), c f, UnionH u) => HeftiaEffects h u hs f ~> HeftiaEffects h u (e1 ': (e2 ': (e3 ': hs))) f
- raise4H :: forall e1 e2 e3 e4 hs h u f c. (TransHeftia c h, HFunctor (u hs), HFunctor (u (e1 ': (e2 ': (e3 ': (e4 ': hs))))), c f, UnionH u) => HeftiaEffects h u hs f ~> HeftiaEffects h u (e1 ': (e2 ': (e3 ': (e4 ': hs)))) f
- raiseUnderH :: forall e1 e2 hs h u f c. (TransHeftia c h, HFunctor (u (e1 ': hs)), HFunctor (u (e1 ': (e2 ': hs))), c f, UnionH u) => HeftiaEffects h u (e1 ': hs) f ~> HeftiaEffects h u (e1 ': (e2 ': hs)) f
- raiseUnder2H :: forall e1 e2 e3 hs h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': hs))), HFunctor (u (e1 ': (e2 ': (e3 ': hs)))), c f, UnionH u) => HeftiaEffects h u (e1 ': (e2 ': hs)) f ~> HeftiaEffects h u (e1 ': (e2 ': (e3 ': hs))) f
- raiseUnder3H :: forall e1 e2 e3 e4 hs h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': (e3 ': hs)))), HFunctor (u (e1 ': (e2 ': (e3 ': (e4 ': hs))))), c f, UnionH u) => HeftiaEffects h u (e1 ': (e2 ': (e3 ': hs))) f ~> HeftiaEffects h u (e1 ': (e2 ': (e3 ': (e4 ': hs)))) f
- raise2UnderH :: forall e1 e2 e3 hs h u f c. (TransHeftia c h, HFunctor (u (e1 ': hs)), HFunctor (u (e1 ': (e2 ': (e3 ': hs)))), c f, UnionH u) => HeftiaEffects h u (e1 ': hs) f ~> HeftiaEffects h u (e1 ': (e2 ': (e3 ': hs))) f
- raise2Under2H :: forall e1 e2 e3 e4 hs h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': hs))), HFunctor (u (e1 ': (e2 ': (e3 ': (e4 ': hs))))), c f, UnionH u) => HeftiaEffects h u (e1 ': (e2 ': hs)) f ~> HeftiaEffects h u (e1 ': (e2 ': (e3 ': (e4 ': hs)))) f
- raise3UnderH :: forall e1 e2 e3 e4 hs h u f c. (TransHeftia c h, HFunctor (u (e1 ': hs)), HFunctor (u (e1 ': (e2 ': (e3 ': (e4 ': hs))))), c f, UnionH u) => HeftiaEffects h u (e1 ': hs) f ~> HeftiaEffects h u (e1 ': (e2 ': (e3 ': (e4 ': hs)))) f
- flipHeftia :: forall e1 e2 hs h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': hs))), HFunctor (u (e2 ': (e1 ': hs))), c f, UnionH u) => HeftiaEffects h u (e1 ': (e2 ': hs)) f ~> HeftiaEffects h u (e2 ': (e1 ': hs)) f
- flipHeftia3 :: forall e1 e2 e3 es h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': (e3 ': es)))), HFunctor (u (e3 ': (e2 ': (e1 ': es)))), c f, UnionH u) => HeftiaEffects h u (e1 ': (e2 ': (e3 ': es))) f ~> HeftiaEffects h u (e3 ': (e2 ': (e1 ': es))) f
- flipHeftiaUnder :: forall e1 e2 e3 es h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': (e3 ': es)))), HFunctor (u (e1 ': (e3 ': (e2 ': es)))), c f, UnionH u) => HeftiaEffects h u (e1 ': (e2 ': (e3 ': es))) f ~> HeftiaEffects h u (e1 ': (e3 ': (e2 ': es))) f
- rotate3H :: forall e1 e2 e3 es h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': (e3 ': es)))), HFunctor (u (e2 ': (e3 ': (e1 ': es)))), c f, UnionH u) => HeftiaEffects h u (e1 ': (e2 ': (e3 ': es))) f ~> HeftiaEffects h u (e2 ': (e3 ': (e1 ': es))) f
- rotate3H' :: forall e1 e2 e3 es h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': (e3 ': es)))), HFunctor (u (e3 ': (e1 ': (e2 ': es)))), c f, UnionH u) => HeftiaEffects h u (e1 ': (e2 ': (e3 ': es))) f ~> HeftiaEffects h u (e3 ': (e1 ': (e2 ': es))) f
- bundle2H :: forall u' e1 e2 es h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': es))), HFunctor (u (u' '[e1, e2] ': es)), c f, UnionH u, UnionH u') => HeftiaEffects h u (e1 ': (e2 ': es)) f ~> HeftiaEffects h u (u' '[e1, e2] ': es) f
- bundle3H :: forall u' e1 e2 e3 es h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': (e3 ': es)))), HFunctor (u (u' '[e1, e2, e3] ': es)), c f, UnionH u, UnionH u') => HeftiaEffects h u (e1 ': (e2 ': (e3 ': es))) f ~> HeftiaEffects h u (u' '[e1, e2, e3] ': es) f
- bundle4H :: forall u' e1 e2 e3 e4 es h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': (e3 ': (e4 ': es))))), HFunctor (u (u' '[e1, e2, e3, e4] ': es)), c f, UnionH u, UnionH u') => HeftiaEffects h u (e1 ': (e2 ': (e3 ': (e4 ': es)))) f ~> HeftiaEffects h u (u' '[e1, e2, e3, e4] ': es) f
- unbundle2H :: forall e1 e2 es h u u' f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': es))), HFunctor (u (u' '[e1, e2] ': es)), c f, UnionH u, UnionH u') => HeftiaEffects h u (u' '[e1, e2] ': es) f ~> HeftiaEffects h u (e1 ': (e2 ': es)) f
- unbundle3H :: forall e1 e2 e3 es h u u' f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': (e3 ': es)))), HFunctor (u (u' '[e1, e2, e3] ': es)), c f, UnionH u, UnionH u') => HeftiaEffects h u (u' '[e1, e2, e3] ': es) f ~> HeftiaEffects h u (e1 ': (e2 ': (e3 ': es))) f
- unbundle4H :: forall e1 e2 e3 e4 es h u u' f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': (e3 ': (e4 ': es))))), HFunctor (u (u' '[e1, e2, e3, e4] ': es)), c f, UnionH u, UnionH u') => HeftiaEffects h u (u' '[e1, e2, e3, e4] ': es) f ~> HeftiaEffects h u (e1 ': (e2 ': (e3 ': (e4 ': es)))) f
- hoistHeftiaEffects :: (TransHeftia c h, HFunctor (u es), c f, c g) => (f ~> g) -> HeftiaEffects h u es f ~> HeftiaEffects h u es g
- overHeftiaEffects :: (h (u es) f a -> h' (u' es') g b) -> HeftiaEffects h u es f a -> HeftiaEffects h' u' es' g b
- hoistInterpose :: forall e h u es fr u' es' f c c'. (TransHeftia c h, HFunctor (u es), TransFreer c' fr, Union u', Member u' e es', c (FreerEffects fr u' es' f), c' f) => (e ~> FreerEffects fr u' es' f) -> HeftiaEffects h u es (FreerEffects fr u' es' f) ~> HeftiaEffects h u es (FreerEffects fr u' es' f)
- interposeLower :: forall e h u es fr u' es' f c c'. (TransHeftia c h, HFunctor (u es), TransFreer c' fr, Union u', Member u' e es', c (FreerEffects fr u' es' f), c' f, c' (HeftiaEffects h u es (FreerEffects fr u' es' f))) => (e ~> HeftiaEffects h u es (FreerEffects fr u' es' f)) -> HeftiaEffects h u es (FreerEffects fr u' es' f) ~> HeftiaEffects h u es (FreerEffects fr u' es' f)
- interpretLowerH :: (c f, c g, TransHeftia c h, HFunctor (u es)) => (f ~> HeftiaEffects h u es g) -> HeftiaEffects h u es f ~> HeftiaEffects h u es g
- subsume :: (TransHeftia c h, MemberH u e es, UnionH u, HFunctor e, HFunctor (u es), HFunctor (u (e ': es)), c f) => HeftiaEffects h u (e ': es) f ~> HeftiaEffects h u es f
- liftLowerH :: (TransHeftia c h, c f, HFunctor (u es)) => f ~> HeftiaEffects h u es f
- elaborated :: (TransHeftia c h, UnionH u, HFunctor (u '[]), c f) => HeftiaEffects h u '[] f ~> f
- runHeftiaEffects :: (TransHeftia c h, HFunctor (u '[LiftIns f]), UnionH u, c f) => HeftiaEffects h u '[LiftIns f] f ~> f
- type Hef es f = HeftiaEffects HeftiaChurchT ExtensibleUnionH es f
- type (<<|) e es = MemberH ExtensibleUnionH e es
- type Elaborator e f = e f ~> f
- type ForallHFunctor = Forall HFunctor
Documentation
newtype HeftiaUnion (h :: Signature -> (Type -> Type) -> Type -> Type) u (es :: [Signature]) f a Source #
A data type that wraps Heftia with any encoding to become an instance of SendIns
/SendSig
based
on the liftInsT
or liftSigT
from the TransFreer
or TransHeftia
type class.
HeftiaUnion | |
|
Instances
SendIns e (HeftiaUnionForSendIns (IsMemberH (LiftIns e) es) h u es f) => SendIns e (HeftiaUnion h u es f) Source # | |
Defined in Control.Effect.Heftia sendIns :: e a -> HeftiaUnion h u es f a # | |
(TransHeftia c h, UnionH u, MemberH u e es, HFunctor (u es)) => SendSig e (HeftiaUnion h u es f) Source # | |
Defined in Control.Effect.Heftia sendSig :: e (HeftiaUnion h u es f) a -> HeftiaUnion h u es f a # | |
Foldable (h (u es) f) => Foldable (HeftiaUnion h u es f) Source # | |
Defined in Control.Effect.Heftia fold :: Monoid m => HeftiaUnion h u es f m -> m # foldMap :: Monoid m => (a -> m) -> HeftiaUnion h u es f a -> m # foldMap' :: Monoid m => (a -> m) -> HeftiaUnion h u es f a -> m # foldr :: (a -> b -> b) -> b -> HeftiaUnion h u es f a -> b # foldr' :: (a -> b -> b) -> b -> HeftiaUnion h u es f a -> b # foldl :: (b -> a -> b) -> b -> HeftiaUnion h u es f a -> b # foldl' :: (b -> a -> b) -> b -> HeftiaUnion h u es f a -> b # foldr1 :: (a -> a -> a) -> HeftiaUnion h u es f a -> a # foldl1 :: (a -> a -> a) -> HeftiaUnion h u es f a -> a # toList :: HeftiaUnion h u es f a -> [a] # null :: HeftiaUnion h u es f a -> Bool # length :: HeftiaUnion h u es f a -> Int # elem :: Eq a => a -> HeftiaUnion h u es f a -> Bool # maximum :: Ord a => HeftiaUnion h u es f a -> a # minimum :: Ord a => HeftiaUnion h u es f a -> a # sum :: Num a => HeftiaUnion h u es f a -> a # product :: Num a => HeftiaUnion h u es f a -> a # | |
Traversable (h (u es) f) => Traversable (HeftiaUnion h u es f) Source # | |
Defined in Control.Effect.Heftia traverse :: Applicative f0 => (a -> f0 b) -> HeftiaUnion h u es f a -> f0 (HeftiaUnion h u es f b) # sequenceA :: Applicative f0 => HeftiaUnion h u es f (f0 a) -> f0 (HeftiaUnion h u es f a) # mapM :: Monad m => (a -> m b) -> HeftiaUnion h u es f a -> m (HeftiaUnion h u es f b) # sequence :: Monad m => HeftiaUnion h u es f (m a) -> m (HeftiaUnion h u es f a) # | |
Alternative (h (u es) f) => Alternative (HeftiaUnion h u es f) Source # | |
Defined in Control.Effect.Heftia empty :: HeftiaUnion h u es f a # (<|>) :: HeftiaUnion h u es f a -> HeftiaUnion h u es f a -> HeftiaUnion h u es f a # some :: HeftiaUnion h u es f a -> HeftiaUnion h u es f [a] # many :: HeftiaUnion h u es f a -> HeftiaUnion h u es f [a] # | |
Applicative (h (u es) f) => Applicative (HeftiaUnion h u es f) Source # | |
Defined in Control.Effect.Heftia pure :: a -> HeftiaUnion h u es f a # (<*>) :: HeftiaUnion h u es f (a -> b) -> HeftiaUnion h u es f a -> HeftiaUnion h u es f b # liftA2 :: (a -> b -> c) -> HeftiaUnion h u es f a -> HeftiaUnion h u es f b -> HeftiaUnion h u es f c # (*>) :: HeftiaUnion h u es f a -> HeftiaUnion h u es f b -> HeftiaUnion h u es f b # (<*) :: HeftiaUnion h u es f a -> HeftiaUnion h u es f b -> HeftiaUnion h u es f a # | |
Functor (h (u es) f) => Functor (HeftiaUnion h u es f) Source # | |
Defined in Control.Effect.Heftia fmap :: (a -> b) -> HeftiaUnion h u es f a -> HeftiaUnion h u es f b # (<$) :: a -> HeftiaUnion h u es f b -> HeftiaUnion h u es f a # | |
Monad (h (u es) f) => Monad (HeftiaUnion h u es f) Source # | |
Defined in Control.Effect.Heftia (>>=) :: HeftiaUnion h u es f a -> (a -> HeftiaUnion h u es f b) -> HeftiaUnion h u es f b # (>>) :: HeftiaUnion h u es f a -> HeftiaUnion h u es f b -> HeftiaUnion h u es f b # return :: a -> HeftiaUnion h u es f a # | |
MonadPlus (h (u es) f) => MonadPlus (HeftiaUnion h u es f) Source # | |
Defined in Control.Effect.Heftia mzero :: HeftiaUnion h u es f a # mplus :: HeftiaUnion h u es f a -> HeftiaUnion h u es f a -> HeftiaUnion h u es f a # |
type HeftiaEffects h u es f = EffectsVia EffectDataHandler (HeftiaUnion h u es f) Source #
A Heftia carrier that can be used as a handler for effect systems based
on classy-effects
.
unHeftiaEffects :: HeftiaEffects h u es f ~> h (u es) f Source #
Unwrap the HeftiaEffects
wrapper.
heftiaEffects :: h (u es) f ~> HeftiaEffects h u es f Source #
Wrap with HeftiaEffects
.
newtype HeftiaUnionForSendIns handleHere h u es f a Source #
A wrapper data type designed to induce instance resolution to delegate the search for first-order
effect classes to a lower carrier f
even when there are no target effect classes in the effect
class list es
.
When a target effect class exists within es
, handleHere
is induced to be 'True
; when it
doesn't exist, it's induced to be 'False
.
HeftiaUnionForSendIns | |
|
Instances
(TransHeftia c h, SendIns e f, c f, HFunctor (u es)) => SendIns e (HeftiaUnionForSendIns 'False h u es f) Source # | |
Defined in Control.Effect.Heftia sendIns :: e a -> HeftiaUnionForSendIns 'False h u es f a # | |
(TransHeftia c h, UnionH u, MemberH u (LiftIns e) es, HFunctor (u es)) => SendIns e (HeftiaUnionForSendIns 'True h u es f) Source # | |
Defined in Control.Effect.Heftia sendIns :: e a -> HeftiaUnionForSendIns 'True h u es f a # | |
Foldable (h (u es) f) => Foldable (HeftiaUnionForSendIns handleHere h u es f) Source # | |
Defined in Control.Effect.Heftia fold :: Monoid m => HeftiaUnionForSendIns handleHere h u es f m -> m # foldMap :: Monoid m => (a -> m) -> HeftiaUnionForSendIns handleHere h u es f a -> m # foldMap' :: Monoid m => (a -> m) -> HeftiaUnionForSendIns handleHere h u es f a -> m # foldr :: (a -> b -> b) -> b -> HeftiaUnionForSendIns handleHere h u es f a -> b # foldr' :: (a -> b -> b) -> b -> HeftiaUnionForSendIns handleHere h u es f a -> b # foldl :: (b -> a -> b) -> b -> HeftiaUnionForSendIns handleHere h u es f a -> b # foldl' :: (b -> a -> b) -> b -> HeftiaUnionForSendIns handleHere h u es f a -> b # foldr1 :: (a -> a -> a) -> HeftiaUnionForSendIns handleHere h u es f a -> a # foldl1 :: (a -> a -> a) -> HeftiaUnionForSendIns handleHere h u es f a -> a # toList :: HeftiaUnionForSendIns handleHere h u es f a -> [a] # null :: HeftiaUnionForSendIns handleHere h u es f a -> Bool # length :: HeftiaUnionForSendIns handleHere h u es f a -> Int # elem :: Eq a => a -> HeftiaUnionForSendIns handleHere h u es f a -> Bool # maximum :: Ord a => HeftiaUnionForSendIns handleHere h u es f a -> a # minimum :: Ord a => HeftiaUnionForSendIns handleHere h u es f a -> a # sum :: Num a => HeftiaUnionForSendIns handleHere h u es f a -> a # product :: Num a => HeftiaUnionForSendIns handleHere h u es f a -> a # | |
Traversable (h (u es) f) => Traversable (HeftiaUnionForSendIns handleHere h u es f) Source # | |
Defined in Control.Effect.Heftia traverse :: Applicative f0 => (a -> f0 b) -> HeftiaUnionForSendIns handleHere h u es f a -> f0 (HeftiaUnionForSendIns handleHere h u es f b) # sequenceA :: Applicative f0 => HeftiaUnionForSendIns handleHere h u es f (f0 a) -> f0 (HeftiaUnionForSendIns handleHere h u es f a) # mapM :: Monad m => (a -> m b) -> HeftiaUnionForSendIns handleHere h u es f a -> m (HeftiaUnionForSendIns handleHere h u es f b) # sequence :: Monad m => HeftiaUnionForSendIns handleHere h u es f (m a) -> m (HeftiaUnionForSendIns handleHere h u es f a) # | |
Alternative (h (u es) f) => Alternative (HeftiaUnionForSendIns handleHere h u es f) Source # | |
Defined in Control.Effect.Heftia empty :: HeftiaUnionForSendIns handleHere h u es f a # (<|>) :: HeftiaUnionForSendIns handleHere h u es f a -> HeftiaUnionForSendIns handleHere h u es f a -> HeftiaUnionForSendIns handleHere h u es f a # some :: HeftiaUnionForSendIns handleHere h u es f a -> HeftiaUnionForSendIns handleHere h u es f [a] # many :: HeftiaUnionForSendIns handleHere h u es f a -> HeftiaUnionForSendIns handleHere h u es f [a] # | |
Applicative (h (u es) f) => Applicative (HeftiaUnionForSendIns handleHere h u es f) Source # | |
Defined in Control.Effect.Heftia pure :: a -> HeftiaUnionForSendIns handleHere h u es f a # (<*>) :: HeftiaUnionForSendIns handleHere h u es f (a -> b) -> HeftiaUnionForSendIns handleHere h u es f a -> HeftiaUnionForSendIns handleHere h u es f b # liftA2 :: (a -> b -> c) -> HeftiaUnionForSendIns handleHere h u es f a -> HeftiaUnionForSendIns handleHere h u es f b -> HeftiaUnionForSendIns handleHere h u es f c # (*>) :: HeftiaUnionForSendIns handleHere h u es f a -> HeftiaUnionForSendIns handleHere h u es f b -> HeftiaUnionForSendIns handleHere h u es f b # (<*) :: HeftiaUnionForSendIns handleHere h u es f a -> HeftiaUnionForSendIns handleHere h u es f b -> HeftiaUnionForSendIns handleHere h u es f a # | |
Functor (h (u es) f) => Functor (HeftiaUnionForSendIns handleHere h u es f) Source # | |
Defined in Control.Effect.Heftia fmap :: (a -> b) -> HeftiaUnionForSendIns handleHere h u es f a -> HeftiaUnionForSendIns handleHere h u es f b # (<$) :: a -> HeftiaUnionForSendIns handleHere h u es f b -> HeftiaUnionForSendIns handleHere h u es f a # | |
Monad (h (u es) f) => Monad (HeftiaUnionForSendIns handleHere h u es f) Source # | |
Defined in Control.Effect.Heftia (>>=) :: HeftiaUnionForSendIns handleHere h u es f a -> (a -> HeftiaUnionForSendIns handleHere h u es f b) -> HeftiaUnionForSendIns handleHere h u es f b # (>>) :: HeftiaUnionForSendIns handleHere h u es f a -> HeftiaUnionForSendIns handleHere h u es f b -> HeftiaUnionForSendIns handleHere h u es f b # return :: a -> HeftiaUnionForSendIns handleHere h u es f a # | |
MonadPlus (h (u es) f) => MonadPlus (HeftiaUnionForSendIns handleHere h u es f) Source # | |
Defined in Control.Effect.Heftia mzero :: HeftiaUnionForSendIns handleHere h u es f a # mplus :: HeftiaUnionForSendIns handleHere h u es f a -> HeftiaUnionForSendIns handleHere h u es f a -> HeftiaUnionForSendIns handleHere h u es f a # |
runElaborate :: (TransHeftia c h, HFunctor (u es), c f, UnionH u) => (u es f ~> f) -> HeftiaEffects h u es f ~> f Source #
Elaborate all effects in the effect class list at once.
runElaborateK :: (MonadTransHeftia h, HFunctor (u es), UnionH u, Monad m) => (a -> m r) -> (forall x. (x -> m r) -> u es (ContT r m) x -> m r) -> HeftiaEffects h u es m a -> m r Source #
Elaborate all effects in the effect class list using a delimited continuation.
runElaborateContT :: (MonadTransHeftia h, HFunctor (u es), UnionH u, Monad m) => (u es (ContT r m) ~> ContT r m) -> HeftiaEffects h u es m ~> ContT r m Source #
Elaborate all effects in the effect class list using a continuation monad transformer.
runElaborateT :: (MonadTransHeftia h, HFunctor (u es), UnionH u, MonadTrans t, Monad m, Monad (t m)) => (u es (t m) ~> t m) -> HeftiaEffects h u es m ~> t m Source #
Elaborate all effects in the effect class list using a monad transformer.
elaborate :: (TransHeftia c h, HFunctor (u es), c f, UnionH u, c g) => (f ~> g) -> (u es g ~> g) -> HeftiaEffects h u es f ~> g Source #
Elaborate all effects in the effect class list and the underlying carrier simultaneously,
transforming them into any carrier g
.
interpretH :: (TransHeftia c h, UnionH u, HFunctor (u es), HFunctor (u (e ': es)), HFunctor e, c f) => (e (HeftiaEffects h u es f) ~> HeftiaEffects h u es f) -> HeftiaEffects h u (e ': es) f ~> HeftiaEffects h u es f Source #
Elaborate the leading effect class in the effect class list.
reinterpretH :: (TransHeftia c h, UnionH u, HFunctor (u (e ': es)), HFunctor e, c f) => (e (HeftiaEffects h u (e ': es) f) ~> HeftiaEffects h u (e ': es) f) -> HeftiaEffects h u (e ': es) f ~> HeftiaEffects h u (e ': es) f Source #
Re-elaborate the leading effect class in the effect class list.
transformAllH :: (TransHeftia c h, UnionH u, UnionH u', HFunctor (u es), HFunctor (u' es'), c f) => (forall g. u es g ~> u' es' g) -> HeftiaEffects h u es f ~> HeftiaEffects h u' es' f Source #
Transform all effect classes in the effect class list into another union of effect classes.
transformH :: forall e' e h u r f c. (TransHeftia c h, UnionH u, c f, HFunctor (u (e ': r)), HFunctor (u (e' ': r))) => (forall g. e g ~> e' g) -> HeftiaEffects h u (e ': r) f ~> HeftiaEffects h u (e' ': r) f Source #
Transform the leading effect class in the effect class list into another effect class.
untagH :: forall tag e h u r f c. (TransHeftia c h, UnionH u, c f, HFunctor (u (e ': r)), HFunctor (u (TagH e tag ': r))) => HeftiaEffects h u (TagH e tag ': r) f ~> HeftiaEffects h u (e ': r) f Source #
Remove the tag attached to the effect class.
translate :: forall e' e h u r f c. (TransHeftia c h, UnionH u, HFunctor (u (e ': r)), HFunctor (u (e' ': r)), HFunctor e, HFunctor e', c f) => (e (HeftiaEffects h u (e' ': r) f) ~> e' (HeftiaEffects h u (e' ': r) f)) -> HeftiaEffects h u (e ': r) f ~> HeftiaEffects h u (e' ': r) f Source #
Transform the leading effect class in the effect class list into another effect class.
translateAll :: (TransHeftia c h, UnionH u, UnionH u', HFunctor (u es), HFunctor (u' es'), c f) => (u es (HeftiaEffects h u' es' f) ~> u' es' (HeftiaEffects h u' es' f)) -> HeftiaEffects h u es f ~> HeftiaEffects h u' es' f Source #
Transform all effect classes in the effect class list into another union of effect classes.
interposeH :: forall e h u es f c. (TransHeftia c h, UnionH u, MemberH u e es, HFunctor (u es), c f) => (e (HeftiaEffects h u es f) ~> HeftiaEffects h u es f) -> HeftiaEffects h u es f ~> HeftiaEffects h u es f Source #
Interpose the effect class that exists within the effect class list using a monad transformer.
interceptH :: forall e h u es f c. (TransHeftia c h, UnionH u, MemberH u e es, HFunctor (u es), HFunctor e, c f) => (e (HeftiaEffects h u es f) ~> e (HeftiaEffects h u es f)) -> HeftiaEffects h u es f ~> HeftiaEffects h u es f Source #
Transform the effect of the effect class that exists within the effect class list.
raiseH :: forall e hs h u f c. (TransHeftia c h, HFunctor (u hs), HFunctor (u (e ': hs)), c f, UnionH u) => HeftiaEffects h u hs f ~> HeftiaEffects h u (e ': hs) f Source #
Insert an arbitrary effect class at the beginning of the effect class list.
raise2H :: forall e1 e2 hs h u f c. (TransHeftia c h, HFunctor (u hs), HFunctor (u (e1 ': (e2 ': hs))), c f, UnionH u) => HeftiaEffects h u hs f ~> HeftiaEffects h u (e1 ': (e2 ': hs)) f Source #
Insert two arbitrary effect classes at the beginning of the effect class list.
raise3H :: forall e1 e2 e3 hs h u f c. (TransHeftia c h, HFunctor (u hs), HFunctor (u (e1 ': (e2 ': (e3 ': hs)))), c f, UnionH u) => HeftiaEffects h u hs f ~> HeftiaEffects h u (e1 ': (e2 ': (e3 ': hs))) f Source #
Insert three arbitrary effect classes at the beginning of the effect class list.
raise4H :: forall e1 e2 e3 e4 hs h u f c. (TransHeftia c h, HFunctor (u hs), HFunctor (u (e1 ': (e2 ': (e3 ': (e4 ': hs))))), c f, UnionH u) => HeftiaEffects h u hs f ~> HeftiaEffects h u (e1 ': (e2 ': (e3 ': (e4 ': hs)))) f Source #
Insert four arbitrary effect classes at the beginning of the effect class list.
raiseUnderH :: forall e1 e2 hs h u f c. (TransHeftia c h, HFunctor (u (e1 ': hs)), HFunctor (u (e1 ': (e2 ': hs))), c f, UnionH u) => HeftiaEffects h u (e1 ': hs) f ~> HeftiaEffects h u (e1 ': (e2 ': hs)) f Source #
Insert an arbitrary effect class below the leading effect class in the effect class list.
raiseUnder2H :: forall e1 e2 e3 hs h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': hs))), HFunctor (u (e1 ': (e2 ': (e3 ': hs)))), c f, UnionH u) => HeftiaEffects h u (e1 ': (e2 ': hs)) f ~> HeftiaEffects h u (e1 ': (e2 ': (e3 ': hs))) f Source #
Insert an arbitrary effect class below the first two leading effect classes in the effect class list.
raiseUnder3H :: forall e1 e2 e3 e4 hs h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': (e3 ': hs)))), HFunctor (u (e1 ': (e2 ': (e3 ': (e4 ': hs))))), c f, UnionH u) => HeftiaEffects h u (e1 ': (e2 ': (e3 ': hs))) f ~> HeftiaEffects h u (e1 ': (e2 ': (e3 ': (e4 ': hs)))) f Source #
Insert an arbitrary effect class below the first three leading effect classes in the effect class list.
raise2UnderH :: forall e1 e2 e3 hs h u f c. (TransHeftia c h, HFunctor (u (e1 ': hs)), HFunctor (u (e1 ': (e2 ': (e3 ': hs)))), c f, UnionH u) => HeftiaEffects h u (e1 ': hs) f ~> HeftiaEffects h u (e1 ': (e2 ': (e3 ': hs))) f Source #
Insert two arbitrary effect classes below the leading effect class in the effect class list.
raise2Under2H :: forall e1 e2 e3 e4 hs h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': hs))), HFunctor (u (e1 ': (e2 ': (e3 ': (e4 ': hs))))), c f, UnionH u) => HeftiaEffects h u (e1 ': (e2 ': hs)) f ~> HeftiaEffects h u (e1 ': (e2 ': (e3 ': (e4 ': hs)))) f Source #
Insert two arbitrary effect classes below the first two leading effect classes in the effect class list.
raise3UnderH :: forall e1 e2 e3 e4 hs h u f c. (TransHeftia c h, HFunctor (u (e1 ': hs)), HFunctor (u (e1 ': (e2 ': (e3 ': (e4 ': hs))))), c f, UnionH u) => HeftiaEffects h u (e1 ': hs) f ~> HeftiaEffects h u (e1 ': (e2 ': (e3 ': (e4 ': hs)))) f Source #
Inserts three arbitrary effect classes under the top effect class in the effect class list.
flipHeftia :: forall e1 e2 hs h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': hs))), HFunctor (u (e2 ': (e1 ': hs))), c f, UnionH u) => HeftiaEffects h u (e1 ': (e2 ': hs)) f ~> HeftiaEffects h u (e2 ': (e1 ': hs)) f Source #
Swaps the top two effect classes in the effect class list.
flipHeftia3 :: forall e1 e2 e3 es h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': (e3 ': es)))), HFunctor (u (e3 ': (e2 ': (e1 ': es)))), c f, UnionH u) => HeftiaEffects h u (e1 ': (e2 ': (e3 ': es))) f ~> HeftiaEffects h u (e3 ': (e2 ': (e1 ': es))) f Source #
Reverses the order of the top three effect classes in the effect class list.
flipHeftiaUnder :: forall e1 e2 e3 es h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': (e3 ': es)))), HFunctor (u (e1 ': (e3 ': (e2 ': es)))), c f, UnionH u) => HeftiaEffects h u (e1 ': (e2 ': (e3 ': es))) f ~> HeftiaEffects h u (e1 ': (e3 ': (e2 ': es))) f Source #
Swaps the second and third effect classes from the top in the effect class list.
rotate3H :: forall e1 e2 e3 es h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': (e3 ': es)))), HFunctor (u (e2 ': (e3 ': (e1 ': es)))), c f, UnionH u) => HeftiaEffects h u (e1 ': (e2 ': (e3 ': es))) f ~> HeftiaEffects h u (e2 ': (e3 ': (e1 ': es))) f Source #
Rotates the top three effect classes in the effect class list to the left.
rotate3H' :: forall e1 e2 e3 es h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': (e3 ': es)))), HFunctor (u (e3 ': (e1 ': (e2 ': es)))), c f, UnionH u) => HeftiaEffects h u (e1 ': (e2 ': (e3 ': es))) f ~> HeftiaEffects h u (e3 ': (e1 ': (e2 ': es))) f Source #
Rotates the top three effect classes in the effect class list to the left twice.
bundle2H :: forall u' e1 e2 es h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': es))), HFunctor (u (u' '[e1, e2] ': es)), c f, UnionH u, UnionH u') => HeftiaEffects h u (e1 ': (e2 ': es)) f ~> HeftiaEffects h u (u' '[e1, e2] ': es) f Source #
Bundles the top two effect classes in the effect class list into any open union.
bundle3H :: forall u' e1 e2 e3 es h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': (e3 ': es)))), HFunctor (u (u' '[e1, e2, e3] ': es)), c f, UnionH u, UnionH u') => HeftiaEffects h u (e1 ': (e2 ': (e3 ': es))) f ~> HeftiaEffects h u (u' '[e1, e2, e3] ': es) f Source #
Bundles the top three effect classes in the effect class list into any open union.
bundle4H :: forall u' e1 e2 e3 e4 es h u f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': (e3 ': (e4 ': es))))), HFunctor (u (u' '[e1, e2, e3, e4] ': es)), c f, UnionH u, UnionH u') => HeftiaEffects h u (e1 ': (e2 ': (e3 ': (e4 ': es)))) f ~> HeftiaEffects h u (u' '[e1, e2, e3, e4] ': es) f Source #
Bundles the top four effect classes in the effect class list into any open union.
unbundle2H :: forall e1 e2 es h u u' f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': es))), HFunctor (u (u' '[e1, e2] ': es)), c f, UnionH u, UnionH u') => HeftiaEffects h u (u' '[e1, e2] ': es) f ~> HeftiaEffects h u (e1 ': (e2 ': es)) f Source #
Expands the open union at the top of the effect class list.
unbundle3H :: forall e1 e2 e3 es h u u' f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': (e3 ': es)))), HFunctor (u (u' '[e1, e2, e3] ': es)), c f, UnionH u, UnionH u') => HeftiaEffects h u (u' '[e1, e2, e3] ': es) f ~> HeftiaEffects h u (e1 ': (e2 ': (e3 ': es))) f Source #
Expands the open union at the top of the effect class list.
unbundle4H :: forall e1 e2 e3 e4 es h u u' f c. (TransHeftia c h, HFunctor (u (e1 ': (e2 ': (e3 ': (e4 ': es))))), HFunctor (u (u' '[e1, e2, e3, e4] ': es)), c f, UnionH u, UnionH u') => HeftiaEffects h u (u' '[e1, e2, e3, e4] ': es) f ~> HeftiaEffects h u (e1 ': (e2 ': (e3 ': (e4 ': es)))) f Source #
Expands the open union at the top of the effect class list.
hoistHeftiaEffects :: (TransHeftia c h, HFunctor (u es), c f, c g) => (f ~> g) -> HeftiaEffects h u es f ~> HeftiaEffects h u es g Source #
Transforms the lower carrier.
Warning: The given natural transformation must be a monad morphism (see https://hackage.haskell.org/package/mmorph-1.2.0/docs/Control-Monad-Morph.html). If not, the result will be ill-behaved.
overHeftiaEffects :: (h (u es) f a -> h' (u' es') g b) -> HeftiaEffects h u es f a -> HeftiaEffects h' u' es' g b Source #
Accesses the inside of the HeftiaEffects
wrapper.
hoistInterpose :: forall e h u es fr u' es' f c c'. (TransHeftia c h, HFunctor (u es), TransFreer c' fr, Union u', Member u' e es', c (FreerEffects fr u' es' f), c' f) => (e ~> FreerEffects fr u' es' f) -> HeftiaEffects h u es (FreerEffects fr u' es' f) ~> HeftiaEffects h u es (FreerEffects fr u' es' f) Source #
Interpose the lower Freer carrier.
Warning: The given natural transformation must be a monad morphism (see https://hackage.haskell.org/package/mmorph-1.2.0/docs/Control-Monad-Morph.html). If not, the result will be ill-behaved.
interposeLower :: forall e h u es fr u' es' f c c'. (TransHeftia c h, HFunctor (u es), TransFreer c' fr, Union u', Member u' e es', c (FreerEffects fr u' es' f), c' f, c' (HeftiaEffects h u es (FreerEffects fr u' es' f))) => (e ~> HeftiaEffects h u es (FreerEffects fr u' es' f)) -> HeftiaEffects h u es (FreerEffects fr u' es' f) ~> HeftiaEffects h u es (FreerEffects fr u' es' f) Source #
Interpose the lower Freer carrier.
Warning: The given natural transformation must be a monad morphism (see https://hackage.haskell.org/package/mmorph-1.2.0/docs/Control-Monad-Morph.html). If not, the result will be ill-behaved.
interpretLowerH :: (c f, c g, TransHeftia c h, HFunctor (u es)) => (f ~> HeftiaEffects h u es g) -> HeftiaEffects h u es f ~> HeftiaEffects h u es g Source #
Interprets the lower carrier.
Warning: The given natural transformation must be a monad morphism (see https://hackage.haskell.org/package/mmorph-1.2.0/docs/Control-Monad-Morph.html). If not, the result will be ill-behaved.
subsume :: (TransHeftia c h, MemberH u e es, UnionH u, HFunctor e, HFunctor (u es), HFunctor (u (e ': es)), c f) => HeftiaEffects h u (e ': es) f ~> HeftiaEffects h u es f Source #
Transfer the higher-order effect to the underlying level.
liftLowerH :: (TransHeftia c h, c f, HFunctor (u es)) => f ~> HeftiaEffects h u es f Source #
Lifts the lower carrier.
elaborated :: (TransHeftia c h, UnionH u, HFunctor (u '[]), c f) => HeftiaEffects h u '[] f ~> f Source #
Drops a Heftia with no effect classes to elaborate to the lower carrier.
runHeftiaEffects :: (TransHeftia c h, HFunctor (u '[LiftIns f]), UnionH u, c f) => HeftiaEffects h u '[LiftIns f] f ~> f Source #
Drops the Heftia to the lower carrier.
type Hef es f = HeftiaEffects HeftiaChurchT ExtensibleUnionH es f Source #
A type synonym for commonly used Monad Heftia.
type (<<|) e es = MemberH ExtensibleUnionH e es Source #
An operator representing the membership relationship of the higher-order effect class list.
type Elaborator e f = e f ~> f Source #
A type synonym for functions that perform the elaboration of higher-order effects.
type ForallHFunctor = Forall HFunctor Source #
A type synonym for frequently occurring constraints on a list of effect classes.