about summary refs log tree commit diff
path: root/README.md
blob: 55ea764d8fbc1c90f44fd8e4671fe2f29b94ef3b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
yants
=====

This is a tiny type-checker for data in Nix, written in Nix.

Features:

* Checking of primitive types (`int`, `string` etc.)
* Checking polymorphic types (`option`, `list`, `either`)
* Defining & checking struct/record types
* Defining & matching enum types
* Defining & matching sum types
* Defining function signatures (including curried functions)
* Types are composable! `option string`! `list (either int (option float))`!
* Type errors also compose!

Lacking:

* Any kind of inference
* Convenient syntax for attribute-set function signatures

## Primitives & simple polymorphism

![simple](screenshots/simple.png)

## Structs

![structs](screenshots/structs.png)

## Nested structs!

![nested structs](screenshots/nested-structs.png)

## Enums!

![enums](screenshots/enums.png)

## Functions!

![functions](screenshots/functions.png)