Commit graph

9048 commits

Author SHA1 Message Date
Folkert
79711b5287 implement annotation lifting 2020-01-09 22:23:20 +01:00
Stoeffel
8170d51e4e parse space around patterns not just before
separaters shouldn't eat spaces, because they might get lost this way.
2020-01-09 17:50:54 +01:00
Stoeffel
8809082f11 zero or more spaces not one
We should allow writing `Foo|Bar`
2020-01-09 17:47:12 +01:00
Stoeffel
4ac5d11e62 format cases 2020-01-09 17:35:16 +01:00
Folkert
ca9e86a56a fix typo in tests 2020-01-09 13:48:37 +01:00
Folkert
ca41a0339d tags with arguments in uniq infer 2020-01-09 13:38:47 +01:00
Folkert
dd240cf53a typecheck tags with arguments
also fixes an issue where private tags in patterns would not have the @ symbol in their name
2020-01-09 13:20:21 +01:00
Chadtech
79fc443969
Merge branch 'trunk' into cohere-comment-formatting 2020-01-09 07:00:14 -05:00
Richard Feldman
98515cdf23
Merge pull request #127 from rtfeldman/phantom-values
Add phantom values to roc-for-elm-programmers.md
2020-01-09 05:37:10 -05:00
Richard Feldman
35ab6be25b
Merge branch 'trunk' into phantom-values 2020-01-09 04:18:33 -05:00
Richard Feldman
af96985069
Merge pull request #123 from rtfeldman/fix-uniq-principality
Fix uniqueness principality
2020-01-09 04:18:17 -05:00
Chad Stearns
99c3848b1e Removing merge conflict text 2020-01-09 00:46:48 -05:00
Chad Stearns
598e51d816 Remove underscore from used variable 2020-01-09 00:38:37 -05:00
Chad Stearns
f472ba53b7 Merging in remote 2020-01-09 00:36:31 -05:00
Chadtech
dd525d3a13
Merge branch 'trunk' into cohere-comment-formatting 2020-01-09 00:35:32 -05:00
Chad Stearns
338ed1fcf3 Uncommented some tests, cleaned up some code 2020-01-09 00:31:50 -05:00
Richard Feldman
e019a4b662
Merge branch 'trunk' into fix-uniq-principality 2020-01-08 22:47:12 -05:00
Richard Feldman
09dc47e2ae
Merge pull request #128 from rtfeldman/fix-tag-parsing
Fix applied tag pattern parsing
2020-01-08 22:45:47 -05:00
Richard Feldman
72ba7310ce Fix nested applied tag pattern parsing bug 2020-01-08 22:23:36 -05:00
Richard Feldman
99b6314af4 Reproduce nested applied tag bug 2020-01-08 22:18:25 -05:00
Richard Feldman
bdf2aa2fe0 Fix formatting of applied tag in closure args 2020-01-08 22:18:19 -05:00
Richard Feldman
7998aea279 Add tag formatting 2020-01-08 22:15:36 -05:00
Richard Feldman
5f04aa7600 Fix applied tag pattern parsing 2020-01-08 22:15:36 -05:00
Richard Feldman
865fd41cdd Fix comment 2020-01-08 22:15:36 -05:00
Richard Feldman
ff48cc66e2 Reproduce applied tag destructuring bug 2020-01-08 22:15:36 -05:00
Richard Feldman
91d75bff72
Merge pull request #126 from rtfeldman/pretty-records
merge `ext` fields into the record when printing
2020-01-08 21:05:20 -05:00
Richard Feldman
3edaff560a Add phantom values to roc-for-elm-programmers.md 2020-01-08 20:56:10 -05:00
Chad Stearns
85badd94c1 Remove debug and improve some variable names 2020-01-08 19:23:43 -05:00
Folkert
fc81a82472 merge ext fields into the record when printing 2020-01-08 23:45:59 +01:00
Folkert
23b1a11a6f clean up uniqueness::constrain 2020-01-08 22:22:08 +01:00
Folkert
1b2da1e893 format Bool in types 2020-01-08 21:53:09 +01:00
Folkert
6c363a7208 restore inference for guards in pattern matches 2020-01-08 20:42:29 +01:00
Folkert
1f8bdf4385 proper constraint generation for records
In a pattern match (or similar, like record access/accessor), the whole container must be at least as unique as its matched parts.
Otherwise, we could duplicate the container, and then have two references to the unique fields.
2020-01-08 20:33:30 +01:00
Stoeffel
33e9a545fc update TODOs 2020-01-08 19:03:23 +01:00
Stoeffel
5744e329ac remove unused keyword 2020-01-08 19:03:13 +01:00
Christoph Hermann
2526d2654b
Merge branch 'trunk' into nix-shell 2020-01-08 18:20:19 +01:00
Folkert
96db4ff9a7 add Tag Union tests 2020-01-08 15:16:20 +01:00
Folkert
95d2c7d04e Fix principality in uniq infer 2020-01-08 15:01:45 +01:00
Folkert
b3e915d043 add tag types to uniq infer 2020-01-08 14:40:25 +01:00
Folkert
37cf0f940b possible fix for uniq principality
Apparently this fails because a closure would force the fn_var to be equal to the inferred type.
I'm really not sure why this would be a problem though. It works fine for 'normal' inference.
2020-01-08 14:30:14 +01:00
Stoeffel
d8923968cf add some TODOs with questions 2020-01-08 13:04:10 +01:00
Stoeffel
150b75721c allow alternatives on all branches. 2020-01-08 12:58:40 +01:00
Stoeffel
a98113c88d don't use a tuple to ensure non-emptiness 2020-01-08 11:05:53 +01:00
Stoeffel
64a562ebc6 no need for spaces between alternatives
allow the following:

  when animal is
    Dog|Fox -> "bark"
2020-01-08 09:34:51 +01:00
Stoeffel
4fce01b57a separate test for alternatives in branch 2020-01-08 09:34:27 +01:00
Stoeffel
505effd1d9 basic parsing of alternative cases in when .. in 2020-01-08 08:53:48 +01:00
Stoeffel
3a1d905b66 one or more patterns in branches
Modify ast to allow mutliple pattern per branch in when.

  when animal is
    Dog x | Fox x => "bark"
    Cat x => "miau"
2020-01-08 06:39:25 +01:00
Richard Feldman
a7ab9c74cb
Merge pull request #122 from rtfeldman/fn-pointers
Cranelift + function pointers
2020-01-08 00:11:28 -05:00
Richard Feldman
d74aff960a Fix function pointers for Cranelift and LLVM 2020-01-07 23:55:22 -05:00
Richard Feldman
68a46b4433 Do what Clippy suggests 2020-01-07 21:43:50 -05:00