syntactic-1.0.1: Generic abstract syntax, and utilities for embedded languages

Language.Syntactic.Constructs.Tuple

Contents

Description

Construction and elimination of tuples in the object language

Synopsis

# Construction

data Tuple sig whereSource

Expressions for constructing tuples

Constructors

 Tup2 :: Tuple (a :-> (b :-> Full (a, b))) Tup3 :: Tuple (a :-> (b :-> (c :-> Full (a, b, c)))) Tup4 :: Tuple (a :-> (b :-> (c :-> (d :-> Full (a, b, c, d))))) Tup5 :: Tuple (a :-> (b :-> (c :-> (d :-> (e :-> Full (a, b, c, d, e)))))) Tup6 :: Tuple (a :-> (b :-> (c :-> (d :-> (e :-> (f :-> Full (a, b, c, d, e, f))))))) Tup7 :: Tuple (a :-> (b :-> (c :-> (d :-> (e :-> (f :-> (g :-> Full (a, b, c, d, e, f, g))))))))

Instances

 Equality Tuple ToTree Tuple Render Tuple Eval Tuple Constrained Tuple Semantic Tuple EvalBind Tuple Optimize Tuple AlphaEq dom dom dom env => AlphaEq Tuple Tuple dom env

# Projection

type family Sel1' a Source

These families (`Sel1'` - `Sel7'`) are needed because of the problem described in:

type family Sel2' a Source

type family Sel3' a Source

type family Sel4' a Source

type family Sel5' a Source

type family Sel6' a Source

type family Sel7' a Source

data Select a whereSource

Expressions for selecting elements of a tuple

Constructors

 Sel1 :: (Sel1 a b, Sel1' a ~ b) => Select (a :-> Full b) Sel2 :: (Sel2 a b, Sel2' a ~ b) => Select (a :-> Full b) Sel3 :: (Sel3 a b, Sel3' a ~ b) => Select (a :-> Full b) Sel4 :: (Sel4 a b, Sel4' a ~ b) => Select (a :-> Full b) Sel5 :: (Sel5 a b, Sel5' a ~ b) => Select (a :-> Full b) Sel6 :: (Sel6 a b, Sel6' a ~ b) => Select (a :-> Full b) Sel7 :: (Sel7 a b, Sel7' a ~ b) => Select (a :-> Full b)

Instances

 Equality Select ToTree Select Render Select Eval Select Constrained Select Semantic Select EvalBind Select Optimize Select AlphaEq dom dom dom env => AlphaEq Select Select dom env

selectPos :: Select a -> IntSource

Return the selected position, e.g.

``` selectPos (Sel3 poly :: Select Poly ((Int,Int,Int,Int) :-> Full Int)) = 3
```