Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Servant.Hateoas.Internal.Polyvariadic
Synopsis
- type family IsFun f where ...
- class b ~ IsFun f => PolyvariadicComp f b where
- (...) :: (PolyvariadicComp f b, IsFun f ~ b) => (Return f b -> r) -> f -> Replace f r b
- class (b ~ IsFun f, b ~ IsFun g) => PolyvariadicComp2 f g b where
IsFunction
Simple Polyvariadic composition
class b ~ IsFun f => PolyvariadicComp f b where Source #
Class for polyvariadic composition.
This is copied from the package erisco/control-dotdotdot
.
Methods
pcomp :: (Return f b -> r) -> f -> Replace f r b Source #
pcomp f g
has g
consume all arguments and then has f
consume the result of g
.
Instances
'False ~ IsFun a => PolyvariadicComp a 'False Source # | |
PolyvariadicComp b (IsFun b) => PolyvariadicComp (a -> b) 'True Source # | |
(...) :: (PolyvariadicComp f b, IsFun f ~ b) => (Return f b -> r) -> f -> Replace f r b infixr 9 Source #
Infix for pcomp
.
Polyvariadic composition with two functions
class (b ~ IsFun f, b ~ IsFun g) => PolyvariadicComp2 f g b where Source #
Like PolyvariadicComp
but allows to consume all arguments twice,
by two functions with the exact same arguments but potentially different return types.
Methods
pcomp2 :: (Return2 f g b -> r) -> f -> g -> Replace2 f g r b Source #
pcomp2 f g h
has each g
and h
consume all arguments and then has f
consume the result of g
and h
.
This is highly similar to (&&&)
from Arrow
but for polyvariadic composition.