Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data ToFer sem a = ToFer {
- tuplesOfFunctions :: forall next. ToF a next -> sem next
- eithersOfTuples :: sem a
Type TuplesOfFunctions
The ToFer
intermediate interpreter
return Tuples-of-Functions instead of Eithers-of-Tuples.
In other words, if transforms SumFunctor
into functions returning (sem next)
and ProductFunctor
into arguments of those functions.
This is like using an extension parameter introduced in
https://okmij.org/ftp/typed-formatting/index.html#DSL-FIn
but here only a single type parameter (a)
is exposed
instead of two.
Useful to avoid declaring and pattern-matching
an algebraic datatype of type (a)
,
as the corresponding function will be called directly,
given as arguments the terms that would have been
pattern-matched from a constructor
of such algebraic datatype.
ToFer | |
|
Instances
Functor sem => Dataable (ToFer sem) Source # | |
(Optionable sem, Functor sem) => Optionable (ToFer sem) Source # | |
(ProductFunctor sem, Monad sem) => ProductFunctor (ToFer sem) Source # | |
(SumFunctor sem, AlternativeFunctor sem) => SumFunctor (ToFer sem) Source # | |