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

Copyright(c) Fumiaki Kinoshita 2018
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 h xs) Source # 
Instance details

Defined in Data.Extensible.Tangle

Methods

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

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

Defined in Data.Extensible.Tangle

Methods

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

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

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

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

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

Defined in Data.Extensible.Tangle

Methods

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

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

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

Defined in Data.Extensible.Tangle

Methods

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

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

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

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

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

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

Defined in Data.Extensible.Tangle

Methods

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

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

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

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

Defined in Data.Extensible.Tangle

Methods

mempty :: TangleT h xs m a #

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

mconcat :: [TangleT h xs m a] -> TangleT 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.