Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
A combinator to flip the order of the last two type parameters of a HyperType
.
Synopsis
- newtype HFlip f x h = MkHFlip (f (GetHyperType h) # x)
- _HFlip :: Iso (HFlip f0 x0 # k0) (HFlip f1 x1 # k1) (f0 k0 # x0) (f1 k1 # x1)
- hflipped :: Iso (f0 k0 # x0) (f1 k1 # x1) (HFlip f0 x0 # k0) (HFlip f1 x1 # k1)
- htraverseFlipped :: (Applicative f, HTraversable (HFlip h a)) => (forall n. HWitness (HFlip h a) n -> (p # n) -> f (q # n)) -> (h p # a) -> f (h q # a)
Documentation
Flip the order of the last two type parameters of a HyperType
.
Useful to use instances of classes such as HTraversable
which
are available on the flipped HyperType
.
For example GTerm
has instances when flipped.
MkHFlip (f (GetHyperType h) # x) |
Instances
htraverseFlipped :: (Applicative f, HTraversable (HFlip h a)) => (forall n. HWitness (HFlip h a) n -> (p # n) -> f (q # n)) -> (h p # a) -> f (h q # a) Source #
Convinience function for traversal over second last HyperType
argument.