1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-15 01:52:11 +03:00
juvix/tests/positive
Paul Cadman 6894300e5a
Support module imports in Juvix REPL (#2029)
This PR adds support for importing modules from within a Juvix project
in the Juvix REPL.

The imported module is checked (parsed, arity-checked, type-checked etc)
as normal and added to the REPL session scope. Any errors during the
checking phase is reported to the user.

### Notes:

* You must load a file before using `import`. This is because the REPL
needs to know which Juvix project is active.
* You may only import modules from within the same Juvix project. 

### Examples

After launching `juvix repl`:

#### `open import`

```
Stdlib.Prelude> open import Stdlib.Data.Int.Ord
Stdlib.Prelude> 1 == 1
true
```

#### `import as`

```
Stdlib.Prelude> import Stdlib.Data.Int.Ord as Int
Stdlib.Prelude> 1 Int.== 1
true
```

#### `import`then `open`

```
Stdlib.Prelude> import Stdlib.Data.Int.Ord as Int
Stdlib.Prelude> open Int
Stdlib.Prelude> 1 == 1
true
```

#### Line-terminating semicolons are ignored:

```
Stdlib.Prelude> import Stdlib.Data.Int.Ord as Int;;;;;
Stdlib.Prelude> 1 Int.== 1
true
```

* Closes https://github.com/anoma/juvix/issues/1951

---------

Co-authored-by: Jonathan Cubides <jonathan.cubides@uib.no>
2023-05-08 12:23:15 +02:00
..
265 Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
272 Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
BuiltinsMultiImport Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
BuiltinsMultiOpenImport Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
Dependencies Support more paths (#2000) 2023-04-19 15:56:48 +01:00
FancyPaths Support more paths (#2000) 2023-04-19 15:56:48 +01:00
Imports Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
ImportShadow Add juvix format command (#1886) 2023-03-29 15:51:04 +02:00
Internal Make format command's filepath optional (#2028) 2023-04-27 17:33:08 +02:00
issue1333 Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
issue1466 Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
issue1693 Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
issue1731 Bump version to 0.3.2 🎉 2023-04-18 14:56:48 +02:00
issue1879 Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
NoDependencies Support module imports in Juvix REPL (#2029) 2023-05-08 12:23:15 +02:00
QualifiedConstructor Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
QualifiedImports Qualified imports (#2004) 2023-04-14 17:37:23 +02:00
QualifiedSymbol Improve formatting of comments (#2022) 2023-04-24 16:46:05 +02:00
QualifiedSymbol2 Make format command's filepath optional (#2028) 2023-04-27 17:33:08 +02:00
Reachability Add builtin integer type to the surface language (#1948) 2023-04-13 08:16:49 +01:00
StdlibImport Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
StdlibList Add juvix format command (#1886) 2023-03-29 15:51:04 +02:00
Termination Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
Ape.juvix Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
Axiom.juvix Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
Builtins.juvix Add juvix format command (#1886) 2023-03-29 15:51:04 +02:00
BuiltinsBool.juvix Fix: pprint positive kw for data types (#1980) 2023-04-05 16:40:46 +02:00
Format.juvix Improve formatting of comments (#2022) 2023-04-24 16:46:05 +02:00
Inductive.juvix Add juvix format command (#1886) 2023-03-29 15:51:04 +02:00
InductivePipes.juvix Add juvix format command (#1886) 2023-03-29 15:51:04 +02:00
Judoc.juvix Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
juvix.yaml Rename MiniJuvix to Juvix (#259) 2022-07-08 13:59:45 +02:00
LetShadow.juvix Add juvix format command (#1886) 2023-03-29 15:51:04 +02:00
Literals.juvix Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
MultiParams.juvix Add juvix format command (#1886) 2023-03-29 15:51:04 +02:00
MutualLet.juvix Automatically detect and split mutually recursive blocks in let expressions (#1894) 2023-03-17 11:05:55 +00:00
NestedPatterns.juvix Fix HasExpressions ConstructorApp (#2044) 2023-05-03 11:24:39 +02:00
Operators.juvix Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
Parsing.juvix Add juvix format command (#1886) 2023-03-29 15:51:04 +02:00
Polymorphism.juvix Add juvix format command (#1886) 2023-03-29 15:51:04 +02:00
PolymorphismHoles.juvix Add juvix format command (#1886) 2023-03-29 15:51:04 +02:00
Pragmas.juvix Add: pragma support (#1997) 2023-04-26 15:26:13 +02:00
ShadowPublicOpen.juvix Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
SignatureWithBody.juvix Add juvix format command (#1886) 2023-03-29 15:51:04 +02:00
Symbols.juvix Fix: format juvix files in test/positive (#1978) 2023-04-12 10:07:01 +02:00
TypeAlias.juvix Support positive arity typealias in arity checker (#2021) 2023-04-20 11:07:37 +01:00