- Closes#1637.
A function type signature is now allowed to have a body. This is valid
for both top level and let definitions.
```
not : Bool -> Bool := λ {
| true := false
| false := true
};
```
The integer to Nat translation in the Internal to Core translation
depends on both Nat and Bool builtin types being in the InfoTable.
544bddba43/src/Juvix/Compiler/Core/Translation/FromInternal.hs (L67)
If the root module does not contain an explicit reference to the builtin
Bool (for example) then builtin Bool type is filtered out by the
reachability analysis and therefore is not available at transltaion
time.
In this commit we add both builtin Nat and builtin Bool as start nodes
in the reachability analysis to guarantee that they will not be filtered
out.
- Fixes https://github.com/anoma/juvix/issues/1774
- Fixes#1723
- It refactors parsing/scoping so that the scoper does not need to read
files or parse any module. Instead, the parser takes care of parsing all
the imported modules transitively.
Filepaths within a Loc must now be absolute or an error is thrown when
mkLoc is called. This Loc is used when displaying errors.
This commit uses imaginary absolute file paths in the Core repl and Asm
commands in the cases (parsing a single expression for example).
Before this fix, the `core {repl, read, eval}` and `asm` commands would
crash if it encountered an error when invoked with a relative path, or
in the case of a repl when parsing a single expression.
Filepaths within a `Loc` must now be absolute or an error is thrown when
`mkLoc` is called. This `Loc` is used when displaying errors.
This commit converts the Core evaluator filepath to an absolute path
before calling `mkLoc`.
Before this fix, the Core evaluator would crash if it encountered an
error instead of displaying the error if called on a relative path.
This PR adds some maintenance at different levels to the CI config, the
Make file, and formatting.
- Most of the actions used by the CI related to haskell, ormolu, hlint
and pre-commit have been updated because Github requires NodeJS 16. This
change removes all the old warnings related to nodeJs.
In the case of ormolu, the new version makes us format some files that
were not formatted before, similarly with hlint.
- The CI has been updated to use the latest version of the Smoke testing
framework, which introduced installation of the dependencies for Linux
(libicu66) and macOS (icu4c) in the CI. In the case of macOS, the CI
uses a binary for smoke. For Linux, we use stack to build smoke from the
source. The source here is in a fork of [the official Smoke
repo](https://github.com/SamirTalwar/smoke). Such includes some
features/changes that are not yet in the official repo.
- The Makefile runs the ormolu and hlint targets using as a path for the
binaries the environment variables ORMOLU and HLINT. Thus, export those
variables in your environment before running `make check,` `make format`
or `make hlint`. Otherwise, the Makefile will use the binaries provided
by `stack`.
Co-authored-by: Paul Cadman <git@paulcadman.dev>
This PR redefines the `html` command unifying our previous subcommands
for the HTML backend. You should use the command in the following way to
obtain the same results as before:
- `juvix html src.juvix` -> `juvix html src.juvix --only-source`
- `juvix dev doc src.juvix` -> `juvix html src.juvix`
- Other fixes here include the flag `--non-recursive`, which replaces
the previous behavior in that we now generate all the HTML recursively
by default.
- The flag `--no-print-metadata` is now called `--no-footer`
- Also, another change introduced by this PR is asset handling; for
example, with our canonical Juvix program,
the new output is organized as follows.
```
juvix html HelloWorld.juvix --only-source && tree html/
Copying assets files to test/html/assets
Writing HelloWorld.html
html/
├── assets
│ ├── css
│ │ ├── linuwial.css
│ │ ├── source-ayu-light.css
│ │ └── source-nord.css
│ ├── images
│ │ ├── tara-magicien.png
│ │ ├── tara-seating.svg
│ │ ├── tara-smiling.png
│ │ ├── tara-smiling.svg
│ │ ├── tara-teaching.png
│ │ └── tara-teaching.svg
│ └── js
│ ├── highlight.js
│ └── tex-chtml.js
└── HelloWorld.html
├── Stdlib.Data.Bool.html
├── Stdlib.Data.List.html
├── Stdlib.Data.Maybe.html
├── Stdlib.Data.Nat.html
├── Stdlib.Data.Ord.html
├── Stdlib.Data.Product.html
├── Stdlib.Data.String.html
├── Stdlib.Function.html
├── Stdlib.Prelude.html
└── Stdlib.System.IO.html
```
In addition, for the vscode-plugin, this PR adds two flags,
`--prefix-assets` and `--prefix-url`, for which one provides input to
help vscode find resource locations and Juvix files.
PS. Make sure to run `make clean` the first time you run `make install`
for the first time.
The internal to core translation was removing implicit arguments from
function definitions and applications. This is incorrect as the implicit
bindings are required when translating the following (in `csuc`, the
binding of the implicit argument is required in an application on the
rhs):
```
Num : Type;
Num := {A : Type} → (A → A) → A → A;
csuc : Num → Num;
csuc n {_} f := f ∘ n {_} f;
```
Apart from removing this filter from function and application
translation, this required the following changes:
ConstructorInfo:
The _constructorArgsNum field must include the number of type parameters
of its inductive type.
PatternConstructorApp:
The pattern arguments must include wildcards for the implicit type
parameters passed to the constructor.
BuiltinIf:
The BuiltinIf expression is passed an implicit type argument that must
be removed when translating to Core if.
LitString:
A literal string is a function with an implcit type argument. So this
must be a translated to a lambda where the type argument is ignored.
Fixes https://github.com/anoma/juvix/issues/1714
A lambda:
```
\ { v0 := b0 ; v1 := b1 ; ... ; vn := bn }
```
should be translated to:
```
λ? (λ? ... (λ? (match ?$0, ?$1, ... , ?$n with ...)))
```
i.e the de Brujin index of the values in the match always start from 0.
Fixes: https://github.com/anoma/juvix/issues/1695
Adds Juvix tests for the compilation pipeline - these are converted from
the JuvixCore tests (those that make sense). Currently, only the
translation from Juvix to JuvixCore is checked for the tests that can be
type-checked. Ultimately, the entire compilation pipeline down to native
code / WebAssembly should be checked on these tests.
Closes#1689
An implementation of the translation from JuvixCore to JuvixAsm. After
merging this PR, the only remaining step to complete the basic
compilation pipeline (#1556) is the compilation of complex pattern
matching (#1531).
* Fixes several bugs in lambda-lifting.
* Fixes several bugs in the RemoveTypeArgs transformation.
* Fixes several bugs in the TopEtaExpand transformation.
* Adds the ConvertBuiltinTypes transformation which converts the builtin
bool inductive type to Core primitive bool.
* Adds the `juvix dev core strip` command.
* Adds the `juvix dev core asm` command.
* Adds the `juvix dev core compile` command.
* Adds two groups of tests:
- JuvixCore to JuvixAsm translation: translate JuvixCore tests to
JuvixAsm and run the results with the JuvixAsm interpreter,
- JuvixCore compilation: compile JuvixCore tests to native code and WASM
and execute the results.
* Closes#1520
* Closes#1549
This PR implements `printString` and `printBool` builtins for the legacy
C backend. Previously IO for strings was done using compile blocks with
included C code.
Fixes https://github.com/anoma/juvix/issues/1696
* Support inductive type and universe expressions
* Support function type expressions
* Add type information to Core function and constructor nodes
* Remove unused do
* Remove ParserParams
ParserParams is only used to record the root of the project, which is
used to prefix source file paths. However source file paths are always
absolute so this is not required.
* Add GetAbsPath to Files effect
The Files effect is not responsible for resolving a relative module
path into an absolute path on disk. This will allow us to resolve
relative module paths to alternative paths, for example to point to the
standard library on disk.
* Files effect getAbsPath returns paths within the registered standard
library
This means that the standard library can exist on disk at a different
location to the Juvix project.
A command line flag --stdlib-path can be specified to point to a
standard library, otherwise the embedded standard library is written to
disk at $PROJ_DIR/.juvix-build/stdlib and this is used instead.
* Recreate stdlib dir only when juvix version changes
* Add UpdateStdlib to the Files effect
* Add comment for stdlibOrFile
* Remove spurious import
builtin boolean
inductive MyBool {
myTrue : Bool;
myFalse : Bool;
};
The first constructor is mapped to primitive true and the second
constructor is mapped to primitive false.
This also adds compilation of builtin boolean in the legacy backend as
this was trivial to implement.
Now that integer literals have the builtin int type we need an actual
IOUnit value to use in the IO sequence implementation.
This commit also adds the TicTacToe web example to the test suite. It is
a typecheck / C generation only test because it uses the Wasm browser APIs.
Allow _ in Wasm exported names
The Anoma validity predicate Wasm signature is:
"_validate_tx": [I64, I64, I64, I64, I64, I64, I64, I64] -> [I64]
So we need to allow exported names containing '_'.
This PR adds a Juvix module that exports a function with this signature
and a test that the resulting Wasm function can be called.
* Add a Web version of TicTacToe
The web version demonstrates injecting host functions into the WASM
import table and call exported Juvix functions from JS.
The web version and the CLI version of the TicTacToe game use the same
game logic backend Juvix module.
* Build and publish web apps in documentation
* Add a link to the TicTacToe web app in example documentation
* Update Makefile to match the new format
* import all non-compile axioms with alphanum names in entrypoint
This commit adds `__attribute__((input_name(<name>)))` to the type
signature of all axioms that do not have a compile block. This indicates
to the compiler that this function should be added to the input table of
the WASM binary.
Adds a test that an imported function can be called from Juvix.
* test: Run node command in same directory as WASM output
* Don't generate importName for non-alphnum axioms
* Add a tutorial on Juvix module to JS interop via Wasm
* Export all functions with alphanum names in entrypoint
Set the export_name attribute on every function signature that has a
fully alpha numeric name.
* Adds a non-WASI target to compile command
WASM libraries we want to run in the browser and in Anoma VM do not have
access to the WASI runtime. For this usecase we need a target runtime
that does not use the WASI runtime.
A `wasi-` prefix is added to existing compile targets and introduce a new
standalone target. This target does not have IO functions like
`putStrLn` and `exit` calls `__builtin_trap` which corresponds to the
`unreachable` WASM instruction.
In the non-exhaustive case error a debug message is emitted to tell the
user which function had the error. This is now abstracted to a `debug`
function in the runtime which calls `putStrLn` in the case of WASI and
is no-op in the case of non-WASI.
Tests are added which check that exported names can be called with the
correct name and result.
* Moves walloc to a common directory
An axiom without a compile block generates a C function signature
without a corresponding body. This allows implementations to be injected
at link time (JS, Anoma).
* Update SimpleFungibleToken to use stdlib
We do not want to put an Int type into the standard library before we
have builtin support for arbitrary precision integers. So we include the
Int type locally in the project for now.
* Update reference to stdlib
* Fix shell-tests for SimpleFungibleToken
* Compute name dependency graph and filter unreachable declarations
* bugfix: recurse into type signatures
* positive tests
* make ormolu happy
* get starting nodes from ExportInfo
* make ormolu happy
* cosmetic refactoring of DependencyInfo
* fix tests & style
* add a simple positive test
* add lambda expressions to microjuvix language
* add basic normalization of type aliases
* fix test name
* normalize only functions on types
* normalize when matching
* fix type of inductive names
* improve detection of normalizing functions
* remove obsolete comment
* match constructor return type
* add test for issue 1333
* fix existing tests
* use lambda case
* add strong normalization
* Add test cases for type aliases and another fix
Co-authored-by: Jonathan Cubides <jonathan.cubides@uib.no>
* w.i.p
* Added strict positivity condition for datatypes w.i.p
* Add negative test for str.postivity check
* Add some revisions
* the branch is back to feet
* w.i.p add lots of traces to check alg.
* Add more test and revisions
* Add negative and positive test to the new flag and the keyword
* Fix shell tests.
* Make pre-commit happy
* Fix rebase conflicts
* Make pre-commit happy
* Add shell test, rename keyword, fix error msg
* Revert change
* Necessary changes
* Remove wrong unless
* Move the positivity checker to its own folder
* Add missing juvix.yaml
* Add a negative test thanks to jan
* make some style changes
* Make ormolu happy
* Remove unnecessary instance of Show
Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
* Implement error message for double braces
* Implement error message for implicit pattern on the left of an application
* Implement error message for constructor expected on the left of an application
Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
* Renaming MiniJuvix to Juvix
* Make Ormolu happy
* Make Hlint happy
* Remove redundant imports
* Fix shell tests and add target ci to our Makefile
* Make pre-commit happy
* Throw error when reading a file that conflicts with stdlib
The Files effect first tries to read a file from the embedded stdlib. If
this succeeds and the file also exists in the project then an error is
thrown.
This error can be thrown either at the parsing stage, if the entrypoint
file conflicts with the standard library, or at the scoping stage if an
imported file conflicts.
* Fix module name in test file
* improve and add Universe to MicroJuvix expressions
* continue with the refactor
* refactor typechecker and aritychecker
* refactor Abstract to Micro
* format
* refactor type calls builder and monojuvix translation
* complete abstract translation
* traversals have betrayed me
* fix monomorphisation and traversals
* update tests
* format
* rename Function2
* remove obsolete comments
* fix comment
This commit introduces a cache of Abstract.TopModule that is queried for
each ImportStatement.
Before this change, `registerBuiltin` could be called multiple times for
a module, if it was imported multiple times.
* Embed stdlib in minijuvix library
We add a new step at the beginning of the pipeline called Setup that
registers the modules in the standard library with the Files effect. The
standard library is then used when the Scoper queries the Files effect
for modules as it resolves import statements.
Use of the standard library can be disabled using the global
`--no-stdlib` command-line option.
* CI: Checkout submodules recursively for stdlib
* Add a new `--no-stdlib` option to shell check
* Poke CI
* CI: Checkout submodules in the test job
* match inductive definitions
* progress towards builtins
* more progress towards builtin types
* add more builtins
* add some errors
* add reverse table to builtins
* Squashed commit of the following:
commit 93333de502d8dd546eb8edf697ca7eef972ea105
Author: Paul Cadman <git@paulcadman.dev>
Date: Mon Jun 27 18:21:30 2022 +0100
Use builtin names for match and project functions
Add an implementation of nat for the standalone backend
commit 868d2098ee57b7acbca84512b6e096650eeeb22d
Author: Jan Mas Rovira <janmasrovira@gmail.com>
Date: Mon Jun 27 18:15:29 2022 +0200
add builtin information to ClosureInfo
commit 32c78aceb19ee4010d66090a3c4e6025621b5c1f
Author: Paul Cadman <git@paulcadman.dev>
Date: Mon Jun 27 12:52:10 2022 +0100
Refactor BuiltinEnum to sum type of each Builtin
commit 55bb72ab12a8fb7d10070c2dee5875482453b7c6
Author: Paul Cadman <git@paulcadman.dev>
Date: Fri Jun 24 14:44:28 2022 +0100
Add Builtin information to Mono InfoTable
commit a72368f2e3af20baaf44c5e21fa7e6a469cf1ac5
Author: Paul Cadman <git@paulcadman.dev>
Date: Fri Jun 24 14:41:51 2022 +0100
Add Bitraversable to Prelude
commit afa3153d82a9509b0882e7ca99830040fad9ef65
Author: Paul Cadman <git@paulcadman.dev>
Date: Fri Jun 24 14:41:39 2022 +0100
Remove unused import
commit ea0b7848fb80970e03a0561be3fb4448486a89a9
Author: Paul Cadman <git@paulcadman.dev>
Date: Thu Jun 23 13:54:58 2022 +0100
Use projection functions instead of direct member access
* Avoid shadowing C runtime names in foreign block
* Fix formatting
* Update C names for builtin functions
* Add prim_ prefix to builtin C names
Implement builtins for standalone and libc backends
* Update ormolu action
* ci: run all tests for draft PRs
Co-authored-by: Paul Cadman <git@paulcadman.dev>
* Add support for parital application eval/apply
* include string.h in libc runtime
* Add wasm SimpleFungibleTokenImplicit to tests
* Update VP example to new syntax
* propagate types from all reachable modules
* Change prelude import ordering to workaround minic issue
* Pre-declare inductive typedefs in C backend
This generates the typedefs corresponding to each inductive type.
e.g
```
inductive Bool { .. }
```
is translated to:
```
typedef struct Bool_3_s Bool_3_t;
```
This means that C code can reference these typedefs before they have
been fully defined. (all references to inductive types go through these typedefs
names).
This fixes an issue with the ordering of delcarations when modules are included.
* Use common Lib for MiniC tests
* libc runtime: flush stdout after writing to it
* Adds MiniTicTacToe example using common example lib
In MonoJuvixToMiniC we emit the inductive type typedefs before anything
else to support includes ordering
* Adds tests for mutually recrusive functions
* Add golden tests for milestone examples
* Example: Remove commented out code
* Test error handling behaviour in MiniTicTacToe
* Fail clang compilation on warnings
* Add test for Nested list types
* Add PrettyCode instances for NonEmpty and ConcreteType
* Ignore IsImplicit field in Eq and Hashable of TypeApplication
This is to workaround a crash in Micro->Mono translation when looking up
a concrete type
* Fix formatting
* hlint fixes
* Formatting fixes not reported by local pre-commit
* Refactor MonoJuvixToMiniC
* Fix shelltest
NB: We cannot check the order of the 'Writing' lines because this
depends on the order of files returned by the FS which is
non-deterministic between systems
* Refactor Base to CBuilder
* Refactor using applyOnFunStatement
Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
* work in progress towards implicit arguments
* Wip towards implicit types
* improve arity checker
* Add version of SimpleFungibleToken with implicit arguments
* guess arity of body before checking the lhs of a clause
* add ArityUnknown and fix some tests
* wip: proper errors in arity checker
* fix bugs, improve errors and add tests
* format
* set hlint version to 3.4 in the ci
* update pre-commit version to 3.0.0
* minor changes
* added more revisions
* minor
Co-authored-by: Jonathan Cubides <jonathan.cubides@uib.no>
* Updates runtime with function calls
* wip function calls
* Remove juvix_function_call macro
* Remove "new_" prefix for constructors and add _field suffix
* Rename test file
* Add example of using constructor as closure
* Test mjuvix function as function closure
* Keep track of emitted closures to avoid duplication
* Use concatMapM from MiniJuvix.Prelude
* Refactoring to split out the closure gen
* Separate passes for function sigs and closures
* Renaming functions generating functionDefs
* Rename juvix_function to minijuvix_function
* Rename DeclJuvixClosure
* Remove typeDefType'
* Remove unnecessary do
* Use Mono.getName
* Extract isNullary
* Use let-in instead of where
* [WIP] EntryPoint now has options. --no-termination is a new global opt.
* Add TerminationChecking to the pipeline
* Add TerminationChecking to the pipeline
* Keep GlobalOptions in App
* Fix reviewer's comments
* delete unnecessary parens
Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
* w.i.p adoption of generic error type
* harmonize
* Remove the use of Error effect for internal bugs
* add location information to expression atom list
* Add GenericError instance for PatternAtoms
* Remove Maybe GenericError occurrences
* [ci] fix draft job's condition
* minor changes
* [stack] macos support ghc-opts
* Fix reviewer's comments
* remove accidentally commited file
* refactor to avoid duplication
* fix
Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
* [minic] Add minic-runtime for linking without libc
The C generated by minic now depends on `minic-runtime.h`. There are two
versions of this, one that depends on libc and one that doesn't (i.e standalone).
The standalone runtime implements the minimal set of functions required for
the tests to compile and run.
The standalone runtime also contains a copy of
https://github.com/wingo/walloc, a small memory allocator that's
indended for use with WASM.
The benefit of using the standalone runtime is that the resulting
binaries are much smaller. For example the Nat example compiles to about
24k WASM binary with libc, the standalone version is 2.8k.
This commit adds a dependency on
https://hackage.haskell.org/package/file-embed for finding the path to
the minic-runtime directory in tests. It does not add any additional
transitive dependencies to the project.
* add face and handling of not in scope symbol error
* small fix
* generic errors wip
* add App effect
* format
* add flycheck-minijuvix
* use absolute paths and refactor
* fix dir0
* add generic error instances and improve some errors
* format
* qualify strings
* use AnsiText
* add ToGenericError instances for the type checker errors
* improve error message
* improve handling of parsing errors
* [minic] Translate TypeFunction to a C function pointer
* [minic] Add define macros for nullary functions
For example in the translation of:
inductive Nat {
zero : Nat;
suc : Nat → Nat;
};
The zero constructor is translated to a nullary C function:
static inline Nat_13_t * new_Zero_14_nullary()
and a macro:
\#define new_Zero_14 (new_Zero_14_nullary())
so that it can be referenced subsequently by the unapplied name
'new_Zero_14'.
A similar translation is applied to nullary top-level functions.
This means that uncurried higher-order functions now work.
* [chore] ormolu and hlint fixes
* [minic] Implement PR review suggestions
* [chore] Fix formatting
* [cbackend] Adds an AST for C
This should cover enough C to implement the microjuvix backend.
* [cbackend] Add C serializer using language-c library
We may decide to write our own serializer for the C AST but this
demonstrates that the C AST is sufficient at least.
* [cbackend] Declarations will always be typed
* [cbackend] Add CPP support to AST
* [cbackend] Rename some names for clarity
* [cbackend] Add translation of InductiveDef to C
* [cbackend] Add CLI for C backend
* [cbackend] Add stdbool.h to file header
* [cbackend] Allow Cpp and Verbatim code inline
* [cbackend] Add a newline after printing C
* [cbackend] Support foreign blocks
* [cbackend] Add support for axioms
* [cbackend] Remove code examples
* [cbackend] wip FunctionDef including Expressions
* [parser] Support esacping '}' inside a foreign block
* [cbackend] Add support for patterns in functions
* [cbackend] Add foreign C support to HelloWorld.mjuvix
* hlint fixes
* More hlint fixes not picked up by pre-commit
* [cbackend] Remove CompileStatement from MonoJuvix
* [cbackend] Add support for compile blocks
* [cbackend] Move compileInfo extraction to MonoJuvixResult
* [minihaskell] Fix compile block support
* [chore] Remove ununsed isBackendSupported function
* [chore] Remove unused imports
* [cbackend] Use a Reader for pattern bindings
* [cbackend] Fix compiler warnings
* [cbackend] Add support for nested patterns
* [cbackend] Use functions to instantiate argument names
* [cbackend] Add non-exhaustive pattern error message
* [cbackend] Adds test for c to WASM compile and execution
* [cbackend] Add links to test dependencies in quickstart
* [cbackend] Add test with inductive types and patterns
* [cbackend] Fix indentation
* [cbackend] Remove ExpressionTyped case
https://github.com/heliaxdev/minijuvix/issues/79
* [lexer] Fix lexing of \ inside a foreign block
* [cbackend] PR review fixes
* [chore] Remove unused import
* [cbackend] Rename CJuvix to MiniC
* [cbackend] Rename MonoJuvixToC to MonoJuvixToMiniC
* [cbackend] Add test for polymorphic function
* [cbackend] Add module for string literals
* add TypeCallsBuilder and others
* implement propagation of type calls
* improve type propagation
* polymorphize fungible token
* sort type calls map pretty output
* use HashSet in TypeCallsMap
* renaming
* rename module
* improve indexing in type propagation
* draft monomorphization generation algorithm
* fix draft
* wip mono code generation
* wip code generation
* finish first candidate for code generation
* add monojuvix command
* fix MonoJuvix pretty printer to properly display name ids
* [monojuvix] improve clause pretty printing
* add support for function types in expressions
* properly translate function expressions
* ormolu
* add a basic positive test for monomorphization
* cleanup effect constraints
* collect type applications in axiom types
* apply some style improvements
* fix PolySimpleFungibleToken and add it to the test suite
* ignore polymorphic inductive definitions that are never used
* Add support for compile (by Jonathan)
* Remove error related to unsopported backend
Co-authored-by: Jonathan Prieto-Cubides <jonathan.cubides@uib.no>
In the following case:
```
module WrongConstructorArity;
inductive T {
A : T;
};
f : T → T;
f (A i) ≔ i;
end;
```
The typechecker fails when checking the clause `f (A i) := i` because of
the extra constructor argument. However if typechecking continues then
the variable `i` on the rhs does not have a type so we must short-circuit.
* [ format ] AbstractToMicroJuvix
* [ CI ] fixes
* [ CI ] fixes
* [ CI ] Using GHC 9.0 for Hlint
* [ CI ] Use static-checks for Dev as well
* [test] Add positive test for typechecker
* [test] Improve positive typechecker error output
* [typecheck] Restore correct handling of TypeAny
I mistakenly removed the matchTypes function in
https://github.com/heliaxdev/minijuvix/pull/22. This caused the handling
of TypeAny to break.
Literals have type TypeAny and so should be valid when matching against
any other type. The tests have been updated to reflect this.
* [test] Add positive MicroJuvix typecheck tests
* [ ormolu ] fixes
Co-authored-by: Jonathan Prieto-Cubides <jonathan.cubides@uib.no>
* add references to the syntax and cleanup code
* [make] add .PHONY to Makefile targets
* [parser] add parser / pretty for axiom backends
* Pairing progress
* [scoper] Add support for Axiom backends
* [parser] Fix foreign block parsing
* [ app ] adds --no-colors flag for the scope command
* [ghc] upgrade to ghc 9.2.2
* use GHC2021
* [doc] Remove out-of-date comment
* [test] Add ambiguity tests
* [scoper] Improve resolution of local symbols
* [error] WIP improving ambiguity error messages
* [ clean-up ] new lab folder for experimentation
* [ app ] ixes the lint warning
* [ Termination ] removes Alga dependency
* [error] Add message for ambiguous symbol error
* [error] Add ambiguous module message
* [scoper] Remove ErrGeneric
* [test] Add test to suite
* [test] show diff when ast's are different
* [ lab ] folder organization
* [ Makefile ] add targets with --watch option (stack cmds) and remove unused things
* [ app ] add --version flag and fixed warnings and formatting
* [test] remove fromRightIO to fix ambiguity error
* [test] Add test of shadowing public open
* [scoper] Add visibility annotation for Name
* prepare buildIntoTable
* [ Concrete ] add instance of hashable for refs.
* add InfoTableBuilder effect
* [ scoper ] add InfoTableBuilder effect
* [ CHANGELOG ] updated v0.1.1
* [ README ] org version now
* fix package.yaml
* fix readme
* [microjuvix] implement basic typechecker
* add simple test for MicroJuvix type checker
* fix checking for constructors apps in patterns
* [scope] Move InfoTable to a new module
* [abstract] Make Iden use references instead of Name
* [abstract] Add InfoTable for abstract syntax
* [scoper] Add function clauses to scoped InfoTable
* [abstract] Add InfoTableBuilder for scoped to abstract
* [main] Fix callsites of translateModule
* [doc] Remove empty docs
* [scoper] Update emptyInfoTable with missing field
* rename some functions
* [minihaskell] add compilation to MiniHaskell
* [microjuvix] improve wrong type message
* Add a validity predicate example written in MiniJuvix
* [typecheck] Add error infrastructure for type errors
Add a pretty error for mismatched constructor type in a pattern match
* [test] Adds negative typecheck test for constructor
* [app] Adds microjuvix subcommands for printing / typechecking
* [typecheck] Add error message for ctor match args mistmatch
* [typecheck] Add descriptive messages for remainng errors
* [typecheck] Updates to error message copy
* [typecheck] fix merge conflicts:
* [highlight] add basic support for highlighting symbols
* [minijuvix-mode] add minijuvix-mode and basic description in the readme
* [readme] improve formatting
* automatically detect the root of the project and add --show-root flag
Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
Co-authored-by: Paul Cadman <git@paulcadman.dev>
Co-authored-by: Paul Cadman <pcadman@gmail.com>