polysemy-vinyl-0.1.3.1: Functions for mapping vinyl records in polysemy.
LicenseMIT
Maintainerdan.firth@homotopic.tech
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Polysemy.Vinyl

Description

Extra functions for using vinyl records with polysemy.

Synopsis

Documentation

rContramapInput Source #

Arguments

:: (RMap xs, Members '[Input (Rec f xs)] r) 
=> (forall y. f y -> g y)

A natural transformation from f to g.

-> Sem (Input (Rec g xs) ': r) a 
-> Sem r a 

Map an Input containing a Rec contravariantly via a natural transformation. Uses rmap.

Since: 0.1.0.0

rContramapInput' Source #

Arguments

:: RMap xs 
=> (forall y. f y -> g y)

A natural transformation from f to g.

-> Sem (Input (Rec g xs) ': r) a 
-> Sem (Input (Rec f xs) ': r) a 

Reinterpreting version of rContramapInput.

Since: 0.1.0.0

rMapOutput Source #

Arguments

:: (RMap xs, Members '[Output (Rec g xs)] r) 
=> (forall y. f y -> g y)

A natural transformation from f to g.

-> Sem (Output (Rec f xs) ': r) a 
-> Sem r a 

Map an Output containing a Rec covariantly via a natural transformation. Uses rmap.

Since: 0.1.0.0

rMapOutput' Source #

Arguments

:: RMap xs 
=> (forall y. f y -> g y)

A natural transformation from f to g.

-> Sem (Output (Rec f xs) ': r) a 
-> Sem (Output (Rec g xs) ': r) a 

Reinterpreting version of rMapOutput.

Since: 0.1.0.0

separateRecInput :: forall f x xs r a. Members '[Input (Rec f xs), Input (f x)] r => Sem (Input (Rec f (x ': xs)) ': r) a -> Sem r a Source #

Separate one of the fields of an Input Rec into its own Input.

Since: 0.1.2.0

separateRecInput' :: forall f x xs r a. Sem (Input (Rec f (x ': xs)) ': r) a -> Sem (Input (f x) ': (Input (Rec f xs) ': r)) a Source #

Reinterpreting version of separateRecInput. This assumes you want to handle the separated case first.

Since: 0.1.2.0

stripRecInput :: forall f x xs r a. Members '[Input (f x)] (Input (Rec f xs) ': r) => Sem (Input (Rec f (x ': xs)) ': r) a -> Sem (Input (Rec f xs) ': r) a Source #

Like separateRecInput, but places the remainer of the Rec at the head of the list while pushing the case into the stack. This is useful when you want to eliminate the record first by repeated applications of stripRecInput.

Since: 0.1.2.0

endRecInput :: Sem (Input (Rec f '[]) ': r) a -> Sem r a Source #

Discard a depleted Rec Input by returning RNil.

Since: 0.1.2.0