Folkert de Vries
59378d35c6
Update compiler/mono/src/borrow.rs
...
Co-authored-by: hafiz <20735482+ayazhafiz@users.noreply.github.com>
2022-03-09 15:08:13 +01:00
Folkert
b3b3b8790c
add new Expr variants
2022-03-07 21:13:48 +01:00
Folkert
3510bad1d5
add scaffolding
2022-03-07 20:55:40 +01:00
Brendan Hansknecht
2e70bb8458
remove list set low level
2022-02-27 15:07:09 -08:00
Brendan Hansknecht
dddf8ff785
switch from pair to record and change name to ListReplaceUnsafe
2022-02-24 20:41:26 -08:00
Brendan Hansknecht
ba2e8cd32b
Add base piping for list.Replace
2022-02-24 17:58:56 -08:00
ayazhafiz
13067f2908
Implement Num.toNNNChecked
...
Closes #2411
2022-02-19 16:20:21 -05:00
ayazhafiz
886e4e07f6
Update alias analysis, implementation for List.mapWithIndex
2022-02-13 22:50:27 -05:00
ayazhafiz
2c41c43aea
Implement saturated add/subtract
2022-01-10 22:37:08 -05:00
Brian Carroll
e847c924dd
Lowlevels: replace RefCountGetPtr with the more general GetPtrAsInt.
2021-12-19 08:29:17 +00:00
Richard Feldman
1ce648ac27
Merge pull request #2116 from rtfeldman/str_to_num
...
Str.toNum
2021-12-09 09:48:38 -05:00
Anton-4
c63c69f1ef
prep merge with Folkert's branch
2021-12-01 19:42:22 +01:00
Anton-4
eaf4e57759
started on Str.toNum
2021-12-01 15:15:30 +01:00
Richard Feldman
e6bec46898
Merge pull request #2109 from rtfeldman/refactor-passed-function
...
refactor passed (to higher order lowlevel) funcion
2021-12-01 08:17:39 -05:00
Brian Carroll
a3827d6636
Merge pull request #2071 from rtfeldman/refcount-mono-ir
...
Start generating refcounting code as mono IR
2021-12-01 12:59:16 +00:00
Folkert
bec74c36c5
refactor passed (to higher order lowlevel) funcion
2021-11-30 21:50:27 +01:00
rvcas
f995a07029
feat: Num.toStr
...
* add type for Num.toStr
* create new lowlevel
* delete types and Symbol for fromInt and fromFloat
* leave LowLevel::{StrFromFloat,StrFromInt}
* match on LowLevel::NumToStr and figure out the layout to decide
which build function to delegate to
2021-11-30 14:52:06 -05:00
Brian Carroll
6e5acadfea
Create new lowlevels for refcounting
2021-11-30 09:57:00 +00:00
Folkert
0bdda2506c
add update mode to reset and reuse
2021-11-28 14:13:02 +01:00
Michael Downey
d946b84e63
adding initial List.all
2021-11-16 16:34:36 -05:00
Richard Feldman
28273b67da
Merge pull request #1970 from rtfeldman/shrink-call-type
...
Shrink call type
2021-11-15 19:56:21 -08:00
satotake
c253273490
Merge branch 'trunk' into refactor-builtin-list-drop
2021-11-15 11:37:32 +00:00
satotake
8e29daa160
remove low-level List.drop
codes
2021-11-15 11:28:38 +00:00
Theo Felippe
8d7c252fce
implemented Str.trimRight
2021-11-13 18:02:58 +00:00
Richard Feldman
0b2df3154c
Merge remote-tracking branch 'origin/trunk' into shrink-call-type
2021-11-13 08:21:13 -08:00
Folkert
83953b0bba
shrink Call
2021-11-13 15:59:19 +01:00
Folkert
e2f7606f25
shrink higher order with indirection
2021-11-13 15:42:47 +01: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
Michael Downey
07cd3850d7
Merge branch 'trunk' into str_trim_left
2021-11-09 19:43:26 -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
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
878400f95f
Implement List.takeFirst
2021-11-08 14:10:53 +00:00
Kevin Sjöberg
44938a9e35
Implement List.any
2021-11-07 20:44:10 +01:00
Kevin Sjöberg
f9ed060e49
Implement List.map4
2021-10-31 21:08:41 +01:00
Dan Knutson
e7523ad41d
add Roc wiring
2021-10-25 20:22:37 -05:00
Folkert
5507743776
pass arguments as owned again, borrowed caused regressions
2021-10-21 21:09:48 +02:00
Folkert
031c7cc2e2
Merge remote-tracking branch 'origin/trunk' into mono-lowlevel
2021-10-18 11:11:04 +02:00
Folkert
a4f7ddb1f5
rename
2021-10-17 20:45:49 +02:00
Folkert
4152519bfb
formatting & catch zig overflow error
2021-10-17 18:03:40 +02:00
Chelsea Troy
0cc6e44d35
Thread through the divCeil implementation from Zig:
...
+ OPEN QUESTION: Evidently the Zig implementation can throw an overflow error. Do we want to do something in Roc to fix this?
2021-10-17 10:46:16 -05:00
Folkert
9763f9b51b
WIP
2021-10-17 16:08:41 +02:00
Folkert
ebcee4021c
flip list.walk passed function arguments
2021-10-10 12:35:03 +02:00
Dan Knutson
3baff93a97
add first version of List.dropAt
...
* adds an implementation with no uniqueness/mutability
2021-10-03 13:55:11 -05:00
Kofi Gumbs
b32a42f05a
Add Str.repeat builtin
2021-09-29 17:32:42 -04:00
Folkert
8e7aef314a
add ListLiteralElement
2021-09-05 21:23:08 +02:00
Richard Feldman
d15f7480dc
Merge pull request #1609 from rtfeldman/type-error-does-not-generate-function
...
Type error does not generate function
2021-08-20 23:17:14 -04:00