Copyright | (c) Fumiaki Kinoshita 2017 |
---|---|
License | BSD3 |
Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Extensible tangles
- newtype TangleT h xs m a = TangleT {}
- lasso :: forall k v m h xs. (Monad m, Associate k v xs, Wrapper h) => FieldName k -> TangleT h xs m (Repr h (k :> v))
- hitchAt :: Monad m => Membership xs x -> TangleT h xs m (h x)
- runTangleT :: Monad m => (Comp (TangleT h xs m) h :* xs) -> (Nullable h :* xs) -> TangleT h xs m a -> m (a, Nullable h :* xs)
- evalTangleT :: Monad m => (Comp (TangleT h xs m) h :* xs) -> (Nullable h :* xs) -> TangleT h xs m a -> m a
- runTangles :: Monad m => (Comp (TangleT h xs m) h :* xs) -> (Nullable h :* xs) -> m (h :* xs)
Documentation
newtype TangleT h xs m a Source #
is the monad of computations that may depend on the elements in TangleT
h xs mxs
.
MonadTrans (TangleT k h xs) Source # | |
Monad m => Monad (TangleT k h xs m) Source # | |
Functor m => Functor (TangleT k h xs m) Source # | |
Monad m => Applicative (TangleT k h xs m) Source # | |
(Monad m, Semigroup a) => Semigroup (TangleT k h xs m a) Source # | |
(Monad m, Monoid a) => Monoid (TangleT k h xs m a) Source # | |
lasso :: forall k v m h xs. (Monad m, Associate k v xs, Wrapper h) => FieldName k -> TangleT h xs m (Repr h (k :> v)) Source #
Hitch an element associated to the FieldName
through a wrapper.
hitchAt :: Monad m => Membership xs x -> TangleT h xs m (h x) Source #
Take a value from the tangles. The result is memoized.
runTangleT :: Monad m => (Comp (TangleT h xs m) h :* xs) -> (Nullable h :* xs) -> TangleT h xs m a -> m (a, Nullable h :* xs) Source #
Run a TangleT
action and return the result and the calculated values.