evincarofautumn/kitten — pull request #16 by evincarofautumn (2013-03-11 01:30:33+00:00)
Title: Type Annotations

Type annotations serve as documentation, and as a sanity check to prevent weird types being inferred for miswritten recursive and higher-order functions. The preliminary syntax for annotations is like so:

```
type (a b) map: {a -> b} [a] -> [b]
type succ { int -> int }
```

Or more generally:

```
type (VARS) NAME { TYPE }
```

Where all variables used in `TYPE` must be quantified by `VARS`, and `TYPE` has the following syntax:

Type	Meaning

a

Value of type a

a0 a1 … -> b0 b1 …

Function consuming a and producing b

[a]

Vector with elements of type a

(a b …)

Tuple with elements of type a, b, &c.

{ … }

Grouping

bool
int
text

Intrinsic types