extensible-0.4.7.2: Extensible, efficient, optics-friendly data types and effects

Copyright(c) Fumiaki Kinoshita 2017
LicenseBSD3
MaintainerFumiaki Kinoshita <fumiexcel@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Data.Extensible.Tangle

Description

Extensible tangles

Synopsis

Documentation

newtype TangleT h xs m a Source #

TangleT h xs m is the monad of computations that may depend on the elements in xs.

Constructors

TangleT 

Fields

Instances

MonadTrans (TangleT k h xs) Source # 

Methods

lift :: Monad m => m a -> TangleT k h xs m a #

Monad m => Monad (TangleT k h xs m) Source # 

Methods

(>>=) :: TangleT k h xs m a -> (a -> TangleT k h xs m b) -> TangleT k h xs m b #

(>>) :: TangleT k h xs m a -> TangleT k h xs m b -> TangleT k h xs m b #

return :: a -> TangleT k h xs m a #

fail :: String -> TangleT k h xs m a #

Functor m => Functor (TangleT k h xs m) Source # 

Methods

fmap :: (a -> b) -> TangleT k h xs m a -> TangleT k h xs m b #

(<$) :: a -> TangleT k h xs m b -> TangleT k h xs m a #

Monad m => Applicative (TangleT k h xs m) Source # 

Methods

pure :: a -> TangleT k h xs m a #

(<*>) :: TangleT k h xs m (a -> b) -> TangleT k h xs m a -> TangleT k h xs m b #

liftA2 :: (a -> b -> c) -> TangleT k h xs m a -> TangleT k h xs m b -> TangleT k h xs m c #

(*>) :: TangleT k h xs m a -> TangleT k h xs m b -> TangleT k h xs m b #

(<*) :: TangleT k h xs m a -> TangleT k h xs m b -> TangleT k h xs m a #

(Monad m, Semigroup a) => Semigroup (TangleT k h xs m a) Source # 

Methods

(<>) :: TangleT k h xs m a -> TangleT k h xs m a -> TangleT k h xs m a #

sconcat :: NonEmpty (TangleT k h xs m a) -> TangleT k h xs m a #

stimes :: Integral b => b -> TangleT k h xs m a -> TangleT k h xs m a #

(Monad m, Monoid a) => Monoid (TangleT k h xs m a) Source # 

Methods

mempty :: TangleT k h xs m a #

mappend :: TangleT k h xs m a -> TangleT k h xs m a -> TangleT k h xs m a #

mconcat :: [TangleT k h xs m a] -> TangleT k h xs m a #

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.

evalTangleT :: Monad m => (Comp (TangleT h xs m) h :* xs) -> (Nullable h :* xs) -> TangleT h xs m a -> m a Source #

Run a TangleT action.

runTangles :: Monad m => (Comp (TangleT h xs m) h :* xs) -> (Nullable h :* xs) -> m (h :* xs) Source #

Run tangles and collect all the results as a Record.