Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype TangleFT t f m a = TangleFT {}
- hitchF :: Monad m => (forall h g. Functor g => (h a -> g (h a)) -> t h -> g (t h)) -> TangleFT t f m (f a)
- evalTangleFT :: (ApplicativeB t, Functor m) => TangleFT t f m a -> t (Compose (TangleFT t f m) f) -> m a
- liftTangles :: (FunctorB b, Functor m) => b (TangleT b m) -> b (Compose (TangleT b m) Identity)
- blank :: ApplicativeB b => b (Compose Maybe f)
- hitch :: Monad m => (forall h g. Functor g => (h a -> g (h a)) -> t h -> g (t h)) -> TangleT t m a
- gather :: (TraversableB t, Monad m) => TangleFT t f m (t f)
- type TangleF t f = TangleFT t f Identity
- evalTangleF :: ApplicativeB t => TangleF t f a -> t (Compose (TangleF t f) f) -> a
- type TangleT t = TangleFT t Identity
- evalTangleT :: (Functor m, ApplicativeB t) => TangleT t m a -> t (TangleT t m) -> m a
- type Tangle t = TangleFT t Identity Identity
- evalTangle :: ApplicativeB t => Tangle t a -> t (Tangle t) -> a
Documentation
newtype TangleFT t f m a Source #
TangleFT
is a higher-kinded heterogeneous memoisation monad transformer.
t
represents the shape of the underlying data structure, and f
is the wrapper type of each field.
This monad represents computations that depend on the contents of t f
.
Instances
MonadTrans (TangleFT t f) Source # | |
Defined in Control.Monad.Tangle | |
Monad m => Monad (TangleFT t f m) Source # | |
Functor m => Functor (TangleFT t f m) Source # | |
Monad m => Applicative (TangleFT t f m) Source # | |
Defined in Control.Monad.Tangle pure :: a -> TangleFT t f m a # (<*>) :: TangleFT t f m (a -> b) -> TangleFT t f m a -> TangleFT t f m b # liftA2 :: (a -> b -> c) -> TangleFT t f m a -> TangleFT t f m b -> TangleFT t f m c # (*>) :: TangleFT t f m a -> TangleFT t f m b -> TangleFT t f m b # (<*) :: TangleFT t f m a -> TangleFT t f m b -> TangleFT t f m a # | |
MonadIO m => MonadIO (TangleFT t f m) Source # | |
Defined in Control.Monad.Tangle | |
(Monad m, Semigroup a) => Semigroup (TangleFT t f m a) Source # | |
(Monad m, Monoid a) => Monoid (TangleFT t f m a) Source # | |
:: Monad m | |
=> (forall h g. Functor g => (h a -> g (h a)) -> t h -> g (t h)) | van Laarhoven lens |
-> TangleFT t f m (f a) |
Obtain a value from the tangle. The result gets memoised.
evalTangleFT :: (ApplicativeB t, Functor m) => TangleFT t f m a -> t (Compose (TangleFT t f m) f) -> m a Source #
liftTangles :: (FunctorB b, Functor m) => b (TangleT b m) -> b (Compose (TangleT b m) Identity) Source #
Lift a collection of TangleT
s so that it fits the argument of runTangleFT
.
:: Monad m | |
=> (forall h g. Functor g => (h a -> g (h a)) -> t h -> g (t h)) | van Laarhoven lens |
-> TangleT t m a |
Bare variant of hitchF
gather :: (TraversableB t, Monad m) => TangleFT t f m (t f) Source #
Collect all results in the tangle.
evalTangleF :: ApplicativeB t => TangleF t f a -> t (Compose (TangleF t f) f) -> a Source #
evalTangleT :: (Functor m, ApplicativeB t) => TangleT t m a -> t (TangleT t m) -> m a Source #
evalTangle :: ApplicativeB t => Tangle t a -> t (Tangle t) -> a Source #