1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-01 00:04:58 +03:00
juvix/tests
Łukasz Czajka eebe961321
User-friendly operator declaration syntax (#2270)
* Closes #1964 

Adds the possibility to define operator fixities. They live in a
separate namespace. Standard library defines a few in
`Stdlib.Data.Fixity`:
```

syntax fixity rapp {arity: binary, assoc: right};
syntax fixity lapp {arity: binary, assoc: left, same: rapp};
syntax fixity seq {arity: binary, assoc: left, above: [lapp]};

syntax fixity functor {arity: binary, assoc: right};

syntax fixity logical {arity: binary, assoc: right, above: [seq]};
syntax fixity comparison {arity: binary, assoc: none, above: [logical]};

syntax fixity pair {arity: binary, assoc: right};
syntax fixity cons {arity: binary, assoc: right, above: [pair]};

syntax fixity step {arity: binary, assoc: right};
syntax fixity range {arity: binary, assoc: right, above: [step]};

syntax fixity additive {arity: binary, assoc: left, above: [comparison, range, cons]};
syntax fixity multiplicative {arity: binary, assoc: left, above: [additive]};

syntax fixity composition {arity: binary, assoc: right, above: [multiplicative]};
```

The fixities are identifiers in a separate namespace (different from
symbol and module namespaces). They can be exported/imported and then
used in operator declarations:
```
import Stdlib.Data.Fixity open;

syntax operator && logical;
syntax operator || logical;
syntax operator + additive;
syntax operator * multiplicative;
```
2023-08-09 18:15:51 +02:00
..
Asm New compilation pipeline (#1832) 2023-03-14 16:24:07 +01:00
benchmark Fix runtime C maybe benchmark example (#2195) 2023-06-16 09:54:13 +01:00
Compilation User-friendly operator declaration syntax (#2270) 2023-08-09 18:15:51 +02:00
Core Fold lets when the bound variable occurs at most once (#2231) 2023-06-29 13:02:10 +02:00
examplesExpected Add a test suite for milestone examples (#1920) 2023-03-24 13:16:26 +00:00
Geb/positive Update to GEB version 0.3.2 (#2244) 2023-07-11 11:02:48 +02:00
Internal Fix reachability analysis with imports in unreachable nested modules (#2062) 2023-05-12 09:53:30 +01:00
negative User-friendly operator declaration syntax (#2270) 2023-08-09 18:15:51 +02:00
positive User-friendly operator declaration syntax (#2270) 2023-08-09 18:15:51 +02:00
runtime/positive Respect fixity in runtime printer (#2182) 2023-06-07 11:44:41 +02:00
smoke/Commands Fixes behaviour of default stdlib when internal-build-flag is set (#2283) 2023-08-09 16:12:44 +01:00
VampIR The public pragma (#2223) 2023-06-22 18:31:53 +02:00
.gitattributes Juvix C runtime (#1580) 2022-11-03 09:38:09 +01:00