License | MIT |
---|---|

Maintainer | dan.firth@homotopic.tech |

Stability | experimental |

Safe Haskell | None |

Language | Haskell2010 |

Extra functions for using vinyl records with polysemy.

## Synopsis

- rContramapInput :: (RMap xs, Members '[Input (Rec f xs)] r) => (forall y. f y -> g y) -> Sem (Input (Rec g xs) ': r) a -> Sem r a
- rContramapInput' :: RMap xs => (forall y. f y -> g y) -> Sem (Input (Rec g xs) ': r) a -> Sem (Input (Rec f xs) ': r) a
- rMapOutput :: (RMap xs, Members '[Output (Rec g xs)] r) => (forall y. f y -> g y) -> Sem (Output (Rec f xs) ': r) a -> Sem r a
- rMapOutput' :: RMap xs => (forall y. f y -> g y) -> Sem (Output (Rec f xs) ': r) a -> Sem (Output (Rec g xs) ': r) a
- 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
- 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
- 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
- endRecInput :: Sem (Input (Rec f '[]) ': r) a -> Sem r a
- runInputConstFC :: forall b f g r a. f (g b) -> Sem (Input ((f :. g) b) ': r) a -> Sem r a
- runSeveral :: forall (e :: Type -> Effect) f (r :: [Effect]) xs a. (forall r' k x. k -> Sem (e k ': r') x -> Sem r' x) -> Rec f xs -> Sem (Append (TypeMap e (TypeMap f xs)) r) a -> Sem r a

# Documentation

:: 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*

:: 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 #

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*

runInputConstFC :: forall b f g r a. f (g b) -> Sem (Input ((f :. g) b) ': r) a -> Sem r a Source #

Like `runInputConstF`

but for vinyl composed functors.

*Since: 0.1.3.0*