Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

Type operators for writing convenient type signatures.

## Synopsis

- type family Each (c :: [k -> Constraint]) (as :: [k]) where ...
- type With a b = a <+> b
- type ($) f a = f a

# Documentation

type family Each (c :: [k -> Constraint]) (as :: [k]) where ... Source #

Map several constraints over several variables.

f :: Each [Show, Read] [a, b] => a -> b -> String = f :: (Show a, Show b, Read a, Read b) => a -> b -> String

To specify list with single constraint / variable, don't forget to prefix
it with `'`

:

f :: Each '[Show] [a, b] => a -> b -> String

Each c '[] = (() :: Constraint) | |

Each c (h ': t) = (c <+> h, Each c t) |