Commit graph

336 commits

Author SHA1 Message Date
Brendan Hansknecht
d681062c63 add Num.toNat 2022-03-11 11:17:42 -08:00
Folkert
3510bad1d5
add scaffolding 2022-03-07 20:55:40 +01:00
Folkert
81e45b1e2f
make List.set use List.replace under the hood 2022-02-27 22:47:26 +01:00
Folkert
78fe734113
change the return type of List.replace 2022-02-27 22:47:08 +01:00
Brendan Hansknecht
4d42d81c63 add broken attempt to get list.set to use list.replace under the hood 2022-02-27 01:21:02 -08:00
Brendan Hansknecht
d9e9c28889 add error test case 2022-02-27 00:45:51 -08:00
Brendan Hansknecht
edfbd6242f fix ListReplace generate if types 2022-02-24 22:38:32 -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
d90915a8cd Implement Num.to* builtins
Just wrap over Num.intCast
2022-02-19 11:28:41 -05:00
Jan Van Bruggen
e12d98af98 WIP: Start adding new Int.toInt builtins 2022-02-19 11:28:12 -05:00
Jan Van Bruggen
f47dbb5171
Swap List.mapWithIndex arg1 args order to put the element first 2022-02-11 16:10:29 -07:00
ayazhafiz
5e0d90ac53 First pass 2022-02-06 15:04:12 -05:00
ayazhafiz
097c5afc73 Check lower bounds for numeric literals, and permit 128-bit literals 2022-02-02 23:35:57 -05:00
ayazhafiz
e7dcc2daa5 Move NumWidth to roc_can 2022-02-02 00:23:43 -05:00
ayazhafiz
a6f7579c07 Parse and expand numeric bounds in canonicalization pass 2022-02-01 22:50:46 -05:00
ayazhafiz
e03592930f Typecheck numeric literals with suffixes in expressions
Part of #2350
2022-02-01 22:49:50 -05:00
ayazhafiz
320827167f Parse number literal width suffixes
Supports [u,i][8,16,32,64,128] and [nat,dec]

Part of #2350
2022-02-01 22:48:48 -05:00
Jan Van Bruggen
9a8a4c6ed7 Add Num.(min/max)(I/U)(8/16) builtins 2022-01-22 00:19:17 -07:00
Jan Van Bruggen
38f0a3717f Extract repeated min/max logic 2022-01-22 00:00:29 -07:00
Folkert
2c139100ca fix big error 2022-01-21 23:30:04 +01:00
Eric Newbury
a96d5e6abf Merge branch 'trunk' into enewbury/list-sort-desc 2022-01-21 17:06:52 -05:00
Eric Newbury
7e7104d9ba WIP 2022-01-21 16:46:47 -05:00
Eric Newbury
05c01a81f5 adding List.sortAsc builtin 2022-01-21 15:34:24 -05:00
Richard Feldman
83f12b6e53
Merge pull request #2361 from rtfeldman/cleanup_builtins_Num.minmaxI128
Remove leftover TODOs from #2354
2022-01-20 18:21:29 -05:00
Richard Feldman
eacbb956cf
Merge pull request #2360 from rtfeldman/builtins-using-builtins
using builtins from builtins
2022-01-20 18:20:50 -05:00
Jan Van Bruggen
8e4b6f0cab Remove Num.(min/max)Int
Replace all uses with `Num.(min/max)I64`,
since all uses expect an `I64`.
2022-01-19 09:55:06 -07:00
Jan Van Bruggen
93d65a1601 Remove leftover TODOs 2022-01-17 18:53:36 -07:00
Jan Van Bruggen
591477e77b Add most remaining Num.min/max* builtins
This skips `min/maxU128`, as they require a subtle change
to the `I128`-centric implementation of `Int`s.
2022-01-17 15:26:23 -07:00
Folkert
697a65e77c builtins can use builtins now 2022-01-16 22:28:36 +01:00
Jan Van Bruggen
d7e2be306f WIP: Add Num.minI128 builtin (TODOs remain) 2022-01-15 17:49:15 -07:00
ayazhafiz
2c41c43aea Implement saturated add/subtract 2022-01-10 22:37:08 -05:00
Folkert de Vries
5f7476d54f
Merge pull request #2266 from rtfeldman/joshuawarner32/loc
Parser refactor: always group (Row, Col) into Position
2021-12-24 00:02:13 +01:00
Joshua Warner
f19220473a Rename Located -> Loc 2021-12-22 19:18:22 -08:00
ayazhafiz
ed64ff912a Implement List.dropIf
This was referenced in the `List` documentation and in the
[tutorial](./TUTORIAL.md), but wasn't actually implemented prior to this
commit!

Part of #2227
2021-12-22 12:34:48 -06:00
Folkert de Vries
e84580c148
Merge pull request #2210 from rtfeldman/rust-ana-fixes
quilified WhenBranch to prevent issues with rust-analyzer
2021-12-16 01:13:10 +01:00
Anton-4
45c1b6a812 fmt 2021-12-15 14:12:32 +01:00
Anton-4
e4b2c91eb4 quilified WhenBranch 2021-12-14 16:35:09 +01:00
Anton-4
eeb8d7e9f1 Added builtins to docs 2021-12-13 20:27:32 +01:00
rvcas
b7d48b2fe1 feat: add the rest of the num types for Str conversion 2021-12-06 23:24:02 -05:00
rvcas
e587e20de2 feat: switch to using a builtin per num type to convert from a string 2021-12-06 22:24:00 -05:00
Folkert
d6ed2147ae basic working test case 2021-12-02 20:30:58 +01:00
rvcas
8a21b42c20 feat: check errorcode in returned record for a value greater than 0 2021-12-02 14:06:29 -05:00
Anton-4
58f3559c98 consistent result type signatures 2021-12-02 17:49:04 +01:00
Anton-4
e63701c5d1 trying to make Str.toNum work for Ints 2021-12-01 20:37:21 +01:00
Anton-4
eaf4e57759 started on Str.toNum 2021-12-01 15:15:30 +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
Richard Feldman
49fd864a2f
Merge pull request #1996 from rtfeldman/add_list_all
adding List.all
2021-11-19 17:55:04 -05:00
ayazhafiz
8b7217847d Rename additional stale roc_module::operator refs and format 2021-11-18 20:20:33 -05:00