extensible-0.9.1: Extensible, efficient, optics-friendly data types and effects
Copyright(c) Fumiaki Kinoshita 2018
LicenseBSD3
MaintainerFumiaki Kinoshita <fumiexcel@gmail.com>
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Extensible.Tangle

Description

Extensible tangles

Synopsis

Documentation

newtype TangleT xs h m a Source #

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

Constructors

TangleT 

Fields

Instances

Instances details
MonadTrans (TangleT xs h) Source # 
Instance details

Defined in Data.Extensible.Tangle

Methods

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

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

Defined in Data.Extensible.Tangle

Methods

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

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

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

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

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

Functor m => Functor (TangleT xs h m) Source # 
Instance details

Defined in Data.Extensible.Tangle

Methods

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

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

Monad m => Monad (TangleT xs h m) Source # 
Instance details

Defined in Data.Extensible.Tangle

Methods

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

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

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

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

Defined in Data.Extensible.Tangle

Methods

mempty :: TangleT xs h m a #

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

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

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

Defined in Data.Extensible.Tangle

Methods

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

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

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

lasso :: forall k v m h xs. (Monad m, Lookup xs k v, Wrapper h) => Proxy k -> TangleT xs h m (Repr h (k ':> v)) Source #

Hitch an element associated to the FieldName through a wrapper.

hitchAt :: Monad m => Membership xs x -> TangleT xs h m (h x) Source #

Take a value from the tangles. The result is memoized.

runTangleT :: Monad m => (xs :& Compose (TangleT xs h m) h) -> (xs :& Nullable h) -> TangleT xs h m a -> m (a, xs :& Nullable h) Source #

Run a TangleT action and return the result and the calculated values.

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

Run a TangleT action.

runTangles :: Monad m => (xs :& Compose (TangleT xs h m) h) -> (xs :& Nullable h) -> m (xs :& h) Source #

Run tangles and collect all the results as a Record.