diff options
| author | Inari Listenmaa <inari.listenmaa@gmail.com> | 2021-02-22 23:18:42 +0800 |
|---|---|---|
| committer | Inari Listenmaa <inari.listenmaa@gmail.com> | 2021-02-22 23:18:42 +0800 |
| commit | f9b8653ab295dbb82214d8947a0b6046df2a7b68 (patch) | |
| tree | 968a40417f2c70830ff11d387ff4115ee9f7774b /doc | |
| parent | 173fca7f125e84736e3d1cfe5b1b2e0b8d729141 (diff) | |
(refman) Add section about lists + links to my blog
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/gf-refman.md | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/doc/gf-refman.md b/doc/gf-refman.md index 2a53041d9..503a5060c 100644 --- a/doc/gf-refman.md +++ b/doc/gf-refman.md @@ -1809,6 +1809,23 @@ As the last rule, subtyping is transitive: - if *A* is a subtype of *B* and *B* is a subtype of *C*, then *A* is a subtype of *C*. +### List categories + +[]{#lists} + +Since categories of lists of elements of another category are a common idiom, the following syntactic sugar is available: + + cat [C] {n} + +abbreviates a set of three judgements: + + cat ListC ; + fun BaseC : C -> ... -> C -> ListC ; --n C’s + fun ConsC : C -> ListC -> ListC + +The functions `BaseC` and `ConsC` are automatically generated in the abstract syntax, but their linearizations, as well as the linearization type of `ListC`, must be defined manually. The type expression `[C]` is in all contexts interchangeable with `ListC`. + +More information on lists in GF can be found [here](https://inariksit.github.io/gf/2021/02/22/lists.html). ### Tables and table types @@ -2113,7 +2130,7 @@ of *x*, and the application thereby disappears. []{#reuse} -*This section is valid for GF 3.0, which abandons the \"lock field\"* +*This section is valid for GF 3.0, which abandons the \"[lock field](https://inariksit.github.io/gf/2018/05/25/subtyping-gf.html#lock-fields)\"* *discipline of GF 2.8.* As explained [here](#openabstract), abstract syntax modules can be |
