From 101089fc77dd15dfc25c91f713ff52719cb8e165 Mon Sep 17 00:00:00 2001 From: Michael Sippel Date: Wed, 1 May 2024 17:07:47 +0200 Subject: [PATCH] readme: add syntax description and roadmap --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index d4dc395..c81f97c 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ Rust Implementation of Ladder-Types (parsing, unification, rewriting, etc) ## Ladder Types +### Motivation + In order to implement complex datastructures and algorithms, usually many layers of abstraction are built ontop of each other. Consequently higher-level data types are encoded into lower-level data @@ -57,6 +59,32 @@ this: 1696093021:1696093039:1528324679:1539892301:1638141920:1688010253 ``` +### Syntax + +A type-term can be of the form: +- `0` | `1` | `2` | ... (**Literal Integer**) +- `'a'` | `'b'` | `'c'` | ... (**Literal Character**) +- `SomeTypeName` (**Atomic Type**) +- `` given `T_1` and `T_2` are type-terms. (**Parameter Application**) +- `T_1 ~ T_2` given `T_1` and `T_2` are type-terms. (**Ladder**) + +Ontop of that, the following syntax-sugar is defined: + +#### Complex Types +- `[T]` <===> `` +- `{a:A,b:B}` <===> ` <"b" B>>` +- `a:A|b:B` <===> ` <"b" B>>` + +#### Function Types +- `A -> B` <===> `` + +#### Reference Types +- `*A` <===> `` +- `&A` <===> `` +- `&!A` <===> `` + + + ## How to use this crate ```rust @@ -73,6 +101,19 @@ fn main() { } ``` +## Roadmap + +- [x] (Un-)Parsing +- [x] (De-)Currying +- [x] Unification +- [x] Ladder-Normal-Form +- [x] Parameter-Normal-Form +- [ ] (De)-Sugaring + - [ ] Seq + - [ ] Enum + - [ ] Struct + - [ ] References + - [ ] Function ## License [GPLv3](COPYING)