first-class-patterns-0.1.0: First class patterns and pattern matching, using type families

Portabilityportable
Stabilityexperimental
MaintainerReiner Pope <reiner.pope@gmail.com>

Data.Pattern.Base.Tuple

Contents

Description

Various types defined inductively as type families or data families on type-lists.

Synopsis

Functions

type family Fun xs r Source

Curried functions. We have

Fun (x1 :*: x2 :*: ... :*: xn :*: Nil) r ~ x1 -> x2 -> ... -> xn -> r

Tuples

data Tuple xs Source

Tuples with types given by xs.

zero :: Tuple NilSource

The empty tuple

one :: a -> Tuple (a :*: Nil)Source

The singleton tuple

(<>) :: Tuple xs -> Tuple ys -> Tuple (xs :++: ys)Source

Concatenation of tuples.

runTuple :: Tuple xs -> Fun xs r -> rSource

Runs a tuple by applying it to a function.