mirror of
https://github.com/anoma/juvix.git
synced 2024-11-30 14:13:27 +03:00
3736ed1c2d
- Closes #2668 This pr migrates the old named application syntax to the new one. In order to migrate a juvix file to the new syntax it suffices to run the formatter. After the next release, we should completely remove the support for the old syntax. ## Other changes I've improved Scope negative tests. Previously, when a negative test failed, you could only see the title of the test and the message "Incorrect Error", as well as the Haskell file and line where the test is defined. This is extremely incovenient because you have to go to the haskell test file, go to the line where the error is defined, look at the name of the file and then visit that file. Moreover, you need to manually run the scoper on that file to see the error that was returned. I've fixed that and it now shows all relevant information. Example: ![image](https://github.com/anoma/juvix/assets/5511599/f0b7ec60-55dc-4f38-9b51-1fbedbda63f4) I've implemented this only using the `Generic` instance for the `ScoperError` type, so doing something similar for the rest of negative tests should be straightforward.
24 lines
411 B
Plaintext
24 lines
411 B
Plaintext
-- eta-expansion
|
|
module test036;
|
|
|
|
import Stdlib.Prelude open;
|
|
|
|
expand : {A : Type} → A → Nat → A
|
|
| f x := f;
|
|
|
|
f : Nat → Nat := suc;
|
|
|
|
g : Nat → Nat → Nat
|
|
| z := f << flip sub z;
|
|
|
|
g' : Nat → Nat → Nat
|
|
| z := f << λ {x := sub x z};
|
|
|
|
h : Nat → Nat := f << g 3;
|
|
|
|
j : Nat → Nat → Nat := g';
|
|
|
|
k : Nat → Nat → Nat → Nat := expand j;
|
|
|
|
main : IO := printNatLn (h 13 + j 2 3 + k 9 4 7);
|