Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Helpers for working with type-level lists.
Synopsis
- type family AllAre a ts :: Constraint where ...
- type family ReplaceAll a xs where ...
- type family ReplaceAllSnd a (xs :: [(k1, k2)]) where ...
Documentation
type family AllAre a ts :: Constraint where ... Source #
Constraint that every element of a promoted list is equal to a particular type. That is, the list of types is a single type repeated some number of times.
type family ReplaceAll a xs where ... Source #
ReplaceAll x ys
produces a type-level list of the same length
as ys
where each element is x
. In other words, it replaces each
element of ys
with x
. This would be map (const x) ys
in
value-level Haskell.
ReplaceAll a '[] = '[] | |
ReplaceAll a (x ': xs) = a ': ReplaceAll a xs |
type family ReplaceAllSnd a (xs :: [(k1, k2)]) where ... Source #
Replace the second component of every tuple in a type-level list with a constant.
ReplaceAllSnd a '[] = '[] | |
ReplaceAllSnd a ('(s, x) ': xs) = '(s, a) ': ReplaceAllSnd a xs |