Add check for number of type variables in type signature (#512)

* Fix tvar string generation

* Add check for number of tvars in a single type signature

The number of tvars is limited by serialization (u8) to 255

* Added a comment in CHANGELOG

* Docs fixes

* Adding docs about the limitation on number of tvars

* Limit is 256, not 255

* Update CHANGELOG.md

Co-authored-by: Gaith Hallak <gaithhallak@gmail.com>

---------

Co-authored-by: Gaith Hallak <gaithhallak@gmail.com>
This commit is contained in:
Hans Svensson
2024-08-26 13:34:02 +02:00
committed by GitHub
parent 16308a7840
commit 927cd42592
6 changed files with 98 additions and 5 deletions
+5
View File
@@ -295,6 +295,11 @@ of `A`.
- When a user-defined type `t('a)` is invariant in `'a`, then `t(A)` can never be
a subtype of `t(B)`.
#### Type variable limitation
Because of how FATE represents types as values there is a fixed upper limit (256)
of type variables that can be used in a single type signature.
## Mutable state
Sophia does not have arbitrary mutable state, but only a limited form of state
+4 -4
View File
@@ -267,11 +267,11 @@ UnOp ::= '-' | '!' | 'bnot'
| Operators | Type
| --- | ---
| `-` `+` `*` `/` `mod` `^` | arithmetic operators
| `!` `&&` `||` | logical operators
| `!` `&&` `\|\|` | logical operators
| `band` `bor` `bxor` `bnot` `<<` `>>` | bitwise operators
| `==` `!=` `<` `>` `=<` `>=` | comparison operators
| `::` `++` | list operators
| `|>` | functional operators
| `\|>` | functional operators
## Operator precedence
@@ -291,5 +291,5 @@ In order of highest to lowest precedence.
| `bxor` | left
| `bor` | left
| `&&` | right
| `||` | right
| `|>` | left
| `\|\|` | right
| `\|>` | left