Commit Graph

648 Commits

Author SHA1 Message Date
satotake
9aabd08953 fmt 2021-11-18 11:17:05 +00:00
satotake
ce8a88416d Merge branch 'trunk' into builtins-list-intersperse 2021-11-18 11:16:27 +00:00
satotake
7ce9f1b3bd refactor after review 2021-11-18 10:15:38 +00:00
Joshua Warner
7f5b873357 Parse _ in type annotations as an 'Inferred' type 2021-11-17 17:59:40 -08:00
Richard Feldman
2bb007e08b
Merge pull request #1987 from rtfeldman/builtins-list-split
Add builtin `List.split`
2021-11-17 13:41:58 -05:00
satotake
16fb04b4fa Add builtin List.intersperse 2021-11-17 15:18:45 +00:00
satotake
46e6e22776 use closure 2021-11-16 12:58:45 +00:00
satotake
541465bc2e Use let 2021-11-16 11:13:37 +00:00
satotake
73dda714de Add builtin List.split 2021-11-15 13:50:11 +00:00
satotake
c253273490 Merge branch 'trunk' into refactor-builtin-list-drop 2021-11-15 11:37:32 +00:00
satotake
5b64eb6983 refacotr List.drop 2021-11-14 13:46:40 +00:00
Folkert de Vries
28eb7a03cc
Merge branch 'trunk' into joshuawarner32/use-collection-4 2021-11-14 13:40:51 +01:00
Joshua Warner
9bf1674946 Shrink Collection to make parse_expr_size test pass 2021-11-13 16:17:44 -08:00
Theo Felippe
8d7c252fce implemented Str.trimRight 2021-11-13 18:02:58 +00:00
Joshua Warner
1fabc64fdf Use Collection in Expr::TagUnion 2021-11-13 07:38:39 -08:00
Joshua Warner
d63405d824 Make Expr::List use a Collection 2021-11-13 07:38:11 -08:00
Joshua Warner
a4ca6a31a6 Use Collection in Expr::Record and related places 2021-11-13 07:36:05 -08:00
Folkert de Vries
c9b15766be
Merge branch 'trunk' into builtins-refactor-list-take 2021-11-13 13:29:57 +01:00
Theo Felippe
10eab4b785 implemented Result.isErr 2021-11-13 08:29:40 +00:00
satotake
9ec2bc7946 Remove takeFirst and takeLast from backend 2021-11-13 06:03:18 +00:00
satotake
2e073d57ea destruct record at high level 2021-11-13 05:13:46 +00:00
satotake
98d2c57edf move List.sublist to backend 2021-11-13 04:57:28 +00:00
satotake
8f8b2463ea reset 2021-11-13 03:38:58 +00:00
satotake
4359dcff73 Merge branch 'trunk' into builtins-refactor-list-take 2021-11-13 03:38:29 +00:00
satotake
a9216d1149 retry recursion 2021-11-13 02:57:45 +00:00
satotake
d63849c5a3 Add List.takeFisrt2, List.takeLast2 for demo 2021-11-12 13:47:28 +00:00
Theo Felippe
356e36b38a Merge branch 'trunk' into builtin-result-is-ok 2021-11-12 10:13:43 +00:00
Theo Felippe
cb9ec369fe working implementation 2021-11-12 10:08:39 +00:00
Joshua Warner
04d4a8ca79 Introduce Collection as a general abstraction in the ast 2021-11-11 14:49:33 -08:00
Theo Felippe
84af26d813 added placeholder implementation 2021-11-11 19:13:42 +00:00
Folkert
33e8f9a6b7 Merge remote-tracking branch 'origin/trunk' into cleanup-im-dependency 2021-11-10 17:19:54 +01:00
Folkert de Vries
b3a663a741
Merge branch 'trunk' into builtins-list-sublist 2021-11-10 16:28:58 +01:00
Folkert
5632e3159d remove im dependency where not needed 2021-11-10 16:00:22 +01:00
satotake
9f5d3f521b Implement List.sublist 2021-11-10 13:16:57 +00:00
Michael Downey
07cd3850d7
Merge branch 'trunk' into str_trim_left 2021-11-09 19:43:26 -05:00
Michael Downey
7e074d300e cleaning up and adding comments 2021-11-09 14:37:31 -05:00
Michael Downey
1bc278d962 initial commit of Str.trimLeft 2021-11-09 14:25:24 -05:00
Folkert
94efbd0e95 Merge remote-tracking branch 'origin/trunk' into builtins-list-take-last 2021-11-09 16:18:19 +01:00
satotake
772fc9c021 Implement List.takeLast 2021-11-09 12:26:17 +00:00
ayazhafiz
074c2ca398 Remove stale DICT_TEST_HASH reference 2021-11-08 21:04:59 -05:00
ayazhafiz
f65b174ab5 Implement List.find
`List.find : List elem, (elem -> Bool) -> Result elem [ NotFound ]*`
behaves as follows:

```
>>> List.find [1, 2, 3] (\n -> n > 2)
Ok 2
>>> List.find [1, 2, 3] (\n -> n > 4)
Err NotFound
```

We implement this as builtin in two phases. First, we call out to a
pure-llvm-lowlevel `ListFindUnsafe` that returns a record indicating
whether a satisfying element was found, and the value of that element
(the value is all null bytes if the element wasn't found). Then, we lift
that record to a `Result` via a standard construction of the can AST.

Closes #1909
2021-11-08 21:03:14 -05:00
satotake
9087bf7273 Merge branch 'trunk' into builtsins-list-take-first 2021-11-08 14:32:36 +00:00
satotake
878400f95f Implement List.takeFirst 2021-11-08 14:10:53 +00:00
satotake
97c82d8d51 pick 02acef6 2021-11-08 11:15:20 +00:00
Kevin Sjöberg
44938a9e35 Implement List.any 2021-11-07 20:44:10 +01:00
ayazhafiz
0d2ed76334 Implement List.joinMap
Closes #1887
2021-11-07 11:08:20 -05:00
Brendan Hansknecht
73e2cbcb1e Make versions numbers consistent and matching the lock files 2021-11-06 13:24:45 -07:00
Anton-4
69f6ffadab
Merge branch 'trunk' into deps 2021-11-06 18:07:34 +01:00
Kevin Sjöberg
f6d055dc62 Correct minor spelling mistakes 2021-11-06 15:29:08 +01:00
Richard Feldman
3df3e2f0d5
Merge branch 'trunk' into deps 2021-11-06 07:19:02 -04:00