composite-xstep-0.1.0.0: ReaderT transformer pattern for higher kinded composite data.

LicenseMIT
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Composite.XStep

Description

Tuple functions for composite records, inspired by relude.

Synopsis

Documentation

data RSource r m a Source #

An RSource is simply a ReaderT transformer. This is a uniquely named type as composte and vinyl aren't compatible via the IsoHKD interface due to the way that `(:->)` is defined.

Instances
Functor m => IsoHKD (RSource r m :: Type -> Type) (s :-> a :: Type) Source # 
Instance details

Defined in Composite.XStep

Associated Types

type HKD (RSource r m) (s :-> a) :: Type #

Methods

unHKD :: HKD (RSource r m) (s :-> a) -> RSource r m (s :-> a) #

toHKD :: RSource r m (s :-> a) -> HKD (RSource r m) (s :-> a) #

type HKD (RSource r m :: Type -> Type) (s :-> a :: Type) Source # 
Instance details

Defined in Composite.XStep

type HKD (RSource r m :: Type -> Type) (s :-> a :: Type) = r -> m a

type RSource' r = RSource (Record r) Source #

The special case where the environment is a Record.

type XStep m a = XRec (RSource a m) Source #

An XStep is a n XRec with an RSource. The type is eta-reduced, but in practice signatures will be written `XStep m a b` to represent a Kleisli arrow from a to m b.

type XStep' m a = XStep m (Record a) Source #

The special case where the environment is a Record.

runSourceI :: Functor m => RSource r m a -> r -> m (Identity a) Source #

Run an RSource against a Record and pull out the underlying functor.

runXStep :: (IsoXRec (RSource a m) b, Applicative m) => XStep m a b -> a -> m (Record b) Source #

Run an XStep to completion.

prependXStep :: (IsoXRec (RSource' a m) b, Applicative m) => XStep' m a b -> Record a -> m (Record (b ++ a)) Source #

The special case where the environnent is a XStep environment is Record, and the result should be prepended extensibly.