1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-15 01:52:11 +03:00
juvix/app/Commands
Ł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
..
Compile Fix: add supported targets as option for compile commands (#1983) 2023-04-13 14:16:07 +02:00
Dev Add field projections for records (#2260) 2023-08-01 09:46:22 +01:00
Doctor Use theJUVIX_LLVM_DIST_PATH environment variable to search for the clang executable (#2152) 2023-06-01 12:18:31 +02:00
Eval Print values in juvix eval (#2179) 2023-06-06 12:35:01 +02:00
Extra Use theJUVIX_LLVM_DIST_PATH environment variable to search for the clang executable (#2152) 2023-06-01 12:18:31 +02:00
Format New syntax for function definitions (#2243) 2023-07-10 19:57:55 +02:00
Html Don't print pragmas in documentation (#2266) 2023-07-31 14:33:05 +02:00
Repl Add field projections for records (#2260) 2023-08-01 09:46:22 +01:00
Typecheck Support basic dependencies (#1622) 2022-12-20 13:05:40 +01:00
Base.hs Refactor CLI (#1527) 2022-09-14 16:16:15 +02:00
Clean.hs Add juvix clean to remove project build artifact directory (#2018) 2023-04-21 14:21:31 +02:00
Compile.hs Add main field to juvix.yaml (#2120) 2023-05-24 15:42:20 +02:00
Dev.hs Add juvix dev repl command (#1941) 2023-03-31 00:57:44 +02:00
Doctor.hs Use theJUVIX_LLVM_DIST_PATH environment variable to search for the clang executable (#2152) 2023-06-01 12:18:31 +02:00
Eval.hs Fix 'function not found' error in juvix eval (#2178) 2023-06-06 13:26:43 +02:00
Format.hs New syntax for function definitions (#2243) 2023-07-10 19:57:55 +02:00
Html.hs Support more paths (#2000) 2023-04-19 15:56:48 +01:00
Init.hs Fixes behaviour of default stdlib when internal-build-flag is set (#2283) 2023-08-09 16:12:44 +01:00
Repl.hs User-friendly operator declaration syntax (#2270) 2023-08-09 18:15:51 +02:00
Typecheck.hs Update typecheck command to check for coverage (#1952) 2023-03-30 19:36:38 +02:00