From 4b055358f25dffd2dba89533aafed9cb07d37d9e Mon Sep 17 00:00:00 2001 From: Julian Schurhammer Date: Wed, 1 Nov 2023 16:50:47 +1300 Subject: [PATCH] update --- .github/workflows/test.yml | 23 + .gitignore | 4 + build/dev/erlang/gleam.lock | 0 .../_gleam_artefacts/gleam@@compile.erl | 157 -- .../_gleam_artefacts/gleam@base.cache | Bin 1616 -> 0 bytes .../_gleam_artefacts/gleam@base.cache_meta | Bin 73 -> 0 bytes .../_gleam_artefacts/gleam@base.erl | 45 - .../_gleam_artefacts/gleam@bit_builder.cache | Bin 6642 -> 0 bytes .../gleam@bit_builder.cache_meta | Bin 57 -> 0 bytes .../_gleam_artefacts/gleam@bit_builder.erl | 63 - .../_gleam_artefacts/gleam@bit_string.cache | Bin 3899 -> 0 bytes .../gleam@bit_string.cache_meta | Bin 29 -> 0 bytes .../_gleam_artefacts/gleam@bit_string.erl | 56 - .../_gleam_artefacts/gleam@bool.cache | Bin 6105 -> 0 bytes .../_gleam_artefacts/gleam@bool.cache_meta | Bin 48 -> 0 bytes .../_gleam_artefacts/gleam@bool.erl | 152 -- .../_gleam_artefacts/gleam@dynamic.cache | Bin 48171 -> 0 bytes .../_gleam_artefacts/gleam@dynamic.cache_meta | Bin 173 -> 0 bytes .../_gleam_artefacts/gleam@dynamic.erl | 796 ------ .../_gleam_artefacts/gleam@float.cache | Bin 11341 -> 0 bytes .../_gleam_artefacts/gleam@float.cache_meta | Bin 48 -> 0 bytes .../_gleam_artefacts/gleam@float.erl | 180 -- .../_gleam_artefacts/gleam@function.cache | Bin 5793 -> 0 bytes .../gleam@function.cache_meta | Bin 29 -> 0 bytes .../_gleam_artefacts/gleam@function.erl | 67 - .../_gleam_artefacts/gleam@int.cache | Bin 18102 -> 0 bytes .../_gleam_artefacts/gleam@int.cache_meta | Bin 67 -> 0 bytes .../_gleam_artefacts/gleam@int.erl | 332 --- .../_gleam_artefacts/gleam@io.cache | Bin 2850 -> 0 bytes .../_gleam_artefacts/gleam@io.cache_meta | Bin 49 -> 0 bytes .../_gleam_artefacts/gleam@io.erl | 27 - .../_gleam_artefacts/gleam@iterator.cache | Bin 36557 -> 0 bytes .../gleam@iterator.cache_meta | Bin 140 -> 0 bytes .../_gleam_artefacts/gleam@iterator.erl | 715 ------ .../_gleam_artefacts/gleam@list.cache | Bin 45630 -> 0 bytes .../_gleam_artefacts/gleam@list.cache_meta | Bin 119 -> 0 bytes .../_gleam_artefacts/gleam@list.erl | 1108 --------- .../_gleam_artefacts/gleam@map.cache | Bin 12078 -> 0 bytes .../_gleam_artefacts/gleam@map.cache_meta | Bin 49 -> 0 bytes .../_gleam_artefacts/gleam@map.erl | 97 - .../_gleam_artefacts/gleam@option.cache | Bin 7235 -> 0 bytes .../_gleam_artefacts/gleam@option.cache_meta | Bin 29 -> 0 bytes .../_gleam_artefacts/gleam@option.erl | 147 -- .../_gleam_artefacts/gleam@order.cache | Bin 2695 -> 0 bytes .../_gleam_artefacts/gleam@order.cache_meta | Bin 29 -> 0 bytes .../_gleam_artefacts/gleam@order.erl | 79 - .../_gleam_artefacts/gleam@pair.cache | Bin 1877 -> 0 bytes .../_gleam_artefacts/gleam@pair.cache_meta | Bin 29 -> 0 bytes .../_gleam_artefacts/gleam@pair.erl | 33 - .../_gleam_artefacts/gleam@queue.cache | Bin 7015 -> 0 bytes .../_gleam_artefacts/gleam@queue.cache_meta | Bin 47 -> 0 bytes .../_gleam_artefacts/gleam@queue.erl | 121 - .../_gleam_artefacts/gleam@regex.cache | Bin 6578 -> 0 bytes .../_gleam_artefacts/gleam@regex.cache_meta | Bin 49 -> 0 bytes .../_gleam_artefacts/gleam@regex.erl | 33 - .../_gleam_artefacts/gleam@result.cache | Bin 10398 -> 0 bytes .../_gleam_artefacts/gleam@result.cache_meta | Bin 47 -> 0 bytes .../_gleam_artefacts/gleam@result.erl | 201 -- .../_gleam_artefacts/gleam@set.cache | Bin 6383 -> 0 bytes .../_gleam_artefacts/gleam@set.cache_meta | Bin 84 -> 0 bytes .../_gleam_artefacts/gleam@set.erl | 85 - .../_gleam_artefacts/gleam@string.cache | Bin 22682 -> 0 bytes .../_gleam_artefacts/gleam@string.cache_meta | Bin 201 -> 0 bytes .../_gleam_artefacts/gleam@string.erl | 397 --- .../gleam@string_builder.cache | Bin 10548 -> 0 bytes .../gleam@string_builder.cache_meta | Bin 47 -> 0 bytes .../_gleam_artefacts/gleam@string_builder.erl | 91 - .../_gleam_artefacts/gleam@uri.cache | Bin 7746 -> 0 bytes .../_gleam_artefacts/gleam@uri.cache_meta | Bin 132 -> 0 bytes .../_gleam_artefacts/gleam@uri.erl | 255 -- .../_gleam_artefacts/gleam_stdlib.erl | 475 ---- .../_gleam_artefacts/gleam_stdlib.mjs | 783 ------ .../_gleam_artefacts/persistent-hash-map.mjs | 957 -------- .../erlang/gleam_stdlib/ebin/gleam@base.beam | Bin 2680 -> 0 bytes .../gleam_stdlib/ebin/gleam@bit_builder.beam | Bin 3080 -> 0 bytes .../gleam_stdlib/ebin/gleam@bit_string.beam | Bin 2688 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@bool.beam | Bin 3708 -> 0 bytes .../gleam_stdlib/ebin/gleam@dynamic.beam | Bin 32224 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@float.beam | Bin 5996 -> 0 bytes .../gleam_stdlib/ebin/gleam@function.beam | Bin 5440 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@int.beam | Bin 9828 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@io.beam | Bin 1688 -> 0 bytes .../gleam_stdlib/ebin/gleam@iterator.beam | Bin 27444 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@list.beam | Bin 34048 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@map.beam | Bin 4644 -> 0 bytes .../gleam_stdlib/ebin/gleam@option.beam | Bin 4504 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@order.beam | Bin 2324 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@pair.beam | Bin 1964 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@queue.beam | Bin 5268 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@regex.beam | Bin 2060 -> 0 bytes .../gleam_stdlib/ebin/gleam@result.beam | Bin 6812 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@set.beam | Bin 4716 -> 0 bytes .../gleam_stdlib/ebin/gleam@string.beam | Bin 14112 -> 0 bytes .../ebin/gleam@string_builder.beam | Bin 4092 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@uri.beam | Bin 9592 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam_stdlib.app | 7 - .../gleam_stdlib/ebin/gleam_stdlib.beam | Bin 25632 -> 0 bytes .../include/gleam@dynamic_DecodeError.hrl | 5 - .../include/gleam@iterator_Iterator.hrl | 1 - .../include/gleam@iterator_Next.hrl | 1 - .../include/gleam@queue_Queue.hrl | 1 - .../include/gleam@regex_CompileError.hrl | 1 - .../include/gleam@regex_Match.hrl | 4 - .../include/gleam@regex_Options.hrl | 1 - .../gleam_stdlib/include/gleam@set_Set.hrl | 1 - .../gleam_stdlib/include/gleam@uri_Uri.hrl | 9 - build/dev/erlang/gleam_version | 1 - .../_gleam_artefacts/gleam@@compile.erl | 157 -- .../_gleam_artefacts/gleamy_bench.cache | Bin 7404 -> 0 bytes .../_gleam_artefacts/gleamy_bench.cache_meta | Bin 119 -> 0 bytes .../_gleam_artefacts/gleamy_bench.erl | 285 --- .../_gleam_artefacts/gleamy_bench@@main.erl | 34 - .../gleamy_bench_example.cache | Bin 740 -> 0 bytes .../gleamy_bench_example.cache_meta | Bin 65 -> 0 bytes .../_gleam_artefacts/gleamy_bench_example.erl | 43 - .../_gleam_artefacts/gleamy_bench_ffi.mjs | 3 - .../_gleam_artefacts/gleamy_bench_test.cache | Bin 385 -> 0 bytes .../gleamy_bench_test.cache_meta | Bin 68 -> 0 bytes .../_gleam_artefacts/gleamy_bench_test.erl | 13 - .../gleamy_bench/_gleam_artefacts/test.cache | Bin 1972 -> 0 bytes .../_gleam_artefacts/test.cache_meta | Bin 45 -> 0 bytes .../gleamy_bench/_gleam_artefacts/test.erl | 74 - .../erlang/gleamy_bench/ebin/gleamy_bench.app | 9 - .../gleamy_bench/ebin/gleamy_bench.beam | Bin 11648 -> 0 bytes .../gleamy_bench/ebin/gleamy_bench@@main.beam | Bin 2660 -> 0 bytes .../ebin/gleamy_bench_example.beam | Bin 2452 -> 0 bytes .../gleamy_bench/ebin/gleamy_bench_test.beam | Bin 1264 -> 0 bytes build/dev/erlang/gleamy_bench/ebin/test.beam | Bin 3840 -> 0 bytes .../include/gleamy_bench_Bench.hrl | 4 - .../include/gleamy_bench_Function.hrl | 1 - .../include/gleamy_bench_Input.hrl | 1 - .../include/gleamy_bench_RepeatFunction.hrl | 5 - .../gleamy_bench/include/gleamy_bench_Set.hrl | 1 - .../include/gleamy_bench_SetSummary.hrl | 9 - .../include/gleamy_bench_Stat.hrl | 4 - .../gleamy_bench/include/test_Yield.hrl | 5 - .../_gleam_artefacts/gleam@@compile.erl | 157 -- .../gleeunit/_gleam_artefacts/gleeunit.cache | Bin 3231 -> 0 bytes .../_gleam_artefacts/gleeunit.cache_meta | Bin 108 -> 0 bytes .../gleeunit/_gleam_artefacts/gleeunit.erl | 59 - .../_gleam_artefacts/gleeunit@should.cache | Bin 1128 -> 0 bytes .../gleeunit@should.cache_meta | Bin 29 -> 0 bytes .../_gleam_artefacts/gleeunit@should.erl | 34 - .../_gleam_artefacts/gleeunit_ffi.erl | 24 - .../_gleam_artefacts/gleeunit_ffi.mjs | 101 - .../_gleam_artefacts/gleeunit_progress.erl | 607 ----- build/dev/erlang/gleeunit/ebin/gleeunit.app | 7 - build/dev/erlang/gleeunit/ebin/gleeunit.beam | Bin 3164 -> 0 bytes .../erlang/gleeunit/ebin/gleeunit@should.beam | Bin 2036 -> 0 bytes .../erlang/gleeunit/ebin/gleeunit_ffi.beam | Bin 2908 -> 0 bytes .../gleeunit/ebin/gleeunit_progress.beam | Bin 30588 -> 0 bytes build/dev/javascript/gleam.lock | 0 .../_gleam_artefacts/gleam@base.cache | Bin 1639 -> 0 bytes .../_gleam_artefacts/gleam@base.cache_meta | Bin 73 -> 0 bytes .../_gleam_artefacts/gleam@bit_builder.cache | Bin 7594 -> 0 bytes .../gleam@bit_builder.cache_meta | Bin 99 -> 0 bytes .../_gleam_artefacts/gleam@bit_string.cache | Bin 3785 -> 0 bytes .../gleam@bit_string.cache_meta | Bin 29 -> 0 bytes .../_gleam_artefacts/gleam@bool.cache | Bin 6104 -> 0 bytes .../_gleam_artefacts/gleam@bool.cache_meta | Bin 48 -> 0 bytes .../_gleam_artefacts/gleam@dynamic.cache | Bin 48078 -> 0 bytes .../_gleam_artefacts/gleam@dynamic.cache_meta | Bin 149 -> 0 bytes .../_gleam_artefacts/gleam@float.cache | Bin 11640 -> 0 bytes .../_gleam_artefacts/gleam@float.cache_meta | Bin 48 -> 0 bytes .../_gleam_artefacts/gleam@function.cache | Bin 5782 -> 0 bytes .../gleam@function.cache_meta | Bin 29 -> 0 bytes .../_gleam_artefacts/gleam@int.cache | Bin 18346 -> 0 bytes .../_gleam_artefacts/gleam@int.cache_meta | Bin 67 -> 0 bytes .../_gleam_artefacts/gleam@io.cache | Bin 2889 -> 0 bytes .../_gleam_artefacts/gleam@io.cache_meta | Bin 49 -> 0 bytes .../_gleam_artefacts/gleam@iterator.cache | Bin 36568 -> 0 bytes .../gleam@iterator.cache_meta | Bin 140 -> 0 bytes .../_gleam_artefacts/gleam@list.cache | Bin 46274 -> 0 bytes .../_gleam_artefacts/gleam@list.cache_meta | Bin 119 -> 0 bytes .../_gleam_artefacts/gleam@map.cache | Bin 14036 -> 0 bytes .../_gleam_artefacts/gleam@map.cache_meta | Bin 49 -> 0 bytes .../_gleam_artefacts/gleam@option.cache | Bin 7239 -> 0 bytes .../_gleam_artefacts/gleam@option.cache_meta | Bin 29 -> 0 bytes .../_gleam_artefacts/gleam@order.cache | Bin 2695 -> 0 bytes .../_gleam_artefacts/gleam@order.cache_meta | Bin 29 -> 0 bytes .../_gleam_artefacts/gleam@pair.cache | Bin 1875 -> 0 bytes .../_gleam_artefacts/gleam@pair.cache_meta | Bin 29 -> 0 bytes .../_gleam_artefacts/gleam@queue.cache | Bin 6994 -> 0 bytes .../_gleam_artefacts/gleam@queue.cache_meta | Bin 47 -> 0 bytes .../_gleam_artefacts/gleam@regex.cache | Bin 6819 -> 0 bytes .../_gleam_artefacts/gleam@regex.cache_meta | Bin 49 -> 0 bytes .../_gleam_artefacts/gleam@result.cache | Bin 10398 -> 0 bytes .../_gleam_artefacts/gleam@result.cache_meta | Bin 47 -> 0 bytes .../_gleam_artefacts/gleam@set.cache | Bin 6288 -> 0 bytes .../_gleam_artefacts/gleam@set.cache_meta | Bin 84 -> 0 bytes .../_gleam_artefacts/gleam@string.cache | Bin 22005 -> 0 bytes .../_gleam_artefacts/gleam@string.cache_meta | Bin 136 -> 0 bytes .../gleam@string_builder.cache | Bin 10041 -> 0 bytes .../gleam@string_builder.cache_meta | Bin 47 -> 0 bytes .../_gleam_artefacts/gleam@uri.cache | Bin 9405 -> 0 bytes .../_gleam_artefacts/gleam@uri.cache_meta | Bin 189 -> 0 bytes build/dev/javascript/gleam_stdlib/gleam.mjs | 424 ---- .../javascript/gleam_stdlib/gleam/base.mjs | 51 - .../gleam_stdlib/gleam/bit_builder.mjs | 177 -- .../gleam_stdlib/gleam/bit_string.mjs | 45 - .../javascript/gleam_stdlib/gleam/bool.mjs | 217 -- .../javascript/gleam_stdlib/gleam/dynamic.mjs | 935 ------- .../javascript/gleam_stdlib/gleam/float.mjs | 265 -- .../gleam_stdlib/gleam/function.mjs | 70 - .../dev/javascript/gleam_stdlib/gleam/int.mjs | 448 ---- .../dev/javascript/gleam_stdlib/gleam/io.mjs | 31 - .../gleam_stdlib/gleam/iterator.mjs | 1312 ---------- .../javascript/gleam_stdlib/gleam/list.mjs | 2153 ----------------- .../dev/javascript/gleam_stdlib/gleam/map.mjs | 343 --- .../javascript/gleam_stdlib/gleam/option.mjs | 232 -- .../javascript/gleam_stdlib/gleam/order.mjs | 83 - .../javascript/gleam_stdlib/gleam/pair.mjs | 31 - .../javascript/gleam_stdlib/gleam/queue.mjs | 169 -- .../javascript/gleam_stdlib/gleam/regex.mjs | 56 - .../javascript/gleam_stdlib/gleam/result.mjs | 326 --- .../dev/javascript/gleam_stdlib/gleam/set.mjs | 96 - .../javascript/gleam_stdlib/gleam/string.mjs | 411 ---- .../gleam_stdlib/gleam/string_builder.mjs | 102 - .../dev/javascript/gleam_stdlib/gleam/uri.mjs | 511 ---- .../javascript/gleam_stdlib/gleam@base.erl | 45 - .../gleam_stdlib/gleam@bit_builder.erl | 63 - .../gleam_stdlib/gleam@bit_string.erl | 56 - .../javascript/gleam_stdlib/gleam@bool.erl | 152 -- .../javascript/gleam_stdlib/gleam@dynamic.erl | 796 ------ .../javascript/gleam_stdlib/gleam@float.erl | 180 -- .../gleam_stdlib/gleam@function.erl | 67 - .../dev/javascript/gleam_stdlib/gleam@int.erl | 332 --- .../dev/javascript/gleam_stdlib/gleam@io.erl | 27 - .../gleam_stdlib/gleam@iterator.erl | 715 ------ .../javascript/gleam_stdlib/gleam@list.erl | 1109 --------- .../dev/javascript/gleam_stdlib/gleam@map.erl | 97 - .../javascript/gleam_stdlib/gleam@option.erl | 147 -- .../javascript/gleam_stdlib/gleam@order.erl | 79 - .../javascript/gleam_stdlib/gleam@pair.erl | 33 - .../javascript/gleam_stdlib/gleam@queue.erl | 121 - .../javascript/gleam_stdlib/gleam@regex.erl | 33 - .../javascript/gleam_stdlib/gleam@result.erl | 201 -- .../dev/javascript/gleam_stdlib/gleam@set.erl | 85 - .../javascript/gleam_stdlib/gleam@string.erl | 397 --- .../gleam_stdlib/gleam@string_builder.erl | 91 - .../dev/javascript/gleam_stdlib/gleam@uri.erl | 255 -- .../javascript/gleam_stdlib/gleam_stdlib.erl | 475 ---- .../javascript/gleam_stdlib/gleam_stdlib.mjs | 783 ------ .../gleam_stdlib/persistent-hash-map.mjs | 957 -------- build/dev/javascript/gleam_version | 1 - .../_gleam_artefacts/gleamy_bench.cache | Bin 7430 -> 0 bytes .../_gleam_artefacts/gleamy_bench.cache_meta | Bin 119 -> 0 bytes .../gleamy_bench_example.cache | Bin 740 -> 0 bytes .../gleamy_bench_example.cache_meta | Bin 65 -> 0 bytes .../_gleam_artefacts/gleamy_bench_test.cache | Bin 385 -> 0 bytes .../gleamy_bench_test.cache_meta | Bin 68 -> 0 bytes .../gleamy_bench/_gleam_artefacts/test.cache | Bin 1970 -> 0 bytes .../_gleam_artefacts/test.cache_meta | Bin 45 -> 0 bytes .../javascript/gleamy_bench/gleam.main.mjs | 2 - build/dev/javascript/gleamy_bench/gleam.mjs | 424 ---- .../javascript/gleamy_bench/gleamy_bench.mjs | 384 --- .../gleamy_bench/gleamy_bench_example.mjs | 44 - .../gleamy_bench/gleamy_bench_ffi.mjs | 3 - .../gleamy_bench/gleamy_bench_test.mjs | 11 - build/dev/javascript/gleamy_bench/test.mjs | 113 - .../gleeunit/_gleam_artefacts/gleeunit.cache | Bin 652 -> 0 bytes .../_gleam_artefacts/gleeunit.cache_meta | Bin 29 -> 0 bytes .../_gleam_artefacts/gleeunit@should.cache | Bin 1377 -> 0 bytes .../gleeunit@should.cache_meta | Bin 49 -> 0 bytes build/dev/javascript/gleeunit/gleam.mjs | 424 ---- build/dev/javascript/gleeunit/gleeunit.erl | 59 - build/dev/javascript/gleeunit/gleeunit.mjs | 5 - .../javascript/gleeunit/gleeunit/should.mjs | 63 - .../javascript/gleeunit/gleeunit@should.erl | 34 - .../dev/javascript/gleeunit/gleeunit_ffi.erl | 24 - .../dev/javascript/gleeunit/gleeunit_ffi.mjs | 101 - .../javascript/gleeunit/gleeunit_progress.erl | 607 ----- build/lsp/erlang/gleam.lock | 0 build/lsp/javascript/gleam.lock | 0 build/packages/gleam.lock | 0 build/packages/gleam_stdlib/LICENCE | 191 -- build/packages/gleam_stdlib/README.md | 39 - build/packages/gleam_stdlib/gleam.toml | 16 - .../include/gleam@dynamic_DecodeError.hrl | 5 - .../include/gleam@iterator_Iterator.hrl | 1 - .../include/gleam@iterator_Next.hrl | 1 - .../include/gleam@queue_Queue.hrl | 1 - .../include/gleam@regex_CompileError.hrl | 1 - .../include/gleam@regex_Match.hrl | 4 - .../include/gleam@regex_Options.hrl | 1 - .../gleam_stdlib/include/gleam@set_Set.hrl | 1 - .../gleam_stdlib/include/gleam@uri_Uri.hrl | 9 - .../gleam_stdlib/src/gleam/base.gleam | 47 - .../gleam_stdlib/src/gleam/bit_builder.gleam | 255 -- .../gleam_stdlib/src/gleam/bit_string.gleam | 124 - .../gleam_stdlib/src/gleam/bool.gleam | 388 --- .../gleam_stdlib/src/gleam/dynamic.gleam | 1491 ------------ .../gleam_stdlib/src/gleam/float.gleam | 532 ---- .../gleam_stdlib/src/gleam/function.gleam | 162 -- .../packages/gleam_stdlib/src/gleam/int.gleam | 862 ------- .../packages/gleam_stdlib/src/gleam/io.gleam | 117 - .../gleam_stdlib/src/gleam/iterator.gleam | 1480 ----------- .../gleam_stdlib/src/gleam/list.gleam | 2120 ---------------- .../packages/gleam_stdlib/src/gleam/map.gleam | 542 ----- .../gleam_stdlib/src/gleam/option.gleam | 346 --- .../gleam_stdlib/src/gleam/order.gleam | 133 - .../gleam_stdlib/src/gleam/pair.gleam | 85 - .../gleam_stdlib/src/gleam/queue.gleam | 292 --- .../gleam_stdlib/src/gleam/regex.gleam | 214 -- .../gleam_stdlib/src/gleam/result.gleam | 483 ---- .../packages/gleam_stdlib/src/gleam/set.gleam | 264 -- .../gleam_stdlib/src/gleam/string.gleam | 975 -------- .../src/gleam/string_builder.gleam | 298 --- .../packages/gleam_stdlib/src/gleam/uri.gleam | 462 ---- .../packages/gleam_stdlib/src/gleam@base.erl | 45 - .../gleam_stdlib/src/gleam@bit_builder.erl | 63 - .../gleam_stdlib/src/gleam@bit_string.erl | 56 - .../packages/gleam_stdlib/src/gleam@bool.erl | 152 -- .../gleam_stdlib/src/gleam@dynamic.erl | 796 ------ .../packages/gleam_stdlib/src/gleam@float.erl | 180 -- .../gleam_stdlib/src/gleam@function.erl | 67 - build/packages/gleam_stdlib/src/gleam@int.erl | 332 --- build/packages/gleam_stdlib/src/gleam@io.erl | 27 - .../gleam_stdlib/src/gleam@iterator.erl | 715 ------ .../packages/gleam_stdlib/src/gleam@list.erl | 1109 --------- build/packages/gleam_stdlib/src/gleam@map.erl | 97 - .../gleam_stdlib/src/gleam@option.erl | 147 -- .../packages/gleam_stdlib/src/gleam@order.erl | 79 - .../packages/gleam_stdlib/src/gleam@pair.erl | 33 - .../packages/gleam_stdlib/src/gleam@queue.erl | 121 - .../packages/gleam_stdlib/src/gleam@regex.erl | 33 - .../gleam_stdlib/src/gleam@result.erl | 201 -- build/packages/gleam_stdlib/src/gleam@set.erl | 85 - .../gleam_stdlib/src/gleam@string.erl | 397 --- .../gleam_stdlib/src/gleam@string_builder.erl | 91 - build/packages/gleam_stdlib/src/gleam@uri.erl | 255 -- .../gleam_stdlib/src/gleam_stdlib.app.src | 28 - .../gleam_stdlib/src/gleam_stdlib.erl | 475 ---- .../gleam_stdlib/src/gleam_stdlib.mjs | 783 ------ .../gleam_stdlib/src/persistent-hash-map.mjs | 957 -------- build/packages/gleeunit/LICENCE | 191 -- build/packages/gleeunit/README.md | 52 - build/packages/gleeunit/gleam.toml | 17 - build/packages/gleeunit/src/gleeunit.app.src | 8 - build/packages/gleeunit/src/gleeunit.erl | 59 - build/packages/gleeunit/src/gleeunit.gleam | 92 - .../gleeunit/src/gleeunit/should.gleam | 90 - .../packages/gleeunit/src/gleeunit@should.erl | 34 - build/packages/gleeunit/src/gleeunit_ffi.erl | 24 - build/packages/gleeunit/src/gleeunit_ffi.mjs | 101 - .../gleeunit/src/gleeunit_progress.erl | 607 ----- build/packages/packages.toml | 3 - build/prod/erlang/gleam.lock | 0 build/prod/javascript/gleam.lock | 0 gleam.toml | 6 +- 350 files changed, 30 insertions(+), 47751 deletions(-) create mode 100644 .github/workflows/test.yml create mode 100644 .gitignore delete mode 100644 build/dev/erlang/gleam.lock delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@@compile.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@base.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@base.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@base.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_builder.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_builder.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_builder.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_string.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_string.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_string.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@iterator.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@iterator.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@iterator.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@map.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@map.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@map.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@queue.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@queue.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@queue.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@regex.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@regex.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@regex.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_builder.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_builder.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_builder.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.cache delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_meta delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam_stdlib.erl delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam_stdlib.mjs delete mode 100644 build/dev/erlang/gleam_stdlib/_gleam_artefacts/persistent-hash-map.mjs delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@base.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@bit_builder.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@bit_string.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@bool.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@dynamic.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@float.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@function.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@int.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@io.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@iterator.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@list.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@map.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@option.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@order.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@pair.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@queue.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@regex.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@result.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@set.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@string.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@string_builder.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam@uri.beam delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam_stdlib.app delete mode 100644 build/dev/erlang/gleam_stdlib/ebin/gleam_stdlib.beam delete mode 100644 build/dev/erlang/gleam_stdlib/include/gleam@dynamic_DecodeError.hrl delete mode 100644 build/dev/erlang/gleam_stdlib/include/gleam@iterator_Iterator.hrl delete mode 100644 build/dev/erlang/gleam_stdlib/include/gleam@iterator_Next.hrl delete mode 100644 build/dev/erlang/gleam_stdlib/include/gleam@queue_Queue.hrl delete mode 100644 build/dev/erlang/gleam_stdlib/include/gleam@regex_CompileError.hrl delete mode 100644 build/dev/erlang/gleam_stdlib/include/gleam@regex_Match.hrl delete mode 100644 build/dev/erlang/gleam_stdlib/include/gleam@regex_Options.hrl delete mode 100644 build/dev/erlang/gleam_stdlib/include/gleam@set_Set.hrl delete mode 100644 build/dev/erlang/gleam_stdlib/include/gleam@uri_Uri.hrl delete mode 100644 build/dev/erlang/gleam_version delete mode 100644 build/dev/erlang/gleamy_bench/_gleam_artefacts/gleam@@compile.erl delete mode 100644 build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench.cache delete mode 100644 build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench.cache_meta delete mode 100644 build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench.erl delete mode 100644 build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench@@main.erl delete mode 100644 build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench_example.cache delete mode 100644 build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench_example.cache_meta delete mode 100644 build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench_example.erl delete mode 100644 build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench_ffi.mjs delete mode 100644 build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench_test.cache delete mode 100644 build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench_test.cache_meta delete mode 100644 build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench_test.erl delete mode 100644 build/dev/erlang/gleamy_bench/_gleam_artefacts/test.cache delete mode 100644 build/dev/erlang/gleamy_bench/_gleam_artefacts/test.cache_meta delete mode 100644 build/dev/erlang/gleamy_bench/_gleam_artefacts/test.erl delete mode 100644 build/dev/erlang/gleamy_bench/ebin/gleamy_bench.app delete mode 100644 build/dev/erlang/gleamy_bench/ebin/gleamy_bench.beam delete mode 100644 build/dev/erlang/gleamy_bench/ebin/gleamy_bench@@main.beam delete mode 100644 build/dev/erlang/gleamy_bench/ebin/gleamy_bench_example.beam delete mode 100644 build/dev/erlang/gleamy_bench/ebin/gleamy_bench_test.beam delete mode 100644 build/dev/erlang/gleamy_bench/ebin/test.beam delete mode 100644 build/dev/erlang/gleamy_bench/include/gleamy_bench_Bench.hrl delete mode 100644 build/dev/erlang/gleamy_bench/include/gleamy_bench_Function.hrl delete mode 100644 build/dev/erlang/gleamy_bench/include/gleamy_bench_Input.hrl delete mode 100644 build/dev/erlang/gleamy_bench/include/gleamy_bench_RepeatFunction.hrl delete mode 100644 build/dev/erlang/gleamy_bench/include/gleamy_bench_Set.hrl delete mode 100644 build/dev/erlang/gleamy_bench/include/gleamy_bench_SetSummary.hrl delete mode 100644 build/dev/erlang/gleamy_bench/include/gleamy_bench_Stat.hrl delete mode 100644 build/dev/erlang/gleamy_bench/include/test_Yield.hrl delete mode 100644 build/dev/erlang/gleeunit/_gleam_artefacts/gleam@@compile.erl delete mode 100644 build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit.cache delete mode 100644 build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit.cache_meta delete mode 100644 build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit.erl delete mode 100644 build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@should.cache delete mode 100644 build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@should.cache_meta delete mode 100644 build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@should.erl delete mode 100644 build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit_ffi.erl delete mode 100644 build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit_ffi.mjs delete mode 100644 build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit_progress.erl delete mode 100644 build/dev/erlang/gleeunit/ebin/gleeunit.app delete mode 100644 build/dev/erlang/gleeunit/ebin/gleeunit.beam delete mode 100644 build/dev/erlang/gleeunit/ebin/gleeunit@should.beam delete mode 100644 build/dev/erlang/gleeunit/ebin/gleeunit_ffi.beam delete mode 100644 build/dev/erlang/gleeunit/ebin/gleeunit_progress.beam delete mode 100644 build/dev/javascript/gleam.lock delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@base.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@base.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_builder.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_builder.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_string.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_string.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@iterator.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@iterator.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@map.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@map.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@queue.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@queue.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@regex.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@regex.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_builder.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_builder.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache delete mode 100644 build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_meta delete mode 100644 build/dev/javascript/gleam_stdlib/gleam.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/base.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/bit_builder.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/bit_string.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/bool.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/dynamic.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/float.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/function.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/int.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/io.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/iterator.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/list.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/map.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/option.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/order.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/pair.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/queue.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/regex.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/result.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/set.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/string.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/string_builder.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam/uri.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@base.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@bit_builder.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@bit_string.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@bool.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@dynamic.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@float.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@function.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@int.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@io.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@iterator.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@list.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@map.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@option.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@order.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@pair.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@queue.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@regex.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@result.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@set.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@string.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@string_builder.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam@uri.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam_stdlib.erl delete mode 100644 build/dev/javascript/gleam_stdlib/gleam_stdlib.mjs delete mode 100644 build/dev/javascript/gleam_stdlib/persistent-hash-map.mjs delete mode 100644 build/dev/javascript/gleam_version delete mode 100644 build/dev/javascript/gleamy_bench/_gleam_artefacts/gleamy_bench.cache delete mode 100644 build/dev/javascript/gleamy_bench/_gleam_artefacts/gleamy_bench.cache_meta delete mode 100644 build/dev/javascript/gleamy_bench/_gleam_artefacts/gleamy_bench_example.cache delete mode 100644 build/dev/javascript/gleamy_bench/_gleam_artefacts/gleamy_bench_example.cache_meta delete mode 100644 build/dev/javascript/gleamy_bench/_gleam_artefacts/gleamy_bench_test.cache delete mode 100644 build/dev/javascript/gleamy_bench/_gleam_artefacts/gleamy_bench_test.cache_meta delete mode 100644 build/dev/javascript/gleamy_bench/_gleam_artefacts/test.cache delete mode 100644 build/dev/javascript/gleamy_bench/_gleam_artefacts/test.cache_meta delete mode 100644 build/dev/javascript/gleamy_bench/gleam.main.mjs delete mode 100644 build/dev/javascript/gleamy_bench/gleam.mjs delete mode 100644 build/dev/javascript/gleamy_bench/gleamy_bench.mjs delete mode 100644 build/dev/javascript/gleamy_bench/gleamy_bench_example.mjs delete mode 100644 build/dev/javascript/gleamy_bench/gleamy_bench_ffi.mjs delete mode 100644 build/dev/javascript/gleamy_bench/gleamy_bench_test.mjs delete mode 100644 build/dev/javascript/gleamy_bench/test.mjs delete mode 100644 build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache delete mode 100644 build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache_meta delete mode 100644 build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache delete mode 100644 build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache_meta delete mode 100644 build/dev/javascript/gleeunit/gleam.mjs delete mode 100644 build/dev/javascript/gleeunit/gleeunit.erl delete mode 100644 build/dev/javascript/gleeunit/gleeunit.mjs delete mode 100644 build/dev/javascript/gleeunit/gleeunit/should.mjs delete mode 100644 build/dev/javascript/gleeunit/gleeunit@should.erl delete mode 100644 build/dev/javascript/gleeunit/gleeunit_ffi.erl delete mode 100644 build/dev/javascript/gleeunit/gleeunit_ffi.mjs delete mode 100644 build/dev/javascript/gleeunit/gleeunit_progress.erl delete mode 100644 build/lsp/erlang/gleam.lock delete mode 100644 build/lsp/javascript/gleam.lock delete mode 100644 build/packages/gleam.lock delete mode 100644 build/packages/gleam_stdlib/LICENCE delete mode 100644 build/packages/gleam_stdlib/README.md delete mode 100644 build/packages/gleam_stdlib/gleam.toml delete mode 100644 build/packages/gleam_stdlib/include/gleam@dynamic_DecodeError.hrl delete mode 100644 build/packages/gleam_stdlib/include/gleam@iterator_Iterator.hrl delete mode 100644 build/packages/gleam_stdlib/include/gleam@iterator_Next.hrl delete mode 100644 build/packages/gleam_stdlib/include/gleam@queue_Queue.hrl delete mode 100644 build/packages/gleam_stdlib/include/gleam@regex_CompileError.hrl delete mode 100644 build/packages/gleam_stdlib/include/gleam@regex_Match.hrl delete mode 100644 build/packages/gleam_stdlib/include/gleam@regex_Options.hrl delete mode 100644 build/packages/gleam_stdlib/include/gleam@set_Set.hrl delete mode 100644 build/packages/gleam_stdlib/include/gleam@uri_Uri.hrl delete mode 100644 build/packages/gleam_stdlib/src/gleam/base.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/bit_builder.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/bit_string.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/bool.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/dynamic.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/float.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/function.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/int.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/io.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/iterator.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/list.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/map.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/option.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/order.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/pair.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/queue.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/regex.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/result.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/set.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/string.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/string_builder.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam/uri.gleam delete mode 100644 build/packages/gleam_stdlib/src/gleam@base.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@bit_builder.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@bit_string.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@bool.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@dynamic.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@float.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@function.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@int.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@io.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@iterator.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@list.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@map.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@option.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@order.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@pair.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@queue.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@regex.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@result.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@set.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@string.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@string_builder.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam@uri.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam_stdlib.app.src delete mode 100644 build/packages/gleam_stdlib/src/gleam_stdlib.erl delete mode 100644 build/packages/gleam_stdlib/src/gleam_stdlib.mjs delete mode 100644 build/packages/gleam_stdlib/src/persistent-hash-map.mjs delete mode 100644 build/packages/gleeunit/LICENCE delete mode 100644 build/packages/gleeunit/README.md delete mode 100644 build/packages/gleeunit/gleam.toml delete mode 100644 build/packages/gleeunit/src/gleeunit.app.src delete mode 100644 build/packages/gleeunit/src/gleeunit.erl delete mode 100644 build/packages/gleeunit/src/gleeunit.gleam delete mode 100644 build/packages/gleeunit/src/gleeunit/should.gleam delete mode 100644 build/packages/gleeunit/src/gleeunit@should.erl delete mode 100644 build/packages/gleeunit/src/gleeunit_ffi.erl delete mode 100644 build/packages/gleeunit/src/gleeunit_ffi.mjs delete mode 100644 build/packages/gleeunit/src/gleeunit_progress.erl delete mode 100644 build/packages/packages.toml delete mode 100644 build/prod/erlang/gleam.lock delete mode 100644 build/prod/javascript/gleam.lock diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..701b1f5 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,23 @@ +name: test + +on: + push: + branches: + - master + - main + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: erlef/setup-beam@v1 + with: + otp-version: "26.0.2" + gleam-version: "0.31.0" + rebar3-version: "3" + # elixir-version: "1.15.4" + - run: gleam format --check src test + - run: gleam deps download + - run: gleam test diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..170cca9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.beam +*.ez +build +erl_crash.dump diff --git a/build/dev/erlang/gleam.lock b/build/dev/erlang/gleam.lock deleted file mode 100644 index e69de29..0000000 diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@@compile.erl b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@@compile.erl deleted file mode 100644 index 543db88..0000000 --- a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@@compile.erl +++ /dev/null @@ -1,157 +0,0 @@ -#!/usr/bin/env escript - -% TODO: Don't concurrently print warnings and errors -% TODO: Some tests - --record(arguments, {lib = "./", out = "./", modules = []}). - -main(Args) -> - #arguments{out = Out, lib = Lib, modules = Modules} = parse(Args), - IsElixirModule = fun(Module) -> - filename:extension(Module) =:= ".ex" - end, - {ElixirModules, ErlangModules} = lists:partition(IsElixirModule, Modules), - ok = configure_logging(), - ok = add_lib_to_erlang_path(Lib), - ok = filelib:ensure_dir([Out, $/]), - {ErlangOk, _ErlangBeams} = compile_erlang(ErlangModules, Out), - {ElixirOk, _ElixirBeams} = case ErlangOk of - true -> compile_elixir(ElixirModules, Out); - false -> {false, []} - end, - case ErlangOk and ElixirOk of - true -> ok; - false -> erlang:halt(1) - end. - -compile_erlang(Modules, Out) -> - Workers = start_compiler_workers(Out), - ok = producer_loop(Modules, Workers), - collect_results({true, []}). - -collect_results(Acc = {Result, Beams}) -> - receive - {compiled, Beam} -> collect_results({Result, [Beam | Beams]}); - failed -> collect_results({false, Beams}) - after 0 -> Acc - end. - -producer_loop([], 0) -> - ok; -producer_loop([], Workers) -> - receive - {work_please, _} -> producer_loop([], Workers - 1) - end; -producer_loop([Module | Modules], Workers) -> - receive - {work_please, Worker} -> - erlang:send(Worker, {module, Module}), - producer_loop(Modules, Workers) - end. - -start_compiler_workers(Out) -> - Parent = self(), - NumSchedulers = erlang:system_info(schedulers), - SpawnWorker = fun(_) -> - erlang:spawn_link(fun() -> worker_loop(Parent, Out) end) - end, - lists:foreach(SpawnWorker, lists:seq(1, NumSchedulers)), - NumSchedulers. - -worker_loop(Parent, Out) -> - Options = [report_errors, report_warnings, debug_info, {outdir, Out}], - erlang:send(Parent, {work_please, self()}), - receive - {module, Module} -> - log({compiling, Module}), - case compile:file(Module, Options) of - {ok, ModuleName} -> - Beam = filename:join(Out, ModuleName) ++ ".beam", - Message = {compiled, Beam}, - log(Message), - erlang:send(Parent, Message); - error -> - log({failed, Module}), - erlang:send(Parent, failed) - end, - worker_loop(Parent, Out) - end. - -compile_elixir(Modules, Out) -> - Error = [ - "The program elixir was not found. Is it installed?", - $\n, - "Documentation for installing Elixir can be viewed here:", - $\n, - "https://elixir-lang.org/install.html" - ], - case Modules of - [] -> {true, []}; - _ -> - log({starting, "compiler.app"}), - ok = application:start(compiler), - log({starting, "elixir.app"}), - case application:start(elixir) of - ok -> do_compile_elixir(Modules, Out); - _ -> - io:put_chars(standard_error, [Error, $\n]), - {false, []} - end - end. - -do_compile_elixir(Modules, Out) -> - ModuleBins = lists:map(fun(Module) -> - log({compiling, Module}), - list_to_binary(Module) - end, Modules), - OutBin = list_to_binary(Out), - Options = [{dest, OutBin}], - % Silence "redefining module" warnings. - % Compiled modules in the build directory are added to the code path. - % These warnings result from recompiling loaded modules. - % TODO: This line can likely be removed if/when the build directory is cleaned before every compilation. - 'Elixir.Code':compiler_options([{ignore_module_conflict, true}]), - case 'Elixir.Kernel.ParallelCompiler':compile_to_path(ModuleBins, OutBin, Options) of - {ok, ModuleAtoms, _} -> - ToBeam = fun(ModuleAtom) -> - Beam = filename:join(Out, atom_to_list(ModuleAtom)) ++ ".beam", - log({compiled, Beam}), - Beam - end, - {true, lists:map(ToBeam, ModuleAtoms)}; - {error, Errors, _} -> - % Log all filenames associated with modules that failed to compile. - % Note: The compiler prints compilation errors upon encountering them. - ErrorFiles = lists:usort([File || {File, _, _} <- Errors]), - Log = fun(File) -> - log({failed, binary_to_list(File)}) - end, - lists:foreach(Log, ErrorFiles), - {false, []}; - _ -> {false, []} - end. - -add_lib_to_erlang_path(Lib) -> - code:add_paths(filelib:wildcard([Lib, "/*/ebin"])). - -parse(Args) -> - parse(Args, #arguments{}). - -parse([], Arguments) -> - Arguments; -parse(["--lib", Lib | Rest], Arguments) -> - parse(Rest, Arguments#arguments{lib = Lib}); -parse(["--out", Out | Rest], Arguments) -> - parse(Rest, Arguments#arguments{out = Out}); -parse([Module | Rest], Arguments = #arguments{modules = Modules}) -> - parse(Rest, Arguments#arguments{modules = [Module | Modules]}). - -configure_logging() -> - Enabled = os:getenv("GLEAM_LOG") /= false, - persistent_term:put(gleam_logging_enabled, Enabled). - -log(Term) -> - case persistent_term:get(gleam_logging_enabled) of - true -> erlang:display(Term), ok; - false -> ok - end. diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@base.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@base.cache deleted file mode 100644 index 233bdc27eb5271e826c82ef12038162b3a14af6f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1616 zcmd5+-)hrP7|%(XWetY%Q5>x(J@rN@&dsir(VK2#6DdVaqYQS_CFZP6%@RpcycT=` zA7CKj69|IWzJnlM2#R>;g-;OAIq9FYtG)0-c9Wc(55D~Vec$FQw6g-2kD#nTxtISf zE1(VXzvLTn&n4#RhGhy;NRp3k7zsJsb*vq6w;;m$K;J}CeivEBKB9+jXkh$chfiY5 z_$<=Hd&x3BNc3=)X&J9GNQ#Gn+qKCPpY|d38bbOdQPSTc8IURn2nhmYH}spLBnWzj zJ`rRakgY;iX&O=Bc)b!w^)OvJY<5UEbfcuCukzZp4wS2u6YWsE4#g@Im3YsIcoP9l z+bH)PchXZv2wD6XJrpdU`e~Vi$&>7;2u)>UoFJ}-P z>TQnbycv}xX5{vKf9l3ksN!Oyrm*IWI^eEwqf#=DmH&6|Mn-*=u4dvyEankSGPmjf zi_+4!lk{%W^u9xBOp6tfY49ewTc$_J>+w)R{|$>I8)7>h$qO~afsXks1E!;_#>`)a zSSZoatk)7HCfkhW`krJ;F{i|5Z0z5K;xuFJN0f#;XYFV!t^9o}o!>ajTe@+6A}rGF uzAA!N0c{P64JfYhxdgcaay9oT7?RRm(+$aJ?Sg!T-b)XjmJWiz5B>m<2Z=TS diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@base.cache_meta b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@base.cache_meta deleted file mode 100644 index 6529fddc4d0511fe07d7d4fe0e88c83c004b3460..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 73 xcmaD+eJF(i3K*H73;`&eo|BrGtDlrv5?@?Wl$n>#gCY(QYdbxe&o8095diw>5r+T( diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@base.erl b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@base.erl deleted file mode 100644 index 1ebe7c7..0000000 --- a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@base.erl +++ /dev/null @@ -1,45 +0,0 @@ --module(gleam@base). --compile([no_auto_import, nowarn_unused_vars]). - --export([encode64/2, decode64/1, url_encode64/2, url_decode64/1]). - --spec encode64(bitstring(), boolean()) -> binary(). -encode64(Input, Padding) -> - Encoded = base64:encode(Input), - case Padding of - true -> - Encoded; - - false -> - gleam@string:replace(Encoded, <<"="/utf8>>, <<""/utf8>>) - end. - --spec decode64(binary()) -> {ok, bitstring()} | {error, nil}. -decode64(Encoded) -> - Padded = case gleam@bit_string:byte_size( - gleam@bit_string:from_string(Encoded) - ) - rem 4 of - 0 -> - Encoded; - - N -> - gleam@string:append( - Encoded, - gleam@string:repeat(<<"="/utf8>>, 4 - N) - ) - end, - gleam_stdlib:base_decode64(Padded). - --spec url_encode64(bitstring(), boolean()) -> binary(). -url_encode64(Input, Padding) -> - _pipe = encode64(Input, Padding), - _pipe@1 = gleam@string:replace(_pipe, <<"+"/utf8>>, <<"-"/utf8>>), - gleam@string:replace(_pipe@1, <<"/"/utf8>>, <<"_"/utf8>>). - --spec url_decode64(binary()) -> {ok, bitstring()} | {error, nil}. -url_decode64(Encoded) -> - _pipe = Encoded, - _pipe@1 = gleam@string:replace(_pipe, <<"-"/utf8>>, <<"+"/utf8>>), - _pipe@2 = gleam@string:replace(_pipe@1, <<"_"/utf8>>, <<"/"/utf8>>), - decode64(_pipe@2). diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_builder.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_builder.cache deleted file mode 100644 index 53d9ea688aa010aec1ab289c3feecaa4eaab50d5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6642 zcmdT}O>7%Q6yDjjv$hk*oj7Sj)he4xQEAjRBq;(cP@2#pS|XA47Nv?Rx$Ai1Y}o9& zyX&S2hl(I1#0gnKqE$~72mTKTE=crHQK{SzQY9)XK@kVk0|z*8G;d~S9oyNoG3gJL z8fUZ~yYs&H=KH?)(vKq2b#%B5_f+t}j^Q_pC@m%t#tZ4oNmMPGL|+`r8_3J$%Z6DX z$nl@$Tu(?9Od~%Y5pi@zjUlNzVR#dClOPcXA+=kS@C!0Vm9TFS5RT8_WCi!g4WA3! zJ0(i+Z~UZ)KmStw3Q6g=QC@oo!Qza#qIn`LK9*Lr&m>sfh+NceMPP9=`i=H$6c!iS zR<%oQus9>{(MmEb_Qf1+KO8vybbLX3HV%v1@vQbcU3{CUXx}AZaiiVQerksWO0H^= zBrI^}MXk3J7TQ2J^VrGJB;tc=nN@N=zmBK>0wo+V&U z0#yrkZq~MDbqc280fK#wVHI6LP&-6PeGf%3N(cf%f`H>g>ZB;aI}vyVs0ML-1Rka) z4fqsGO7Kn=Cr5CSfv9=#eF7@_8vwEvL5?EG`*BsFzZS3puZgNrAeLu%%Yq>Isi`Gi z5J%4^KTTHW9D5NSI)V(rK-y_6W>YLr*2j`zvB+cWxLZ4HUOhz*TfwK$aL-k#@hoAb zR8?Mdi0%=$Q_&TREGd3fI|_{g9zh%s#lb{E$(AiwF)Rf#=6bs2DW0)Nl%;uMDNfn4 zV3%TB%2CJE>HgYw)3Au{_?vBSo;XW}OW^w;ucJ3RlW7})Tf<&|UoK@-*|Ho!WA`$us9rm)^}F*96CYq*Nhb*B%XPFMh3j|>*#Pr!Y+J7ECBvI%nKOx1ge4@8=Fvx4X|DS>;#cBT#(Y40h%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xx@0U% X+_LH6=uUVpz506JQOB{JhJ*YIcm+E7 diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_builder.cache_meta b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_builder.cache_meta deleted file mode 100644 index c72ac75a49e2fc014240a467bbbcea0c3d9ad53d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 57 wcmaD+eJF(i3K$uo3=t@uo|BrGt6yAFl$nUnmhkf+o{05d8LyZ`_I diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_builder.erl b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_builder.erl deleted file mode 100644 index 8cc9d32..0000000 --- a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_builder.erl +++ /dev/null @@ -1,63 +0,0 @@ --module(gleam@bit_builder). --compile([no_auto_import, nowarn_unused_vars]). - --export([append_builder/2, prepend_builder/2, new/0, concat/1, concat_bit_strings/1, from_string/1, prepend_string/2, append_string/2, from_string_builder/1, from_bit_string/1, prepend/2, append/2, to_bit_string/1, byte_size/1]). --export_type([bit_builder/0]). - --type bit_builder() :: any(). - --spec append_builder(bit_builder(), bit_builder()) -> bit_builder(). -append_builder(First, Second) -> - gleam_stdlib:iodata_append(First, Second). - --spec prepend_builder(bit_builder(), bit_builder()) -> bit_builder(). -prepend_builder(To, Prefix) -> - append_builder(Prefix, To). - --spec new() -> bit_builder(). -new() -> - gleam_stdlib:identity([]). - --spec concat(list(bit_builder())) -> bit_builder(). -concat(Builders) -> - gleam_stdlib:identity(Builders). - --spec concat_bit_strings(list(bitstring())) -> bit_builder(). -concat_bit_strings(Bits) -> - gleam_stdlib:identity(Bits). - --spec from_string(binary()) -> bit_builder(). -from_string(String) -> - gleam_stdlib:wrap_list(String). - --spec prepend_string(bit_builder(), binary()) -> bit_builder(). -prepend_string(To, Prefix) -> - append_builder(from_string(Prefix), To). - --spec append_string(bit_builder(), binary()) -> bit_builder(). -append_string(To, Suffix) -> - append_builder(To, from_string(Suffix)). - --spec from_string_builder(gleam@string_builder:string_builder()) -> bit_builder(). -from_string_builder(Builder) -> - gleam_stdlib:wrap_list(Builder). - --spec from_bit_string(bitstring()) -> bit_builder(). -from_bit_string(Bits) -> - gleam_stdlib:wrap_list(Bits). - --spec prepend(bit_builder(), bitstring()) -> bit_builder(). -prepend(To, Prefix) -> - append_builder(from_bit_string(Prefix), To). - --spec append(bit_builder(), bitstring()) -> bit_builder(). -append(To, Suffix) -> - append_builder(To, from_bit_string(Suffix)). - --spec to_bit_string(bit_builder()) -> bitstring(). -to_bit_string(Builder) -> - erlang:list_to_bitstring(Builder). - --spec byte_size(bit_builder()) -> integer(). -byte_size(Builder) -> - erlang:iolist_size(Builder). diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_string.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_string.cache deleted file mode 100644 index 0e4fd1e09afed2ac445a48108baeeaa732bdf1b8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3899 zcmds4&2Jk;6yI6LUVCHL8d_JRYMQCrs7chM)K*3015VNpiKv3EovKx#ir4no8F#&F z?T+iF0#%42p@a2Sf zt58KjMqCXUzo0NiIy@mo!LfUWrG^wm>?jDIE#Pw*d`<&#K8@!ycwUIpX*`_)-@7Y} z7loG!s!vJJuc#sIWt#^-z{yw+$1*r}EnlEs+v>e%M5V6D0zRI>$AyB4G@i)diCq-D z!mMot5Fw1WjFSlAR0CJxs&~uG4?eQ%eNRVnAe_B|Anq8wxExn;Y85{ZT65diZp-l) zXO69iSMwIN>wE*L`F>8bkHXg@B9b-NX|5~V>oTC#p@5z-W@JFeq?5e>Xn7g8$59ip zDd0o~CxV?0gM)b0AmY}*1g?6QRjJJx-vk>+{Zq4VqmR&(%rpAGq&Z`J0PZKY@VDqJ zZfL%DzULzqM=svsu36znJz^5CU7q)7MP!pWHCOO%x=z+MD3Ng@9cEduVY-}{ zoYdKEYLh+=h-p_z#esO+ZA#iL!X4tZXob}nt?I-F$bwFmiB0P!hqJvkQZa2(h9e%W zibK@5jFdMy1?xEBpr69W15INdskLq2cDHSNgxSIhFw%yTteK?X!U&e<@F6IJBl0Tb zBsXtSq=rn6P*UJkQL?{}y&e|u6;`Y(NsrwHItT>s=|S-Bg;0Uuw5)Dzhyo;X3&v4_ z+#Eg%34{t2YC)-jXr8*32{fr@KUBX`^Wa=X7%FXfcchRm585&(b)89GW?r91dL{NG zEBD%$*5(YbKmd&c&{o4eqk@rk-lZmF@(|$4rkw$7L54}gVK(#t(gdz!EsMgoZMuwl z0(d7*08Gs$EPL=&DwQOI>f|MnVF<#^Ym!`iq|T(vZO*Bio;^*5mTT5#diLh5KD_F` zEcfK6bsYk{FkTxMN$1c2pc(nyNe23pkwEV&>3dOn4o_zAq@eUv8mBTiwS)MyVKx`^ zCfOWs;ggchhYb!$LMVGN_C`!NCgY|c-h=YL1)ul(?Z|gvupLPY5#LGIkH(M1yD~9; zJMC4#e=0ErV@(wC7G6VVQ_qD4%?(J4(k15|`!;p?xM1POq$^kuSXoX-q7Dj_w_Tt% z;7RJbj!RfglH$M#ph0HeHZ4{qSJy7hFOsUs%>^B%7L@Hozli3|Rtq?^7qs_=(0t8+ zp#%`IbI2(8;0&B%0vDg$q*dU!K6!i$6{o%(%7#pu*>RKxdt4O}T;+32 zsVE~^B7Cz&fqx`zxn_ryR(iiZb=b?prc4BW@NjUh*~P_uA#0Cu>Vogz1@JGU4(bi| zuE(*OAX)H))&W|b4OZD8fGIJ7+U;f;)?f(r2UD0c#d4p6r|i0qwm;D^bxD==KZg^C o#Xr-;VOf+oJcq-Xv8H<{Vg`v3p{ diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_string.cache_meta b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_string.cache_meta deleted file mode 100644 index 59b9691490c4db01a7d36c37b5d53c8f4265b8aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29 ZcmaD+eJF(i3K(IGy{Y=Vi&fT40RUBU1@Hg> diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_string.erl b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_string.erl deleted file mode 100644 index f3ce77a..0000000 --- a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_string.erl +++ /dev/null @@ -1,56 +0,0 @@ --module(gleam@bit_string). --compile([no_auto_import, nowarn_unused_vars]). - --export([from_string/1, byte_size/1, slice/3, is_utf8/1, to_string/1, concat/1, append/2]). - --spec from_string(binary()) -> bitstring(). -from_string(X) -> - gleam_stdlib:identity(X). - --spec byte_size(bitstring()) -> integer(). -byte_size(X) -> - erlang:byte_size(X). - --spec slice(bitstring(), integer(), integer()) -> {ok, bitstring()} | - {error, nil}. -slice(String, Position, Length) -> - gleam_stdlib:bit_string_slice(String, Position, Length). - --spec do_is_utf8(bitstring()) -> boolean(). -do_is_utf8(Bits) -> - case Bits of - <<>> -> - true; - - <<_/utf8, Rest/binary>> -> - do_is_utf8(Rest); - - _ -> - false - end. - --spec is_utf8(bitstring()) -> boolean(). -is_utf8(Bits) -> - do_is_utf8(Bits). - --spec do_to_string(bitstring()) -> {ok, binary()} | {error, nil}. -do_to_string(Bits) -> - case is_utf8(Bits) of - true -> - {ok, gleam_stdlib:identity(Bits)}; - - false -> - {error, nil} - end. - --spec to_string(bitstring()) -> {ok, binary()} | {error, nil}. -to_string(Bits) -> - do_to_string(Bits). - --spec concat(list(bitstring())) -> bitstring(). -concat(Bit_strings) -> - gleam_stdlib:bit_string_concat(Bit_strings). - --spec append(bitstring(), bitstring()) -> bitstring(). -append(First, Second) -> - concat([First, Second]). diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.cache deleted file mode 100644 index 9c3f9ecb79a82a2fe764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&7YjOHbl^AMGJtp1clwI`j<4w;YpPr}nwCb=-ypkwfuPL6>}Uf++=UlZpG>mKhyOzK?s7F!uTPWaI2^f%QoW$WyXHr4;*6Bkctkx3*@Pc`%M(7EtKGO2J4jO68y9EufHyv6Ap*g|HTr>p%h;Qz%oQ)gV{D zRlHs-*|fkOHNKzhzZ6|!NzA~A&JRB`w9h0Ep314Dd+;Q|+UvUov3U5@I2 zIo7gr0V5{f9LzfqR^{PFzLPKY>_Z(er)XbjpRvU}0{hmBs6w`VpJ5i>bGXBdISg6x3E8WDMc7p%TM7`7899aHE)B zR)N&kpmf7qD(C>-7XYi6oPTrfy>q4iL+@B?K2qR30&qSqq6*o_%t<0SS(kW%-f&3t zi{chVQRWHyz=7!hZYufv_oWX@(;g7OX$Sb?Fz%lhr4D0(2OU!sK0cQ5N^ywBfp=Vt z4$Eqo#){(N0Q)Bp)tl6*hE+_aTZMuZB zZ=Q+HP;%n|_F=Z*w+M_wBz6BRH9h&tGguhF?$Ao9`YP7g+8DmbmEcXXI}BrQ$Vnn( zN+d9|5UVs|x$h}OXP}IX&4g)R&j55+;D|uaOdxey@=OccZCQo#w(oVu2c6UFWAiVQ z&x&jdkn}Z1BQ}uB%P)nx%xb-6>H3wnz%& diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.erl b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.erl deleted file mode 100644 index 3469c4e..0000000 --- a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.erl +++ /dev/null @@ -1,152 +0,0 @@ --module(gleam@bool). --compile([no_auto_import, nowarn_unused_vars]). - --export(['and'/2, 'or'/2, negate/1, nor/2, nand/2, exclusive_or/2, exclusive_nor/2, compare/2, max/2, min/2, to_int/1, to_string/1, guard/3]). - --spec 'and'(boolean(), boolean()) -> boolean(). -'and'(A, B) -> - A andalso B. - --spec 'or'(boolean(), boolean()) -> boolean(). -'or'(A, B) -> - A orelse B. - --spec negate(boolean()) -> boolean(). -negate(Bool) -> - case Bool of - true -> - false; - - false -> - true - end. - --spec nor(boolean(), boolean()) -> boolean(). -nor(A, B) -> - case {A, B} of - {false, false} -> - true; - - {false, true} -> - false; - - {true, false} -> - false; - - {true, true} -> - false - end. - --spec nand(boolean(), boolean()) -> boolean(). -nand(A, B) -> - case {A, B} of - {false, false} -> - true; - - {false, true} -> - true; - - {true, false} -> - true; - - {true, true} -> - false - end. - --spec exclusive_or(boolean(), boolean()) -> boolean(). -exclusive_or(A, B) -> - case {A, B} of - {false, false} -> - false; - - {false, true} -> - true; - - {true, false} -> - true; - - {true, true} -> - false - end. - --spec exclusive_nor(boolean(), boolean()) -> boolean(). -exclusive_nor(A, B) -> - case {A, B} of - {false, false} -> - true; - - {false, true} -> - false; - - {true, false} -> - false; - - {true, true} -> - true - end. - --spec compare(boolean(), boolean()) -> gleam@order:order(). -compare(A, B) -> - case {A, B} of - {true, true} -> - eq; - - {true, false} -> - gt; - - {false, false} -> - eq; - - {false, true} -> - lt - end. - --spec max(boolean(), boolean()) -> boolean(). -max(A, B) -> - case A of - true -> - true; - - false -> - B - end. - --spec min(boolean(), boolean()) -> boolean(). -min(A, B) -> - case A of - false -> - false; - - true -> - B - end. - --spec to_int(boolean()) -> integer(). -to_int(Bool) -> - case Bool of - false -> - 0; - - true -> - 1 - end. - --spec to_string(boolean()) -> binary(). -to_string(Bool) -> - case Bool of - false -> - <<"False"/utf8>>; - - true -> - <<"True"/utf8>> - end. - --spec guard(boolean(), FBB, fun(() -> FBB)) -> FBB. -guard(Requirement, Consequence, Alternative) -> - case Requirement of - true -> - Consequence; - - false -> - Alternative() - end. diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache deleted file mode 100644 index d897cd817bdbb01f5a61424f798a1484f310ffa0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 48171 zcmd^o4{RLQdFRe7D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y)LzP6Hp5*`&W6N!Rhr_ixKel6 zrpc+`bgS6n<|wn=l@&Y7Y^y%xv3zOH5Em5GU(2N@w4n8C%;{+}V_zI$FD`QtN0&%X zCBxG*_iN7g=pxOOQmBSHXo?)?jVqE>?mD9$ovRcpFACC6AXeUTjfoYKAjh6K`4=Z0 zrLKy;K5{JD!s2@+!eY~_myj%|7R*L6#!(zsrfbzNj#~jgG#ZG?4X2f>U&$vg$4R@# zqA0H8ECwdmIh5FRYbiFJ5i-VAQV7g##;4XmfAu;F;ZEo)TG7i|8uRQbEn_9+V}8}w zM~97zkEXg2JhpN-qKFuEPkA>!G4kAqZG&_KE{&E3E`2AN=0-wV-b7v})p7^w$rar>?&oyPW4au(Echv@86o z*UpS4V9=!s5Z}NwdarAMV>!2yY6S%ThSV#tCK~tTRY^4EjkrV3DUFo+uF=#AezI_9 zO5~5!3i?!WJX6c!fW*3gk$hZu z0%=tuQruU@(c_v`5c*CPTqvvyNM$c@U(KFX(^rYI1o_TNRX$2tSRwD`u zd@;mcjItMbP#`ew6^`OR$M>^*KgahezMpT>nzV(&z_+0^1EnI}pfK?0fUqW2SnNnz zlYYCdHR;GFYfT!~VhHIT*0BE25etHGi^LJjvc!{!Tsr}kEIUg{8&xrqusi`D#UL+g z-Be0F5${vu&UUc4{RCC+?uZ)~=a!n8Jb&5>hAqS&p@`2Qp5ClXGHQO{(L(a~hf>*s z&X+8<%|nvBO8r8?N2uw8z4M(odxjbx)4GJQ20budl+QILX%Pe_O8mI z)p_55!wl#2um1hPJ)dzD*sN+f!;a^xUwDgyd;?!&GxvU~Mb9f2`sUqMZcY5w?BC8Z<(|o{D(js`a!8&VtZi6R;{`5b(~yx9Y%so5%yYscA` dynamic_(). -from(A) -> - gleam_stdlib:identity(A). - --spec unsafe_coerce(dynamic_()) -> any(). -unsafe_coerce(A) -> - gleam_stdlib:identity(A). - --spec dynamic(dynamic_()) -> {ok, dynamic_()} | {error, list(decode_error())}. -dynamic(Value) -> - {ok, Value}. - --spec bit_string(dynamic_()) -> {ok, bitstring()} | - {error, list(decode_error())}. -bit_string(Data) -> - gleam_stdlib:decode_bit_string(Data). - --spec put_expected(decode_error(), binary()) -> decode_error(). -put_expected(Error, Expected) -> - erlang:setelement(2, Error, Expected). - --spec classify(dynamic_()) -> binary(). -classify(Data) -> - gleam_stdlib:classify_dynamic(Data). - --spec int(dynamic_()) -> {ok, integer()} | {error, list(decode_error())}. -int(Data) -> - gleam_stdlib:decode_int(Data). - --spec float(dynamic_()) -> {ok, float()} | {error, list(decode_error())}. -float(Data) -> - gleam_stdlib:decode_float(Data). - --spec bool(dynamic_()) -> {ok, boolean()} | {error, list(decode_error())}. -bool(Data) -> - gleam_stdlib:decode_bool(Data). - --spec shallow_list(dynamic_()) -> {ok, list(dynamic_())} | - {error, list(decode_error())}. -shallow_list(Value) -> - gleam_stdlib:decode_list(Value). - --spec optional(fun((dynamic_()) -> {ok, DDL} | {error, list(decode_error())})) -> fun((dynamic_()) -> {ok, - gleam@option:option(DDL)} | - {error, list(decode_error())}). -optional(Decode) -> - fun(Value) -> gleam_stdlib:decode_option(Value, Decode) end. - --spec at_least_decode_tuple_error(integer(), dynamic_()) -> {ok, any()} | - {error, list(decode_error())}. -at_least_decode_tuple_error(Size, Data) -> - S = case Size of - 1 -> - <<""/utf8>>; - - _ -> - <<"s"/utf8>> - end, - Error = begin - _pipe = [<<"Tuple of at least "/utf8>>, - gleam@int:to_string(Size), - <<" element"/utf8>>, - S], - _pipe@1 = gleam@string_builder:from_strings(_pipe), - _pipe@2 = gleam@string_builder:to_string(_pipe@1), - {decode_error, _pipe@2, classify(Data), []} - end, - {error, [Error]}. - --spec any(list(fun((dynamic_()) -> {ok, DHL} | {error, list(decode_error())}))) -> fun((dynamic_()) -> {ok, - DHL} | - {error, list(decode_error())}). -any(Decoders) -> - fun(Data) -> case Decoders of - [] -> - {error, - [{decode_error, <<"another type"/utf8>>, classify(Data), []}]}; - - [Decoder | Decoders@1] -> - case Decoder(Data) of - {ok, Decoded} -> - {ok, Decoded}; - - {error, _} -> - (any(Decoders@1))(Data) - end - end end. - --spec all_errors({ok, any()} | {error, list(decode_error())}) -> list(decode_error()). -all_errors(Result) -> - case Result of - {ok, _} -> - []; - - {error, Errors} -> - Errors - end. - --spec decode1( - fun((DHP) -> DHQ), - fun((dynamic_()) -> {ok, DHP} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DHQ} | {error, list(decode_error())}). -decode1(Constructor, T1) -> - fun(Value) -> case T1(Value) of - {ok, A} -> - {ok, Constructor(A)}; - - A@1 -> - {error, all_errors(A@1)} - end end. - --spec push_path(decode_error(), any()) -> decode_error(). -push_path(Error, Name) -> - Name@1 = from(Name), - Decoder = any( - [fun string/1, - fun(X) -> gleam@result:map(int(X), fun gleam@int:to_string/1) end] - ), - Name@3 = case Decoder(Name@1) of - {ok, Name@2} -> - Name@2; - - {error, _} -> - _pipe = [<<"<"/utf8>>, classify(Name@1), <<">"/utf8>>], - _pipe@1 = gleam@string_builder:from_strings(_pipe), - gleam@string_builder:to_string(_pipe@1) - end, - erlang:setelement(4, Error, [Name@3 | erlang:element(4, Error)]). - --spec result( - fun((dynamic_()) -> {ok, DCZ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DDB} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, {ok, DCZ} | {error, DDB}} | - {error, list(decode_error())}). -result(Decode_ok, Decode_error) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_result(Value), - fun(Inner_result) -> case Inner_result of - {ok, Raw} -> - gleam@result:'try'( - begin - _pipe = Decode_ok(Raw), - map_errors( - _pipe, - fun(_capture) -> - push_path(_capture, <<"ok"/utf8>>) - end - ) - end, - fun(Value@1) -> {ok, {ok, Value@1}} end - ); - - {error, Raw@1} -> - gleam@result:'try'( - begin - _pipe@1 = Decode_error(Raw@1), - map_errors( - _pipe@1, - fun(_capture@1) -> - push_path(_capture@1, <<"error"/utf8>>) - end - ) - end, - fun(Value@2) -> {ok, {error, Value@2}} end - ) - end end - ) - end. - --spec list(fun((dynamic_()) -> {ok, DDG} | {error, list(decode_error())})) -> fun((dynamic_()) -> {ok, - list(DDG)} | - {error, list(decode_error())}). -list(Decoder_type) -> - fun(Dynamic) -> - gleam@result:'try'(shallow_list(Dynamic), fun(List) -> _pipe = List, - _pipe@1 = gleam@list:try_map(_pipe, Decoder_type), - map_errors( - _pipe@1, - fun(_capture) -> push_path(_capture, <<"*"/utf8>>) end - ) end) - end. - --spec map_errors( - {ok, DBU} | {error, list(decode_error())}, - fun((decode_error()) -> decode_error()) -) -> {ok, DBU} | {error, list(decode_error())}. -map_errors(Result, F) -> - gleam@result:map_error( - Result, - fun(_capture) -> gleam@list:map(_capture, F) end - ). - --spec decode_string(dynamic_()) -> {ok, binary()} | - {error, list(decode_error())}. -decode_string(Data) -> - _pipe = bit_string(Data), - _pipe@1 = map_errors( - _pipe, - fun(_capture) -> put_expected(_capture, <<"String"/utf8>>) end - ), - gleam@result:'try'( - _pipe@1, - fun(Raw) -> case gleam@bit_string:to_string(Raw) of - {ok, String} -> - {ok, String}; - - {error, nil} -> - {error, - [{decode_error, - <<"String"/utf8>>, - <<"BitString"/utf8>>, - []}]} - end end - ). - --spec string(dynamic_()) -> {ok, binary()} | {error, list(decode_error())}. -string(Data) -> - decode_string(Data). - --spec field( - any(), - fun((dynamic_()) -> {ok, DDV} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DDV} | {error, list(decode_error())}). -field(Name, Inner_type) -> - fun(Value) -> - Missing_field_error = {decode_error, - <<"field"/utf8>>, - <<"nothing"/utf8>>, - []}, - gleam@result:'try'( - gleam_stdlib:decode_field(Value, Name), - fun(Maybe_inner) -> _pipe = Maybe_inner, - _pipe@1 = gleam@option:to_result(_pipe, [Missing_field_error]), - _pipe@2 = gleam@result:'try'(_pipe@1, Inner_type), - map_errors( - _pipe@2, - fun(_capture) -> push_path(_capture, Name) end - ) end - ) - end. - --spec optional_field( - any(), - fun((dynamic_()) -> {ok, DDZ} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, gleam@option:option(DDZ)} | - {error, list(decode_error())}). -optional_field(Name, Inner_type) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_field(Value, Name), - fun(Maybe_inner) -> case Maybe_inner of - none -> - {ok, none}; - - {some, Dynamic_inner} -> - _pipe = Dynamic_inner, - _pipe@1 = gleam_stdlib:decode_option(_pipe, Inner_type), - map_errors( - _pipe@1, - fun(_capture) -> push_path(_capture, Name) end - ) - end end - ) - end. - --spec element( - integer(), - fun((dynamic_()) -> {ok, DEH} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DEH} | {error, list(decode_error())}). -element(Index, Inner_type) -> - fun(Data) -> - gleam@result:'try'( - gleam_stdlib:decode_tuple(Data), - fun(Tuple) -> - Size = gleam_stdlib:size_of_tuple(Tuple), - gleam@result:'try'(case Index >= 0 of - true -> - case Index < Size of - true -> - gleam_stdlib:tuple_get(Tuple, Index); - - false -> - at_least_decode_tuple_error(Index + 1, Data) - end; - - false -> - case gleam@int:absolute_value(Index) =< Size of - true -> - gleam_stdlib:tuple_get(Tuple, Size + Index); - - false -> - at_least_decode_tuple_error( - gleam@int:absolute_value(Index), - Data - ) - end - end, fun(Data@1) -> _pipe = Inner_type(Data@1), - map_errors( - _pipe, - fun(_capture) -> push_path(_capture, Index) end - ) end) - end - ) - end. - --spec tuple_errors({ok, any()} | {error, list(decode_error())}, binary()) -> list(decode_error()). -tuple_errors(Result, Name) -> - case Result of - {ok, _} -> - []; - - {error, Errors} -> - gleam@list:map( - Errors, - fun(_capture) -> push_path(_capture, Name) end - ) - end. - --spec tuple2( - fun((dynamic_()) -> {ok, DFH} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DFJ} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, {DFH, DFJ}} | {error, list(decode_error())}). -tuple2(Decode1, Decode2) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_tuple2(Value), - fun(_use0) -> - {A, B} = _use0, - case {Decode1(A), Decode2(B)} of - {{ok, A@1}, {ok, B@1}} -> - {ok, {A@1, B@1}}; - - {A@2, B@2} -> - _pipe = tuple_errors(A@2, <<"0"/utf8>>), - _pipe@1 = gleam@list:append( - _pipe, - tuple_errors(B@2, <<"1"/utf8>>) - ), - {error, _pipe@1} - end - end - ) - end. - --spec tuple3( - fun((dynamic_()) -> {ok, DFM} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DFO} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DFQ} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, {DFM, DFO, DFQ}} | {error, list(decode_error())}). -tuple3(Decode1, Decode2, Decode3) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_tuple3(Value), - fun(_use0) -> - {A, B, C} = _use0, - case {Decode1(A), Decode2(B), Decode3(C)} of - {{ok, A@1}, {ok, B@1}, {ok, C@1}} -> - {ok, {A@1, B@1, C@1}}; - - {A@2, B@2, C@2} -> - _pipe = tuple_errors(A@2, <<"0"/utf8>>), - _pipe@1 = gleam@list:append( - _pipe, - tuple_errors(B@2, <<"1"/utf8>>) - ), - _pipe@2 = gleam@list:append( - _pipe@1, - tuple_errors(C@2, <<"2"/utf8>>) - ), - {error, _pipe@2} - end - end - ) - end. - --spec tuple4( - fun((dynamic_()) -> {ok, DFT} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DFV} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DFX} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DFZ} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, {DFT, DFV, DFX, DFZ}} | - {error, list(decode_error())}). -tuple4(Decode1, Decode2, Decode3, Decode4) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_tuple4(Value), - fun(_use0) -> - {A, B, C, D} = _use0, - case {Decode1(A), Decode2(B), Decode3(C), Decode4(D)} of - {{ok, A@1}, {ok, B@1}, {ok, C@1}, {ok, D@1}} -> - {ok, {A@1, B@1, C@1, D@1}}; - - {A@2, B@2, C@2, D@2} -> - _pipe = tuple_errors(A@2, <<"0"/utf8>>), - _pipe@1 = gleam@list:append( - _pipe, - tuple_errors(B@2, <<"1"/utf8>>) - ), - _pipe@2 = gleam@list:append( - _pipe@1, - tuple_errors(C@2, <<"2"/utf8>>) - ), - _pipe@3 = gleam@list:append( - _pipe@2, - tuple_errors(D@2, <<"3"/utf8>>) - ), - {error, _pipe@3} - end - end - ) - end. - --spec tuple5( - fun((dynamic_()) -> {ok, DGC} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DGE} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DGG} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DGI} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DGK} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, {DGC, DGE, DGG, DGI, DGK}} | - {error, list(decode_error())}). -tuple5(Decode1, Decode2, Decode3, Decode4, Decode5) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_tuple5(Value), - fun(_use0) -> - {A, B, C, D, E} = _use0, - case {Decode1(A), - Decode2(B), - Decode3(C), - Decode4(D), - Decode5(E)} of - {{ok, A@1}, {ok, B@1}, {ok, C@1}, {ok, D@1}, {ok, E@1}} -> - {ok, {A@1, B@1, C@1, D@1, E@1}}; - - {A@2, B@2, C@2, D@2, E@2} -> - _pipe = tuple_errors(A@2, <<"0"/utf8>>), - _pipe@1 = gleam@list:append( - _pipe, - tuple_errors(B@2, <<"1"/utf8>>) - ), - _pipe@2 = gleam@list:append( - _pipe@1, - tuple_errors(C@2, <<"2"/utf8>>) - ), - _pipe@3 = gleam@list:append( - _pipe@2, - tuple_errors(D@2, <<"3"/utf8>>) - ), - _pipe@4 = gleam@list:append( - _pipe@3, - tuple_errors(E@2, <<"4"/utf8>>) - ), - {error, _pipe@4} - end - end - ) - end. - --spec tuple6( - fun((dynamic_()) -> {ok, DGN} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DGP} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DGR} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DGT} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DGV} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DGX} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, {DGN, DGP, DGR, DGT, DGV, DGX}} | - {error, list(decode_error())}). -tuple6(Decode1, Decode2, Decode3, Decode4, Decode5, Decode6) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_tuple6(Value), - fun(_use0) -> - {A, B, C, D, E, F} = _use0, - case {Decode1(A), - Decode2(B), - Decode3(C), - Decode4(D), - Decode5(E), - Decode6(F)} of - {{ok, A@1}, - {ok, B@1}, - {ok, C@1}, - {ok, D@1}, - {ok, E@1}, - {ok, F@1}} -> - {ok, {A@1, B@1, C@1, D@1, E@1, F@1}}; - - {A@2, B@2, C@2, D@2, E@2, F@2} -> - _pipe = tuple_errors(A@2, <<"0"/utf8>>), - _pipe@1 = gleam@list:append( - _pipe, - tuple_errors(B@2, <<"1"/utf8>>) - ), - _pipe@2 = gleam@list:append( - _pipe@1, - tuple_errors(C@2, <<"2"/utf8>>) - ), - _pipe@3 = gleam@list:append( - _pipe@2, - tuple_errors(D@2, <<"3"/utf8>>) - ), - _pipe@4 = gleam@list:append( - _pipe@3, - tuple_errors(E@2, <<"4"/utf8>>) - ), - _pipe@5 = gleam@list:append( - _pipe@4, - tuple_errors(F@2, <<"5"/utf8>>) - ), - {error, _pipe@5} - end - end - ) - end. - --spec map( - fun((dynamic_()) -> {ok, DHA} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DHC} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, gleam@map:map_(DHA, DHC)} | - {error, list(decode_error())}). -map(Key_type, Value_type) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_map(Value), - fun(Map) -> - gleam@result:'try'( - begin - _pipe = Map, - _pipe@1 = gleam@map:to_list(_pipe), - gleam@list:try_map( - _pipe@1, - fun(Pair) -> - {K, V} = Pair, - gleam@result:'try'( - begin - _pipe@2 = Key_type(K), - map_errors( - _pipe@2, - fun(_capture) -> - push_path( - _capture, - <<"keys"/utf8>> - ) - end - ) - end, - fun(K@1) -> - gleam@result:'try'( - begin - _pipe@3 = Value_type(V), - map_errors( - _pipe@3, - fun(_capture@1) -> - push_path( - _capture@1, - <<"values"/utf8>> - ) - end - ) - end, - fun(V@1) -> {ok, {K@1, V@1}} end - ) - end - ) - end - ) - end, - fun(Pairs) -> {ok, gleam@map:from_list(Pairs)} end - ) - end - ) - end. - --spec decode2( - fun((DHT, DHU) -> DHV), - fun((dynamic_()) -> {ok, DHT} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DHU} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DHV} | {error, list(decode_error())}). -decode2(Constructor, T1, T2) -> - fun(Value) -> case {T1(Value), T2(Value)} of - {{ok, A}, {ok, B}} -> - {ok, Constructor(A, B)}; - - {A@1, B@1} -> - {error, gleam@list:concat([all_errors(A@1), all_errors(B@1)])} - end end. - --spec decode3( - fun((DHZ, DIA, DIB) -> DIC), - fun((dynamic_()) -> {ok, DHZ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DIA} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DIB} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DIC} | {error, list(decode_error())}). -decode3(Constructor, T1, T2, T3) -> - fun(Value) -> case {T1(Value), T2(Value), T3(Value)} of - {{ok, A}, {ok, B}, {ok, C}} -> - {ok, Constructor(A, B, C)}; - - {A@1, B@1, C@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), all_errors(B@1), all_errors(C@1)] - )} - end end. - --spec decode4( - fun((DIH, DII, DIJ, DIK) -> DIL), - fun((dynamic_()) -> {ok, DIH} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DII} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DIJ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DIK} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DIL} | {error, list(decode_error())}). -decode4(Constructor, T1, T2, T3, T4) -> - fun(X) -> case {T1(X), T2(X), T3(X), T4(X)} of - {{ok, A}, {ok, B}, {ok, C}, {ok, D}} -> - {ok, Constructor(A, B, C, D)}; - - {A@1, B@1, C@1, D@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), - all_errors(B@1), - all_errors(C@1), - all_errors(D@1)] - )} - end end. - --spec decode5( - fun((DIR, DIS, DIT, DIU, DIV) -> DIW), - fun((dynamic_()) -> {ok, DIR} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DIS} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DIT} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DIU} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DIV} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DIW} | {error, list(decode_error())}). -decode5(Constructor, T1, T2, T3, T4, T5) -> - fun(X) -> case {T1(X), T2(X), T3(X), T4(X), T5(X)} of - {{ok, A}, {ok, B}, {ok, C}, {ok, D}, {ok, E}} -> - {ok, Constructor(A, B, C, D, E)}; - - {A@1, B@1, C@1, D@1, E@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), - all_errors(B@1), - all_errors(C@1), - all_errors(D@1), - all_errors(E@1)] - )} - end end. - --spec decode6( - fun((DJD, DJE, DJF, DJG, DJH, DJI) -> DJJ), - fun((dynamic_()) -> {ok, DJD} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DJE} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DJF} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DJG} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DJH} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DJI} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DJJ} | {error, list(decode_error())}). -decode6(Constructor, T1, T2, T3, T4, T5, T6) -> - fun(X) -> case {T1(X), T2(X), T3(X), T4(X), T5(X), T6(X)} of - {{ok, A}, {ok, B}, {ok, C}, {ok, D}, {ok, E}, {ok, F}} -> - {ok, Constructor(A, B, C, D, E, F)}; - - {A@1, B@1, C@1, D@1, E@1, F@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), - all_errors(B@1), - all_errors(C@1), - all_errors(D@1), - all_errors(E@1), - all_errors(F@1)] - )} - end end. - --spec decode7( - fun((DJR, DJS, DJT, DJU, DJV, DJW, DJX) -> DJY), - fun((dynamic_()) -> {ok, DJR} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DJS} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DJT} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DJU} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DJV} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DJW} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DJX} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DJY} | {error, list(decode_error())}). -decode7(Constructor, T1, T2, T3, T4, T5, T6, T7) -> - fun(X) -> case {T1(X), T2(X), T3(X), T4(X), T5(X), T6(X), T7(X)} of - {{ok, A}, {ok, B}, {ok, C}, {ok, D}, {ok, E}, {ok, F}, {ok, G}} -> - {ok, Constructor(A, B, C, D, E, F, G)}; - - {A@1, B@1, C@1, D@1, E@1, F@1, G@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), - all_errors(B@1), - all_errors(C@1), - all_errors(D@1), - all_errors(E@1), - all_errors(F@1), - all_errors(G@1)] - )} - end end. - --spec decode8( - fun((DKH, DKI, DKJ, DKK, DKL, DKM, DKN, DKO) -> DKP), - fun((dynamic_()) -> {ok, DKH} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DKI} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DKJ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DKK} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DKL} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DKM} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DKN} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DKO} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DKP} | {error, list(decode_error())}). -decode8(Constructor, T1, T2, T3, T4, T5, T6, T7, T8) -> - fun(X) -> case {T1(X), T2(X), T3(X), T4(X), T5(X), T6(X), T7(X), T8(X)} of - {{ok, A}, - {ok, B}, - {ok, C}, - {ok, D}, - {ok, E}, - {ok, F}, - {ok, G}, - {ok, H}} -> - {ok, Constructor(A, B, C, D, E, F, G, H)}; - - {A@1, B@1, C@1, D@1, E@1, F@1, G@1, H@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), - all_errors(B@1), - all_errors(C@1), - all_errors(D@1), - all_errors(E@1), - all_errors(F@1), - all_errors(G@1), - all_errors(H@1)] - )} - end end. - --spec decode9( - fun((DKZ, DLA, DLB, DLC, DLD, DLE, DLF, DLG, DLH) -> DLI), - fun((dynamic_()) -> {ok, DKZ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DLA} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DLB} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DLC} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DLD} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DLE} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DLF} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DLG} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DLH} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DLI} | {error, list(decode_error())}). -decode9(Constructor, T1, T2, T3, T4, T5, T6, T7, T8, T9) -> - fun(X) -> - case {T1(X), T2(X), T3(X), T4(X), T5(X), T6(X), T7(X), T8(X), T9(X)} of - {{ok, A}, - {ok, B}, - {ok, C}, - {ok, D}, - {ok, E}, - {ok, F}, - {ok, G}, - {ok, H}, - {ok, I}} -> - {ok, Constructor(A, B, C, D, E, F, G, H, I)}; - - {A@1, B@1, C@1, D@1, E@1, F@1, G@1, H@1, I@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), - all_errors(B@1), - all_errors(C@1), - all_errors(D@1), - all_errors(E@1), - all_errors(F@1), - all_errors(G@1), - all_errors(H@1), - all_errors(I@1)] - )} - end - end. diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.cache deleted file mode 100644 index 7f321f7622a26fc8d12363f89cf50d218169d14a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11341 zcmeHNO>7&-73PqlX)%)NHT@UIw#KyU(6U5Hq@-Ac8(B*1#DWu>rU3_b4RJ}Xq_s&d zy}Ps|BZXbpx#Z|$PC?L1f}#fl0fJnb_D}>tfC51S6g?(6q&c-f3$(eY-@KWX$Q319 z@lSFn%oT^;+4*_z&3oVb-X35bp|`>(HfcMG+JVT>fnCA)J4cz;eKr2UQMNQ&G4$%d zOeGMpbXWeGcHBU$TrrC$f)jUx@i4oZ-^^Gj{ysaO|E*}e6-?ys2GMAQZsr$4X#6rf zmA@TEV{B6~e|!@fUv9dT|Ep+Rk4)z45j0M2F6Lj|jK*T;RQ}CQGd_i)|RSp02ViR~<&#r5897Qc_{&K~r^mEFtYQ@B3ckLPf` za{%{o-8+Q7;yR4qxUMEK7Ou%&7QfWXmde(&YmumIvo;$D_#0iC5f5YL zAf~2?X&n3@jRk_4{?Mt=60Hok18kPDC$+Nkxi`ehirO1&Nc*5=QlDAz^M>27Yfd+J z=L{|v&TXS^8;((Pb=S0N+?t`Ab=$gOmW?tmkeCX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Bv8iQgH*7rTMHRL*? z8m>qIQphs8_Bx0vUB+`mz+`{YzSaaLs~NM1myax*_F|)OmCc=z;pz;+)wYnDag}^z z4dEGz_p~S=R1Zl>YQ=k3V10?m4Jp*L0^Nx!`TDsKMK2<^SN7Z*y?h4o^ceVbZb1ra z0fPEI+(WDM%W1-OjcVQ93D0S9>VYt(Ua@GdOf|n&P*?$ms0Pn)6BRApiBeU#ZaI#L zTJ!osrHPXCx&`crsxiXiR)bR2abohN1n#fQ+mwGt*cfQ3L_{x_S5$DjrB<1`OEFir; zzvA^&cCcbE;7b1avwep(HhGJ<$&$O)aeuPu(xjIa;Jvl(&qCf})=>Wzp?;(RzQl>r zO!=Y~OadI6+ET0A^d(fPPx3O@XOT}KK^RV@MN*Z?q(+sdAf|usOY9do1r}%7D?<8# zIAtx*hhva#ektOeketvji1X{d5+N#B?a+#sVzvszpDNJ~J-DKbRaWQATYtTkI3m1c zNs0AOif+&5_R5g47m0Ut9CZ7tq#Jtt^WMll;q`EvHY&Z|6MMx*z3QW0v60I3-m&?| z)-d2*p= {ok, float()} | {error, nil}. -parse(String) -> - gleam_stdlib:parse_float(String). - --spec to_string(float()) -> binary(). -to_string(X) -> - gleam_stdlib:float_to_string(X). - --spec compare(float(), float()) -> gleam@order:order(). -compare(A, B) -> - case A =:= B of - true -> - eq; - - false -> - case A < B of - true -> - lt; - - false -> - gt - end - end. - --spec min(float(), float()) -> float(). -min(A, B) -> - case A < B of - true -> - A; - - false -> - B - end. - --spec max(float(), float()) -> float(). -max(A, B) -> - case A > B of - true -> - A; - - false -> - B - end. - --spec clamp(float(), float(), float()) -> float(). -clamp(X, Min_bound, Max_bound) -> - _pipe = X, - _pipe@1 = min(_pipe, Max_bound), - max(_pipe@1, Min_bound). - --spec ceiling(float()) -> float(). -ceiling(X) -> - math:ceil(X). - --spec floor(float()) -> float(). -floor(X) -> - math:floor(X). - --spec round(float()) -> integer(). -round(X) -> - erlang:round(X). - --spec truncate(float()) -> integer(). -truncate(X) -> - erlang:trunc(X). - --spec absolute_value(float()) -> float(). -absolute_value(X) -> - case X >= 0.0 of - true -> - X; - - _ -> - 0.0 - X - end. - --spec loosely_compare(float(), float(), float()) -> gleam@order:order(). -loosely_compare(A, B, Tolerance) -> - Difference = absolute_value(A - B), - case Difference =< Tolerance of - true -> - eq; - - false -> - compare(A, B) - end. - --spec loosely_equals(float(), float(), float()) -> boolean(). -loosely_equals(A, B, Tolerance) -> - Difference = absolute_value(A - B), - Difference =< Tolerance. - --spec power(float(), float()) -> {ok, float()} | {error, nil}. -power(Base, Exponent) -> - Fractional = (ceiling(Exponent) - Exponent) > 0.0, - case ((Base < 0.0) andalso Fractional) orelse ((Base =:= 0.0) andalso (Exponent - < 0.0)) of - true -> - {error, nil}; - - false -> - {ok, math:pow(Base, Exponent)} - end. - --spec square_root(float()) -> {ok, float()} | {error, nil}. -square_root(X) -> - power(X, 0.5). - --spec negate(float()) -> float(). -negate(X) -> - -1.0 * X. - --spec do_sum(list(float()), float()) -> float(). -do_sum(Numbers, Initial) -> - case Numbers of - [] -> - Initial; - - [X | Rest] -> - do_sum(Rest, X + Initial) - end. - --spec sum(list(float())) -> float(). -sum(Numbers) -> - _pipe = Numbers, - do_sum(_pipe, 0.0). - --spec do_product(list(float()), float()) -> float(). -do_product(Numbers, Initial) -> - case Numbers of - [] -> - Initial; - - [X | Rest] -> - do_product(Rest, X * Initial) - end. - --spec product(list(float())) -> float(). -product(Numbers) -> - case Numbers of - [] -> - 1.0; - - _ -> - do_product(Numbers, 1.0) - end. - --spec random(float(), float()) -> float(). -random(Min, Max) -> - (rand:uniform() * (Max - Min)) + Min. - --spec divide(float(), float()) -> {ok, float()} | {error, nil}. -divide(A, B) -> - case B of - 0.0 -> - {error, nil}; - - B@1 -> - {ok, case B@1 of - 0.0 -> 0.0; - Gleam@denominator -> A / Gleam@denominator - end} - end. - --spec add(float(), float()) -> float(). -add(A, B) -> - A + B. - --spec multiply(float(), float()) -> float(). -multiply(A, B) -> - A * B. - --spec subtract(float(), float()) -> float(). -subtract(A, B) -> - A - B. diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.cache deleted file mode 100644 index 23234ec89952cbab76276ec42bc42d6a447c2cc1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5793 zcmc&&OKcn073CX}`p}f+{i8u9>DQwg>!V&o>O+B1p z=VO^}4F`c2Mixa7WD#T)AVu>*7e$su&_z~V^s}tHGtyPNYP;!Yqn>x)%!s6hLaQ#i z(9`3c_dWOCbMJk#ESG(cT^iAk-`8hH_1WK-y&}^mzF&U5$ac4EVYZiAVP?Z=1eWV4 z!K;3dDK%|t^OE-Bnx=~dqsg-6k65+#Aw#E~y&Et^GQOjyZa@)*MA=eC%qi zIEKzY$IjILAv@0&s!$h_AWCESPPF8DwnM9{us+K<=VdeYdto+6} zE46H^!B&k z800j$CxXy((C3cW>7P@GCv6Mvn{C1SW>@%T7;wwM3U`I)3+{SN;Vl*b0bBj?kzXF! zXoQ~ET~+ARI2(Yc(+|%>;~OLZk^m)3(B!DiQ#%sFv}Bx0W~zY^-o0WuGew*%MSxa~ zM+(qK0Q9Yq=)A)ro!*0I#|pN2eYM^L=A7x^mlbrm+mfH=D}DF|+oHfFB9>@!@q^I1 zYuZr4Vxhq6EoaUIoE6@f=g(c_%{t!{4Yv(7(kBvP%x2t)hsnt`A^6QYLA_GHJ$F|1 z=6TEYpwp%ZOv{!#-s{+=V@k(~RP_AFjgg1grQ`Y{vf!tED!OhwP7GFJd3s4%Faf*1 zWW3a)hEdYdSVkjz*BE-x;&{3i)L?wfGfmeo8+E0HI<)Y5Er>2PI zS}9_=c#2r=mLithr-+mDM9%ZJQrp{5+b>2V7=~)iJiVs`P*+5TN~!w!Ws zXSO<9{AzI**6jzT6YL#0IN-p?(ru+o_rS;K9yioIZr~mtXM498evgUNdmI?9tS!g& zz?$-Qag#RF_I6l`ZvR>FPs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c2H;jR*&Hw-a diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.cache_meta b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.cache_meta deleted file mode 100644 index 74611747293b5213e8a6d4a25c9c2a7ec62bc588..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29 ZcmbPVus4MP3K(IGw1ZcRUJLk41prY%27CYj diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.erl b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.erl deleted file mode 100644 index c8aa836..0000000 --- a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.erl +++ /dev/null @@ -1,67 +0,0 @@ --module(gleam@function). --compile([no_auto_import, nowarn_unused_vars]). - --export([compose/2, curry2/1, curry3/1, curry4/1, curry5/1, curry6/1, flip/1, identity/1, constant/1, tap/2, apply1/2, apply2/3, apply3/4]). - --spec compose(fun((EYE) -> EYF), fun((EYF) -> EYG)) -> fun((EYE) -> EYG). -compose(Fun1, Fun2) -> - fun(A) -> Fun2(Fun1(A)) end. - --spec curry2(fun((EYH, EYI) -> EYJ)) -> fun((EYH) -> fun((EYI) -> EYJ)). -curry2(Fun) -> - fun(A) -> fun(B) -> Fun(A, B) end end. - --spec curry3(fun((EYL, EYM, EYN) -> EYO)) -> fun((EYL) -> fun((EYM) -> fun((EYN) -> EYO))). -curry3(Fun) -> - fun(A) -> fun(B) -> fun(C) -> Fun(A, B, C) end end end. - --spec curry4(fun((EYQ, EYR, EYS, EYT) -> EYU)) -> fun((EYQ) -> fun((EYR) -> fun((EYS) -> fun((EYT) -> EYU)))). -curry4(Fun) -> - fun(A) -> fun(B) -> fun(C) -> fun(D) -> Fun(A, B, C, D) end end end end. - --spec curry5(fun((EYW, EYX, EYY, EYZ, EZA) -> EZB)) -> fun((EYW) -> fun((EYX) -> fun((EYY) -> fun((EYZ) -> fun((EZA) -> EZB))))). -curry5(Fun) -> - fun(A) -> - fun(B) -> - fun(C) -> fun(D) -> fun(E) -> Fun(A, B, C, D, E) end end end - end - end. - --spec curry6(fun((EZD, EZE, EZF, EZG, EZH, EZI) -> EZJ)) -> fun((EZD) -> fun((EZE) -> fun((EZF) -> fun((EZG) -> fun((EZH) -> fun((EZI) -> EZJ)))))). -curry6(Fun) -> - fun(A) -> - fun(B) -> - fun(C) -> - fun(D) -> fun(E) -> fun(F) -> Fun(A, B, C, D, E, F) end end end - end - end - end. - --spec flip(fun((EZL, EZM) -> EZN)) -> fun((EZM, EZL) -> EZN). -flip(Fun) -> - fun(B, A) -> Fun(A, B) end. - --spec identity(EZO) -> EZO. -identity(X) -> - X. - --spec constant(EZP) -> fun((any()) -> EZP). -constant(Value) -> - fun(_) -> Value end. - --spec tap(EZR, fun((EZR) -> any())) -> EZR. -tap(Arg, Effect) -> - Effect(Arg), - Arg. - --spec apply1(fun((EZT) -> EZU), EZT) -> EZU. -apply1(Fun, Arg1) -> - Fun(Arg1). - --spec apply2(fun((EZV, EZW) -> EZX), EZV, EZW) -> EZX. -apply2(Fun, Arg1, Arg2) -> - Fun(Arg1, Arg2). - --spec apply3(fun((EZY, EZZ, FAA) -> FAB), EZY, EZZ, FAA) -> FAB. -apply3(Fun, Arg1, Arg2, Arg3) -> - Fun(Arg1, Arg2, Arg3). diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache deleted file mode 100644 index 21648017be6cb17707c86f839272238bbeec0b61..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18102 zcmeHPTWlLwdgdV|Q=%=)WBL*+b~I*^hE^n797?jqt}V+>vay=AP0{Ek-YmqSIFiO8 zIo#pUvb~EYU8F#;Pk|8>*Z>8Bpf5Gjq8s$3MSvPXQM5*Z-R?tyrbU|?Xm>a0Q(m?W zTBzTD&dhKQuaa-s4GMUyp?K!p{@eF|=N}yo_h|$1$mwm$-bLl`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ph3* zik+(2@`bIUW9Npke3&59&;q$|87KLUjC8P&Bna2GHrps$) zns`kmqu@1_!PqD&QgqKa0343SpNrGkC+c+RxTayDZ%P(=pHU9e!`~x`j$WX53Ee%n zkQd>T_tM6hEDk~lEWCxtmFf2;Bn!x8U*hc#l@P%A%ZlAaTwX$18~lC~{PY^3 zDuNE2zTUMF+%z?M{yQGI*ukhU4=)!phz;W$!-aa7H=2Pnjqvsh#|FC8d8%>DPwo@OPA-?z(@BL+KyE?;{sp T8|6uoJO$EBuaKMnk(vJkCcHE2 diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache_meta b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache_meta deleted file mode 100644 index d3bd477bb8d403636e1cab81fe081b6b24955e6a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67 ucmZpy5=>=)0!Ah%gBwbx=cFd)>Zj%8CzhZJ integer(). -absolute_value(X) -> - case X >= 0 of - true -> - X; - - false -> - X * -1 - end. - --spec parse(binary()) -> {ok, integer()} | {error, nil}. -parse(String) -> - gleam_stdlib:parse_int(String). - --spec base_parse(binary(), integer()) -> {ok, integer()} | {error, nil}. -base_parse(String, Base) -> - case (Base >= 2) andalso (Base =< 36) of - true -> - gleam_stdlib:int_from_base_string(String, Base); - - false -> - {error, nil} - end. - --spec to_string(integer()) -> binary(). -to_string(X) -> - erlang:integer_to_binary(X). - --spec to_base_string(integer(), integer()) -> {ok, binary()} | - {error, invalid_base()}. -to_base_string(X, Base) -> - case (Base >= 2) andalso (Base =< 36) of - true -> - {ok, erlang:integer_to_binary(X, Base)}; - - false -> - {error, invalid_base} - end. - --spec to_base2(integer()) -> binary(). -to_base2(X) -> - erlang:integer_to_binary(X, 2). - --spec to_base8(integer()) -> binary(). -to_base8(X) -> - erlang:integer_to_binary(X, 8). - --spec to_base16(integer()) -> binary(). -to_base16(X) -> - erlang:integer_to_binary(X, 16). - --spec to_base36(integer()) -> binary(). -to_base36(X) -> - erlang:integer_to_binary(X, 36). - --spec to_float(integer()) -> float(). -to_float(X) -> - erlang:float(X). - --spec power(integer(), float()) -> {ok, float()} | {error, nil}. -power(Base, Exponent) -> - _pipe = Base, - _pipe@1 = to_float(_pipe), - gleam@float:power(_pipe@1, Exponent). - --spec square_root(integer()) -> {ok, float()} | {error, nil}. -square_root(X) -> - _pipe = X, - _pipe@1 = to_float(_pipe), - gleam@float:square_root(_pipe@1). - --spec compare(integer(), integer()) -> gleam@order:order(). -compare(A, B) -> - case A =:= B of - true -> - eq; - - false -> - case A < B of - true -> - lt; - - false -> - gt - end - end. - --spec min(integer(), integer()) -> integer(). -min(A, B) -> - case A < B of - true -> - A; - - false -> - B - end. - --spec max(integer(), integer()) -> integer(). -max(A, B) -> - case A > B of - true -> - A; - - false -> - B - end. - --spec clamp(integer(), integer(), integer()) -> integer(). -clamp(X, Min_bound, Max_bound) -> - _pipe = X, - _pipe@1 = min(_pipe, Max_bound), - max(_pipe@1, Min_bound). - --spec is_even(integer()) -> boolean(). -is_even(X) -> - (X rem 2) =:= 0. - --spec is_odd(integer()) -> boolean(). -is_odd(X) -> - (X rem 2) /= 0. - --spec negate(integer()) -> integer(). -negate(X) -> - -1 * X. - --spec do_sum(list(integer()), integer()) -> integer(). -do_sum(Numbers, Initial) -> - case Numbers of - [] -> - Initial; - - [X | Rest] -> - do_sum(Rest, X + Initial) - end. - --spec sum(list(integer())) -> integer(). -sum(Numbers) -> - _pipe = Numbers, - do_sum(_pipe, 0). - --spec do_product(list(integer()), integer()) -> integer(). -do_product(Numbers, Initial) -> - case Numbers of - [] -> - Initial; - - [X | Rest] -> - do_product(Rest, X * Initial) - end. - --spec product(list(integer())) -> integer(). -product(Numbers) -> - case Numbers of - [] -> - 1; - - _ -> - do_product(Numbers, 1) - end. - --spec do_digits(integer(), integer(), list(integer())) -> list(integer()). -do_digits(X, Base, Acc) -> - case absolute_value(X) < Base of - true -> - [X | Acc]; - - false -> - do_digits(case Base of - 0 -> 0; - Gleam@denominator -> X div Gleam@denominator - end, Base, [case Base of - 0 -> 0; - Gleam@denominator@1 -> X rem Gleam@denominator@1 - end | Acc]) - end. - --spec digits(integer(), integer()) -> {ok, list(integer())} | - {error, invalid_base()}. -digits(X, Base) -> - case Base < 2 of - true -> - {error, invalid_base}; - - false -> - {ok, do_digits(X, Base, [])} - end. - --spec do_undigits(list(integer()), integer(), integer()) -> {ok, integer()} | - {error, invalid_base()}. -do_undigits(Numbers, Base, Acc) -> - case Numbers of - [] -> - {ok, Acc}; - - [Digit | _] when Digit >= Base -> - {error, invalid_base}; - - [Digit@1 | Rest] -> - do_undigits(Rest, Base, (Acc * Base) + Digit@1) - end. - --spec undigits(list(integer()), integer()) -> {ok, integer()} | - {error, invalid_base()}. -undigits(Numbers, Base) -> - case Base < 2 of - true -> - {error, invalid_base}; - - false -> - do_undigits(Numbers, Base, 0) - end. - --spec random(integer(), integer()) -> integer(). -random(Min, Max) -> - _pipe = gleam@float:random(to_float(Min), to_float(Max)), - _pipe@1 = gleam@float:floor(_pipe), - gleam@float:round(_pipe@1). - --spec divide(integer(), integer()) -> {ok, integer()} | {error, nil}. -divide(Dividend, Divisor) -> - case Divisor of - 0 -> - {error, nil}; - - Divisor@1 -> - {ok, case Divisor@1 of - 0 -> 0; - Gleam@denominator -> Dividend div Gleam@denominator - end} - end. - --spec remainder(integer(), integer()) -> {ok, integer()} | {error, nil}. -remainder(Dividend, Divisor) -> - case Divisor of - 0 -> - {error, nil}; - - Divisor@1 -> - {ok, case Divisor@1 of - 0 -> 0; - Gleam@denominator -> Dividend rem Gleam@denominator - end} - end. - --spec modulo(integer(), integer()) -> {ok, integer()} | {error, nil}. -modulo(Dividend, Divisor) -> - case Divisor of - 0 -> - {error, nil}; - - _ -> - Remainder = case Divisor of - 0 -> 0; - Gleam@denominator -> Dividend rem Gleam@denominator - end, - case (Remainder * Divisor) < 0 of - true -> - {ok, Remainder + Divisor}; - - false -> - {ok, Remainder} - end - end. - --spec floor_divide(integer(), integer()) -> {ok, integer()} | {error, nil}. -floor_divide(Dividend, Divisor) -> - case Divisor of - 0 -> - {error, nil}; - - Divisor@1 -> - case ((Dividend * Divisor@1) < 0) andalso ((case Divisor@1 of - 0 -> 0; - Gleam@denominator -> Dividend rem Gleam@denominator - end) /= 0) of - true -> - {ok, (case Divisor@1 of - 0 -> 0; - Gleam@denominator@1 -> Dividend div Gleam@denominator@1 - end) - 1}; - - false -> - {ok, case Divisor@1 of - 0 -> 0; - Gleam@denominator@2 -> Dividend div Gleam@denominator@2 - end} - end - end. - --spec add(integer(), integer()) -> integer(). -add(A, B) -> - A + B. - --spec multiply(integer(), integer()) -> integer(). -multiply(A, B) -> - A * B. - --spec subtract(integer(), integer()) -> integer(). -subtract(A, B) -> - A - B. - --spec bitwise_and(integer(), integer()) -> integer(). -bitwise_and(X, Y) -> - erlang:'band'(X, Y). - --spec bitwise_not(integer()) -> integer(). -bitwise_not(X) -> - erlang:'bnot'(X). - --spec bitwise_or(integer(), integer()) -> integer(). -bitwise_or(X, Y) -> - erlang:'bor'(X, Y). - --spec bitwise_exclusive_or(integer(), integer()) -> integer(). -bitwise_exclusive_or(X, Y) -> - erlang:'bxor'(X, Y). - --spec bitwise_shift_left(integer(), integer()) -> integer(). -bitwise_shift_left(X, Y) -> - erlang:'bsl'(X, Y). - --spec bitwise_shift_right(integer(), integer()) -> integer(). -bitwise_shift_right(X, Y) -> - erlang:'bsr'(X, Y). diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.cache deleted file mode 100644 index a248facf950de1e8633a0d95d6f513d9bbf9f9f3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2850 zcmdT`OK%%h6ux&JevE3RS5bqCD)}^7;DnIi2|_4}>?Tr6h$zi4k&uWgd(7MIIfOK0fzx&i&5!ow;ux zYqv_|+6K8KkXfA@%x;L5vVmb|+(K!ViPqEp4@-k-LwbEv!!x zY`a%6H#{wMeT^G;b=&<==f*j+ccVVV!ziphaQj!%2}F77005V0^q*tw$VP8XX5TL@u{5UDOY4NXVLG58ac>N2U?q*`vf zjIY_P%iK5B(6kyVe-wlxzlkv+sRQC?pRDkwbvB6BL3Ns@aeC>@BJL*UAA(<7H8f%_ z69cz184jVPUiC?}uF_W7u3yUb#xPr~AzgfB3byl%?^xR)&v3K$*A=yciabCbHU$V7 z*dBcDg*gQlL&m(w_fj8ZqR_~g&#hTF4ru7}DP?&Y zQ6Ib=MpNifu|gi6`?44U2A_Em_d}j>PY^*8Bs2^nnu)z;X5jXb*H1#q|8%=u3AF_+ zkf(1_v@hPGTktB@=5j_-T7SkAK4EMjV;6c1F)QlvetbGzE=e1W{uz*WXl&-As`p*2_tjm?- zLdkZRk`?2!dO8SJh|RS^Y~q|HITMHfU{iuC0(8jp1T;rDo`C9FA{XZ~<;R;c_T8N^O`73IVFBbRti)6-FH_kOO zE>+vk4FS$Rd5=G>x-5l4W^}>(m&?wV`1|uNgmivG8`4;e9E=YIX(LH)M42>uO0#lR*2 diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.cache_meta b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.cache_meta deleted file mode 100644 index 11d9234d73009d887f340b6abde09bf038446b22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49 ocmaD+eJF(i3K$uo3?3+*o|BrGt6yAFl$n=qansB9uK$<60MaT9DF6Tf diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.erl b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.erl deleted file mode 100644 index 7abe3bd..0000000 --- a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.erl +++ /dev/null @@ -1,27 +0,0 @@ --module(gleam@io). --compile([no_auto_import, nowarn_unused_vars]). - --export([print/1, print_error/1, println/1, println_error/1, debug/1]). - --spec print(binary()) -> nil. -print(String) -> - gleam_stdlib:print(String). - --spec print_error(binary()) -> nil. -print_error(String) -> - gleam_stdlib:print_error(String). - --spec println(binary()) -> nil. -println(String) -> - gleam_stdlib:println(String). - --spec println_error(binary()) -> nil. -println_error(String) -> - gleam_stdlib:println_error(String). - --spec debug(EQJ) -> EQJ. -debug(Term) -> - _pipe = Term, - _pipe@1 = gleam@string:inspect(_pipe), - gleam_stdlib:println_error(_pipe@1), - Term. diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@iterator.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@iterator.cache deleted file mode 100644 index beed4df9045b77f34a9e9aea125da496ef675879..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36557 zcmd6QeQX@(ncvPVsg>4}snJSGEL-N7vTSNiiR4m}En1c=>cbXKwzQ&R+LUGPk{nVi zEqCetkVGYpY$XL8UsCu4{}H$;>ZWO9xIu9Ug2TaZQ8!83gL~)&uF)3mq2~rp5x8!9 zaD8oH1Ym#9^M34n?Q(}Fp*B3LUCzuq@5l2#&+qx1d*U5EtJlZxUG?ZHYtvQhp7Ei7 zWj@xKdSzGKT6ZBe)gND)D?0i4{z5Hw(5d8W<%;;jWVIISnkg2h4sA58?Zer7jkxul z(d>8e&);OSpBwSiOGbL^MFU^fnG<8{O(TBr&~&X(F2!Qm^=8~U+HVUtS)#B->%e4Ko&3|1KS`iH^l$F~i`tk2h_5)LM7dvijZkG2;&(U`rMjXxies_)4oCP_A=FdorXYj?%9?`*%=+uwU zzn8`eSDhIQCKlJjX+B#Ma<<$z1s}=lVXV^Ag>Q#X8D{G5o2SR#z(7;~JU%h@ZX910 zJ2PWfI`QReiQ%y`34EDfJu+5YjW6F>lOB6{4Zi%3WP0q=B)%AHN5?wW;!DObQlmKD zUuC3zjbp=YMydzLhqoK4PjF16j8p}Oxf$nhOl&by7jXRWZX@+m9KY^1QeWVBYnzdJ z569GfxE{yrY5Wbx=q}tt#~}WWq`Y5gcznj`KL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0)&jtW0$|zfn83| zY(C_WH<7C_0#rW1mS%I!W&)7!w4a} zqsT_Z8!QKigMoX3$rG80XiSm*1pwmOh2GZ)iq~3_!3J(#9hl;8K}MKRG!`eY(Rr77 zhdjV7xO1O+5hkRC%1mob@l-xIkFlVxFh_>)XsF}W+746|Rt`-v2GS<5iScT-tp7sm zPCsOf=U^C|;SqWKwAxI_EZWQZU4f&baS_KtygUhl`!`=T?jTK#YtLz}G`8B0X>N*_ zWmfMke8b+FlW3(yAw9mNY2W~w;r*4#z9Z=Fx1hUpQj8{q@J@?YO5YELoqGcHBQEx# z@OD*)@$5j3p&Rfl9d4nhtv)` zF9qQU=lehqQqhIYG)mr-nKGC3$7_C}<4nPnE$AM5K}cuX6(rhb!BmATTWI**hKXMuKu^#r}psV(%S!&)8%lf8WC zF4NkRw)Skc4rQ!Eo2~4G^|iaL!mw4?Y%Qj(#m&~=8MVH1yY)xI)*o%=$61|e{Lk?( z{Q9qM?9$RjtMfEW2kv|fRr$faldUx)+{s~8CxI&n%N=|0&@|O~b4xKcO&@d;kCd diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@iterator.cache_meta b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@iterator.cache_meta deleted file mode 100644 index 926611b8ad869a75a469738c939faf38b10b4701..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 140 zcmY#5_BDk83K-d-3?3+*o|BrGt6!8_T$)qDi6WMnSHguNkds-ArX)A90M(rQf|AVq WJZ=_8%(% diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@iterator.erl b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@iterator.erl deleted file mode 100644 index 9fa515d..0000000 --- a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@iterator.erl +++ /dev/null @@ -1,715 +0,0 @@ --module(gleam@iterator). --compile([no_auto_import, nowarn_unused_vars]). - --export([unfold/2, repeatedly/1, repeat/1, from_list/1, transform/3, fold/3, run/1, to_list/1, step/1, take/2, drop/2, map/2, append/2, flatten/1, concat/1, flat_map/2, filter/2, cycle/1, find/2, index/1, iterate/2, take_while/2, drop_while/2, scan/3, zip/2, chunk/2, sized_chunk/2, intersperse/2, any/2, all/2, group/2, reduce/2, last/1, empty/0, once/1, range/2, single/1, interleave/2, fold_until/3, try_fold/3, first/1, at/2, length/1, each/2, yield/2]). --export_type([action/1, iterator/1, step/2, chunk/2, sized_chunk/1]). - --type action(BZC) :: stop | {continue, BZC, fun(() -> action(BZC))}. - --opaque iterator(BZD) :: {iterator, fun(() -> action(BZD))}. - --type step(BZE, BZF) :: {next, BZE, BZF} | done. - --type chunk(BZG, BZH) :: {another_by, - list(BZG), - BZH, - BZG, - fun(() -> action(BZG))} | - {last_by, list(BZG)}. - --type sized_chunk(BZI) :: {another, list(BZI), fun(() -> action(BZI))} | - {last, list(BZI)} | - no_more. - --spec stop() -> action(any()). -stop() -> - stop. - --spec do_unfold(BZL, fun((BZL) -> step(BZM, BZL))) -> fun(() -> action(BZM)). -do_unfold(Initial, F) -> - fun() -> case F(Initial) of - {next, X, Acc} -> - {continue, X, do_unfold(Acc, F)}; - - done -> - stop - end end. - --spec unfold(BZQ, fun((BZQ) -> step(BZR, BZQ))) -> iterator(BZR). -unfold(Initial, F) -> - _pipe = Initial, - _pipe@1 = do_unfold(_pipe, F), - {iterator, _pipe@1}. - --spec repeatedly(fun(() -> BZV)) -> iterator(BZV). -repeatedly(F) -> - unfold(nil, fun(_) -> {next, F(), nil} end). - --spec repeat(BZX) -> iterator(BZX). -repeat(X) -> - repeatedly(fun() -> X end). - --spec from_list(list(BZZ)) -> iterator(BZZ). -from_list(List) -> - Yield = fun(Acc) -> case Acc of - [] -> - done; - - [Head | Tail] -> - {next, Head, Tail} - end end, - unfold(List, Yield). - --spec do_transform( - fun(() -> action(CAC)), - CAE, - fun((CAE, CAC) -> step(CAF, CAE)) -) -> fun(() -> action(CAF)). -do_transform(Continuation, State, F) -> - fun() -> case Continuation() of - stop -> - stop; - - {continue, El, Next} -> - case F(State, El) of - done -> - stop; - - {next, Yield, Next_state} -> - {continue, Yield, do_transform(Next, Next_state, F)} - end - end end. - --spec transform(iterator(CAJ), CAL, fun((CAL, CAJ) -> step(CAM, CAL))) -> iterator(CAM). -transform(Iterator, Initial, F) -> - _pipe = do_transform(erlang:element(2, Iterator), Initial, F), - {iterator, _pipe}. - --spec do_fold(fun(() -> action(CAQ)), fun((CAS, CAQ) -> CAS), CAS) -> CAS. -do_fold(Continuation, F, Accumulator) -> - case Continuation() of - {continue, Elem, Next} -> - do_fold(Next, F, F(Accumulator, Elem)); - - stop -> - Accumulator - end. - --spec fold(iterator(CAT), CAV, fun((CAV, CAT) -> CAV)) -> CAV. -fold(Iterator, Initial, F) -> - _pipe = erlang:element(2, Iterator), - do_fold(_pipe, F, Initial). - --spec run(iterator(any())) -> nil. -run(Iterator) -> - fold(Iterator, nil, fun(_, _) -> nil end). - --spec to_list(iterator(CAY)) -> list(CAY). -to_list(Iterator) -> - _pipe = Iterator, - _pipe@1 = fold(_pipe, [], fun(Acc, E) -> [E | Acc] end), - gleam@list:reverse(_pipe@1). - --spec step(iterator(CBB)) -> step(CBB, iterator(CBB)). -step(Iterator) -> - case (erlang:element(2, Iterator))() of - stop -> - done; - - {continue, E, A} -> - {next, E, {iterator, A}} - end. - --spec do_take(fun(() -> action(CBG)), integer()) -> fun(() -> action(CBG)). -do_take(Continuation, Desired) -> - fun() -> case Desired > 0 of - false -> - stop; - - true -> - case Continuation() of - stop -> - stop; - - {continue, E, Next} -> - {continue, E, do_take(Next, Desired - 1)} - end - end end. - --spec take(iterator(CBJ), integer()) -> iterator(CBJ). -take(Iterator, Desired) -> - _pipe = erlang:element(2, Iterator), - _pipe@1 = do_take(_pipe, Desired), - {iterator, _pipe@1}. - --spec do_drop(fun(() -> action(CBM)), integer()) -> action(CBM). -do_drop(Continuation, Desired) -> - case Continuation() of - stop -> - stop; - - {continue, E, Next} -> - case Desired > 0 of - true -> - do_drop(Next, Desired - 1); - - false -> - {continue, E, Next} - end - end. - --spec drop(iterator(CBP), integer()) -> iterator(CBP). -drop(Iterator, Desired) -> - _pipe = fun() -> do_drop(erlang:element(2, Iterator), Desired) end, - {iterator, _pipe}. - --spec do_map(fun(() -> action(CBS)), fun((CBS) -> CBU)) -> fun(() -> action(CBU)). -do_map(Continuation, F) -> - fun() -> case Continuation() of - stop -> - stop; - - {continue, E, Continuation@1} -> - {continue, F(E), do_map(Continuation@1, F)} - end end. - --spec map(iterator(CBW), fun((CBW) -> CBY)) -> iterator(CBY). -map(Iterator, F) -> - _pipe = erlang:element(2, Iterator), - _pipe@1 = do_map(_pipe, F), - {iterator, _pipe@1}. - --spec do_append(fun(() -> action(CCA)), fun(() -> action(CCA))) -> action(CCA). -do_append(First, Second) -> - case First() of - {continue, E, First@1} -> - {continue, E, fun() -> do_append(First@1, Second) end}; - - stop -> - Second() - end. - --spec append(iterator(CCE), iterator(CCE)) -> iterator(CCE). -append(First, Second) -> - _pipe = fun() -> - do_append(erlang:element(2, First), erlang:element(2, Second)) - end, - {iterator, _pipe}. - --spec do_flatten(fun(() -> action(iterator(CCI)))) -> action(CCI). -do_flatten(Flattened) -> - case Flattened() of - stop -> - stop; - - {continue, It, Next_iterator} -> - do_append( - erlang:element(2, It), - fun() -> do_flatten(Next_iterator) end - ) - end. - --spec flatten(iterator(iterator(CCM))) -> iterator(CCM). -flatten(Iterator) -> - _pipe = fun() -> do_flatten(erlang:element(2, Iterator)) end, - {iterator, _pipe}. - --spec concat(list(iterator(CCQ))) -> iterator(CCQ). -concat(Iterators) -> - flatten(from_list(Iterators)). - --spec flat_map(iterator(CCU), fun((CCU) -> iterator(CCW))) -> iterator(CCW). -flat_map(Iterator, F) -> - _pipe = Iterator, - _pipe@1 = map(_pipe, F), - flatten(_pipe@1). - --spec do_filter(fun(() -> action(CCZ)), fun((CCZ) -> boolean())) -> action(CCZ). -do_filter(Continuation, Predicate) -> - case Continuation() of - stop -> - stop; - - {continue, E, Iterator} -> - case Predicate(E) of - true -> - {continue, E, fun() -> do_filter(Iterator, Predicate) end}; - - false -> - do_filter(Iterator, Predicate) - end - end. - --spec filter(iterator(CDC), fun((CDC) -> boolean())) -> iterator(CDC). -filter(Iterator, Predicate) -> - _pipe = fun() -> do_filter(erlang:element(2, Iterator), Predicate) end, - {iterator, _pipe}. - --spec cycle(iterator(CDF)) -> iterator(CDF). -cycle(Iterator) -> - _pipe = repeat(Iterator), - flatten(_pipe). - --spec do_find(fun(() -> action(CDJ)), fun((CDJ) -> boolean())) -> {ok, CDJ} | - {error, nil}. -do_find(Continuation, F) -> - case Continuation() of - stop -> - {error, nil}; - - {continue, E, Next} -> - case F(E) of - true -> - {ok, E}; - - false -> - do_find(Next, F) - end - end. - --spec find(iterator(CDN), fun((CDN) -> boolean())) -> {ok, CDN} | {error, nil}. -find(Haystack, Is_desired) -> - _pipe = erlang:element(2, Haystack), - do_find(_pipe, Is_desired). - --spec do_index(fun(() -> action(CDR)), integer()) -> fun(() -> action({integer(), - CDR})). -do_index(Continuation, Next) -> - fun() -> case Continuation() of - stop -> - stop; - - {continue, E, Continuation@1} -> - {continue, {Next, E}, do_index(Continuation@1, Next + 1)} - end end. - --spec index(iterator(CDU)) -> iterator({integer(), CDU}). -index(Iterator) -> - _pipe = erlang:element(2, Iterator), - _pipe@1 = do_index(_pipe, 0), - {iterator, _pipe@1}. - --spec iterate(CDX, fun((CDX) -> CDX)) -> iterator(CDX). -iterate(Initial, F) -> - unfold(Initial, fun(Element) -> {next, Element, F(Element)} end). - --spec do_take_while(fun(() -> action(CDZ)), fun((CDZ) -> boolean())) -> fun(() -> action(CDZ)). -do_take_while(Continuation, Predicate) -> - fun() -> case Continuation() of - stop -> - stop; - - {continue, E, Next} -> - case Predicate(E) of - false -> - stop; - - true -> - {continue, E, do_take_while(Next, Predicate)} - end - end end. - --spec take_while(iterator(CEC), fun((CEC) -> boolean())) -> iterator(CEC). -take_while(Iterator, Predicate) -> - _pipe = erlang:element(2, Iterator), - _pipe@1 = do_take_while(_pipe, Predicate), - {iterator, _pipe@1}. - --spec do_drop_while(fun(() -> action(CEF)), fun((CEF) -> boolean())) -> action(CEF). -do_drop_while(Continuation, Predicate) -> - case Continuation() of - stop -> - stop; - - {continue, E, Next} -> - case Predicate(E) of - false -> - {continue, E, Next}; - - true -> - do_drop_while(Next, Predicate) - end - end. - --spec drop_while(iterator(CEI), fun((CEI) -> boolean())) -> iterator(CEI). -drop_while(Iterator, Predicate) -> - _pipe = fun() -> do_drop_while(erlang:element(2, Iterator), Predicate) end, - {iterator, _pipe}. - --spec do_scan(fun(() -> action(CEL)), fun((CEN, CEL) -> CEN), CEN) -> fun(() -> action(CEN)). -do_scan(Continuation, F, Accumulator) -> - fun() -> case Continuation() of - stop -> - stop; - - {continue, El, Next} -> - Accumulated = F(Accumulator, El), - {continue, Accumulated, do_scan(Next, F, Accumulated)} - end end. - --spec scan(iterator(CEP), CER, fun((CER, CEP) -> CER)) -> iterator(CER). -scan(Iterator, Initial, F) -> - _pipe = erlang:element(2, Iterator), - _pipe@1 = do_scan(_pipe, F, Initial), - {iterator, _pipe@1}. - --spec do_zip(fun(() -> action(CET)), fun(() -> action(CEV))) -> fun(() -> action({CET, - CEV})). -do_zip(Left, Right) -> - fun() -> case Left() of - stop -> - stop; - - {continue, El_left, Next_left} -> - case Right() of - stop -> - stop; - - {continue, El_right, Next_right} -> - {continue, - {El_left, El_right}, - do_zip(Next_left, Next_right)} - end - end end. - --spec zip(iterator(CEY), iterator(CFA)) -> iterator({CEY, CFA}). -zip(Left, Right) -> - _pipe = do_zip(erlang:element(2, Left), erlang:element(2, Right)), - {iterator, _pipe}. - --spec next_chunk(fun(() -> action(CFD)), fun((CFD) -> CFF), CFF, list(CFD)) -> chunk(CFD, CFF). -next_chunk(Continuation, F, Previous_key, Current_chunk) -> - case Continuation() of - stop -> - {last_by, gleam@list:reverse(Current_chunk)}; - - {continue, E, Next} -> - Key = F(E), - case Key =:= Previous_key of - true -> - next_chunk(Next, F, Key, [E | Current_chunk]); - - false -> - {another_by, - gleam@list:reverse(Current_chunk), - Key, - E, - Next} - end - end. - --spec do_chunk(fun(() -> action(CFJ)), fun((CFJ) -> CFL), CFL, CFJ) -> action(list(CFJ)). -do_chunk(Continuation, F, Previous_key, Previous_element) -> - case next_chunk(Continuation, F, Previous_key, [Previous_element]) of - {last_by, Chunk} -> - {continue, Chunk, fun stop/0}; - - {another_by, Chunk@1, Key, El, Next} -> - {continue, Chunk@1, fun() -> do_chunk(Next, F, Key, El) end} - end. - --spec chunk(iterator(CFO), fun((CFO) -> any())) -> iterator(list(CFO)). -chunk(Iterator, F) -> - _pipe = fun() -> case (erlang:element(2, Iterator))() of - stop -> - stop; - - {continue, E, Next} -> - do_chunk(Next, F, F(E), E) - end end, - {iterator, _pipe}. - --spec next_sized_chunk(fun(() -> action(CFT)), integer(), list(CFT)) -> sized_chunk(CFT). -next_sized_chunk(Continuation, Left, Current_chunk) -> - case Continuation() of - stop -> - case Current_chunk of - [] -> - no_more; - - Remaining -> - {last, gleam@list:reverse(Remaining)} - end; - - {continue, E, Next} -> - Chunk = [E | Current_chunk], - case Left > 1 of - false -> - {another, gleam@list:reverse(Chunk), Next}; - - true -> - next_sized_chunk(Next, Left - 1, Chunk) - end - end. - --spec do_sized_chunk(fun(() -> action(CFX)), integer()) -> fun(() -> action(list(CFX))). -do_sized_chunk(Continuation, Count) -> - fun() -> case next_sized_chunk(Continuation, Count, []) of - no_more -> - stop; - - {last, Chunk} -> - {continue, Chunk, fun stop/0}; - - {another, Chunk@1, Next_element} -> - {continue, Chunk@1, do_sized_chunk(Next_element, Count)} - end end. - --spec sized_chunk(iterator(CGB), integer()) -> iterator(list(CGB)). -sized_chunk(Iterator, Count) -> - _pipe = erlang:element(2, Iterator), - _pipe@1 = do_sized_chunk(_pipe, Count), - {iterator, _pipe@1}. - --spec do_intersperse(fun(() -> action(CGF)), CGF) -> action(CGF). -do_intersperse(Continuation, Separator) -> - case Continuation() of - stop -> - stop; - - {continue, E, Next} -> - Next_interspersed = fun() -> do_intersperse(Next, Separator) end, - {continue, Separator, fun() -> {continue, E, Next_interspersed} end} - end. - --spec intersperse(iterator(CGI), CGI) -> iterator(CGI). -intersperse(Iterator, Elem) -> - _pipe = fun() -> case (erlang:element(2, Iterator))() of - stop -> - stop; - - {continue, E, Next} -> - {continue, E, fun() -> do_intersperse(Next, Elem) end} - end end, - {iterator, _pipe}. - --spec do_any(fun(() -> action(CGL)), fun((CGL) -> boolean())) -> boolean(). -do_any(Continuation, Predicate) -> - case Continuation() of - stop -> - false; - - {continue, E, Next} -> - case Predicate(E) of - true -> - true; - - false -> - do_any(Next, Predicate) - end - end. - --spec any(iterator(CGN), fun((CGN) -> boolean())) -> boolean(). -any(Iterator, Predicate) -> - _pipe = erlang:element(2, Iterator), - do_any(_pipe, Predicate). - --spec do_all(fun(() -> action(CGP)), fun((CGP) -> boolean())) -> boolean(). -do_all(Continuation, Predicate) -> - case Continuation() of - stop -> - true; - - {continue, E, Next} -> - case Predicate(E) of - true -> - do_all(Next, Predicate); - - false -> - false - end - end. - --spec all(iterator(CGR), fun((CGR) -> boolean())) -> boolean(). -all(Iterator, Predicate) -> - _pipe = erlang:element(2, Iterator), - do_all(_pipe, Predicate). - --spec update_group_with(CGT) -> fun((gleam@option:option(list(CGT))) -> list(CGT)). -update_group_with(El) -> - fun(Maybe_group) -> case Maybe_group of - {some, Group} -> - [El | Group]; - - none -> - [El] - end end. - --spec group_updater(fun((CGX) -> CGY)) -> fun((gleam@map:map_(CGY, list(CGX)), CGX) -> gleam@map:map_(CGY, list(CGX))). -group_updater(F) -> - fun(Groups, Elem) -> _pipe = Groups, - gleam@map:update(_pipe, F(Elem), update_group_with(Elem)) end. - --spec group(iterator(CHF), fun((CHF) -> CHH)) -> gleam@map:map_(CHH, list(CHF)). -group(Iterator, Key) -> - _pipe = Iterator, - _pipe@1 = fold(_pipe, gleam@map:new(), group_updater(Key)), - gleam@map:map_values( - _pipe@1, - fun(_, Group) -> gleam@list:reverse(Group) end - ). - --spec reduce(iterator(CHL), fun((CHL, CHL) -> CHL)) -> {ok, CHL} | {error, nil}. -reduce(Iterator, F) -> - case (erlang:element(2, Iterator))() of - stop -> - {error, nil}; - - {continue, E, Next} -> - _pipe = do_fold(Next, F, E), - {ok, _pipe} - end. - --spec last(iterator(CHP)) -> {ok, CHP} | {error, nil}. -last(Iterator) -> - _pipe = Iterator, - reduce(_pipe, fun(_, Elem) -> Elem end). - --spec empty() -> iterator(any()). -empty() -> - {iterator, fun stop/0}. - --spec once(fun(() -> CHV)) -> iterator(CHV). -once(F) -> - _pipe = fun() -> {continue, F(), fun stop/0} end, - {iterator, _pipe}. - --spec range(integer(), integer()) -> iterator(integer()). -range(Start, Stop) -> - case gleam@int:compare(Start, Stop) of - eq -> - once(fun() -> Start end); - - gt -> - unfold(Start, fun(Current) -> case Current < Stop of - false -> - {next, Current, Current - 1}; - - true -> - done - end end); - - lt -> - unfold(Start, fun(Current@1) -> case Current@1 > Stop of - false -> - {next, Current@1, Current@1 + 1}; - - true -> - done - end end) - end. - --spec single(CHX) -> iterator(CHX). -single(Elem) -> - once(fun() -> Elem end). - --spec do_interleave(fun(() -> action(CHZ)), fun(() -> action(CHZ))) -> action(CHZ). -do_interleave(Current, Next) -> - case Current() of - stop -> - Next(); - - {continue, E, Next_other} -> - {continue, E, fun() -> do_interleave(Next, Next_other) end} - end. - --spec interleave(iterator(CID), iterator(CID)) -> iterator(CID). -interleave(Left, Right) -> - _pipe = fun() -> - do_interleave(erlang:element(2, Left), erlang:element(2, Right)) - end, - {iterator, _pipe}. - --spec do_fold_until( - fun(() -> action(CIH)), - fun((CIJ, CIH) -> gleam@list:continue_or_stop(CIJ)), - CIJ -) -> CIJ. -do_fold_until(Continuation, F, Accumulator) -> - case Continuation() of - stop -> - Accumulator; - - {continue, Elem, Next} -> - case F(Accumulator, Elem) of - {continue, Accumulator@1} -> - do_fold_until(Next, F, Accumulator@1); - - {stop, Accumulator@2} -> - Accumulator@2 - end - end. - --spec fold_until( - iterator(CIL), - CIN, - fun((CIN, CIL) -> gleam@list:continue_or_stop(CIN)) -) -> CIN. -fold_until(Iterator, Initial, F) -> - _pipe = erlang:element(2, Iterator), - do_fold_until(_pipe, F, Initial). - --spec do_try_fold( - fun(() -> action(CIP)), - fun((CIR, CIP) -> {ok, CIR} | {error, CIS}), - CIR -) -> {ok, CIR} | {error, CIS}. -do_try_fold(Continuation, F, Accumulator) -> - case Continuation() of - stop -> - {ok, Accumulator}; - - {continue, Elem, Next} -> - gleam@result:'try'( - F(Accumulator, Elem), - fun(Accumulator@1) -> do_try_fold(Next, F, Accumulator@1) end - ) - end. - --spec try_fold(iterator(CIX), CIZ, fun((CIZ, CIX) -> {ok, CIZ} | {error, CJA})) -> {ok, - CIZ} | - {error, CJA}. -try_fold(Iterator, Initial, F) -> - _pipe = erlang:element(2, Iterator), - do_try_fold(_pipe, F, Initial). - --spec first(iterator(CJF)) -> {ok, CJF} | {error, nil}. -first(Iterator) -> - case (erlang:element(2, Iterator))() of - stop -> - {error, nil}; - - {continue, E, _} -> - {ok, E} - end. - --spec at(iterator(CJJ), integer()) -> {ok, CJJ} | {error, nil}. -at(Iterator, Index) -> - _pipe = Iterator, - _pipe@1 = drop(_pipe, Index), - first(_pipe@1). - --spec do_length(fun(() -> action(any())), integer()) -> integer(). -do_length(Continuation, Length) -> - case Continuation() of - stop -> - Length; - - {continue, _, Next} -> - do_length(Next, Length + 1) - end. - --spec length(iterator(any())) -> integer(). -length(Iterator) -> - _pipe = erlang:element(2, Iterator), - do_length(_pipe, 0). - --spec each(iterator(CJR), fun((CJR) -> any())) -> nil. -each(Iterator, F) -> - _pipe = Iterator, - _pipe@1 = map(_pipe, F), - run(_pipe@1). - --spec yield(CJU, fun(() -> iterator(CJU))) -> iterator(CJU). -yield(Element, Next) -> - {iterator, fun() -> {continue, Element, erlang:element(2, Next())} end}. diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.cache deleted file mode 100644 index fb73b70e0c89dd08e3a141c8631b34591426f9fa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 45630 zcmd6Q4RBo5z2Dwl%d%w)`Lft?434fB2+|_U(#i&-_yfeJ^)PrPI|3O;T4}GWwO6}h zKP<~Y41~M@k0gZ9CZ+U|@X|nd$s|KFos?$gCG>TgNi!4TdGngmc3zrE`%)$|FQJ(} zhIv!<_y3=B?!D)JNytuHhAZ#xz31HX@jw6n@Bekqj?|jWx=pDkH{HC}+&pgXxUTWxH4v0R$EWnI#2KbPNRq|E%e{81yd zbhlkO*_b_CN*t`u6&lmChLPWtOqqLHO=DcEDPfrF&zbGxrr8=Oq&;{fnZo}|w^l2S zQl)7p4&GZEZB*xF#fNr9SG+4wNUJ!%CYdsliIn>H))$RrdQWO9S9xboOhyD$@(Y_7%@Vkv8qrcyX5Bo108r^ppK78x4 zsq~wMfq!%9_gjqgV4IO1$MwQSBmFwAH#QmR3%D-7!boRvWwziMTy5L%9oHLI8R@ri zjdvR9Q@CEv;5S^aU2CM@#PxI*zu{`@HPYK~y+44ucH{F6D39y?z4(5UksjHH^0?mL zk7o}U=^Xkvge$o=ncjx$m+O=1_i>%tkW4?0>*bDQ`gL5dU7k$8iK}f(5^clxt;zHo zxTda5rfaw|A4#SMaXoG&(=Xr}ye63*#x;H&>caI}H_GGsWp6V5F0NcZ-ivEwH_GFB z`-Wut9l8ebeq4hGa1U4JR(!_w^zCR1u93S?AFlC3_!n35Fxrjl^&_Ys*9*t+E?mR+ zp>4R{IG#*j!1e9~o}EOQX|xg7;4GfO_3|8^!IgY4nZ6v?xf*`Mm20AXxL!Y#O#c|y z&^f#tSN1$UpHG?>Qsz6U^tMzgoy9e@HkBU7_4@i$`b}K#Z%m~xZ%?I@oA58L$J43w z3%D{{Q|UomuU(l+{}@;1BdK%_*M%La^e=I>eH6dpx{$?pTrcdzv$)>q!*959yYVh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/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.cache_meta b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.cache_meta deleted file mode 100644 index d132e2ad150900c81601f90cff5e3ef43e18d2c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 119 zcmY#5_BDk83K&_T3{EJWo|BrGtDl)y!i^%3mXn`|CX`>4l3K)tqN*S integer(). -length(List) -> - erlang:length(List). - --spec reverse(list(UI)) -> list(UI). -reverse(Xs) -> - lists:reverse(Xs). - --spec is_empty(list(any())) -> boolean(). -is_empty(List) -> - List =:= []. - --spec contains(list(UQ), UQ) -> boolean(). -contains(List, Elem) -> - case List of - [] -> - false; - - [First | _] when First =:= Elem -> - true; - - [_ | Rest] -> - contains(Rest, Elem) - end. - --spec first(list(US)) -> {ok, US} | {error, nil}. -first(List) -> - case List of - [] -> - {error, nil}; - - [X | _] -> - {ok, X} - end. - --spec rest(list(UW)) -> {ok, list(UW)} | {error, nil}. -rest(List) -> - case List of - [] -> - {error, nil}; - - [_ | Xs] -> - {ok, Xs} - end. - --spec do_filter(list(VP), fun((VP) -> boolean()), list(VP)) -> list(VP). -do_filter(List, Fun, Acc) -> - case List of - [] -> - reverse(Acc); - - [X | Xs] -> - New_acc = case Fun(X) of - true -> - [X | Acc]; - - false -> - Acc - end, - do_filter(Xs, Fun, New_acc) - end. - --spec filter(list(VT), fun((VT) -> boolean())) -> list(VT). -filter(List, Predicate) -> - do_filter(List, Predicate, []). - --spec do_filter_map(list(VW), fun((VW) -> {ok, VY} | {error, any()}), list(VY)) -> list(VY). -do_filter_map(List, Fun, Acc) -> - case List of - [] -> - reverse(Acc); - - [X | Xs] -> - New_acc = case Fun(X) of - {ok, X@1} -> - [X@1 | Acc]; - - {error, _} -> - Acc - end, - do_filter_map(Xs, Fun, New_acc) - end. - --spec filter_map(list(WE), fun((WE) -> {ok, WG} | {error, any()})) -> list(WG). -filter_map(List, Fun) -> - do_filter_map(List, Fun, []). - --spec do_map(list(WL), fun((WL) -> WN), list(WN)) -> list(WN). -do_map(List, Fun, Acc) -> - case List of - [] -> - reverse(Acc); - - [X | Xs] -> - do_map(Xs, Fun, [Fun(X) | Acc]) - end. - --spec map(list(WQ), fun((WQ) -> WS)) -> list(WS). -map(List, Fun) -> - do_map(List, Fun, []). - --spec update_group(fun((VB) -> VC)) -> fun((gleam@map:map_(VC, list(VB)), VB) -> gleam@map:map_(VC, list(VB))). -update_group(F) -> - fun(Groups, Elem) -> case gleam@map:get(Groups, F(Elem)) of - {ok, Existing} -> - gleam@map:insert(Groups, F(Elem), [Elem | Existing]); - - {error, _} -> - gleam@map:insert(Groups, F(Elem), [Elem]) - end end. - --spec do_map2(list(XA), list(XC), fun((XA, XC) -> XE), list(XE)) -> list(XE). -do_map2(List1, List2, Fun, Acc) -> - case {List1, List2} of - {[], _} -> - reverse(Acc); - - {_, []} -> - reverse(Acc); - - {[A | As_], [B | Bs]} -> - do_map2(As_, Bs, Fun, [Fun(A, B) | Acc]) - end. - --spec map2(list(WU), list(WW), fun((WU, WW) -> WY)) -> list(WY). -map2(List1, List2, Fun) -> - do_map2(List1, List2, Fun, []). - --spec do_index_map(list(XM), fun((integer(), XM) -> XO), integer(), list(XO)) -> list(XO). -do_index_map(List, Fun, Index, Acc) -> - case List of - [] -> - reverse(Acc); - - [X | Xs] -> - Acc@1 = [Fun(Index, X) | Acc], - do_index_map(Xs, Fun, Index + 1, Acc@1) - end. - --spec index_map(list(XR), fun((integer(), XR) -> XT)) -> list(XT). -index_map(List, Fun) -> - do_index_map(List, Fun, 0, []). - --spec do_try_map(list(XV), fun((XV) -> {ok, XX} | {error, XY}), list(XX)) -> {ok, - list(XX)} | - {error, XY}. -do_try_map(List, Fun, Acc) -> - case List of - [] -> - {ok, reverse(Acc)}; - - [X | Xs] -> - case Fun(X) of - {ok, Y} -> - do_try_map(Xs, Fun, [Y | Acc]); - - {error, Error} -> - {error, Error} - end - end. - --spec try_map(list(YF), fun((YF) -> {ok, YH} | {error, YI})) -> {ok, list(YH)} | - {error, YI}. -try_map(List, Fun) -> - do_try_map(List, Fun, []). - --spec drop(list(YO), integer()) -> list(YO). -drop(List, N) -> - case N =< 0 of - true -> - List; - - false -> - case List of - [] -> - []; - - [_ | Xs] -> - drop(Xs, N - 1) - end - end. - --spec do_take(list(YR), integer(), list(YR)) -> list(YR). -do_take(List, N, Acc) -> - case N =< 0 of - true -> - reverse(Acc); - - false -> - case List of - [] -> - reverse(Acc); - - [X | Xs] -> - do_take(Xs, N - 1, [X | Acc]) - end - end. - --spec take(list(YV), integer()) -> list(YV). -take(List, N) -> - do_take(List, N, []). - --spec new() -> list(any()). -new() -> - []. - --spec append(list(AAA), list(AAA)) -> list(AAA). -append(First, Second) -> - lists:append(First, Second). - --spec prepend(list(AAI), AAI) -> list(AAI). -prepend(List, Item) -> - [Item | List]. - --spec reverse_and_prepend(list(AAL), list(AAL)) -> list(AAL). -reverse_and_prepend(Prefix, Suffix) -> - case Prefix of - [] -> - Suffix; - - [First | Rest] -> - reverse_and_prepend(Rest, [First | Suffix]) - end. - --spec do_concat(list(list(AAP)), list(AAP)) -> list(AAP). -do_concat(Lists, Acc) -> - case Lists of - [] -> - reverse(Acc); - - [List | Further_lists] -> - do_concat(Further_lists, reverse_and_prepend(List, Acc)) - end. - --spec concat(list(list(AAU))) -> list(AAU). -concat(Lists) -> - do_concat(Lists, []). - --spec flatten(list(list(AAY))) -> list(AAY). -flatten(Lists) -> - do_concat(Lists, []). - --spec flat_map(list(ABC), fun((ABC) -> list(ABE))) -> list(ABE). -flat_map(List, Fun) -> - _pipe = map(List, Fun), - concat(_pipe). - --spec fold(list(ABH), ABJ, fun((ABJ, ABH) -> ABJ)) -> ABJ. -fold(List, Initial, Fun) -> - case List of - [] -> - Initial; - - [X | Rest] -> - fold(Rest, Fun(Initial, X), Fun) - end. - --spec group(list(VJ), fun((VJ) -> VL)) -> gleam@map:map_(VL, list(VJ)). -group(List, Key) -> - fold(List, gleam@map:new(), update_group(Key)). - --spec map_fold(list(XH), XJ, fun((XJ, XH) -> {XJ, XK})) -> {XJ, list(XK)}. -map_fold(List, Acc, Fun) -> - _pipe = fold( - List, - {Acc, []}, - fun(Acc@1, Item) -> - {Current_acc, Items} = Acc@1, - {Next_acc, Next_item} = Fun(Current_acc, Item), - {Next_acc, [Next_item | Items]} - end - ), - gleam@pair:map_second(_pipe, fun reverse/1). - --spec fold_right(list(ABK), ABM, fun((ABM, ABK) -> ABM)) -> ABM. -fold_right(List, Initial, Fun) -> - case List of - [] -> - Initial; - - [X | Rest] -> - Fun(fold_right(Rest, Initial, Fun), X) - end. - --spec do_index_fold( - list(ABN), - ABP, - fun((ABP, ABN, integer()) -> ABP), - integer() -) -> ABP. -do_index_fold(Over, Acc, With, Index) -> - case Over of - [] -> - Acc; - - [First | Rest] -> - do_index_fold(Rest, With(Acc, First, Index), With, Index + 1) - end. - --spec index_fold(list(ABQ), ABS, fun((ABS, ABQ, integer()) -> ABS)) -> ABS. -index_fold(Over, Initial, Fun) -> - do_index_fold(Over, Initial, Fun, 0). - --spec try_fold(list(ABT), ABV, fun((ABV, ABT) -> {ok, ABV} | {error, ABW})) -> {ok, - ABV} | - {error, ABW}. -try_fold(Collection, Accumulator, Fun) -> - case Collection of - [] -> - {ok, Accumulator}; - - [First | Rest] -> - case Fun(Accumulator, First) of - {ok, Result} -> - try_fold(Rest, Result, Fun); - - {error, _} = Error -> - Error - end - end. - --spec fold_until(list(ACB), ACD, fun((ACD, ACB) -> continue_or_stop(ACD))) -> ACD. -fold_until(Collection, Accumulator, Fun) -> - case Collection of - [] -> - Accumulator; - - [First | Rest] -> - case Fun(Accumulator, First) of - {continue, Next_accumulator} -> - fold_until(Rest, Next_accumulator, Fun); - - {stop, B} -> - B - end - end. - --spec find(list(ACF), fun((ACF) -> boolean())) -> {ok, ACF} | {error, nil}. -find(Haystack, Is_desired) -> - case Haystack of - [] -> - {error, nil}; - - [X | Rest] -> - case Is_desired(X) of - true -> - {ok, X}; - - _ -> - find(Rest, Is_desired) - end - end. - --spec find_map(list(ACJ), fun((ACJ) -> {ok, ACL} | {error, any()})) -> {ok, ACL} | - {error, nil}. -find_map(Haystack, Fun) -> - case Haystack of - [] -> - {error, nil}; - - [X | Rest] -> - case Fun(X) of - {ok, X@1} -> - {ok, X@1}; - - _ -> - find_map(Rest, Fun) - end - end. - --spec all(list(ACR), fun((ACR) -> boolean())) -> boolean(). -all(List, Predicate) -> - case List of - [] -> - true; - - [First | Rest] -> - case Predicate(First) of - true -> - all(Rest, Predicate); - - false -> - false - end - end. - --spec any(list(ACT), fun((ACT) -> boolean())) -> boolean(). -any(List, Predicate) -> - case List of - [] -> - false; - - [First | Rest] -> - case Predicate(First) of - true -> - true; - - false -> - any(Rest, Predicate) - end - end. - --spec do_zip(list(ACV), list(ACX), list({ACV, ACX})) -> list({ACV, ACX}). -do_zip(Xs, Ys, Acc) -> - case {Xs, Ys} of - {[X | Xs@1], [Y | Ys@1]} -> - do_zip(Xs@1, Ys@1, [{X, Y} | Acc]); - - {_, _} -> - reverse(Acc) - end. - --spec zip(list(ADB), list(ADD)) -> list({ADB, ADD}). -zip(List, Other) -> - do_zip(List, Other, []). - --spec strict_zip(list(ADG), list(ADI)) -> {ok, list({ADG, ADI})} | - {error, length_mismatch()}. -strict_zip(List, Other) -> - case length(List) =:= length(Other) of - true -> - {ok, zip(List, Other)}; - - false -> - {error, length_mismatch} - end. - --spec do_unzip(list({ATE, ATF}), list(ATE), list(ATF)) -> {list(ATE), list(ATF)}. -do_unzip(Input, Xs, Ys) -> - case Input of - [] -> - {reverse(Xs), reverse(Ys)}; - - [{X, Y} | Rest] -> - do_unzip(Rest, [X | Xs], [Y | Ys]) - end. - --spec unzip(list({ADR, ADS})) -> {list(ADR), list(ADS)}. -unzip(Input) -> - do_unzip(Input, [], []). - --spec do_intersperse(list(ADW), ADW, list(ADW)) -> list(ADW). -do_intersperse(List, Separator, Acc) -> - case List of - [] -> - reverse(Acc); - - [X | Rest] -> - do_intersperse(Rest, Separator, [X, Separator | Acc]) - end. - --spec intersperse(list(AEA), AEA) -> list(AEA). -intersperse(List, Elem) -> - case List of - [] -> - List; - - [_] -> - List; - - [X | Rest] -> - do_intersperse(Rest, Elem, [X]) - end. - --spec at(list(AED), integer()) -> {ok, AED} | {error, nil}. -at(List, Index) -> - case Index >= 0 of - true -> - _pipe = List, - _pipe@1 = drop(_pipe, Index), - first(_pipe@1); - - false -> - {error, nil} - end. - --spec unique(list(AEH)) -> list(AEH). -unique(List) -> - case List of - [] -> - []; - - [X | Rest] -> - [X | unique(filter(Rest, fun(Y) -> Y /= X end))] - end. - --spec merge_up( - integer(), - integer(), - list(AEK), - list(AEK), - list(AEK), - fun((AEK, AEK) -> gleam@order:order()) -) -> list(AEK). -merge_up(Na, Nb, A, B, Acc, Compare) -> - case {Na, Nb, A, B} of - {0, 0, _, _} -> - Acc; - - {_, 0, [Ax | Ar], _} -> - merge_up(Na - 1, Nb, Ar, B, [Ax | Acc], Compare); - - {0, _, _, [Bx | Br]} -> - merge_up(Na, Nb - 1, A, Br, [Bx | Acc], Compare); - - {_, _, [Ax@1 | Ar@1], [Bx@1 | Br@1]} -> - case Compare(Ax@1, Bx@1) of - gt -> - merge_up(Na, Nb - 1, A, Br@1, [Bx@1 | Acc], Compare); - - _ -> - merge_up(Na - 1, Nb, Ar@1, B, [Ax@1 | Acc], Compare) - end - end. - --spec merge_down( - integer(), - integer(), - list(AEP), - list(AEP), - list(AEP), - fun((AEP, AEP) -> gleam@order:order()) -) -> list(AEP). -merge_down(Na, Nb, A, B, Acc, Compare) -> - case {Na, Nb, A, B} of - {0, 0, _, _} -> - Acc; - - {_, 0, [Ax | Ar], _} -> - merge_down(Na - 1, Nb, Ar, B, [Ax | Acc], Compare); - - {0, _, _, [Bx | Br]} -> - merge_down(Na, Nb - 1, A, Br, [Bx | Acc], Compare); - - {_, _, [Ax@1 | Ar@1], [Bx@1 | Br@1]} -> - case Compare(Bx@1, Ax@1) of - lt -> - merge_down(Na - 1, Nb, Ar@1, B, [Ax@1 | Acc], Compare); - - _ -> - merge_down(Na, Nb - 1, A, Br@1, [Bx@1 | Acc], Compare) - end - end. - --spec merge_sort( - list(AEU), - integer(), - fun((AEU, AEU) -> gleam@order:order()), - boolean() -) -> list(AEU). -merge_sort(L, Ln, Compare, Down) -> - N = Ln div 2, - A = L, - B = drop(L, N), - case Ln < 3 of - true -> - case Down of - true -> - merge_down(N, Ln - N, A, B, [], Compare); - - false -> - merge_up(N, Ln - N, A, B, [], Compare) - end; - - false -> - case Down of - true -> - merge_down( - N, - Ln - N, - merge_sort(A, N, Compare, false), - merge_sort(B, Ln - N, Compare, false), - [], - Compare - ); - - false -> - merge_up( - N, - Ln - N, - merge_sort(A, N, Compare, true), - merge_sort(B, Ln - N, Compare, true), - [], - Compare - ) - end - end. - --spec sort(list(AEX), fun((AEX, AEX) -> gleam@order:order())) -> list(AEX). -sort(List, Compare) -> - merge_sort(List, length(List), Compare, true). - --spec tail_recursive_range(integer(), integer(), list(integer())) -> list(integer()). -tail_recursive_range(Start, Stop, Acc) -> - case gleam@int:compare(Start, Stop) of - eq -> - [Stop | Acc]; - - gt -> - tail_recursive_range(Start, Stop + 1, [Stop | Acc]); - - lt -> - tail_recursive_range(Start, Stop - 1, [Stop | Acc]) - end. - --spec range(integer(), integer()) -> list(integer()). -range(Start, Stop) -> - tail_recursive_range(Start, Stop, []). - --spec do_repeat(AFD, integer(), list(AFD)) -> list(AFD). -do_repeat(A, Times, Acc) -> - case Times =< 0 of - true -> - Acc; - - false -> - do_repeat(A, Times - 1, [A | Acc]) - end. - --spec repeat(AFG, integer()) -> list(AFG). -repeat(A, Times) -> - do_repeat(A, Times, []). - --spec do_split(list(AFI), integer(), list(AFI)) -> {list(AFI), list(AFI)}. -do_split(List, N, Taken) -> - case N =< 0 of - true -> - {reverse(Taken), List}; - - false -> - case List of - [] -> - {reverse(Taken), []}; - - [X | Xs] -> - do_split(Xs, N - 1, [X | Taken]) - end - end. - --spec split(list(AFN), integer()) -> {list(AFN), list(AFN)}. -split(List, Index) -> - do_split(List, Index, []). - --spec do_split_while(list(AFR), fun((AFR) -> boolean()), list(AFR)) -> {list(AFR), - list(AFR)}. -do_split_while(List, F, Acc) -> - case List of - [] -> - {reverse(Acc), []}; - - [X | Xs] -> - case F(X) of - false -> - {reverse(Acc), List}; - - _ -> - do_split_while(Xs, F, [X | Acc]) - end - end. - --spec split_while(list(AFW), fun((AFW) -> boolean())) -> {list(AFW), list(AFW)}. -split_while(List, Predicate) -> - do_split_while(List, Predicate, []). - --spec key_find(list({AGA, AGB}), AGA) -> {ok, AGB} | {error, nil}. -key_find(Keyword_list, Desired_key) -> - find_map( - Keyword_list, - fun(Keyword) -> - {Key, Value} = Keyword, - case Key =:= Desired_key of - true -> - {ok, Value}; - - false -> - {error, nil} - end - end - ). - --spec do_pop(list(AWO), fun((AWO) -> boolean()), list(AWO)) -> {ok, - {AWO, list(AWO)}} | - {error, nil}. -do_pop(Haystack, Predicate, Checked) -> - case Haystack of - [] -> - {error, nil}; - - [X | Rest] -> - case Predicate(X) of - true -> - {ok, {X, append(reverse(Checked), Rest)}}; - - false -> - do_pop(Rest, Predicate, [X | Checked]) - end - end. - --spec pop(list(AGJ), fun((AGJ) -> boolean())) -> {ok, {AGJ, list(AGJ)}} | - {error, nil}. -pop(Haystack, Is_desired) -> - do_pop(Haystack, Is_desired, []). - --spec do_pop_map(list(AXC), fun((AXC) -> {ok, AXP} | {error, any()}), list(AXC)) -> {ok, - {AXP, list(AXC)}} | - {error, nil}. -do_pop_map(Haystack, Mapper, Checked) -> - case Haystack of - [] -> - {error, nil}; - - [X | Rest] -> - case Mapper(X) of - {ok, Y} -> - {ok, {Y, append(reverse(Checked), Rest)}}; - - {error, _} -> - do_pop_map(Rest, Mapper, [X | Checked]) - end - end. - --spec pop_map(list(AGS), fun((AGS) -> {ok, AGU} | {error, any()})) -> {ok, - {AGU, list(AGS)}} | - {error, nil}. -pop_map(Haystack, Is_desired) -> - do_pop_map(Haystack, Is_desired, []). - --spec key_pop(list({AHB, AHC}), AHB) -> {ok, {AHC, list({AHB, AHC})}} | - {error, nil}. -key_pop(Haystack, Key) -> - pop_map( - Haystack, - fun(Entry) -> - {K, V} = Entry, - case K of - K@1 when K@1 =:= Key -> - {ok, V}; - - _ -> - {error, nil} - end - end - ). - --spec key_set(list({AHH, AHI}), AHH, AHI) -> list({AHH, AHI}). -key_set(List, Key, Value) -> - case List of - [] -> - [{Key, Value}]; - - [{K, _} | Rest] when K =:= Key -> - [{Key, Value} | Rest]; - - [First | Rest@1] -> - [First | key_set(Rest@1, Key, Value)] - end. - --spec each(list(AHL), fun((AHL) -> any())) -> nil. -each(List, F) -> - case List of - [] -> - nil; - - [X | Xs] -> - F(X), - each(Xs, F) - end. - --spec try_each(list(AHO), fun((AHO) -> {ok, any()} | {error, AHR})) -> {ok, nil} | - {error, AHR}. -try_each(List, Fun) -> - case List of - [] -> - {ok, nil}; - - [X | Xs] -> - case Fun(X) of - {ok, _} -> - try_each(Xs, Fun); - - {error, E} -> - {error, E} - end - end. - --spec do_partition(list(AYW), fun((AYW) -> boolean()), list(AYW), list(AYW)) -> {list(AYW), - list(AYW)}. -do_partition(List, Categorise, Trues, Falses) -> - case List of - [] -> - {reverse(Trues), reverse(Falses)}; - - [X | Xs] -> - case Categorise(X) of - true -> - do_partition(Xs, Categorise, [X | Trues], Falses); - - false -> - do_partition(Xs, Categorise, Trues, [X | Falses]) - end - end. - --spec partition(list(AIB), fun((AIB) -> boolean())) -> {list(AIB), list(AIB)}. -partition(List, Categorise) -> - do_partition(List, Categorise, [], []). - --spec permutations(list(AIF)) -> list(list(AIF)). -permutations(L) -> - case L of - [] -> - [[]]; - - _ -> - _pipe = L, - _pipe@5 = index_map(_pipe, fun(I_idx, I) -> _pipe@1 = L, - _pipe@2 = index_fold( - _pipe@1, - [], - fun(Acc, J, J_idx) -> case I_idx =:= J_idx of - true -> - Acc; - - false -> - [J | Acc] - end end - ), - _pipe@3 = reverse(_pipe@2), - _pipe@4 = permutations(_pipe@3), - map(_pipe@4, fun(Permutation) -> [I | Permutation] end) end), - concat(_pipe@5) - end. - --spec do_window(list(list(AIJ)), list(AIJ), integer()) -> list(list(AIJ)). -do_window(Acc, L, N) -> - Window = take(L, N), - case length(Window) =:= N of - true -> - do_window([Window | Acc], drop(L, 1), N); - - false -> - Acc - end. - --spec window(list(AIP), integer()) -> list(list(AIP)). -window(L, N) -> - _pipe = do_window([], L, N), - reverse(_pipe). - --spec window_by_2(list(AIT)) -> list({AIT, AIT}). -window_by_2(L) -> - zip(L, drop(L, 1)). - --spec drop_while(list(AIW), fun((AIW) -> boolean())) -> list(AIW). -drop_while(List, Predicate) -> - case List of - [] -> - []; - - [X | Xs] -> - case Predicate(X) of - true -> - drop_while(Xs, Predicate); - - false -> - [X | Xs] - end - end. - --spec do_take_while(list(AIZ), fun((AIZ) -> boolean()), list(AIZ)) -> list(AIZ). -do_take_while(List, Predicate, Acc) -> - case List of - [] -> - reverse(Acc); - - [First | Rest] -> - case Predicate(First) of - true -> - do_take_while(Rest, Predicate, [First | Acc]); - - false -> - reverse(Acc) - end - end. - --spec take_while(list(AJD), fun((AJD) -> boolean())) -> list(AJD). -take_while(List, Predicate) -> - do_take_while(List, Predicate, []). - --spec do_chunk(list(AJG), fun((AJG) -> AJI), AJI, list(AJG), list(list(AJG))) -> list(list(AJG)). -do_chunk(List, F, Previous_key, Current_chunk, Acc) -> - case List of - [First | Rest] -> - Key = F(First), - case Key =:= Previous_key of - false -> - New_acc = [reverse(Current_chunk) | Acc], - do_chunk(Rest, F, Key, [First], New_acc); - - _ -> - do_chunk(Rest, F, Key, [First | Current_chunk], Acc) - end; - - _ -> - reverse([reverse(Current_chunk) | Acc]) - end. - --spec chunk(list(AJO), fun((AJO) -> any())) -> list(list(AJO)). -chunk(List, F) -> - case List of - [] -> - []; - - [First | Rest] -> - do_chunk(Rest, F, F(First), [First], []) - end. - --spec do_sized_chunk( - list(AJT), - integer(), - integer(), - list(AJT), - list(list(AJT)) -) -> list(list(AJT)). -do_sized_chunk(List, Count, Left, Current_chunk, Acc) -> - case List of - [] -> - case Current_chunk of - [] -> - reverse(Acc); - - Remaining -> - reverse([reverse(Remaining) | Acc]) - end; - - [First | Rest] -> - Chunk = [First | Current_chunk], - case Left > 1 of - false -> - do_sized_chunk( - Rest, - Count, - Count, - [], - [reverse(Chunk) | Acc] - ); - - true -> - do_sized_chunk(Rest, Count, Left - 1, Chunk, Acc) - end - end. - --spec sized_chunk(list(AKA), integer()) -> list(list(AKA)). -sized_chunk(List, Count) -> - do_sized_chunk(List, Count, Count, [], []). - --spec reduce(list(AKE), fun((AKE, AKE) -> AKE)) -> {ok, AKE} | {error, nil}. -reduce(List, Fun) -> - case List of - [] -> - {error, nil}; - - [First | Rest] -> - {ok, fold(Rest, First, Fun)} - end. - --spec do_scan(list(AKI), AKK, list(AKK), fun((AKK, AKI) -> AKK)) -> list(AKK). -do_scan(List, Accumulator, Accumulated, Fun) -> - case List of - [] -> - reverse(Accumulated); - - [X | Xs] -> - Next = Fun(Accumulator, X), - do_scan(Xs, Next, [Next | Accumulated], Fun) - end. - --spec scan(list(AKN), AKP, fun((AKP, AKN) -> AKP)) -> list(AKP). -scan(List, Initial, Fun) -> - do_scan(List, Initial, [], Fun). - --spec last(list(AKR)) -> {ok, AKR} | {error, nil}. -last(List) -> - _pipe = List, - reduce(_pipe, fun(_, Elem) -> Elem end). - --spec combinations(list(AKV), integer()) -> list(list(AKV)). -combinations(Items, N) -> - case N of - 0 -> - [[]]; - - _ -> - case Items of - [] -> - []; - - [X | Xs] -> - First_combinations = begin - _pipe = map( - combinations(Xs, N - 1), - fun(Com) -> [X | Com] end - ), - reverse(_pipe) - end, - fold( - First_combinations, - combinations(Xs, N), - fun(Acc, C) -> [C | Acc] end - ) - end - end. - --spec do_combination_pairs(list(AKZ)) -> list(list({AKZ, AKZ})). -do_combination_pairs(Items) -> - case Items of - [] -> - []; - - [X | Xs] -> - First_combinations = map(Xs, fun(Other) -> {X, Other} end), - [First_combinations | do_combination_pairs(Xs)] - end. - --spec combination_pairs(list(ALD)) -> list({ALD, ALD}). -combination_pairs(Items) -> - _pipe = do_combination_pairs(Items), - concat(_pipe). - --spec transpose(list(list(ALK))) -> list(list(ALK)). -transpose(List_of_list) -> - Take_first = fun(List) -> case List of - [] -> - []; - - [F] -> - [F]; - - [F@1 | _] -> - [F@1] - end end, - case List_of_list of - [] -> - []; - - [[] | Xss] -> - transpose(Xss); - - Rows -> - Firsts = begin - _pipe = Rows, - _pipe@1 = map(_pipe, Take_first), - concat(_pipe@1) - end, - Rest = transpose(map(Rows, fun(_capture) -> drop(_capture, 1) end)), - [Firsts | Rest] - end. - --spec interleave(list(list(ALG))) -> list(ALG). -interleave(List) -> - _pipe = transpose(List), - concat(_pipe). - --spec do_shuffle_pair_unwrap(list({float(), ALP}), list(ALP)) -> list(ALP). -do_shuffle_pair_unwrap(List, Acc) -> - case List of - [] -> - Acc; - - _ -> - [Elem_pair | Enumerable] = List, - do_shuffle_pair_unwrap( - Enumerable, - [erlang:element(2, Elem_pair) | Acc] - ) - end. - --spec do_shuffle_by_pair_indexes(list({float(), ALT})) -> list({float(), ALT}). -do_shuffle_by_pair_indexes(List_of_pairs) -> - sort( - List_of_pairs, - fun(A_pair, B_pair) -> - gleam@float:compare( - erlang:element(1, A_pair), - erlang:element(1, B_pair) - ) - end - ). - --spec shuffle(list(ALW)) -> list(ALW). -shuffle(List) -> - _pipe = List, - _pipe@1 = fold( - _pipe, - [], - fun(Acc, A) -> [{gleam@float:random(0.0, 1.0), A} | Acc] end - ), - _pipe@2 = do_shuffle_by_pair_indexes(_pipe@1), - do_shuffle_pair_unwrap(_pipe@2, []). diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@map.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@map.cache deleted file mode 100644 index 8f4c70253a23f184ff54003cb7307279227de993..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12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rwKHzv@AR$y<&4U*m>8bSsA9 zo;G=-*WqfgOyILsOKX1>IW%NgH<#Z|q(N1!VclVJyRSpvXIQQ!lB>rNT?aDR2f$cB zRaQg&GW&*(mHM%fXGbVIQ!?`5rlVW7FKK^=rG2)Kw64Gy7A>9m9wP&hsqv*43lWBe z7xl|0PuQa_qSu@^0~r$@Ptkv+&#Nc=hdKKc9jBAR`flpY8AP3aPR;QlP!PDHT1i~A>;`%?v= zJA4e*i*KI%Qk7AiC3W zI>7Q{TjKR%^ySP;tR1hm?77Ce$P!-aR%2Z>xw7|L$HIU5su(t9*5B(e{t#ij9%G5S z25~At1$py6e&D)14T^t zqN^8o+UN8J&$|^$euLjX5Vvba{l0uhGiH^FCz8N%c5ZuK4GKgzW integer(). -size(Map) -> - maps:size(Map). - --spec to_list(map_(LC, LD)) -> list({LC, LD}). -to_list(Map) -> - maps:to_list(Map). - --spec from_list(list({LM, LN})) -> map_(LM, LN). -from_list(List) -> - maps:from_list(List). - --spec has_key(map_(LW, any()), LW) -> boolean(). -has_key(Map, Key) -> - maps:is_key(Key, Map). - --spec new() -> map_(any(), any()). -new() -> - maps:new(). - --spec get(map_(MM, MN), MM) -> {ok, MN} | {error, nil}. -get(From, Get) -> - gleam_stdlib:map_get(From, Get). - --spec insert(map_(MY, MZ), MY, MZ) -> map_(MY, MZ). -insert(Map, Key, Value) -> - maps:put(Key, Value, Map). - --spec map_values(map_(NK, NL), fun((NK, NL) -> NO)) -> map_(NK, NO). -map_values(Map, Fun) -> - maps:map(Fun, Map). - --spec keys(map_(NY, any())) -> list(NY). -keys(Map) -> - maps:keys(Map). - --spec values(map_(any(), OJ)) -> list(OJ). -values(Map) -> - maps:values(Map). - --spec filter(map_(OS, OT), fun((OS, OT) -> boolean())) -> map_(OS, OT). -filter(Map, Property) -> - maps:filter(Property, Map). - --spec take(map_(PE, PF), list(PE)) -> map_(PE, PF). -take(Map, Desired_keys) -> - maps:with(Desired_keys, Map). - --spec merge(map_(PS, PT), map_(PS, PT)) -> map_(PS, PT). -merge(Map, New_entries) -> - maps:merge(Map, New_entries). - --spec delete(map_(QI, QJ), QI) -> map_(QI, QJ). -delete(Map, Key) -> - maps:remove(Key, Map). - --spec drop(map_(QU, QV), list(QU)) -> map_(QU, QV). -drop(Map, Disallowed_keys) -> - case Disallowed_keys of - [] -> - Map; - - [X | Xs] -> - drop(delete(Map, X), Xs) - end. - --spec update(map_(RB, RC), RB, fun((gleam@option:option(RC)) -> RC)) -> map_(RB, RC). -update(Map, Key, Fun) -> - _pipe = Map, - _pipe@1 = get(_pipe, Key), - _pipe@2 = gleam@option:from_result(_pipe@1), - _pipe@3 = Fun(_pipe@2), - insert(Map, Key, _pipe@3). - --spec do_fold(list({RI, RJ}), RL, fun((RL, RI, RJ) -> RL)) -> RL. -do_fold(List, Initial, Fun) -> - case List of - [] -> - Initial; - - [{K, V} | Rest] -> - do_fold(Rest, Fun(Initial, K, V), Fun) - end. - --spec fold(map_(RM, RN), RQ, fun((RQ, RM, RN) -> RQ)) -> RQ. -fold(Map, Initial, Fun) -> - _pipe = Map, - _pipe@1 = to_list(_pipe), - do_fold(_pipe@1, Initial, Fun). diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.cache deleted file mode 100644 index d1aeec2e43345d00fac9b6fbaffa4de79fe33f47..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7235 zcmcIpO>84c74B-=vE#(?Ry;`{nrJE>t#CY^@x%ckEJ0=r0|GJ3bR3k!Xcc$jcH&IC z+jO@l2`riw5)!O9tPn_u(;nuqTJ3QpZU}CB*aKRDv`8El0TP!zAnl1uc(1D3?QZ|X zqa6-$%H8$%zW2TFy(+JhcuZ68%+RG1y1ugc>lKpAQ$jN*xeqD1I5G{rQ?|QG)@$3A z_`2_UO15dX5AMcQny6}V65D>z#rK40uc$G4uT05FWT-;uY?aQQ&`eo&j&#uCYK*8# z%>RG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zq@NeX_scvNl>aKCf=izQm()4jYs8TLHO~#m zk(>}O?V1Of^8aa)SAbu;5+{F{g>+(*b-4Q~VK zSCUhfWlHQ0TxWdw?z~Euigan2u2<>$GFP%?{_6)#6ltQ8#rxfB{PtG<2t^aC@I3b5 S@il%iE*Iy$i~JnO!|H#0qF*5Z diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.cache_meta b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.cache_meta deleted file mode 100644 index 6d890286b5c9aa8ccd46f52d45b2d77bb69a31b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29 YcmbPVus4MP3K(IGZ;F!H!Nmpd08Bpx@c;k- diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.erl b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.erl deleted file mode 100644 index f34d075..0000000 --- a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.erl +++ /dev/null @@ -1,147 +0,0 @@ --module(gleam@option). --compile([no_auto_import, nowarn_unused_vars]). - --export([all/1, is_some/1, is_none/1, to_result/2, from_result/1, unwrap/2, lazy_unwrap/2, map/2, flatten/1, then/2, 'or'/2, lazy_or/2, values/1]). --export_type([option/1]). - --type option(GB) :: {some, GB} | none. - --spec do_all(list(option(GC)), list(GC)) -> option(list(GC)). -do_all(List, Acc) -> - case List of - [] -> - {some, Acc}; - - [X | Rest] -> - Accumulate = fun(Acc@1, Item) -> case {Acc@1, Item} of - {{some, Values}, {some, Value}} -> - {some, [Value | Values]}; - - {_, _} -> - none - end end, - Accumulate(do_all(Rest, Acc), X) - end. - --spec all(list(option(GI))) -> option(list(GI)). -all(List) -> - do_all(List, []). - --spec is_some(option(any())) -> boolean(). -is_some(Option) -> - Option /= none. - --spec is_none(option(any())) -> boolean(). -is_none(Option) -> - Option =:= none. - --spec to_result(option(GR), GU) -> {ok, GR} | {error, GU}. -to_result(Option, E) -> - case Option of - {some, A} -> - {ok, A}; - - _ -> - {error, E} - end. - --spec from_result({ok, GX} | {error, any()}) -> option(GX). -from_result(Result) -> - case Result of - {ok, A} -> - {some, A}; - - _ -> - none - end. - --spec unwrap(option(HC), HC) -> HC. -unwrap(Option, Default) -> - case Option of - {some, X} -> - X; - - none -> - Default - end. - --spec lazy_unwrap(option(HE), fun(() -> HE)) -> HE. -lazy_unwrap(Option, Default) -> - case Option of - {some, X} -> - X; - - none -> - Default() - end. - --spec map(option(HG), fun((HG) -> HI)) -> option(HI). -map(Option, Fun) -> - case Option of - {some, X} -> - {some, Fun(X)}; - - none -> - none - end. - --spec flatten(option(option(HK))) -> option(HK). -flatten(Option) -> - case Option of - {some, X} -> - X; - - none -> - none - end. - --spec then(option(HO), fun((HO) -> option(HQ))) -> option(HQ). -then(Option, Fun) -> - case Option of - {some, X} -> - Fun(X); - - none -> - none - end. - --spec 'or'(option(HT), option(HT)) -> option(HT). -'or'(First, Second) -> - case First of - {some, _} -> - First; - - none -> - Second - end. - --spec lazy_or(option(HX), fun(() -> option(HX))) -> option(HX). -lazy_or(First, Second) -> - case First of - {some, _} -> - First; - - none -> - Second() - end. - --spec do_values(list(option(IB)), list(IB)) -> list(IB). -do_values(List, Acc) -> - case List of - [] -> - Acc; - - [X | Xs] -> - Accumulate = fun(Acc@1, Item) -> case Item of - {some, Value} -> - [Value | Acc@1]; - - none -> - Acc@1 - end end, - Accumulate(do_values(Xs, Acc), X) - end. - --spec values(list(option(IG))) -> list(IG). -values(Options) -> - do_values(Options, []). diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache deleted file mode 100644 index 7076c96ddfe6ba9141885bfc09efd3ea02cc6fef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2695 zcmd6p&u<$=6vuaVz216N%RE_W6hp`)Em9h7)7T-ZWFeB67^_mGX6r~CN>#7zsbg60 z#l|%JTuGnrzSR@q$~CB(!{WO-2fMLSvTA-hzZ2j zG(t2DG9S1&pQgE&@Je8@1dF(J3!4iiSZKoH^H%ws#n0ZJNpye}_mB|CHsO#IvtP^A zjdM7scbORQAj(p4#Awv>e4j;vh7YMY4QUudj%cTQ!U7EN1Z~s=eV11Ic-a??b=#&_ zuhQz!>mB2Jc-Lq&WCCprKo+ajzJr0+ZM?{bHX$gFiGxh;e4j&{4`)onFu$>##4vE?%6j3x#4;x?CcL2_sA*s(tjqi_<-3 zmH#*f){f0z$e(0egb%vGNIdPAgS{fn!?JD%Vo5qR)+H0!B4S@5_7U-#nM^u~_&}Z< zmXG3-Gw3niZBfpSIg3~zJkbr2Jk}1ZC9-x*C#UwM$lWL=t~bUdiIC(rrUcaD5)+S* zYc%Y*!q|pmoN?V*;E%Qt7BdZ^#a;&_vhbzd6fiU-(4{yy8Amz#qlNmL9Ek zl6WHO`3q6Uw)Jojv|`x*i@^PEB-W#li`9EYhi*Ca?fVXGep1H7OTMcp&h^9{uVWtW z#UTzY-j@kOW5j&4tnV%L^@dmVQRAXPz+3S*&&G6K3=MF9`e5c!&<4M diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache_meta b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache_meta deleted file mode 100644 index dd414f1ad5abdab1699359cf90ea34d13da80d1e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29 YcmbPVus4MP3K(GwOMy8Jo{2AO07-oXrT_o{ diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.erl b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.erl deleted file mode 100644 index c6c2124..0000000 --- a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.erl +++ /dev/null @@ -1,79 +0,0 @@ --module(gleam@order). --compile([no_auto_import, nowarn_unused_vars]). - --export([negate/1, to_int/1, compare/2, max/2, min/2, reverse/1]). --export_type([order/0]). - --type order() :: lt | eq | gt. - --spec negate(order()) -> order(). -negate(Order) -> - case Order of - lt -> - gt; - - eq -> - eq; - - gt -> - lt - end. - --spec to_int(order()) -> integer(). -to_int(Order) -> - case Order of - lt -> - -1; - - eq -> - 0; - - gt -> - 1 - end. - --spec compare(order(), order()) -> order(). -compare(A, B) -> - case {A, B} of - {X, Y} when X =:= Y -> - eq; - - {lt, _} -> - lt; - - {eq, gt} -> - lt; - - {_, _} -> - gt - end. - --spec max(order(), order()) -> order(). -max(A, B) -> - case {A, B} of - {gt, _} -> - gt; - - {eq, lt} -> - eq; - - {_, _} -> - B - end. - --spec min(order(), order()) -> order(). -min(A, B) -> - case {A, B} of - {lt, _} -> - lt; - - {eq, gt} -> - eq; - - {_, _} -> - B - end. - --spec reverse(fun((I, I) -> order())) -> fun((I, I) -> order()). -reverse(Orderer) -> - fun(A, B) -> Orderer(B, A) end. diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.cache deleted file mode 100644 index 6366df14f9f4a23de07b8bada721591debc5a1fd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1877 zcmb`IO-~a+7{_;JyR?in%}69dVt9Z9r6SN)FC@H~V2Cl1r6eRx47;!cUEOY*?iMiW zoiAYG!2=}vMf?aJJ$d%v$&&~1nc23sbVJa1=ycxq`TzF+JiG9VtPb#7Wj>MQ6Nkee zlS!U_K75{>zBu%RU7fGnn(j8D!EO+08OL+?R_WSp%I__jvqT>rB$K5S!OjdVl(G~% zhQ3uw>DW0>luI8H*jXFMl~xCcz7mN2n(q)|4pH3b#aAaAQ(#~MHbt*fR&Cfz%W`;ol*E5#Im_~|s$rF7|&rmJ)l?Mvl9{56| zi{o)c7En)a4AXAF1NdGWK$R={3 zoJ_B!C{K^^Ax!TawtDSA(=sv)LW)0VURN4rHfwsPlKdO}Q&cXiRL+?gg)HZrSoa?5>QV71hhkB-s(Ju2#=3B>cBtIcmC?$H z`3@3V{7%voKXKBBIi4Qjql FM. -first(Pair) -> - {A, _} = Pair, - A. - --spec second({any(), FP}) -> FP. -second(Pair) -> - {_, A} = Pair, - A. - --spec swap({FQ, FR}) -> {FR, FQ}. -swap(Pair) -> - {A, B} = Pair, - {B, A}. - --spec map_first({FS, FT}, fun((FS) -> FU)) -> {FU, FT}. -map_first(Pair, Fun) -> - {A, B} = Pair, - {Fun(A), B}. - --spec map_second({FV, FW}, fun((FW) -> FX)) -> {FV, FX}. -map_second(Pair, Fun) -> - {A, B} = Pair, - {A, Fun(B)}. - --spec new(FY, FZ) -> {FY, FZ}. -new(First, Second) -> - {First, Second}. diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@queue.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@queue.cache deleted file mode 100644 index 546270520a834bf66e854367bb41a12123f030bc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7015 zcmd^EU1%HG6`ngIS@uM>b64^HWH>A-HesuCL!1(c^pkV znvrKlaojcp`c~+}QYds63VB%Cr7taEUkjzQkaiymdFoRsrLfO!UkmPc?u>p$Ke5vE zrSw7aXy)EK_nz-N=X~e*Bui=kWEUs+T$P`Eh5zV_++SxHpT3*>#|%5T<5*^+xZ6@P zR?CWhZ3Lk*yXDx`m6XcUWh2G3d838Lj2TB&jbABpR!vS+7@sQhsVbi?MnjX2jg+b} zRngjiSI(-uv1T-xmirxBt2|-2nA0v*j%m2CQ)?9m@67#v;#}p)1U;I(S$TC57mcZE zr8$L*lSeL9#1UM4lwGL&IE#xb)2o%M)42G_%xdM)3@#q0SnfCYEM!>j5`D5PcQeZl znysL|Q8jA{+rfdds%Ct`(wymv!kD7)sdeMJsws*wiEqYFl=%smt;ke7RYxBVPg7&q zfEGzJmGd=Yi!sit{6kjaH&ea4O4{x~T*HQ~KpZt)VL4XAazo*{p(nz+C2)=%;cd(7 zUBc+Ju8TLtmHTF+=~w}NY;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8kKDT(3vktciH1D8z zTs7W^y!0&NDk}U~E#O2+Gd)8nd~@cbnFBjOtdo&0Hbw5S3R%%@4dm{s=n?d`269gk z$XHHSS?)MKWt9!<5tP`%%z=ny>)V!a%$@>KdLDU^6j}e9s=m-4`)z4$Smx@UaBYaa*4#eVK-2!V+W$t+q zbpla`Ad~@lWC1)XLZjQz3assxBS>3I@x@y0=G@_I0s`Wur!i->QYy))L88+L3fkJKRUM zv3xW1e6e}{{HCA{MTMRST7J{F11zcI7FDf?bcfdH^RkuF(M3@aaU4a27JBGqedqOG zyxsx&8Wq1XNd7tz*w>Aw6hU#*ups+}BzG1Ie6h?I2isbTHlS~m^cXoo(dJYHC0>>> z?>(dubY1mfL5JdbqFuKj+jYnBok6*armO9uMEZ-G)j0c@80UC*>>8u8mExdgIyi2W z6DmiOs_&ukCwX27LL9PG=A|nC3Y~YQ%vY*t5leYztQ+@f*s$HjUX*>ND96)S#^DMw zF8iOzIF0jYyconIJRnqWM6H zMY6ZI)C;=h+Loy9cLZ2xv{c~aBkf+`Aff+{T^HTh2E5#EI<_V4M*vW7RD|XZ>StIq zGJf1Qf2LVucY!lR-R)I=6n=Ib-;wSI3Z#+LC@ieM_W5g^t;#^%XomZE)bSSM1)B`h zBWW&sWvlp)h0GP7AXii;d$-U};jcx_05rP-A|s4}UV{%INZqbjaR?B|q9Y7a>%XJh zNmkMNh{S#iuCPh<{GociJL~JF6O5QPRHqM_NvRv+{Lh(*NzO7Ck-6Vq$*O#=z~^4( vC(Hcg3_o>_pL$u=hCE%s|Gj2uv-9%Z?Ia&(`?w>@)5kGP`(S5Y%7lLdp;&W6 diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@queue.cache_meta b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@queue.cache_meta deleted file mode 100644 index cd60b30bf68afea17ae8c8b1016c0796a1f265e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 47 mcmbPVus4MP3K$uo3@#|0o|BrGtDlouT+(&)WU_8~%L4$eatg5k diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@queue.erl b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@queue.erl deleted file mode 100644 index 1a3b367..0000000 --- a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@queue.erl +++ /dev/null @@ -1,121 +0,0 @@ --module(gleam@queue). --compile([no_auto_import, nowarn_unused_vars]). - --export([new/0, from_list/1, to_list/1, is_empty/1, length/1, push_back/2, push_front/2, pop_back/1, pop_front/1, reverse/1, is_logically_equal/3, is_equal/2]). --export_type([queue/1]). - --opaque queue(BEZ) :: {queue, list(BEZ), list(BEZ)}. - --spec new() -> queue(any()). -new() -> - {queue, [], []}. - --spec from_list(list(BFC)) -> queue(BFC). -from_list(List) -> - {queue, [], List}. - --spec to_list(queue(BFF)) -> list(BFF). -to_list(Queue) -> - _pipe = erlang:element(3, Queue), - gleam@list:append(_pipe, gleam@list:reverse(erlang:element(2, Queue))). - --spec is_empty(queue(any())) -> boolean(). -is_empty(Queue) -> - (erlang:element(2, Queue) =:= []) andalso (erlang:element(3, Queue) =:= []). - --spec length(queue(any())) -> integer(). -length(Queue) -> - gleam@list:length(erlang:element(2, Queue)) + gleam@list:length( - erlang:element(3, Queue) - ). - --spec push_back(queue(BFM), BFM) -> queue(BFM). -push_back(Queue, Item) -> - {queue, [Item | erlang:element(2, Queue)], erlang:element(3, Queue)}. - --spec push_front(queue(BFP), BFP) -> queue(BFP). -push_front(Queue, Item) -> - {queue, erlang:element(2, Queue), [Item | erlang:element(3, Queue)]}. - --spec pop_back(queue(BFS)) -> {ok, {BFS, queue(BFS)}} | {error, nil}. -pop_back(Queue) -> - case Queue of - {queue, [], []} -> - {error, nil}; - - {queue, [], Out} -> - pop_back({queue, gleam@list:reverse(Out), []}); - - {queue, [First | Rest], Out@1} -> - Queue@1 = {queue, Rest, Out@1}, - {ok, {First, Queue@1}} - end. - --spec pop_front(queue(BFX)) -> {ok, {BFX, queue(BFX)}} | {error, nil}. -pop_front(Queue) -> - case Queue of - {queue, [], []} -> - {error, nil}; - - {queue, In, []} -> - pop_front({queue, [], gleam@list:reverse(In)}); - - {queue, In@1, [First | Rest]} -> - Queue@1 = {queue, In@1, Rest}, - {ok, {First, Queue@1}} - end. - --spec reverse(queue(BGC)) -> queue(BGC). -reverse(Queue) -> - {queue, erlang:element(3, Queue), erlang:element(2, Queue)}. - --spec check_equal( - list(BGF), - list(BGF), - list(BGF), - list(BGF), - fun((BGF, BGF) -> boolean()) -) -> boolean(). -check_equal(Xs, X_tail, Ys, Y_tail, Eq) -> - case {Xs, X_tail, Ys, Y_tail} of - {[], [], [], []} -> - true; - - {[X | Xs@1], _, [Y | Ys@1], _} -> - case Eq(X, Y) of - false -> - false; - - true -> - check_equal(Xs@1, X_tail, Ys@1, Y_tail, Eq) - end; - - {[], [_ | _], _, _} -> - check_equal(gleam@list:reverse(X_tail), [], Ys, Y_tail, Eq); - - {_, _, [], [_ | _]} -> - check_equal(Xs, X_tail, gleam@list:reverse(Y_tail), [], Eq); - - {_, _, _, _} -> - false - end. - --spec is_logically_equal(queue(BGK), queue(BGK), fun((BGK, BGK) -> boolean())) -> boolean(). -is_logically_equal(A, B, Element_is_equal) -> - check_equal( - erlang:element(3, A), - erlang:element(2, A), - erlang:element(3, B), - erlang:element(2, B), - Element_is_equal - ). - --spec is_equal(queue(BGN), queue(BGN)) -> boolean(). -is_equal(A, B) -> - check_equal( - erlang:element(3, A), - erlang:element(2, A), - erlang:element(3, B), - erlang:element(2, B), - fun(A@1, B@1) -> A@1 =:= B@1 end - ). diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@regex.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@regex.cache deleted file mode 100644 index 50c6705ed4dc4d2c2ea03fc2b5fc355cc98cce1a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6578 zcmds6+ix3H8lN*0$Ej;KIhb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P9pjS1>%I7vp>p0TYFmM1+YjH2$3fhfsm_t0b*hHD$7}5VUGgtjAA(Qo+DFX6 zb^H;U!4D?F7C4ZpMU{98vY+l?baqFf{1S@Z=nZ&I8Ya{n zL4pg0Pjt6T&hqr0An-BBEx;@=qIrAdn-Pp2XQaWW5t1YUVtm^8UmMqSofNoRQXB>} z2hsmw@~b39kMfytvqEJ2FSYWyjK8l|zLV4MBlW`HksN7TSYL?qrx@xFIWgozzXfd! zrb!i5I}axY78m0_e&Rz5?8K}XM1^LPq20m6P`sn=$KHW{PV5w|7~lOc8=LL*th{Lo z#|yMz=jEUc6t8eK2h9pQ^}DM*2KogZl9>B-=qE;SkqJ*|d$%E>IN&Z5zxx3}tF}K_ zltic9p+*1lze9%?s@fgUA*g^w>&*|M+(&)Ki1$2C2z_tA(HE*$`}jH7i_u2q0U1v= z@ysziTg9`-@VNp$cN||*@ug$ {ok, regex()} | {error, compile_error()}. -compile(Pattern, Options) -> - gleam_stdlib:compile_regex(Pattern, Options). - --spec from_string(binary()) -> {ok, regex()} | {error, compile_error()}. -from_string(Pattern) -> - compile(Pattern, {options, false, false}). - --spec check(regex(), binary()) -> boolean(). -check(Regex, Content) -> - gleam_stdlib:regex_check(Regex, Content). - --spec split(regex(), binary()) -> list(binary()). -split(Regex, String) -> - gleam_stdlib:regex_split(Regex, String). - --spec scan(regex(), binary()) -> list(match()). -scan(Regex, String) -> - gleam_stdlib:regex_scan(Regex, String). diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.cache deleted file mode 100644 index 52a21a926255f94b705fd13761d6e859873feeed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10398 zcmd5?O>7&-73NTqDKV1iF>Tpa>}X6oj>IUINnHvdu4AQX(6ouYk^{GO3~?!~td+@K zdP&7rYQsSqq-m1?K@UZaMUVnP4@FU+MPT$)7--Q`kzR^innO-G6+sU{5kURs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G0j@dv1KV2 z4h~)rxm-V3g;SOEqUvkSS!tjODyN6nftz)uYc}O6KX9+Oo?VIJa8mRXQo|N6tRpG$ zL{SqPRDE0yv$e8LbZqKUaYhs_&xlL8GD@FlipxzR{`~OW!<;?0?bb;%kupn!M6}+# zPtiP1Y|4PumR|eIyyMeZ+J7{4>rY~Z?*@w2hf1COd09yMrR0`Q9*LXv1OpR&kL20tF;ET4g>w!|OD+vAV>`*Rq3g7|PUWYH6S_%o~9_b!i^R%#=Y zx4zXB!e1xpJvwN17U5pSwMX#3C**)i$h^R_FFESZU90}eru^p!?VPCrZJxv2v+Pp! z@kbKZ!(ml6%XlDJByZmK&zzaDH^w+iJq5pD@E;rJhvxaAaq@$FD3Aa0WTYdRB#G38 QB|bEP>jUSmPST417nm1(q5uE@ diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.cache_meta b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.cache_meta deleted file mode 100644 index 1b97a9be16692a2564ac8ebd9fc8a6066a888df2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 47 mcmZp!7ffY<0!BtCg9}Qh=cFd)>gQw@mrSzozIXUe`x*d^AqqPH diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.erl b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.erl deleted file mode 100644 index 43fb761..0000000 --- a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.erl +++ /dev/null @@ -1,201 +0,0 @@ --module(gleam@result). --compile([no_auto_import, nowarn_unused_vars]). - --export([is_ok/1, is_error/1, map/2, map_error/2, flatten/1, 'try'/2, then/2, unwrap/2, lazy_unwrap/2, unwrap_error/2, unwrap_both/1, nil_error/1, 'or'/2, lazy_or/2, all/1, partition/1, replace/2, replace_error/2, values/1, try_recover/2]). - --spec is_ok({ok, any()} | {error, any()}) -> boolean(). -is_ok(Result) -> - case Result of - {error, _} -> - false; - - {ok, _} -> - true - end. - --spec is_error({ok, any()} | {error, any()}) -> boolean(). -is_error(Result) -> - case Result of - {ok, _} -> - false; - - {error, _} -> - true - end. - --spec map({ok, BJV} | {error, BJW}, fun((BJV) -> BJZ)) -> {ok, BJZ} | - {error, BJW}. -map(Result, Fun) -> - case Result of - {ok, X} -> - {ok, Fun(X)}; - - {error, E} -> - {error, E} - end. - --spec map_error({ok, BKC} | {error, BKD}, fun((BKD) -> BKG)) -> {ok, BKC} | - {error, BKG}. -map_error(Result, Fun) -> - case Result of - {ok, X} -> - {ok, X}; - - {error, Error} -> - {error, Fun(Error)} - end. - --spec flatten({ok, {ok, BKJ} | {error, BKK}} | {error, BKK}) -> {ok, BKJ} | - {error, BKK}. -flatten(Result) -> - case Result of - {ok, X} -> - X; - - {error, Error} -> - {error, Error} - end. - --spec 'try'({ok, BKR} | {error, BKS}, fun((BKR) -> {ok, BKV} | {error, BKS})) -> {ok, - BKV} | - {error, BKS}. -'try'(Result, Fun) -> - case Result of - {ok, X} -> - Fun(X); - - {error, E} -> - {error, E} - end. - --spec then({ok, BLA} | {error, BLB}, fun((BLA) -> {ok, BLE} | {error, BLB})) -> {ok, - BLE} | - {error, BLB}. -then(Result, Fun) -> - 'try'(Result, Fun). - --spec unwrap({ok, BLJ} | {error, any()}, BLJ) -> BLJ. -unwrap(Result, Default) -> - case Result of - {ok, V} -> - V; - - {error, _} -> - Default - end. - --spec lazy_unwrap({ok, BLN} | {error, any()}, fun(() -> BLN)) -> BLN. -lazy_unwrap(Result, Default) -> - case Result of - {ok, V} -> - V; - - {error, _} -> - Default() - end. - --spec unwrap_error({ok, any()} | {error, BLS}, BLS) -> BLS. -unwrap_error(Result, Default) -> - case Result of - {ok, _} -> - Default; - - {error, E} -> - E - end. - --spec unwrap_both({ok, BLV} | {error, BLV}) -> BLV. -unwrap_both(Result) -> - case Result of - {ok, A} -> - A; - - {error, A@1} -> - A@1 - end. - --spec nil_error({ok, BLY} | {error, any()}) -> {ok, BLY} | {error, nil}. -nil_error(Result) -> - map_error(Result, fun(_) -> nil end). - --spec 'or'({ok, BME} | {error, BMF}, {ok, BME} | {error, BMF}) -> {ok, BME} | - {error, BMF}. -'or'(First, Second) -> - case First of - {ok, _} -> - First; - - {error, _} -> - Second - end. - --spec lazy_or({ok, BMM} | {error, BMN}, fun(() -> {ok, BMM} | {error, BMN})) -> {ok, - BMM} | - {error, BMN}. -lazy_or(First, Second) -> - case First of - {ok, _} -> - First; - - {error, _} -> - Second() - end. - --spec all(list({ok, BMU} | {error, BMV})) -> {ok, list(BMU)} | {error, BMV}. -all(Results) -> - gleam@list:try_map(Results, fun(X) -> X end). - --spec do_partition(list({ok, BNJ} | {error, BNK}), list(BNJ), list(BNK)) -> {list(BNJ), - list(BNK)}. -do_partition(Results, Oks, Errors) -> - case Results of - [] -> - {Oks, Errors}; - - [{ok, A} | Rest] -> - do_partition(Rest, [A | Oks], Errors); - - [{error, E} | Rest@1] -> - do_partition(Rest@1, Oks, [E | Errors]) - end. - --spec partition(list({ok, BNC} | {error, BND})) -> {list(BNC), list(BND)}. -partition(Results) -> - do_partition(Results, [], []). - --spec replace({ok, any()} | {error, BNS}, BNV) -> {ok, BNV} | {error, BNS}. -replace(Result, Value) -> - case Result of - {ok, _} -> - {ok, Value}; - - {error, Error} -> - {error, Error} - end. - --spec replace_error({ok, BNY} | {error, any()}, BOC) -> {ok, BNY} | {error, BOC}. -replace_error(Result, Error) -> - case Result of - {ok, X} -> - {ok, X}; - - {error, _} -> - {error, Error} - end. - --spec values(list({ok, BOF} | {error, any()})) -> list(BOF). -values(Results) -> - gleam@list:filter_map(Results, fun(R) -> R end). - --spec try_recover( - {ok, BOL} | {error, BOM}, - fun((BOM) -> {ok, BOL} | {error, BOP}) -) -> {ok, BOL} | {error, BOP}. -try_recover(Result, Fun) -> - case Result of - {ok, Value} -> - {ok, Value}; - - {error, Error} -> - Fun(Error) - end. diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache deleted file mode 100644 index d8a82df9934d982c52425a0f5b5a080899687585..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6383 zcmcIoO>7&-8QocuT4^Pj9y3Y}L54>3Av7yl6)DH4kj6i)lQ^&&lQiI>fncr3k+{-w zSJ+)zb{oS%f!^F(4?VO%e|$&)pM2^uD0&ETDvBOjpalw}#{x}@UJLcj%ZWY5npTovG7>*H->#kb-%V(CMAR>`8L4?QpBJ9B_?<>iTXF zYWbF9Z(bSK>2#$wMKY8ZYb}zQzwPaESJP@I^$fjfP*P9N)(D*_(}@b5SkB+DgK%E1 zT+8YiF;bKxhVfn7Q3JR14E`An9uguKytX`KK}@UD>1FX+`deaEqHCG>|0|bu`f#oG z0m&4IUasr-{}-8ZLw{{;`eNl6n-~J zF15JBLykjD>6zLSlB2}bG(t3uPTZ;8hBdU>xU|WcB0U2{mWhs0efSYEl9k3AZ3Qto zM|4WpYCk1_wN5`FE7Q-6Xd`K}9k4p@c=vd4hFPq`JDc2RTfW!9UBJWh?D`f9+gx0; zmd69;dLe6iZfM!A9Ehgi9oJ0Wv;*ezu1}D?KXzC@F=uBm-$^c zU|7fTwk_Wd+a0^fLc7Don`h6mYxk|rp2Gv&ZES2v>X__J=JNg0IdSp9o0uGMKP*+^ zdu8a}eYDe{w1PL@vYddMY#xi5CLy;7fr-d#lG9~61v`nqd2xD8%ZJ!1A=QtJ&y9R& z?Z)W+egM622zns*QkgDQ=+X$5f~Wd`LjZC8Xk0N*;##gfR=EBaxL#Eo>__$6KDR<1 z%mGIjjCHKN7}jn39(ToqMdrEA1K6g|+3=>LR<)d+N#8O(x#2u1ijsCcLN*$EyjB zk9IlV!>LG&X!S?*k2D|HKZv2c-v{M#?XrZjCr*d>S0;iA%4QhX-ALFVUOB)*%QZ)# z;{csvPJXi=ows=yz*`EOxn1dU-d19HIE3=Ok^TZ!2chML$1w8{XA!P2)OmzyOjZ$= zHQ*r{salyIXA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Da|q2x69#jG_E}z*JvC*0)<-bSpT+Rsy^j zh!4LlnqZi~uK5o77l#PhaZ6rVi-{PSbS=IZFjaE`rPunzPbMg-%*)dNHTW39SK~Ap zh&Nv@y_p)B-e5$042>y`4E5^6vZh0qjhr-6r8%KW>U3#FXnJ+x)TL9D6oqgk=dS&s z@7T+=4`rC`tJUuqH?6&Bt&XLUJ+XZ>RdO#H?2l9(Ei;4u9Hm7mv2P$}Ku9(Rl`d9T zsO8tLWObS=(kwC1chR)!g8nVEo{9!2(eudf^_|g>*4K`ug3|y^?x&>Q8;UdQ|&JT3)77bfrjF>hywWSLVeQ zz?-G0BptLyr0XY;=15rN1fAeMnk<(>_FY@6tV$(|z^hXtVnqRA;850Vq8 z@<^`M8%^4qqFaN^s9$}~o9sKDTxB19O^&L##UXG==Y8&oo#M+v@8mar_H=d7uM*)t0JLTIw2btG*_m%N?w%s^D@)CROdn032AN?&ol4s&R_F=&le1g Gbmaee6%rZ% diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache_meta b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache_meta deleted file mode 100644 index 79d164109d59f21d9d1820c266558467a9b06d83..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 84 zcmaD+eJF(i3K*H83@#|0o|BrGtDlouT*8SWlABn-gCbCrT3nh_vRX81=XUYE2LWfH B69fPN diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.erl b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.erl deleted file mode 100644 index 12b8e95..0000000 --- a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.erl +++ /dev/null @@ -1,85 +0,0 @@ --module(gleam@set). --compile([no_auto_import, nowarn_unused_vars]). - --export([new/0, size/1, insert/2, contains/2, delete/2, to_list/1, from_list/1, fold/3, filter/2, drop/2, take/2, union/2, intersection/2]). --export_type([set/1]). - --opaque set(BTO) :: {set, gleam@map:map_(BTO, list(nil))}. - --spec new() -> set(any()). -new() -> - {set, gleam@map:new()}. - --spec size(set(any())) -> integer(). -size(Set) -> - gleam@map:size(erlang:element(2, Set)). - --spec insert(set(BTU), BTU) -> set(BTU). -insert(Set, Member) -> - {set, gleam@map:insert(erlang:element(2, Set), Member, [])}. - --spec contains(set(BTX), BTX) -> boolean(). -contains(Set, Member) -> - _pipe = erlang:element(2, Set), - _pipe@1 = gleam@map:get(_pipe, Member), - gleam@result:is_ok(_pipe@1). - --spec delete(set(BTZ), BTZ) -> set(BTZ). -delete(Set, Member) -> - {set, gleam@map:delete(erlang:element(2, Set), Member)}. - --spec to_list(set(BUC)) -> list(BUC). -to_list(Set) -> - gleam@map:keys(erlang:element(2, Set)). - --spec from_list(list(BUF)) -> set(BUF). -from_list(Members) -> - Map = gleam@list:fold( - Members, - gleam@map:new(), - fun(M, K) -> gleam@map:insert(M, K, []) end - ), - {set, Map}. - --spec fold(set(BUI), BUK, fun((BUK, BUI) -> BUK)) -> BUK. -fold(Set, Initial, Reducer) -> - gleam@map:fold( - erlang:element(2, Set), - Initial, - fun(A, K, _) -> Reducer(A, K) end - ). - --spec filter(set(BUL), fun((BUL) -> boolean())) -> set(BUL). -filter(Set, Property) -> - {set, - gleam@map:filter(erlang:element(2, Set), fun(M, _) -> Property(M) end)}. - --spec drop(set(BUO), list(BUO)) -> set(BUO). -drop(Set, Disallowed) -> - gleam@list:fold(Disallowed, Set, fun delete/2). - --spec take(set(BUS), list(BUS)) -> set(BUS). -take(Set, Desired) -> - {set, gleam@map:take(erlang:element(2, Set), Desired)}. - --spec order(set(BUW), set(BUW)) -> {set(BUW), set(BUW)}. -order(First, Second) -> - case gleam@map:size(erlang:element(2, First)) > gleam@map:size( - erlang:element(2, Second) - ) of - true -> - {First, Second}; - - false -> - {Second, First} - end. - --spec union(set(BVB), set(BVB)) -> set(BVB). -union(First, Second) -> - {Larger, Smaller} = order(First, Second), - fold(Smaller, Larger, fun insert/2). - --spec intersection(set(BVF), set(BVF)) -> set(BVF). -intersection(First, Second) -> - {Larger, Smaller} = order(First, Second), - take(Larger, to_list(Smaller)). diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.cache deleted file mode 100644 index d725f6e387731f8b808af4f70bc9de22f61d5477..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22682 zcmeHPeQX=&dFP!ZOQJ0^XI74##L<~{8cLBwi;7~KwXImT<5;yFQ<9U^jzOKslSrB3 zv3Ezy_PRMW`h}oHyKHNVphaAx+ft+0g7%*^>mNmm0i96{ThIbUfeu)TeINt6!Wgi$ z7{L9W_r32UDOtAKbr_P9kN5e!&-;A-p69)tVtcylYn@MTka`!Toez%GUTBXe4v13E zVmy67tS^*RWhrHtk(gepEbyN>`dKKK<_@=uQpZ%bOK7VfE$M3BENKy;5{YCV5Zk1& zPDxk{+#eC7?kPN4k~+P21g<(Gw&DLH9}vX&W8%Q{Zc%89f39tE`U`E?$+j;}&$MIb zLdUu3*$(We8}#Yo2JCcq4or7-V&|h>ndvI1ivM%> zgqk{JEvHi3g$FRM< z5&PKQ>k;DOW}JIKh`)v{5f|baY+D`_;se;;+9t%`!S?HiaqJNxesc%z#rBQO1M#^& zAwDVN+1Ms_3h_m3H+SJ4Y_}i7v$4JMxDdaE?PfoYW6L~&d$1*ju#fHfFy4#p+#cMI zEio#@)7a+r;$Cdm_v1Xa_YQ#0gSht)&SASX4mz-16~*{#*z^rz{1t3>a4gy_VtgXT zC&q7Y!oS#VZx-Y4VtZ(d7*Aun9T(&8VY}Lk`>_4`K{38%8}=U(<2SM0egyYn)BD8u zb!?M6#rQdFZzpgZ+iSbU__wg#c?|b`5a;@FEw;Cx5aaJ)J2!;i*siC<_^a5&G~SJE zaTLd}-F_1EU|W0&G+>+CkL$6$mBIZPF_zc0svu-HiEY`Jg$_xGMk0a`iAdcqWS$JD@Z#s(vGyWqZ7Nm8L2ld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ztnkb*P(zhr@b?Bq&(7fDlCIFi|DlwM>r9b5z-fq&@94@TBSy-7JMTR02ICXmW$!9f2lE0+_ne}%qud4Cx>(tu^8rK zJcjugVwgJ}Uh0|&+*U8T!Rvgp{Qb@cP~bIH)c>(aFHjYn!$-LA`6968G*&FF@Szl& zQx*OV0J@`*U-Mj6q;->+scF0f0GRd5K|A!*ub;Mj8-0e$wMMIr$?pP7Y#KO*+p}Qb ziJSnx;laMz`=eeG8J3VE@8uTMGF9t9bF0+|vs_GQ4Pdn0OHqJqAe}2OVxs}w{Sr2t z4UHDCc|H&U#(k#mdwrBc!{OpvQ?8n=mS^`P_sV4PNghHnzkopD)eei6Ft>O;uQ!+& zAj;&_b4b{UA#5zz$%|Rq%c4d<%6QjZQv7wKHi!>toe;j5!WvkL3jJq=`kpV7@WnG} zG)nfd%dsBe*(W~!goPrpGIJzG>7T1;vw_enc^}&M7Q-FO)H%ps9pE=)qq6r)XryC3 zkE~4jTPV-lQMCZct1MXOhH4R z8B1rs$+hsC(86dpCo>=vPO!dK!$TlZXL{9pZ{F*cCZd}++O5YcC-Kxl*jULpCCg?mjbh#`2w{*{)o!hf0T2JbGtf+CbF6*l84jum)Glv6@E&pE+D# z%Fcz1jq~C#dH>MyKB_C7PosIo{%lR}R`wmCtT9(u?Aa$f;=)0!9ufgAYol=cFd)>Svau7A2PC7jdD8=42L^@Sup~7nEe?=W(No6{VyW ziJ%A-mlS2@rN<|gX669p1W@FXGE3qi^1LYGDV2GNxtYnR_7$ZTm*$kHaBf`M$rW}M E0CV*)IRF3v diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.erl b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.erl deleted file mode 100644 index f3dcc69..0000000 --- a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.erl +++ /dev/null @@ -1,397 +0,0 @@ --module(gleam@string). --compile([no_auto_import, nowarn_unused_vars]). - --export([is_empty/1, length/1, reverse/1, replace/3, lowercase/1, uppercase/1, compare/2, slice/3, crop/2, drop_left/2, drop_right/2, contains/2, starts_with/2, ends_with/2, split_once/2, append/2, concat/1, repeat/2, join/2, pad_left/3, pad_right/3, trim/1, trim_left/1, trim_right/1, pop_grapheme/1, to_graphemes/1, split/2, to_utf_codepoints/1, from_utf_codepoints/1, utf_codepoint/1, utf_codepoint_to_int/1, to_option/1, first/1, last/1, capitalise/1, inspect/1, byte_size/1]). --export_type([direction/0]). - --type direction() :: leading | trailing | both. - --spec is_empty(binary()) -> boolean(). -is_empty(Str) -> - Str =:= <<""/utf8>>. - --spec length(binary()) -> integer(). -length(String) -> - string:length(String). - --spec do_reverse(binary()) -> binary(). -do_reverse(String) -> - _pipe = String, - _pipe@1 = gleam@string_builder:from_string(_pipe), - _pipe@2 = gleam@string_builder:reverse(_pipe@1), - gleam@string_builder:to_string(_pipe@2). - --spec reverse(binary()) -> binary(). -reverse(String) -> - do_reverse(String). - --spec replace(binary(), binary(), binary()) -> binary(). -replace(String, Pattern, Substitute) -> - _pipe = String, - _pipe@1 = gleam@string_builder:from_string(_pipe), - _pipe@2 = gleam@string_builder:replace(_pipe@1, Pattern, Substitute), - gleam@string_builder:to_string(_pipe@2). - --spec lowercase(binary()) -> binary(). -lowercase(String) -> - string:lowercase(String). - --spec uppercase(binary()) -> binary(). -uppercase(String) -> - string:uppercase(String). - --spec compare(binary(), binary()) -> gleam@order:order(). -compare(A, B) -> - case A =:= B of - true -> - eq; - - _ -> - case gleam_stdlib:less_than(A, B) of - true -> - lt; - - _ -> - gt - end - end. - --spec slice(binary(), integer(), integer()) -> binary(). -slice(String, Idx, Len) -> - case Len < 0 of - true -> - <<""/utf8>>; - - false -> - case Idx < 0 of - true -> - Translated_idx = length(String) + Idx, - case Translated_idx < 0 of - true -> - <<""/utf8>>; - - false -> - string:slice(String, Translated_idx, Len) - end; - - false -> - string:slice(String, Idx, Len) - end - end. - --spec do_crop(binary(), binary()) -> binary(). -do_crop(String, Substring) -> - _pipe = String, - _pipe@1 = string:find(_pipe, Substring), - _pipe@2 = gleam@dynamic:string(_pipe@1), - gleam@result:unwrap(_pipe@2, String). - --spec crop(binary(), binary()) -> binary(). -crop(String, Substring) -> - do_crop(String, Substring). - --spec drop_left(binary(), integer()) -> binary(). -drop_left(String, Num_graphemes) -> - case Num_graphemes < 0 of - true -> - String; - - false -> - slice(String, Num_graphemes, length(String) - Num_graphemes) - end. - --spec drop_right(binary(), integer()) -> binary(). -drop_right(String, Num_graphemes) -> - case Num_graphemes < 0 of - true -> - String; - - false -> - slice(String, 0, length(String) - Num_graphemes) - end. - --spec do_contains(binary(), binary()) -> boolean(). -do_contains(Haystack, Needle) -> - _pipe = Haystack, - _pipe@1 = string:find(_pipe, Needle), - _pipe@2 = gleam@dynamic:bit_string(_pipe@1), - gleam@result:is_ok(_pipe@2). - --spec contains(binary(), binary()) -> boolean(). -contains(Haystack, Needle) -> - do_contains(Haystack, Needle). - --spec starts_with(binary(), binary()) -> boolean(). -starts_with(String, Prefix) -> - gleam_stdlib:string_starts_with(String, Prefix). - --spec ends_with(binary(), binary()) -> boolean(). -ends_with(String, Suffix) -> - gleam_stdlib:string_ends_with(String, Suffix). - --spec do_split_once(binary(), binary()) -> {ok, {binary(), binary()}} | - {error, nil}. -do_split_once(X, Substring) -> - case string:split(X, Substring) of - [First, Rest] -> - {ok, {First, Rest}}; - - _ -> - {error, nil} - end. - --spec split_once(binary(), binary()) -> {ok, {binary(), binary()}} | - {error, nil}. -split_once(X, Substring) -> - do_split_once(X, Substring). - --spec append(binary(), binary()) -> binary(). -append(First, Second) -> - _pipe = First, - _pipe@1 = gleam@string_builder:from_string(_pipe), - _pipe@2 = gleam@string_builder:append(_pipe@1, Second), - gleam@string_builder:to_string(_pipe@2). - --spec concat(list(binary())) -> binary(). -concat(Strings) -> - _pipe = Strings, - _pipe@1 = gleam@string_builder:from_strings(_pipe), - gleam@string_builder:to_string(_pipe@1). - --spec repeat(binary(), integer()) -> binary(). -repeat(String, Times) -> - _pipe = gleam@iterator:repeat(String), - _pipe@1 = gleam@iterator:take(_pipe, Times), - _pipe@2 = gleam@iterator:to_list(_pipe@1), - concat(_pipe@2). - --spec do_join(list(binary()), binary()) -> binary(). -do_join(Strings, Separator) -> - _pipe = Strings, - _pipe@1 = gleam@list:intersperse(_pipe, Separator), - concat(_pipe@1). - --spec join(list(binary()), binary()) -> binary(). -join(Strings, Separator) -> - do_join(Strings, Separator). - --spec padding(integer(), binary()) -> gleam@iterator:iterator(binary()). -padding(Size, Pad_string) -> - Pad_length = length(Pad_string), - Num_pads = case Pad_length of - 0 -> 0; - Gleam@denominator -> Size div Gleam@denominator - end, - Extra = case Pad_length of - 0 -> 0; - Gleam@denominator@1 -> Size rem Gleam@denominator@1 - end, - _pipe = gleam@iterator:repeat(Pad_string), - _pipe@1 = gleam@iterator:take(_pipe, Num_pads), - gleam@iterator:append( - _pipe@1, - gleam@iterator:single(slice(Pad_string, 0, Extra)) - ). - --spec pad_left(binary(), integer(), binary()) -> binary(). -pad_left(String, Desired_length, Pad_string) -> - Current_length = length(String), - To_pad_length = Desired_length - Current_length, - _pipe = padding(To_pad_length, Pad_string), - _pipe@1 = gleam@iterator:append(_pipe, gleam@iterator:single(String)), - _pipe@2 = gleam@iterator:to_list(_pipe@1), - concat(_pipe@2). - --spec pad_right(binary(), integer(), binary()) -> binary(). -pad_right(String, Desired_length, Pad_string) -> - Current_length = length(String), - To_pad_length = Desired_length - Current_length, - _pipe = gleam@iterator:single(String), - _pipe@1 = gleam@iterator:append(_pipe, padding(To_pad_length, Pad_string)), - _pipe@2 = gleam@iterator:to_list(_pipe@1), - concat(_pipe@2). - --spec do_trim(binary()) -> binary(). -do_trim(String) -> - string:trim(String, both). - --spec trim(binary()) -> binary(). -trim(String) -> - do_trim(String). - --spec do_trim_left(binary()) -> binary(). -do_trim_left(String) -> - string:trim(String, leading). - --spec trim_left(binary()) -> binary(). -trim_left(String) -> - do_trim_left(String). - --spec do_trim_right(binary()) -> binary(). -do_trim_right(String) -> - string:trim(String, trailing). - --spec trim_right(binary()) -> binary(). -trim_right(String) -> - do_trim_right(String). - --spec pop_grapheme(binary()) -> {ok, {binary(), binary()}} | {error, nil}. -pop_grapheme(String) -> - gleam_stdlib:string_pop_grapheme(String). - --spec do_to_graphemes(binary(), list(binary())) -> list(binary()). -do_to_graphemes(String, Acc) -> - case pop_grapheme(String) of - {ok, {Grapheme, Rest}} -> - do_to_graphemes(Rest, [Grapheme | Acc]); - - _ -> - Acc - end. - --spec to_graphemes(binary()) -> list(binary()). -to_graphemes(String) -> - _pipe = do_to_graphemes(String, []), - gleam@list:reverse(_pipe). - --spec split(binary(), binary()) -> list(binary()). -split(X, Substring) -> - case Substring of - <<""/utf8>> -> - to_graphemes(X); - - _ -> - _pipe = X, - _pipe@1 = gleam@string_builder:from_string(_pipe), - _pipe@2 = gleam@string_builder:split(_pipe@1, Substring), - gleam@list:map(_pipe@2, fun gleam@string_builder:to_string/1) - end. - --spec do_to_utf_codepoints_impl(bitstring(), list(integer())) -> list(integer()). -do_to_utf_codepoints_impl(Bit_string, Acc) -> - case Bit_string of - <> -> - do_to_utf_codepoints_impl(Rest, [First | Acc]); - - <<>> -> - Acc - end. - --spec do_to_utf_codepoints(binary()) -> list(integer()). -do_to_utf_codepoints(String) -> - _pipe = do_to_utf_codepoints_impl(gleam@bit_string:from_string(String), []), - gleam@list:reverse(_pipe). - --spec to_utf_codepoints(binary()) -> list(integer()). -to_utf_codepoints(String) -> - do_to_utf_codepoints(String). - --spec do_from_utf_codepoints_impl(list(integer()), bitstring()) -> bitstring(). -do_from_utf_codepoints_impl(Utf_codepoints, Acc) -> - case Utf_codepoints of - [First | Rest] -> - do_from_utf_codepoints_impl(Rest, <>); - - [] -> - Acc - end. - --spec do_from_utf_codepoints(list(integer())) -> binary(). -do_from_utf_codepoints(Utf_codepoints) -> - _assert_subject = begin - _pipe = do_from_utf_codepoints_impl( - Utf_codepoints, - gleam@bit_string:from_string(<<""/utf8>>) - ), - gleam@bit_string:to_string(_pipe) - end, - {ok, String} = case _assert_subject of - {ok, _} -> _assert_subject; - _assert_fail -> - erlang:error(#{gleam_error => let_assert, - message => <<"Assertion pattern match failed"/utf8>>, - value => _assert_fail, - module => <<"gleam/string"/utf8>>, - function => <<"do_from_utf_codepoints"/utf8>>, - line => 807}) - end, - String. - --spec from_utf_codepoints(list(integer())) -> binary(). -from_utf_codepoints(Utf_codepoints) -> - do_from_utf_codepoints(Utf_codepoints). - --spec utf_codepoint(integer()) -> {ok, integer()} | {error, nil}. -utf_codepoint(Value) -> - case Value of - I when I > 1114111 -> - {error, nil}; - - 65534 -> - {error, nil}; - - 65535 -> - {error, nil}; - - I@1 when (I@1 >= 55296) andalso (I@1 =< 57343) -> - {error, nil}; - - I@2 -> - {ok, gleam_stdlib:identity(I@2)} - end. - --spec utf_codepoint_to_int(integer()) -> integer(). -utf_codepoint_to_int(Cp) -> - gleam_stdlib:identity(Cp). - --spec to_option(binary()) -> gleam@option:option(binary()). -to_option(S) -> - case S of - <<""/utf8>> -> - none; - - _ -> - {some, S} - end. - --spec first(binary()) -> {ok, binary()} | {error, nil}. -first(S) -> - case pop_grapheme(S) of - {ok, {First, _}} -> - {ok, First}; - - {error, E} -> - {error, E} - end. - --spec last(binary()) -> {ok, binary()} | {error, nil}. -last(S) -> - case pop_grapheme(S) of - {ok, {First, <<""/utf8>>}} -> - {ok, First}; - - {ok, {_, Rest}} -> - {ok, slice(Rest, -1, 1)}; - - {error, E} -> - {error, E} - end. - --spec capitalise(binary()) -> binary(). -capitalise(S) -> - case pop_grapheme(S) of - {ok, {First, Rest}} -> - append(uppercase(First), lowercase(Rest)); - - _ -> - <<""/utf8>> - end. - --spec inspect(any()) -> binary(). -inspect(Term) -> - _pipe = gleam_stdlib:inspect(Term), - gleam@string_builder:to_string(_pipe). - --spec byte_size(binary()) -> integer(). -byte_size(String) -> - erlang:byte_size(String). diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_builder.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_builder.cache deleted file mode 100644 index ea22c864c825be904a3abdd2dba81c0cd0aba689..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10548 zcmdT~O>7&-72equMUfUwjVRfU991L6c5ESuE7@)nB8q+zr?Ft5CTSx-ZAvZ0k+cfA zOYbgiOAX+_Xn`W=$v}`GKma3XT7ZWf3KU3#9*W+2>7j=LP5J`_Jq0}l2vD>^*>7fd z$tCS|EZJ#fKtm0GW@qNT@4ffEH#154v~R}d`{`(t9)5WGuMex4;iH7ojm$5PlGa+4 z>$T&KOKihjE0r5Yx?173_i@Q_m2{RG29qoF8WZp$9?;)8jv}-Anc^l16<9oCvito@q&5+E$ z(bRn;Glurrev(NZz-JGT%*O~liSmQ|gQpoH#Y z1UOyF-w^+r^ahz8{UjbTo&YcH??SowplbHpn^py_b9D3P#13lSze~m>Pd^T*~QUL$7wU z_EwkHp3g5!tqn-6joWmxNsq;$i%FXvZqi4$VWxL((6>>wDpdW2r|K`D>bFzjEkvsN zX{%P(ZGOsO?qw@bHs17T+g<0IY+b*^8G6joYv}MRF66^jEYpSlg|fYeL80sB zoi!Z!0fsHl&Mq^n&TZYbY*y1Zna$mXZL(#l>}AF;aZ_MR%$Dq#&Yyw%Bl{5U)>Kqn5hY5iEH6IwqX{?YK9UKdv9 zNAlj7a9%3-=9rM9lQVSkE>yWgrNE+c`R9aEn$#uJw5j^*k5GS$Ey(RT350&%h(gwb zjSJhkm5JSrAvujz&yarK_du*w-gJ4%F}4)KzcRj*_4rc!jOn(mMbf20{z=dOJSqGS z2`?s6WCa<;oS5fej4du?B%DpJ7lMxwn@c+o7I?<9sYXheLjxkWmGp|f>kOihe^5vx zM;`=&k}bJVEEAgP7w`-vRjRbk?EcE^HKa8h0EW`9s^+A`{ zc|PxkZFh=}&(QJXA&;CsYdAhwc1+cK9rDhtdMf{nXVuHF>Md37D-xhf*feO<03f+$ z2#)0kQxWw9ZD%IG9DK$c4nnBAy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QT@YMiATv(~0(19wr zsk^9|S2uBVBa7je3|roNsG&+H?!xFe6T|RzV{N^PB;Bgx^w@BCT3jeV?R0XmI4IIl z|Fpg%!fyKVyic1&eS*;Nb&{{~=x{N7boe_p*h8eu{X_Vq$W#OIcBo;yx^XK88A)ck zFzTJdhnQk;1n)7$zi21>d_ONytE9z&1w`(b0sp_KZAz9hy66|qP|UIQ6_*p+DPeVG zBW>#T=GBI2tXLJUs1N;pFhz-Hg*NURv;x@rmjuP36Uyg1%7W%`hv7R5Ln<9F(8;~@ zuuYHk)5BBr@IE@7qtpAs?%l87^-eFZmWjij*i2g7MwyUzcIFD)X;fVr8^h string_builder(). -prepend_builder(Builder, Prefix) -> - gleam_stdlib:iodata_append(Prefix, Builder). - --spec append_builder(string_builder(), string_builder()) -> string_builder(). -append_builder(Builder, Suffix) -> - gleam_stdlib:iodata_append(Builder, Suffix). - --spec new() -> string_builder(). -new() -> - gleam_stdlib:identity([]). - --spec from_strings(list(binary())) -> string_builder(). -from_strings(Strings) -> - gleam_stdlib:identity(Strings). - --spec concat(list(string_builder())) -> string_builder(). -concat(Builders) -> - gleam_stdlib:identity(Builders). - --spec from_string(binary()) -> string_builder(). -from_string(String) -> - gleam_stdlib:identity(String). - --spec prepend(string_builder(), binary()) -> string_builder(). -prepend(Builder, Prefix) -> - append_builder(from_string(Prefix), Builder). - --spec append(string_builder(), binary()) -> string_builder(). -append(Builder, Second) -> - append_builder(Builder, from_string(Second)). - --spec to_string(string_builder()) -> binary(). -to_string(Builder) -> - unicode:characters_to_binary(Builder). - --spec byte_size(string_builder()) -> integer(). -byte_size(Builder) -> - erlang:iolist_size(Builder). - --spec join(list(string_builder()), binary()) -> string_builder(). -join(Builders, Sep) -> - _pipe = Builders, - _pipe@1 = gleam@list:intersperse(_pipe, from_string(Sep)), - concat(_pipe@1). - --spec lowercase(string_builder()) -> string_builder(). -lowercase(Builder) -> - string:lowercase(Builder). - --spec uppercase(string_builder()) -> string_builder(). -uppercase(Builder) -> - string:uppercase(Builder). - --spec reverse(string_builder()) -> string_builder(). -reverse(Builder) -> - string:reverse(Builder). - --spec do_split(string_builder(), binary()) -> list(string_builder()). -do_split(Iodata, Pattern) -> - string:split(Iodata, Pattern, all). - --spec split(string_builder(), binary()) -> list(string_builder()). -split(Iodata, Pattern) -> - do_split(Iodata, Pattern). - --spec do_replace(string_builder(), binary(), binary()) -> string_builder(). -do_replace(Iodata, Pattern, Substitute) -> - string:replace(Iodata, Pattern, Substitute, all). - --spec replace(string_builder(), binary(), binary()) -> string_builder(). -replace(Builder, Pattern, Substitute) -> - do_replace(Builder, Pattern, Substitute). - --spec is_equal(string_builder(), string_builder()) -> boolean(). -is_equal(A, B) -> - string:equal(A, B). - --spec is_empty(string_builder()) -> boolean(). -is_empty(Builder) -> - string:is_empty(Builder). diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.cache b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.cache deleted file mode 100644 index 38e4a9c625af843d4c48e29d994e9bd85221921f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7746 zcmds6O>7&-72Y95(V{KU6P8wGTh(|K*AgR>7G)(i5k<8d8?|BBBI&@616N#%BWh`q z%kD0%S|{6R0Uy#Hj0A8Kq-X;NXp5YR7KjbBC{pwf@FhTVNReEM9-2cB?xihIfPHUf zmt2ziwbCLeAT4KiXJ_BMpYMC`?E%u`kNCgROQRWjU~sbX9EoI}BDB90`THPg6w6$z zB-iHsJ{nNdJ;Wb;$h(=bj1pfE*L}y9%lCsz#tI5 zOK-zYeI!zX|EB^Z5`+IYc96(V;s5b~8u?R*MDn{yWMwyL6ilNwU)C&z*ouE}qsGkzUbW|ySzcW*3LMOU!sR-I8}ka662b*%v$m;Mi&8u=1j@a} zEg{%S8f*jd(E^#IS9-c$?G>-VP6=_W-ArSacn{O7wgG33#7xRtU?#7b+=4x5wr*78 zp%5D#Wv9NWRcd8!!C5Ys6ABEm7u;v(<+E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XOZZ|L>-aD76U3AeU5DHnrb)M!M2QKG#dxJ=-)P;*80*a-Mz*oWO`kUbF{^+nyqBloRY2;E>EaDLa@Sa-nt8d)YJsclga02BO#+cB@x~6kEO>>DB3UlGBj`{79F ztrWdgqTj}R;jI*Xt3-c@!v`t)phSOx!w*yR!xH@nhmTYAagsj9Ceo)V`e}*&4X#E4 zBnAJaNFPbeUZ`RE<7nEbDPcTyJLGG0nm;cOLEQxn{9y1*)#>a)w%u8||L$KM!^nB0XGCBK2{hcE3(o1Cl_i#||XT(aQyHI&KL9Vk>PvU)RHU8O$u8 z<4SvP*(KIzC9NYBDtA&kN zs_7JR#nh%(Tni_plR1tk7CqpKiGkZ0t74+-uTqBOc4d&uIbOb1O|7vnv08gP$(6Tn zT~Clw^4y7CJ{pbD=pK3?MGx$uhgEubAbb+qFEkLNfn@k1G=)b_Yh{Z&U$|&sFI@Lu PxHcmCCFtjrsQB|Ai66Jt diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_meta b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_meta deleted file mode 100644 index a5c9366cecccccc287a48ec0960f493924e3f071..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 132 zcmaD+eJF(i3K&_T3{EJWo|BrGtDl)y!i6G`lUZECgCde&P?DLShbmTFQk0pOE`p*C WA{L)inwgW5TBKEdfX}Ap=TZQa+#j_7 diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.erl b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.erl deleted file mode 100644 index c77203b..0000000 --- a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.erl +++ /dev/null @@ -1,255 +0,0 @@ --module(gleam@uri). --compile([no_auto_import, nowarn_unused_vars]). - --export([parse/1, parse_query/1, percent_encode/1, query_to_string/1, percent_decode/1, path_segments/1, to_string/1, origin/1, merge/2]). --export_type([uri/0]). - --type uri() :: {uri, - gleam@option:option(binary()), - gleam@option:option(binary()), - gleam@option:option(binary()), - gleam@option:option(integer()), - binary(), - gleam@option:option(binary()), - gleam@option:option(binary())}. - --spec parse(binary()) -> {ok, uri()} | {error, nil}. -parse(Uri_string) -> - gleam_stdlib:uri_parse(Uri_string). - --spec parse_query(binary()) -> {ok, list({binary(), binary()})} | {error, nil}. -parse_query(Query) -> - gleam_stdlib:parse_query(Query). - --spec percent_encode(binary()) -> binary(). -percent_encode(Value) -> - gleam_stdlib:percent_encode(Value). - --spec query_pair({binary(), binary()}) -> gleam@string_builder:string_builder(). -query_pair(Pair) -> - gleam@string_builder:from_strings( - [percent_encode(erlang:element(1, Pair)), - <<"="/utf8>>, - percent_encode(erlang:element(2, Pair))] - ). - --spec query_to_string(list({binary(), binary()})) -> binary(). -query_to_string(Query) -> - _pipe = Query, - _pipe@1 = gleam@list:map(_pipe, fun query_pair/1), - _pipe@2 = gleam@list:intersperse( - _pipe@1, - gleam@string_builder:from_string(<<"&"/utf8>>) - ), - _pipe@3 = gleam@string_builder:concat(_pipe@2), - gleam@string_builder:to_string(_pipe@3). - --spec percent_decode(binary()) -> {ok, binary()} | {error, nil}. -percent_decode(Value) -> - gleam_stdlib:percent_decode(Value). - --spec do_remove_dot_segments(list(binary()), list(binary())) -> list(binary()). -do_remove_dot_segments(Input, Accumulator) -> - case Input of - [] -> - gleam@list:reverse(Accumulator); - - [Segment | Rest] -> - Accumulator@5 = case {Segment, Accumulator} of - {<<""/utf8>>, Accumulator@1} -> - Accumulator@1; - - {<<"."/utf8>>, Accumulator@2} -> - Accumulator@2; - - {<<".."/utf8>>, []} -> - []; - - {<<".."/utf8>>, [_ | Accumulator@3]} -> - Accumulator@3; - - {Segment@1, Accumulator@4} -> - [Segment@1 | Accumulator@4] - end, - do_remove_dot_segments(Rest, Accumulator@5) - end. - --spec remove_dot_segments(list(binary())) -> list(binary()). -remove_dot_segments(Input) -> - do_remove_dot_segments(Input, []). - --spec path_segments(binary()) -> list(binary()). -path_segments(Path) -> - remove_dot_segments(gleam@string:split(Path, <<"/"/utf8>>)). - --spec to_string(uri()) -> binary(). -to_string(Uri) -> - Parts = case erlang:element(8, Uri) of - {some, Fragment} -> - [<<"#"/utf8>>, Fragment]; - - _ -> - [] - end, - Parts@1 = case erlang:element(7, Uri) of - {some, Query} -> - [<<"?"/utf8>>, Query | Parts]; - - _ -> - Parts - end, - Parts@2 = [erlang:element(6, Uri) | Parts@1], - Parts@3 = case {erlang:element(4, Uri), - gleam@string:starts_with(erlang:element(6, Uri), <<"/"/utf8>>)} of - {{some, Host}, false} when Host =/= <<""/utf8>> -> - [<<"/"/utf8>> | Parts@2]; - - {_, _} -> - Parts@2 - end, - Parts@4 = case {erlang:element(4, Uri), erlang:element(5, Uri)} of - {{some, _}, {some, Port}} -> - [<<":"/utf8>>, gleam@int:to_string(Port) | Parts@3]; - - {_, _} -> - Parts@3 - end, - Parts@5 = case {erlang:element(2, Uri), - erlang:element(3, Uri), - erlang:element(4, Uri)} of - {{some, S}, {some, U}, {some, H}} -> - [S, <<"://"/utf8>>, U, <<"@"/utf8>>, H | Parts@4]; - - {{some, S@1}, none, {some, H@1}} -> - [S@1, <<"://"/utf8>>, H@1 | Parts@4]; - - {{some, S@2}, {some, _}, none} -> - [S@2, <<":"/utf8>> | Parts@4]; - - {{some, S@2}, none, none} -> - [S@2, <<":"/utf8>> | Parts@4]; - - {none, none, {some, H@2}} -> - [<<"//"/utf8>>, H@2 | Parts@4]; - - {none, {some, _}, none} -> - Parts@4; - - {none, none, none} -> - Parts@4 - end, - gleam@string:concat(Parts@5). - --spec origin(uri()) -> {ok, binary()} | {error, nil}. -origin(Uri) -> - {uri, Scheme, _, Host, Port, _, _, _} = Uri, - case Scheme of - {some, <<"https"/utf8>>} when Port =:= {some, 443} -> - Origin = {uri, Scheme, none, Host, none, <<""/utf8>>, none, none}, - {ok, to_string(Origin)}; - - {some, <<"http"/utf8>>} when Port =:= {some, 80} -> - Origin@1 = {uri, Scheme, none, Host, none, <<""/utf8>>, none, none}, - {ok, to_string(Origin@1)}; - - {some, S} when (S =:= <<"http"/utf8>>) orelse (S =:= <<"https"/utf8>>) -> - Origin@2 = {uri, Scheme, none, Host, Port, <<""/utf8>>, none, none}, - {ok, to_string(Origin@2)}; - - _ -> - {error, nil} - end. - --spec drop_last(list(ERQ)) -> list(ERQ). -drop_last(Elements) -> - gleam@list:take(Elements, gleam@list:length(Elements) - 1). - --spec join_segments(list(binary())) -> binary(). -join_segments(Segments) -> - gleam@string:join([<<""/utf8>> | Segments], <<"/"/utf8>>). - --spec merge(uri(), uri()) -> {ok, uri()} | {error, nil}. -merge(Base, Relative) -> - case Base of - {uri, {some, _}, _, {some, _}, _, _, _, _} -> - case Relative of - {uri, _, _, {some, _}, _, _, _, _} -> - Path = begin - _pipe = gleam@string:split( - erlang:element(6, Relative), - <<"/"/utf8>> - ), - _pipe@1 = remove_dot_segments(_pipe), - join_segments(_pipe@1) - end, - Resolved = {uri, - gleam@option:'or'( - erlang:element(2, Relative), - erlang:element(2, Base) - ), - none, - erlang:element(4, Relative), - gleam@option:'or'( - erlang:element(5, Relative), - erlang:element(5, Base) - ), - Path, - erlang:element(7, Relative), - erlang:element(8, Relative)}, - {ok, Resolved}; - - {uri, none, _, none, _, _, _, _} -> - {New_path, New_query} = case erlang:element(6, Relative) of - <<""/utf8>> -> - {erlang:element(6, Base), - gleam@option:'or'( - erlang:element(7, Relative), - erlang:element(7, Base) - )}; - - _ -> - Path_segments = case gleam@string:starts_with( - erlang:element(6, Relative), - <<"/"/utf8>> - ) of - true -> - gleam@string:split( - erlang:element(6, Relative), - <<"/"/utf8>> - ); - - false -> - _pipe@2 = gleam@string:split( - erlang:element(6, Base), - <<"/"/utf8>> - ), - _pipe@3 = drop_last(_pipe@2), - gleam@list:append( - _pipe@3, - gleam@string:split( - erlang:element(6, Relative), - <<"/"/utf8>> - ) - ) - end, - Path@1 = begin - _pipe@4 = Path_segments, - _pipe@5 = remove_dot_segments(_pipe@4), - join_segments(_pipe@5) - end, - {Path@1, erlang:element(7, Relative)} - end, - Resolved@1 = {uri, - erlang:element(2, Base), - none, - erlang:element(4, Base), - erlang:element(5, Base), - New_path, - New_query, - erlang:element(8, Relative)}, - {ok, Resolved@1} - end; - - _ -> - {error, nil} - end. diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam_stdlib.erl b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam_stdlib.erl deleted file mode 100644 index 9f3bd02..0000000 --- a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam_stdlib.erl +++ /dev/null @@ -1,475 +0,0 @@ --module(gleam_stdlib). - --export([map_get/2, iodata_append/2, identity/1, decode_int/1, decode_bool/1, - decode_float/1, decode_list/1, decode_option/2, - decode_field/2, parse_int/1, parse_float/1, less_than/2, - string_pop_grapheme/1, string_starts_with/2, wrap_list/1, - string_ends_with/2, string_pad/4, decode_map/1, uri_parse/1, - bit_string_int_to_u32/1, bit_string_int_from_u32/1, decode_result/1, - bit_string_slice/3, decode_bit_string/1, compile_regex/2, regex_scan/2, - percent_encode/1, percent_decode/1, regex_check/2, regex_split/2, - base_decode64/1, parse_query/1, bit_string_concat/1, size_of_tuple/1, - decode_tuple/1, decode_tuple2/1, decode_tuple3/1, decode_tuple4/1, - decode_tuple5/1, decode_tuple6/1, tuple_get/2, classify_dynamic/1, - print/1, println/1, print_error/1, println_error/1, inspect/1, - float_to_string/1, int_from_base_string/2]). - -%% Taken from OTP's uri_string module --define(DEC2HEX(X), - if ((X) >= 0) andalso ((X) =< 9) -> (X) + $0; - ((X) >= 10) andalso ((X) =< 15) -> (X) + $A - 10 - end). - -%% Taken from OTP's uri_string module --define(HEX2DEC(X), - if ((X) >= $0) andalso ((X) =< $9) -> (X) - $0; - ((X) >= $A) andalso ((X) =< $F) -> (X) - $A + 10; - ((X) >= $a) andalso ((X) =< $f) -> (X) - $a + 10 - end). - --define(is_lowercase_char(X), (X > 96 andalso X < 123)). --define(is_underscore_char(X), (X == 95)). --define(is_digit_char(X), (X > 47 andalso X < 58)). - -uppercase(X) -> X - 32. - -map_get(Map, Key) -> - case maps:find(Key, Map) of - error -> {error, nil}; - OkFound -> OkFound - end. - -iodata_append(Iodata, String) -> [Iodata, String]. - -identity(X) -> X. - -decode_error_msg(Expected, Data) when is_binary(Expected) -> - decode_error(Expected, classify_dynamic(Data)). -decode_error(Expected, Got) when is_binary(Expected) andalso is_binary(Got) -> - {error, [{decode_error, Expected, Got, []}]}. - -classify_dynamic(nil) -> <<"Nil">>; -classify_dynamic(X) when is_atom(X) -> <<"Atom">>; -classify_dynamic(X) when is_binary(X) -> <<"String">>; -classify_dynamic(X) when is_bitstring(X) -> <<"BitString">>; -classify_dynamic(X) when is_integer(X) -> <<"Int">>; -classify_dynamic(X) when is_float(X) -> <<"Float">>; -classify_dynamic(X) when is_list(X) -> <<"List">>; -classify_dynamic(X) when is_boolean(X) -> <<"Bool">>; -classify_dynamic(X) when is_map(X) -> <<"Map">>; -classify_dynamic(X) when is_tuple(X) -> - iolist_to_binary(["Tuple of ", integer_to_list(tuple_size(X)), " elements"]); -classify_dynamic(X) when - is_function(X, 0) orelse is_function(X, 1) orelse is_function(X, 2) orelse - is_function(X, 3) orelse is_function(X, 4) orelse is_function(X, 5) orelse - is_function(X, 6) orelse is_function(X, 7) orelse is_function(X, 8) orelse - is_function(X, 9) orelse is_function(X, 10) orelse is_function(X, 11) orelse - is_function(X, 12) -> <<"Function">>; -classify_dynamic(_) -> <<"Some other type">>. - -decode_map(Data) when is_map(Data) -> {ok, Data}; -decode_map(Data) -> decode_error_msg(<<"Map">>, Data). - -decode_bit_string(Data) when is_bitstring(Data) -> {ok, Data}; -decode_bit_string(Data) -> decode_error_msg(<<"BitString">>, Data). - -decode_int(Data) when is_integer(Data) -> {ok, Data}; -decode_int(Data) -> decode_error_msg(<<"Int">>, Data). - -decode_float(Data) when is_float(Data) -> {ok, Data}; -decode_float(Data) -> decode_error_msg(<<"Float">>, Data). - -decode_bool(Data) when is_boolean(Data) -> {ok, Data}; -decode_bool(Data) -> decode_error_msg(<<"Bool">>, Data). - -decode_list(Data) when is_list(Data) -> {ok, Data}; -decode_list(Data) -> decode_error_msg(<<"List">>, Data). - -decode_field(Data, Key) when is_map(Data) -> - case Data of - #{Key := Value} -> {ok, {some, Value}}; - _ -> - {ok, none} - end; -decode_field(Data, _) -> - decode_error_msg(<<"Map">>, Data). - -size_of_tuple(Data) -> tuple_size(Data). - -tuple_get(_tup, Index) when Index < 0 -> {error, nil}; -tuple_get(Data, Index) when Index >= tuple_size(Data) -> {error, nil}; -tuple_get(Data, Index) -> {ok, element(Index + 1, Data)}. - -decode_tuple(Data) when is_tuple(Data) -> {ok, Data}; -decode_tuple(Data) -> decode_error_msg(<<"Tuple">>, Data). - -decode_tuple2({_,_} = A) -> {ok, A}; -decode_tuple2([A,B]) -> {ok, {A,B}}; -decode_tuple2(Data) -> decode_error_msg(<<"Tuple of 2 elements">>, Data). - -decode_tuple3({_,_,_} = A) -> {ok, A}; -decode_tuple3([A,B,C]) -> {ok, {A,B,C}}; -decode_tuple3(Data) -> decode_error_msg(<<"Tuple of 3 elements">>, Data). - -decode_tuple4({_,_,_,_} = A) -> {ok, A}; -decode_tuple4([A,B,C,D]) -> {ok, {A,B,C,D}}; -decode_tuple4(Data) -> decode_error_msg(<<"Tuple of 4 elements">>, Data). - -decode_tuple5({_,_,_,_,_} = A) -> {ok, A}; -decode_tuple5([A,B,C,D,E]) -> {ok, {A,B,C,D,E}}; -decode_tuple5(Data) -> decode_error_msg(<<"Tuple of 5 elements">>, Data). - -decode_tuple6({_,_,_,_,_,_} = A) -> {ok, A}; -decode_tuple6([A,B,C,D,E,F]) -> {ok, {A,B,C,D,E,F}}; -decode_tuple6(Data) -> decode_error_msg(<<"Tuple of 6 elements">>, Data). - -decode_option(Term, F) -> - Decode = fun(Inner) -> - case F(Inner) of - {ok, Decoded} -> {ok, {some, Decoded}}; - Error -> Error - end - end, - case Term of - undefined -> {ok, none}; - error -> {ok, none}; - null -> {ok, none}; - none -> {ok, none}; - nil -> {ok, none}; - {some, Inner} -> Decode(Inner); - _ -> Decode(Term) - end. - -decode_result(Term) -> - case Term of - {ok, Inner} -> {ok, {ok, Inner}}; - ok -> {ok, {ok, nil}}; - {error, Inner} -> {ok, {error, Inner}}; - error -> {ok, {error, nil}}; - _ -> decode_error_msg(<<"Result">>, Term) - end. - -int_from_base_string(String, Base) -> - case catch binary_to_integer(String, Base) of - Int when is_integer(Int) -> {ok, Int}; - _ -> {error, nil} - end. - -parse_int(String) -> - case catch binary_to_integer(String) of - Int when is_integer(Int) -> {ok, Int}; - _ -> {error, nil} - end. - -parse_float(String) -> - case catch binary_to_float(String) of - Float when is_float(Float) -> {ok, Float}; - _ -> {error, nil} - end. - -less_than(Lhs, Rhs) -> - Lhs < Rhs. - -string_starts_with(_, <<>>) -> true; -string_starts_with(String, Prefix) when byte_size(Prefix) > byte_size(String) -> false; -string_starts_with(String, Prefix) -> - PrefixSize = byte_size(Prefix), - Prefix == binary_part(String, 0, PrefixSize). - -string_ends_with(_, <<>>) -> true; -string_ends_with(String, Suffix) when byte_size(Suffix) > byte_size(String) -> false; -string_ends_with(String, Suffix) -> - SuffixSize = byte_size(Suffix), - Suffix == binary_part(String, byte_size(String) - SuffixSize, SuffixSize). - -string_pad(String, Length, Dir, PadString) -> - Chars = string:pad(String, Length, Dir, binary_to_list(PadString)), - case unicode:characters_to_binary(Chars) of - Bin when is_binary(Bin) -> Bin; - Error -> erlang:error({gleam_error, {string_invalid_utf8, Error}}) - end. - -string_pop_grapheme(String) -> - case string:next_grapheme(String) of - [ Next | Rest ] -> - {ok, {unicode:characters_to_binary([Next]), unicode:characters_to_binary(Rest)}}; - _ -> {error, nil} - end. - -bit_string_concat(BitStrings) -> - list_to_bitstring(BitStrings). - -bit_string_slice(Bin, Pos, Len) -> - try {ok, binary:part(Bin, Pos, Len)} - catch error:badarg -> {error, nil} - end. - -bit_string_int_to_u32(I) when 0 =< I, I < 4294967296 -> - {ok, <>}; -bit_string_int_to_u32(_) -> - {error, nil}. - -bit_string_int_from_u32(<>) -> - {ok, I}; -bit_string_int_from_u32(_) -> - {error, nil}. - -compile_regex(String, Options) -> - {options, Caseless, Multiline} = Options, - OptionsList = [ - unicode, - ucp, - Caseless andalso caseless, - Multiline andalso multiline - ], - FilteredOptions = [Option || Option <- OptionsList, Option /= false], - case re:compile(String, FilteredOptions) of - {ok, MP} -> {ok, MP}; - {error, {Str, Pos}} -> - {error, {compile_error, unicode:characters_to_binary(Str), Pos}} - end. - -regex_check(Regex, String) -> - re:run(String, Regex) /= nomatch. - -regex_split(Regex, String) -> - re:split(String, Regex). - -regex_submatches(_, {-1, 0}) -> none; -regex_submatches(String, {Start, Length}) -> - BinarySlice = binary:part(String, {Start, Length}), - case string:is_empty(binary_to_list(BinarySlice)) of - true -> none; - false -> {some, BinarySlice} - end. - -regex_matches(String, [{Start, Length} | Submatches]) -> - Submatches1 = lists:map(fun(X) -> regex_submatches(String, X) end, Submatches), - {match, binary:part(String, Start, Length), Submatches1}. - -regex_scan(Regex, String) -> - case re:run(String, Regex, [global]) of - {match, Captured} -> lists:map(fun(X) -> regex_matches(String, X) end, Captured); - nomatch -> [] - end. - -base_decode64(S) -> - try {ok, base64:decode(S)} - catch error:_ -> {error, nil} - end. - -wrap_list(X) when is_list(X) -> X; -wrap_list(X) -> [X]. - -parse_query(Query) -> - case uri_string:dissect_query(Query) of - {error, _, _} -> {error, nil}; - Pairs -> - Pairs1 = lists:map(fun - ({K, true}) -> {K, <<"">>}; - (Pair) -> Pair - end, Pairs), - {ok, Pairs1} - end. - -percent_encode(B) -> percent_encode(B, <<>>). -percent_encode(<<>>, Acc) -> - Acc; -percent_encode(<>, Acc) -> - case percent_ok(H) of - true -> - percent_encode(T, <>); - false -> - <> = <>, - percent_encode(T, <>) - end. - -percent_decode(Cs) -> percent_decode(Cs, <<>>). -percent_decode(<<$%, C0, C1, Cs/binary>>, Acc) -> - case is_hex_digit(C0) andalso is_hex_digit(C1) of - true -> - B = ?HEX2DEC(C0)*16+?HEX2DEC(C1), - percent_decode(Cs, <>); - false -> - {error, nil} - end; -percent_decode(<>, Acc) -> - percent_decode(Cs, <>); -percent_decode(<<>>, Acc) -> - check_utf8(Acc). - -percent_ok($!) -> true; -percent_ok($$) -> true; -percent_ok($') -> true; -percent_ok($() -> true; -percent_ok($)) -> true; -percent_ok($*) -> true; -percent_ok($+) -> true; -percent_ok($-) -> true; -percent_ok($.) -> true; -percent_ok($_) -> true; -percent_ok($~) -> true; -percent_ok(C) when $0 =< C, C =< $9 -> true; -percent_ok(C) when $A =< C, C =< $Z -> true; -percent_ok(C) when $a =< C, C =< $z -> true; -percent_ok(_) -> false. - -is_hex_digit(C) -> - ($0 =< C andalso C =< $9) orelse ($a =< C andalso C =< $f) orelse ($A =< C andalso C =< $F). - -check_utf8(Cs) -> - case unicode:characters_to_list(Cs) of - {incomplete, _, _} -> {error, nil}; - {error, _, _} -> {error, nil}; - _ -> {ok, Cs} - end. - -uri_parse(String) -> - case uri_string:parse(String) of - {error, _, _} -> {error, nil}; - Uri -> - {ok, {uri, - maps_get_optional(Uri, scheme), - maps_get_optional(Uri, userinfo), - maps_get_optional(Uri, host), - maps_get_optional(Uri, port), - maps_get_or(Uri, path, <<>>), - maps_get_optional(Uri, query), - maps_get_optional(Uri, fragment) - }} - end. - -maps_get_optional(Map, Key) -> - try {some, maps:get(Key, Map)} - catch _:_ -> none - end. - -maps_get_or(Map, Key, Default) -> - try maps:get(Key, Map) - catch _:_ -> Default - end. - -print(String) -> - io:put_chars(String), - nil. - -println(String) -> - io:put_chars([String, $\n]), - nil. - -print_error(String) -> - io:put_chars(standard_error, String), - nil. - -println_error(String) -> - io:put_chars(standard_error, [String, $\n]), - nil. - -inspect(true) -> - "True"; -inspect(false) -> - "False"; -inspect(nil) -> - "Nil"; -inspect(Atom) when is_atom(Atom) -> - Binary = erlang:atom_to_binary(Atom), - case inspect_maybe_gleam_atom(Binary, none, <<>>) of - {ok, Inspected} -> Inspected; - {error, _} -> ["atom.create_from_string(\"", Binary, "\")"] - end; -inspect(Any) when is_integer(Any) -> - erlang:integer_to_list(Any); -inspect(Any) when is_float(Any) -> - io_lib_format:fwrite_g(Any); -inspect(Binary) when is_binary(Binary) -> - case inspect_maybe_utf8_string(Binary, <<>>) of - {ok, InspectedUtf8String} -> InspectedUtf8String; - {error, not_a_utf8_string} -> - Segments = [erlang:integer_to_list(X) || <> <= Binary], - ["<<", lists:join(", ", Segments), ">>"] - end; -inspect(List) when is_list(List) -> - case inspect_list(List) of - {proper, Elements} -> ["[", Elements, "]"]; - {improper, Elements} -> ["//erl([", Elements, "])"] - end; -inspect(Any) when is_tuple(Any) % Record constructors - andalso is_atom(element(1, Any)) - andalso element(1, Any) =/= false - andalso element(1, Any) =/= true - andalso element(1, Any) =/= nil --> - [Atom | ArgsList] = erlang:tuple_to_list(Any), - Args = lists:join(<<", ">>, - lists:map(fun inspect/1, ArgsList) - ), - [inspect(Atom), "(", Args, ")"]; -inspect(Tuple) when is_tuple(Tuple) -> - Elements = lists:map(fun inspect/1, erlang:tuple_to_list(Tuple)), - ["#(", lists:join(", ", Elements), ")"]; -inspect(Any) when is_function(Any) -> - {arity, Arity} = erlang:fun_info(Any, arity), - ArgsAsciiCodes = lists:seq($a, $a + Arity - 1), - Args = lists:join(<<", ">>, - lists:map(fun(Arg) -> <> end, ArgsAsciiCodes) - ), - ["//fn(", Args, ") { ... }"]; -inspect(Any) -> - ["//erl(", io_lib:format("~p", [Any]), ")"]. - - -inspect_maybe_gleam_atom(<<>>, none, _) -> - {error, nil}; -inspect_maybe_gleam_atom(<>, none, _) when ?is_digit_char(First) -> - {error, nil}; -inspect_maybe_gleam_atom(<<"_", _Rest/binary>>, none, _) -> - {error, nil}; -inspect_maybe_gleam_atom(<<"_">>, _PrevChar, _Acc) -> - {error, nil}; -inspect_maybe_gleam_atom(<<"_", _Rest/binary>>, $_, _Acc) -> - {error, nil}; -inspect_maybe_gleam_atom(<>, _PrevChar, _Acc) - when not (?is_lowercase_char(First) orelse ?is_underscore_char(First) orelse ?is_digit_char(First)) -> - {error, nil}; -inspect_maybe_gleam_atom(<>, none, Acc) -> - inspect_maybe_gleam_atom(Rest, First, <>); -inspect_maybe_gleam_atom(<<"_", Rest/binary>>, _PrevChar, Acc) -> - inspect_maybe_gleam_atom(Rest, $_, Acc); -inspect_maybe_gleam_atom(<>, $_, Acc) -> - inspect_maybe_gleam_atom(Rest, First, <>); -inspect_maybe_gleam_atom(<>, _PrevChar, Acc) -> - inspect_maybe_gleam_atom(Rest, First, <>); -inspect_maybe_gleam_atom(<<>>, _PrevChar, Acc) -> - {ok, Acc}; -inspect_maybe_gleam_atom(A, B, C) -> - erlang:display({A, B, C}), - throw({gleam_error, A, B, C}). - -inspect_list([]) -> - {proper, []}; -inspect_list([First]) -> - {proper, [inspect(First)]}; -inspect_list([First | Rest]) when is_list(Rest) -> - {Kind, Inspected} = inspect_list(Rest), - {Kind, [inspect(First), <<", ">> | Inspected]}; -inspect_list([First | ImproperTail]) -> - {improper, [inspect(First), <<" | ">>, inspect(ImproperTail)]}. - -inspect_maybe_utf8_string(Binary, Acc) -> - case Binary of - <<>> -> {ok, <<$", Acc/binary, $">>}; - <> -> - Escaped = case First of - $" -> <<$\\, $">>; - $\\ -> <<$\\, $\\>>; - $\r -> <<$\\, $r>>; - $\n -> <<$\\, $n>>; - $\t -> <<$\\, $t>>; - Other -> <> - end, - inspect_maybe_utf8_string(Rest, <>); - _ -> {error, not_a_utf8_string} - end. - -float_to_string(Float) when is_float(Float) -> - erlang:iolist_to_binary(io_lib_format:fwrite_g(Float)). diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam_stdlib.mjs b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam_stdlib.mjs deleted file mode 100644 index fb255d9..0000000 --- a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam_stdlib.mjs +++ /dev/null @@ -1,783 +0,0 @@ -import { - BitString, - Error, - List, - Ok, - Result, - UtfCodepoint, - inspect, - stringBits, - toBitString, -} from "./gleam.mjs"; -import { - CompileError as RegexCompileError, - Match as RegexMatch, -} from "./gleam/regex.mjs"; -import { DecodeError } from "./gleam/dynamic.mjs"; -import { Some, None } from "./gleam/option.mjs"; -import PMap from "./persistent-hash-map.mjs"; - -const Nil = undefined; -const NOT_FOUND = {}; - -export function identity(x) { - return x; -} - -export function parse_int(value) { - if (/^[-+]?(\d+)$/.test(value)) { - return new Ok(parseInt(value)); - } else { - return new Error(Nil); - } -} - -export function parse_float(value) { - if (/^[-+]?(\d+)\.(\d+)$/.test(value)) { - return new Ok(parseFloat(value)); - } else { - return new Error(Nil); - } -} - -export function to_string(term) { - return term.toString(); -} - -export function float_to_string(float) { - const string = float.toString(); - if (string.indexOf(".") >= 0) { - return string; - } else { - return string + ".0"; - } -} - -export function int_to_base_string(int, base) { - return int.toString(base).toUpperCase(); -} - -const int_base_patterns = { - 2: /[^0-1]/, - 3: /[^0-2]/, - 4: /[^0-3]/, - 5: /[^0-4]/, - 6: /[^0-5]/, - 7: /[^0-6]/, - 8: /[^0-7]/, - 9: /[^0-8]/, - 10: /[^0-9]/, - 11: /[^0-9a]/, - 12: /[^0-9a-b]/, - 13: /[^0-9a-c]/, - 14: /[^0-9a-d]/, - 15: /[^0-9a-e]/, - 16: /[^0-9a-f]/, - 17: /[^0-9a-g]/, - 18: /[^0-9a-h]/, - 19: /[^0-9a-i]/, - 20: /[^0-9a-j]/, - 21: /[^0-9a-k]/, - 22: /[^0-9a-l]/, - 23: /[^0-9a-m]/, - 24: /[^0-9a-n]/, - 25: /[^0-9a-o]/, - 26: /[^0-9a-p]/, - 27: /[^0-9a-q]/, - 28: /[^0-9a-r]/, - 29: /[^0-9a-s]/, - 30: /[^0-9a-t]/, - 31: /[^0-9a-u]/, - 32: /[^0-9a-v]/, - 33: /[^0-9a-w]/, - 34: /[^0-9a-x]/, - 35: /[^0-9a-y]/, - 36: /[^0-9a-z]/, -}; - -export function int_from_base_string(string, base) { - if (int_base_patterns[base].test(string.replace(/^-/, "").toLowerCase())) { - return new Error(Nil); - } - - const result = parseInt(string, base); - - if (isNaN(result)) { - return new Error(Nil); - } - - return new Ok(result); -} - -export function string_replace(string, target, substitute) { - if (typeof string.replaceAll !== "undefined") { - return string.replaceAll(target, substitute); - } - // Fallback for older Node.js versions: - // 1. - // 2. - // TODO: This fallback could be remove once Node.js 14 is EOL - // aka on or after 2024-04-30 - return string.replace( - // $& means the whole matched string - new RegExp(target.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), - substitute - ); -} - -export function string_reverse(string) { - return [...string].reverse().join(""); -} - -export function string_length(string) { - if (string === "") { - return 0; - } - const iterator = graphemes_iterator(string); - if (iterator) { - let i = 0; - for (const _ of iterator) { - i++; - } - return i; - } else { - return string.match(/./gsu).length; - } -} - -export function graphemes(string) { - return List.fromArray( - Array.from(graphemes_iterator(string)).map((item) => item.segment) - ); -} - -function graphemes_iterator(string) { - if (Intl && Intl.Segmenter) { - return new Intl.Segmenter().segment(string)[Symbol.iterator](); - } -} - -export function pop_grapheme(string) { - let first; - const iterator = graphemes_iterator(string); - if (iterator) { - first = iterator.next().value?.segment; - } else { - first = string.match(/./su)?.[0]; - } - if (first) { - return new Ok([first, string.slice(first.length)]); - } else { - return new Error(Nil); - } -} - -export function lowercase(string) { - return string.toLowerCase(); -} - -export function uppercase(string) { - return string.toUpperCase(); -} - -export function less_than(a, b) { - return a < b; -} - -export function add(a, b) { - return a + b; -} - -export function equal(a, b) { - return a === b; -} - -export function split(xs, pattern) { - return List.fromArray(xs.split(pattern)); -} - -export function join(xs, separator) { - const iterator = xs[Symbol.iterator](); - let result = iterator.next().value || ""; - let current = iterator.next(); - while (!current.done) { - result = result + separator + current.value; - current = iterator.next(); - } - return result; -} - -export function concat(xs) { - let result = ""; - for (const x of xs) { - result = result + x; - } - return result; -} - -export function length(data) { - return data.length; -} - -export function crop_string(string, substring) { - return string.substring(string.indexOf(substring)); -} - -export function index_of(haystack, needle) { - return haystack.indexOf(needle) | 0; -} - -export function starts_with(haystack, needle) { - return haystack.startsWith(needle); -} - -export function ends_with(haystack, needle) { - return haystack.endsWith(needle); -} - -export function split_once(haystack, needle) { - const index = haystack.indexOf(needle); - if (index >= 0) { - const before = haystack.slice(0, index); - const after = haystack.slice(index + needle.length); - return new Ok([before, after]); - } else { - return new Error(Nil); - } -} - -export function trim(string) { - return string.trim(); -} - -export function trim_left(string) { - return string.trimLeft(); -} - -export function trim_right(string) { - return string.trimRight(); -} - -export function bit_string_from_string(string) { - return toBitString([stringBits(string)]); -} - -export function bit_string_concat(bit_strings) { - return toBitString(bit_strings.toArray().map((b) => b.buffer)); -} - -export function console_log(term) { - console.log(term); -} - -export function console_error(term) { - console.error(term); -} - -export function crash(message) { - throw new globalThis.Error(message); -} - -export function bit_string_to_string(bit_string) { - try { - const decoder = new TextDecoder("utf-8", { fatal: true }); - return new Ok(decoder.decode(bit_string.buffer)); - } catch (_error) { - return new Error(Nil); - } -} - -export function print(string) { - if (typeof process === "object") { - process.stdout.write(string); // We can write without a trailing newline - } else if (typeof Deno === "object") { - Deno.stdout.writeSync(new TextEncoder().encode(string)); // We can write without a trailing newline - } else { - console.log(string); // We're in a browser. Newlines are mandated - } -} - -export function print_error(string) { - if (typeof process === "object" && process.stderr?.write) { - process.stderr.write(string); // We can write without a trailing newline - } else if (typeof Deno === "object") { - Deno.stderr.writeSync(new TextEncoder().encode(string)); // We can write without a trailing newline - } else { - console.error(string); // We're in a browser. Newlines are mandated - } -} - -export function print_debug(string) { - if (typeof process === "object" && process.stderr?.write) { - process.stderr.write(string + "\n"); // If we're in Node.js, use `stderr` - } else if (typeof Deno === "object") { - Deno.stderr.writeSync(new TextEncoder().encode(string + "\n")); // If we're in Deno, use `stderr` - } else { - console.log(string); // Otherwise, use `console.log` (so that it doesn't look like an error) - } -} - -export function ceiling(float) { - return Math.ceil(float); -} - -export function floor(float) { - return Math.floor(float); -} - -export function round(float) { - return Math.round(float); -} - -export function truncate(float) { - return Math.trunc(float); -} - -export function power(base, exponent) { - // It is checked in Gleam that: - // - The base is non-negative and that the exponent is not fractional. - // - The base is non-zero and the exponent is non-negative (otherwise - // the result will essentially be division by zero). - // It can thus be assumed that valid input is passed to the Math.pow - // function and a NaN or Infinity value will not be produced. - return Math.pow(base, exponent); -} - -export function random_uniform() { - const random_uniform_result = Math.random(); - // With round-to-nearest-even behavior, the ranges claimed for the functions below - // (excluding the one for Math.random() itself) aren't exact. - // If extremely large bounds are chosen (2^53 or higher), - // it's possible in extremely rare cases to calculate the usually-excluded upper bound. - // Note that as numbers in JavaScript are IEEE 754 floating point numbers - // See: - // Because of this, we just loop 'until' we get a valid result where 0.0 <= x < 1.0: - if (random_uniform_result === 1.0) { - return random_uniform(); - } - return random_uniform_result; -} - -export function bit_string_slice(bits, position, length) { - const start = Math.min(position, position + length); - const end = Math.max(position, position + length); - if (start < 0 || end > bits.length) return new Error(Nil); - const buffer = new Uint8Array(bits.buffer.buffer, start, Math.abs(length)); - return new Ok(new BitString(buffer)); -} - -export function codepoint(int) { - return new UtfCodepoint(int); -} - -export function string_to_codepoint_integer_list(string) { - return List.fromArray(Array.from(string).map((item) => item.codePointAt(0))); -} - -export function utf_codepoint_list_to_string(utf_codepoint_integer_list) { - return utf_codepoint_integer_list - .toArray() - .map((x) => String.fromCodePoint(x.value)) - .join(""); -} - -export function utf_codepoint_to_int(utf_codepoint) { - return utf_codepoint.value; -} - -export function regex_check(regex, string) { - regex.lastIndex = 0; - return regex.test(string); -} - -export function compile_regex(pattern, options) { - try { - let flags = "gu"; - if (options.case_insensitive) flags += "i"; - if (options.multi_line) flags += "m"; - return new Ok(new RegExp(pattern, flags)); - } catch (error) { - const number = (error.columnNumber || 0) | 0; - return new Error(new RegexCompileError(error.message, number)); - } -} - -export function regex_scan(regex, string) { - const matches = Array.from(string.matchAll(regex)).map((match) => { - const content = match[0]; - const submatches = []; - for (let n = match.length - 1; n > 0; n--) { - if (match[n]) { - submatches[n - 1] = new Some(match[n]); - continue; - } - if (submatches.length > 0) { - submatches[n - 1] = new None(); - } - } - return new RegexMatch(content, List.fromArray(submatches)); - }); - return List.fromArray(matches); -} - -export function new_map() { - return PMap.new(); -} - -export function map_size(map) { - return map.size; -} - -export function map_to_list(map) { - return List.fromArray(map.entries()); -} - -export function map_remove(key, map) { - return map.delete(key); -} - -export function map_get(map, key) { - const value = map.get(key, NOT_FOUND); - if (value === NOT_FOUND) { - return new Error(Nil); - } - return new Ok(value); -} - -export function map_insert(key, value, map) { - return map.set(key, value); -} - -function unsafe_percent_decode(string) { - return decodeURIComponent((string || "").replace("+", " ")); -} - -export function percent_decode(string) { - try { - return new Ok(unsafe_percent_decode(string)); - } catch (_error) { - return new Error(Nil); - } -} - -export function percent_encode(string) { - return encodeURIComponent(string); -} - -export function parse_query(query) { - try { - const pairs = []; - for (const section of query.split("&")) { - const [key, value] = section.split("="); - if (!key) continue; - pairs.push([unsafe_percent_decode(key), unsafe_percent_decode(value)]); - } - return new Ok(List.fromArray(pairs)); - } catch (_error) { - return new Error(Nil); - } -} - -// From https://developer.mozilla.org/en-US/docs/Glossary/Base64#Solution_2_%E2%80%93_rewrite_the_DOMs_atob()_and_btoa()_using_JavaScript's_TypedArrays_and_UTF-8 -export function encode64(bit_string) { - const aBytes = bit_string.buffer; - let nMod3 = 2; - let sB64Enc = ""; - - for (let nLen = aBytes.length, nUint24 = 0, nIdx = 0; nIdx < nLen; nIdx++) { - nMod3 = nIdx % 3; - if (nIdx > 0 && ((nIdx * 4) / 3) % 76 === 0) { - sB64Enc += "\r\n"; - } - nUint24 |= aBytes[nIdx] << ((16 >>> nMod3) & 24); - if (nMod3 === 2 || aBytes.length - nIdx === 1) { - sB64Enc += String.fromCharCode( - uint6ToB64((nUint24 >>> 18) & 63), - uint6ToB64((nUint24 >>> 12) & 63), - uint6ToB64((nUint24 >>> 6) & 63), - uint6ToB64(nUint24 & 63) - ); - nUint24 = 0; - } - } - - return ( - sB64Enc.substr(0, sB64Enc.length - 2 + nMod3) + - (nMod3 === 2 ? "" : nMod3 === 1 ? "=" : "==") - ); -} - -// From https://developer.mozilla.org/en-US/docs/Glossary/Base64#Solution_2_%E2%80%93_rewrite_the_DOMs_atob()_and_btoa()_using_JavaScript's_TypedArrays_and_UTF-8 -function uint6ToB64(nUint6) { - return nUint6 < 26 - ? nUint6 + 65 - : nUint6 < 52 - ? nUint6 + 71 - : nUint6 < 62 - ? nUint6 - 4 - : nUint6 === 62 - ? 43 - : nUint6 === 63 - ? 47 - : 65; -} - -// From https://developer.mozilla.org/en-US/docs/Glossary/Base64#Solution_2_%E2%80%93_rewrite_the_DOMs_atob()_and_btoa()_using_JavaScript's_TypedArrays_and_UTF-8 -function b64ToUint6(nChr) { - return nChr > 64 && nChr < 91 - ? nChr - 65 - : nChr > 96 && nChr < 123 - ? nChr - 71 - : nChr > 47 && nChr < 58 - ? nChr + 4 - : nChr === 43 - ? 62 - : nChr === 47 - ? 63 - : 0; -} - -// From https://developer.mozilla.org/en-US/docs/Glossary/Base64#Solution_2_%E2%80%93_rewrite_the_DOMs_atob()_and_btoa()_using_JavaScript's_TypedArrays_and_UTF-8 -export function decode64(sBase64) { - if (sBase64.match(/[^A-Za-z0-9\+\/=]/g)) return new Error(Nil); - const sB64Enc = sBase64.replace(/=/g, ""); - const nInLen = sB64Enc.length; - const nOutLen = (nInLen * 3 + 1) >> 2; - const taBytes = new Uint8Array(nOutLen); - - for ( - let nMod3, nMod4, nUint24 = 0, nOutIdx = 0, nInIdx = 0; - nInIdx < nInLen; - nInIdx++ - ) { - nMod4 = nInIdx & 3; - nUint24 |= b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << (6 * (3 - nMod4)); - if (nMod4 === 3 || nInLen - nInIdx === 1) { - for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) { - taBytes[nOutIdx] = (nUint24 >>> ((16 >>> nMod3) & 24)) & 255; - } - nUint24 = 0; - } - } - - return new Ok(new BitString(taBytes)); -} - -export function classify_dynamic(data) { - if (typeof data === "string") { - return "String"; - } else if (Result.isResult(data)) { - return "Result"; - } else if (List.isList(data)) { - return "List"; - } else if (Number.isInteger(data)) { - return "Int"; - } else if (Array.isArray(data)) { - return `Tuple of ${data.length} elements`; - } else if (BitString.isBitString(data)) { - return "BitString"; - } else if (data instanceof PMap) { - return "Map"; - } else if (typeof data === "number") { - return "Float"; - } else if (data === null) { - return "Null"; - } else if (data === undefined) { - return "Nil"; - } else { - const type = typeof data; - return type.charAt(0).toUpperCase() + type.slice(1); - } -} - -function decoder_error(expected, got) { - return decoder_error_no_classify(expected, classify_dynamic(got)); -} - -function decoder_error_no_classify(expected, got) { - return new Error( - List.fromArray([new DecodeError(expected, got, List.fromArray([]))]) - ); -} - -export function decode_string(data) { - return typeof data === "string" - ? new Ok(data) - : decoder_error("String", data); -} - -export function decode_int(data) { - return Number.isInteger(data) ? new Ok(data) : decoder_error("Int", data); -} - -export function decode_float(data) { - return typeof data === "number" ? new Ok(data) : decoder_error("Float", data); -} - -export function decode_bool(data) { - return typeof data === "boolean" ? new Ok(data) : decoder_error("Bool", data); -} - -export function decode_bit_string(data) { - if (BitString.isBitString(data)) { - return new Ok(data); - } - if (data instanceof Uint8Array) { - return new Ok(new BitString(data)); - } - return decoder_error("BitString", data); -} - -export function decode_tuple(data) { - return Array.isArray(data) ? new Ok(data) : decoder_error("Tuple", data); -} - -export function decode_tuple2(data) { - return decode_tupleN(data, 2); -} - -export function decode_tuple3(data) { - return decode_tupleN(data, 3); -} - -export function decode_tuple4(data) { - return decode_tupleN(data, 4); -} - -export function decode_tuple5(data) { - return decode_tupleN(data, 5); -} - -export function decode_tuple6(data) { - return decode_tupleN(data, 6); -} - -function decode_tupleN(data, n) { - if (Array.isArray(data) && data.length == n) { - return new Ok(data); - } - - const list = decode_exact_length_list(data, n); - if (list) return new Ok(list); - - return decoder_error(`Tuple of ${n} elements`, data); -} - -function decode_exact_length_list(data, n) { - if (!List.isList(data)) return; - - const elements = []; - let current = data; - - for (let i = 0; i < n; i++) { - if (current.isEmpty()) break; - elements.push(current.head); - current = current.tail; - } - - if (elements.length === n && current.isEmpty()) return elements; -} - -export function tuple_get(data, index) { - return index >= 0 && data.length > index - ? new Ok(data[index]) - : new Error(Nil); -} - -export function decode_list(data) { - if (Array.isArray(data)) { - return new Ok(List.fromArray(data)); - } - return List.isList(data) ? new Ok(data) : decoder_error("List", data); -} - -export function decode_result(data) { - return Result.isResult(data) ? new Ok(data) : decoder_error("Result", data); -} - -export function decode_map(data) { - if (data instanceof PMap) { - return new Ok(PMap.fromMap(data)); - } - if (data == null) { - return decoder_error("Map", data); - } - if (typeof data !== "object") { - return decoder_error("Map", data); - } - const proto = Object.getPrototypeOf(data); - if (proto === Object.prototype || proto === null) { - return new Ok(PMap.fromObject(data)); - } - return decoder_error("Map", data); -} - -export function decode_option(data, decoder) { - if (data === null || data === undefined || data instanceof None) - return new Ok(new None()); - if (data instanceof Some) data = data[0]; - const result = decoder(data); - if (result.isOk()) { - return new Ok(new Some(result[0])); - } else { - return result; - } -} - -export function decode_field(value, name) { - const not_a_map_error = () => decoder_error("Map", value); - - if ( - value instanceof PMap || - value instanceof WeakMap || - value instanceof Map - ) { - const entry = map_get(value, name); - return new Ok(entry.isOk() ? new Some(entry[0]) : new None()); - } else if (Object.getPrototypeOf(value) == Object.prototype) { - return try_get_field(value, name, () => new Ok(new None())); - } else { - return try_get_field(value, name, not_a_map_error); - } -} - -function try_get_field(value, field, or_else) { - try { - return field in value ? new Ok(new Some(value[field])) : or_else(); - } catch { - return or_else(); - } -} - -export function byte_size(string) { - return new TextEncoder().encode(string).length; -} - -// In Javascript bitwise operations convert numbers to a sequence of 32 bits -// while Erlang uses arbitrary precision. -// To get around this problem and get consistent results use BigInt and then -// downcast the value back to a Number value. - -export function bitwise_and(x, y) { - return Number(BigInt(x) & BigInt(y)); -} - -export function bitwise_not(x) { - return Number(~BigInt(x)); -} - -export function bitwise_or(x, y) { - return Number(BigInt(x) | BigInt(y)); -} - -export function bitwise_exclusive_or(x, y) { - return Number(BigInt(x) ^ BigInt(y)); -} - -export function bitwise_shift_left(x, y) { - return Number(BigInt(x) << BigInt(y)); -} - -export function bitwise_shift_right(x, y) { - return Number(BigInt(x) >> BigInt(y)); -} diff --git a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/persistent-hash-map.mjs b/build/dev/erlang/gleam_stdlib/_gleam_artefacts/persistent-hash-map.mjs deleted file mode 100644 index ff849d8..0000000 --- a/build/dev/erlang/gleam_stdlib/_gleam_artefacts/persistent-hash-map.mjs +++ /dev/null @@ -1,957 +0,0 @@ -/** - * This file uses jsdoc to annotate types. - * These types can be checked using the typescript compiler with "checkjs" option. - */ - -import { isEqual } from "./gleam.mjs"; - -const referenceMap = new WeakMap(); -const tempDataView = new DataView(new ArrayBuffer(8)); -let referenceUID = 0; -/** - * hash the object by reference using a weak map and incrementing uid - * @param {any} o - * @returns {number} - */ -function hashByReference(o) { - const known = referenceMap.get(o); - if (known !== undefined) { - return known; - } - const hash = referenceUID++; - if (referenceUID === 0x7fffffff) { - referenceUID = 0; - } - referenceMap.set(o, hash); - return hash; -} -/** - * merge two hashes in an order sensitive way - * @param {number} a - * @param {number} b - * @returns {number} - */ -function hashMerge(a, b) { - return (a ^ (b + 0x9e3779b9 + (a << 6) + (a >> 2))) | 0; -} -/** - * standard string hash popularised by java - * @param {string} s - * @returns {number} - */ -function hashString(s) { - let hash = 0; - const len = s.length; - for (let i = 0; i < len; i++) { - hash = (Math.imul(31, hash) + s.charCodeAt(i)) | 0; - } - return hash; -} -/** - * hash a number by converting to two integers and do some jumbling - * @param {number} n - * @returns {number} - */ -function hashNumber(n) { - tempDataView.setFloat64(0, n); - const i = tempDataView.getInt32(0); - const j = tempDataView.getInt32(4); - return Math.imul(0x45d9f3b, (i >> 16) ^ i) ^ j; -} -/** - * hash a BigInt by converting it to a string and hashing that - * @param {BigInt} n - * @returns {number} - */ -function hashBigInt(n) { - return hashString(n.toString()); -} -/** - * hash any js object - * @param {any} o - * @returns {number} - */ -function hashObject(o) { - const proto = Object.getPrototypeOf(o); - if (proto !== null && typeof proto.hashCode === "function") { - try { - const code = o.hashCode(o); - if (typeof code === "number") { - return code; - } - } catch {} - } - if (o instanceof Promise || o instanceof WeakSet || o instanceof WeakMap) { - return hashByReference(o); - } - if (o instanceof Date) { - return hashNumber(o.getTime()); - } - let h = 0; - if (o instanceof ArrayBuffer) { - o = new Uint8Array(o); - } - if (Array.isArray(o) || o instanceof Uint8Array) { - for (let i = 0; i < o.length; i++) { - h = (Math.imul(31, h) + getHash(o[i])) | 0; - } - } else if (o instanceof Set) { - o.forEach((v) => { - h = (h + getHash(v)) | 0; - }); - } else if (o instanceof Map) { - o.forEach((v, k) => { - h = (h + hashMerge(getHash(v), getHash(k))) | 0; - }); - } else { - const keys = Object.keys(o); - for (let i = 0; i < keys.length; i++) { - const k = keys[i]; - const v = o[k]; - h = (h + hashMerge(getHash(v), hashString(k))) | 0; - } - } - return h; -} -/** - * hash any js value - * @param {any} u - * @returns {number} - */ -export function getHash(u) { - if (u === null) return 0x42108422; - if (u === undefined) return 0x42108423; - if (u === true) return 0x42108421; - if (u === false) return 0x42108420; - switch (typeof u) { - case "number": - return hashNumber(u); - case "string": - return hashString(u); - case "bigint": - return hashBigInt(u); - case "object": - return hashObject(u); - case "symbol": - return hashByReference(u); - case "function": - return hashByReference(u); - default: - return 0; // should be unreachable - } -} -/** - * @template K,V - * @typedef {ArrayNode | IndexNode | CollisionNode} Node - */ -/** - * @template K,V - * @typedef {{ type: typeof ENTRY, k: K, v: V }} Entry - */ -/** - * @template K,V - * @typedef {{ type: typeof ARRAY_NODE, size: number, array: (undefined | Entry | Node)[] }} ArrayNode - */ -/** - * @template K,V - * @typedef {{ type: typeof INDEX_NODE, bitmap: number, array: (Entry | Node)[] }} IndexNode - */ -/** - * @template K,V - * @typedef {{ type: typeof COLLISION_NODE, hash: number, array: Entry[] }} CollisionNode - */ -/** - * @typedef {{ val: boolean }} Flag - */ -const SHIFT = 5; // number of bits you need to shift by to get the next bucket -const BUCKET_SIZE = Math.pow(2, SHIFT); -const MASK = BUCKET_SIZE - 1; // used to zero out all bits not in the bucket -const MAX_INDEX_NODE = BUCKET_SIZE / 2; // when does index node grow into array node -const MIN_ARRAY_NODE = BUCKET_SIZE / 4; // when does array node shrink to index node -const ENTRY = 0; -const ARRAY_NODE = 1; -const INDEX_NODE = 2; -const COLLISION_NODE = 3; -/** @type {IndexNode} */ -const EMPTY = { - type: INDEX_NODE, - bitmap: 0, - array: [], -}; -/** - * Mask the hash to get only the bucket corresponding to shift - * @param {number} hash - * @param {number} shift - * @returns {number} - */ -function mask(hash, shift) { - return (hash >>> shift) & MASK; -} -/** - * Set only the Nth bit where N is the masked hash - * @param {number} hash - * @param {number} shift - * @returns {number} - */ -function bitpos(hash, shift) { - return 1 << mask(hash, shift); -} -/** - * Count the number of 1 bits in a number - * @param {number} x - * @returns {number} - */ -function bitcount(x) { - x -= (x >> 1) & 0x55555555; - x = (x & 0x33333333) + ((x >> 2) & 0x33333333); - x = (x + (x >> 4)) & 0x0f0f0f0f; - x += x >> 8; - x += x >> 16; - return x & 0x7f; -} -/** - * Calculate the array index of an item in a bitmap index node - * @param {number} bitmap - * @param {number} bit - * @returns {number} - */ -function index(bitmap, bit) { - return bitcount(bitmap & (bit - 1)); -} -/** - * Efficiently copy an array and set one value at an index - * @template T - * @param {T[]} arr - * @param {number} at - * @param {T} val - * @returns {T[]} - */ -function cloneAndSet(arr, at, val) { - const len = arr.length; - const out = new Array(len); - for (let i = 0; i < len; ++i) { - out[i] = arr[i]; - } - out[at] = val; - return out; -} -/** - * Efficiently copy an array and insert one value at an index - * @template T - * @param {T[]} arr - * @param {number} at - * @param {T} val - * @returns {T[]} - */ -function spliceIn(arr, at, val) { - const len = arr.length; - const out = new Array(len + 1); - let i = 0; - let g = 0; - while (i < at) { - out[g++] = arr[i++]; - } - out[g++] = val; - while (i < len) { - out[g++] = arr[i++]; - } - return out; -} -/** - * Efficiently copy an array and remove one value at an index - * @template T - * @param {T[]} arr - * @param {number} at - * @returns {T[]} - */ -function spliceOut(arr, at) { - const len = arr.length; - const out = new Array(len - 1); - let i = 0; - let g = 0; - while (i < at) { - out[g++] = arr[i++]; - } - ++i; - while (i < len) { - out[g++] = arr[i++]; - } - return out; -} -/** - * Create a new node containing two entries - * @template K,V - * @param {number} shift - * @param {K} key1 - * @param {V} val1 - * @param {number} key2hash - * @param {K} key2 - * @param {V} val2 - * @returns {Node} - */ -function createNode(shift, key1, val1, key2hash, key2, val2) { - const key1hash = getHash(key1); - if (key1hash === key2hash) { - return { - type: COLLISION_NODE, - hash: key1hash, - array: [ - { type: ENTRY, k: key1, v: val1 }, - { type: ENTRY, k: key2, v: val2 }, - ], - }; - } - const addedLeaf = { val: false }; - return assoc( - assocIndex(EMPTY, shift, key1hash, key1, val1, addedLeaf), - shift, - key2hash, - key2, - val2, - addedLeaf - ); -} -/** - * @template T,K,V - * @callback AssocFunction - * @param {T} root - * @param {number} shift - * @param {number} hash - * @param {K} key - * @param {V} val - * @param {Flag} addedLeaf - * @returns {Node} - */ -/** - * Associate a node with a new entry, creating a new node - * @template T,K,V - * @type {AssocFunction,K,V>} - */ -function assoc(root, shift, hash, key, val, addedLeaf) { - switch (root.type) { - case ARRAY_NODE: - return assocArray(root, shift, hash, key, val, addedLeaf); - case INDEX_NODE: - return assocIndex(root, shift, hash, key, val, addedLeaf); - case COLLISION_NODE: - return assocCollision(root, shift, hash, key, val, addedLeaf); - } -} -/** - * @template T,K,V - * @type {AssocFunction,K,V>} - */ -function assocArray(root, shift, hash, key, val, addedLeaf) { - const idx = mask(hash, shift); - const node = root.array[idx]; - // if the corresponding index is empty set the index to a newly created node - if (node === undefined) { - addedLeaf.val = true; - return { - type: ARRAY_NODE, - size: root.size + 1, - array: cloneAndSet(root.array, idx, { type: ENTRY, k: key, v: val }), - }; - } - if (node.type === ENTRY) { - // if keys are equal replace the entry - if (isEqual(key, node.k)) { - if (val === node.v) { - return root; - } - return { - type: ARRAY_NODE, - size: root.size, - array: cloneAndSet(root.array, idx, { - type: ENTRY, - k: key, - v: val, - }), - }; - } - // otherwise upgrade the entry to a node and insert - addedLeaf.val = true; - return { - type: ARRAY_NODE, - size: root.size, - array: cloneAndSet( - root.array, - idx, - createNode(shift + SHIFT, node.k, node.v, hash, key, val) - ), - }; - } - // otherwise call assoc on the child node - const n = assoc(node, shift + SHIFT, hash, key, val, addedLeaf); - // if the child node hasn't changed just return the old root - if (n === node) { - return root; - } - // otherwise set the index to the new node - return { - type: ARRAY_NODE, - size: root.size, - array: cloneAndSet(root.array, idx, n), - }; -} -/** - * @template T,K,V - * @type {AssocFunction,K,V>} - */ -function assocIndex(root, shift, hash, key, val, addedLeaf) { - const bit = bitpos(hash, shift); - const idx = index(root.bitmap, bit); - // if there is already a item at this hash index.. - if ((root.bitmap & bit) !== 0) { - // if there is a node at the index (not an entry), call assoc on the child node - const node = root.array[idx]; - if (node.type !== ENTRY) { - const n = assoc(node, shift + SHIFT, hash, key, val, addedLeaf); - if (n === node) { - return root; - } - return { - type: INDEX_NODE, - bitmap: root.bitmap, - array: cloneAndSet(root.array, idx, n), - }; - } - // otherwise there is an entry at the index - // if the keys are equal replace the entry with the updated value - const nodeKey = node.k; - if (isEqual(key, nodeKey)) { - if (val === node.v) { - return root; - } - return { - type: INDEX_NODE, - bitmap: root.bitmap, - array: cloneAndSet(root.array, idx, { - type: ENTRY, - k: key, - v: val, - }), - }; - } - // if the keys are not equal, replace the entry with a new child node - addedLeaf.val = true; - return { - type: INDEX_NODE, - bitmap: root.bitmap, - array: cloneAndSet( - root.array, - idx, - createNode(shift + SHIFT, nodeKey, node.v, hash, key, val) - ), - }; - } else { - // else there is currently no item at the hash index - const n = root.array.length; - // if the number of nodes is at the maximum, expand this node into an array node - if (n >= MAX_INDEX_NODE) { - // create a 32 length array for the new array node (one for each bit in the hash) - const nodes = new Array(32); - // create and insert a node for the new entry - const jdx = mask(hash, shift); - nodes[jdx] = assocIndex(EMPTY, shift + SHIFT, hash, key, val, addedLeaf); - let j = 0; - let bitmap = root.bitmap; - // place each item in the index node into the correct spot in the array node - // loop through all 32 bits / array positions - for (let i = 0; i < 32; i++) { - if ((bitmap & 1) !== 0) { - const node = root.array[j++]; - nodes[i] = node; - } - // shift the bitmap to process the next bit - bitmap = bitmap >>> 1; - } - return { - type: ARRAY_NODE, - size: n + 1, - array: nodes, - }; - } else { - // else there is still space in this index node - // simply insert a new entry at the hash index - const newArray = spliceIn(root.array, idx, { - type: ENTRY, - k: key, - v: val, - }); - addedLeaf.val = true; - return { - type: INDEX_NODE, - bitmap: root.bitmap | bit, - array: newArray, - }; - } - } -} -/** - * @template T,K,V - * @type {AssocFunction,K,V>} - */ -function assocCollision(root, shift, hash, key, val, addedLeaf) { - // if there is a hash collision - if (hash === root.hash) { - const idx = collisionIndexOf(root, key); - // if this key already exists replace the entry with the new value - if (idx !== -1) { - const entry = root.array[idx]; - if (entry.v === val) { - return root; - } - return { - type: COLLISION_NODE, - hash: hash, - array: cloneAndSet(root.array, idx, { type: ENTRY, k: key, v: val }), - }; - } - // otherwise insert the entry at the end of the array - const size = root.array.length; - addedLeaf.val = true; - return { - type: COLLISION_NODE, - hash: hash, - array: cloneAndSet(root.array, size, { type: ENTRY, k: key, v: val }), - }; - } - // if there is no hash collision, upgrade to an index node - return assoc( - { - type: INDEX_NODE, - bitmap: bitpos(root.hash, shift), - array: [root], - }, - shift, - hash, - key, - val, - addedLeaf - ); -} -/** - * Find the index of a key in the collision node's array - * @template K,V - * @param {CollisionNode} root - * @param {K} key - * @returns {number} - */ -function collisionIndexOf(root, key) { - const size = root.array.length; - for (let i = 0; i < size; i++) { - if (isEqual(key, root.array[i].k)) { - return i; - } - } - return -1; -} -/** - * @template T,K,V - * @callback FindFunction - * @param {T} root - * @param {number} shift - * @param {number} hash - * @param {K} key - * @returns {undefined | Entry} - */ -/** - * Return the found entry or undefined if not present in the root - * @template K,V - * @type {FindFunction,K,V>} - */ -function find(root, shift, hash, key) { - switch (root.type) { - case ARRAY_NODE: - return findArray(root, shift, hash, key); - case INDEX_NODE: - return findIndex(root, shift, hash, key); - case COLLISION_NODE: - return findCollision(root, key); - } -} -/** - * @template K,V - * @type {FindFunction,K,V>} - */ -function findArray(root, shift, hash, key) { - const idx = mask(hash, shift); - const node = root.array[idx]; - if (node === undefined) { - return undefined; - } - if (node.type !== ENTRY) { - return find(node, shift + SHIFT, hash, key); - } - if (isEqual(key, node.k)) { - return node; - } - return undefined; -} -/** - * @template K,V - * @type {FindFunction,K,V>} - */ -function findIndex(root, shift, hash, key) { - const bit = bitpos(hash, shift); - if ((root.bitmap & bit) === 0) { - return undefined; - } - const idx = index(root.bitmap, bit); - const node = root.array[idx]; - if (node.type !== ENTRY) { - return find(node, shift + SHIFT, hash, key); - } - if (isEqual(key, node.k)) { - return node; - } - return undefined; -} -/** - * @template K,V - * @param {CollisionNode} root - * @param {K} key - * @returns {undefined | Entry} - */ -function findCollision(root, key) { - const idx = collisionIndexOf(root, key); - if (idx < 0) { - return undefined; - } - return root.array[idx]; -} -/** - * @template T,K,V - * @callback WithoutFunction - * @param {T} root - * @param {number} shift - * @param {number} hash - * @param {K} key - * @returns {undefined | Node} - */ -/** - * Remove an entry from the root, returning the updated root. - * Returns undefined if the node should be removed from the parent. - * @template K,V - * @type {WithoutFunction,K,V>} - * */ -function without(root, shift, hash, key) { - switch (root.type) { - case ARRAY_NODE: - return withoutArray(root, shift, hash, key); - case INDEX_NODE: - return withoutIndex(root, shift, hash, key); - case COLLISION_NODE: - return withoutCollision(root, key); - } -} -/** - * @template K,V - * @type {WithoutFunction,K,V>} - */ -function withoutArray(root, shift, hash, key) { - const idx = mask(hash, shift); - const node = root.array[idx]; - if (node === undefined) { - return root; // already empty - } - let n = undefined; - // if node is an entry and the keys are not equal there is nothing to remove - // if node is not an entry do a recursive call - if (node.type === ENTRY) { - if (!isEqual(node.k, key)) { - return root; // no changes - } - } else { - n = without(node, shift + SHIFT, hash, key); - if (n === node) { - return root; // no changes - } - } - // if the recursive call returned undefined the node should be removed - if (n === undefined) { - // if the number of child nodes is at the minimum, pack into an index node - if (root.size <= MIN_ARRAY_NODE) { - const arr = root.array; - const out = new Array(root.size - 1); - let i = 0; - let j = 0; - let bitmap = 0; - while (i < idx) { - const nv = arr[i]; - if (nv !== undefined) { - out[j] = nv; - bitmap |= 1 << i; - ++j; - } - ++i; - } - ++i; // skip copying the removed node - while (i < arr.length) { - const nv = arr[i]; - if (nv !== undefined) { - out[j] = nv; - bitmap |= 1 << i; - ++j; - } - ++i; - } - return { - type: INDEX_NODE, - bitmap: bitmap, - array: out, - }; - } - return { - type: ARRAY_NODE, - size: root.size - 1, - array: cloneAndSet(root.array, idx, n), - }; - } - return { - type: ARRAY_NODE, - size: root.size, - array: cloneAndSet(root.array, idx, n), - }; -} -/** - * @template K,V - * @type {WithoutFunction,K,V>} - */ -function withoutIndex(root, shift, hash, key) { - const bit = bitpos(hash, shift); - if ((root.bitmap & bit) === 0) { - return root; // already empty - } - const idx = index(root.bitmap, bit); - const node = root.array[idx]; - // if the item is not an entry - if (node.type !== ENTRY) { - const n = without(node, shift + SHIFT, hash, key); - if (n === node) { - return root; // no changes - } - // if not undefined, the child node still has items, so update it - if (n !== undefined) { - return { - type: INDEX_NODE, - bitmap: root.bitmap, - array: cloneAndSet(root.array, idx, n), - }; - } - // otherwise the child node should be removed - // if it was the only child node, remove this node from the parent - if (root.bitmap === bit) { - return undefined; - } - // otherwise just remove the child node - return { - type: INDEX_NODE, - bitmap: root.bitmap ^ bit, - array: spliceOut(root.array, idx), - }; - } - // otherwise the item is an entry, remove it if the key matches - if (isEqual(key, node.k)) { - if (root.bitmap === bit) { - return undefined; - } - return { - type: INDEX_NODE, - bitmap: root.bitmap ^ bit, - array: spliceOut(root.array, idx), - }; - } - return root; -} -/** - * @template K,V - * @param {CollisionNode} root - * @param {K} key - * @returns {undefined | Node} - */ -function withoutCollision(root, key) { - const idx = collisionIndexOf(root, key); - // if the key not found, no changes - if (idx < 0) { - return root; - } - // otherwise the entry was found, remove it - // if it was the only entry in this node, remove the whole node - if (root.array.length === 1) { - return undefined; - } - // otherwise just remove the entry - return { - type: COLLISION_NODE, - hash: root.hash, - array: spliceOut(root.array, idx), - }; -} -/** - * @template K,V - * @param {undefined | Node} root - * @param {(value:V,key:K)=>void} fn - * @returns {void} - */ -function forEach(root, fn) { - if (root === undefined) { - return; - } - const items = root.array; - const size = items.length; - for (let i = 0; i < size; i++) { - const item = items[i]; - if (item === undefined) { - continue; - } - if (item.type === ENTRY) { - fn(item.v, item.k); - continue; - } - forEach(item, fn); - } -} -/** - * Extra wrapper to keep track of map size and clean up the API - * @template K,V - */ -export default class PMap { - /** - * @template V - * @param {Record} o - * @returns {PMap} - */ - static fromObject(o) { - const keys = Object.keys(o); - /** @type PMap */ - let m = PMap.new(); - for (let i = 0; i < keys.length; i++) { - const k = keys[i]; - m = m.set(k, o[k]); - } - return m; - } - /** - * @template K,V - * @param {Map} o - * @returns {PMap} - */ - static fromMap(o) { - /** @type PMap */ - let m = PMap.new(); - o.forEach((v, k) => { - m = m.set(k, v); - }); - return m; - } - static new() { - return new PMap(undefined, 0); - } - /** - * @param {undefined | Node} root - * @param {number} size - */ - constructor(root, size) { - this.root = root; - this.size = size; - } - /** - * @template NotFound - * @param {K} key - * @param {NotFound} notFound - * @returns {NotFound | V} - */ - get(key, notFound) { - if (this.root === undefined) { - return notFound; - } - const found = find(this.root, 0, getHash(key), key); - if (found === undefined) { - return notFound; - } - return found.v; - } - /** - * @param {K} key - * @param {V} val - * @returns {PMap} - */ - set(key, val) { - const addedLeaf = { val: false }; - const root = this.root === undefined ? EMPTY : this.root; - const newRoot = assoc(root, 0, getHash(key), key, val, addedLeaf); - if (newRoot === this.root) { - return this; - } - return new PMap(newRoot, addedLeaf.val ? this.size + 1 : this.size); - } - /** - * @param {K} key - * @returns {PMap} - */ - delete(key) { - if (this.root === undefined) { - return this; - } - const newRoot = without(this.root, 0, getHash(key), key); - if (newRoot === this.root) { - return this; - } - if (newRoot === undefined) { - return PMap.new(); - } - return new PMap(newRoot, this.size - 1); - } - /** - * @param {K} key - * @returns {boolean} - */ - has(key) { - if (this.root === undefined) { - return false; - } - return find(this.root, 0, getHash(key), key) !== undefined; - } - /** - * @returns {[K,V][]} - */ - entries() { - if (this.root === undefined) { - return []; - } - /** @type [K,V][] */ - const result = []; - this.forEach((v, k) => result.push([k, v])); - return result; - } - /** - * - * @param {(val:V,key:K)=>void} fn - */ - forEach(fn) { - forEach(this.root, fn); - } - hashCode() { - let h = 0; - this.forEach((v, k) => { - h = (h + hashMerge(getHash(v), getHash(k))) | 0; - }); - return h; - } - /** - * @param {unknown} o - * @returns {boolean} - */ - equals(o) { - if (!(o instanceof PMap)) { - return false; - } - let equal = true; - this.forEach((v, k) => { - equal = equal && isEqual(o.get(k, !v), v); - }); - return equal; - } -} diff --git a/build/dev/erlang/gleam_stdlib/ebin/gleam@base.beam b/build/dev/erlang/gleam_stdlib/ebin/gleam@base.beam deleted file mode 100644 index 21d2ee1736c7d3fd36cf92a315baeee9d6c807a2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2680 zcmcImX;c$g7Oo;8NnwB@!GJ6hWl=;)KwJ>eu!(FEaY2PP3n@Y%n^^>0(~TgFI)Zyz zMpV#2p;@$59CbiMR2+mxyCZ0WMo>{XA~cID^9r!focTZZoGij%nk0~_F``DL#i--K zYK=-F7n4<(QYuKqC?ae;4V@?@(eTD2CMBs9vI!j#W@s>;TCy1a?yBwkRg&vgywh`yl=&+T9uUdt-&$ln`e?tA<{}Qoo#!2}bp(32izPW>QfmhfdTp$tdJUTy4XN4HeFV*))_6b2wp; zGbaqC>)8}Gio#qyCxQs`^;{F$eiT+xQIta<>iJ}psaKLwwqCc*6fl7VkE}QX3Ui2r zfJ3lOp9ffOAYkaA6oJg-a|m?cE3-j~`V(ZP63)|CQcxWVpU~Hu(9Eova3vLD>RX6R zS56oc%+IFlpOV=qCyWCO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s@?z<9GdvJU;2>nfnsIBcM0 zv*TEZv&+#;N&kS~tl4JHudEqaR@d?wS+ipN4gT*>)V^NIC-1y^G1cMgXE$!6!N&db zJWsM}1+r|D-ekUNvr~5%! zc+7>v{!Jf;k0(Wc@JVfbu*Z8*f%^t=`IJN?AQ29D9UWoD$;PC~t4R zi4gi$i=&jjR)#~!;_bOw?1$Nb5q%?e_C55qmM{{0 z-=UzqsYdz9Qu{Ud3%g&7eE6qs>laGDc3%G=;f~?Z9fNDv8>D|Sr`z#dUPa^`1HH?m zB;;wMduNrTqberh_L+kI)cngpM!}N5mdsBF=~l;)=K-?uZ96`~Uy_hgM}M@%|hD T#_m$5Q9fsMT)qGf7s7u4AD-0U diff --git a/build/dev/erlang/gleam_stdlib/ebin/gleam@bit_builder.beam b/build/dev/erlang/gleam_stdlib/ebin/gleam@bit_builder.beam deleted file mode 100644 index f623354a5ec28260cbc730102516c0d003735b15..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3080 zcmcguiCYub7M~<6Gps`bgiVPciiiZPpt4jDg@-~|WKj`gLIy|(NlXF(r7Q+TSuCwo z99a}lo+u#er_W+l7O4wL3ko8r!6M);SQK%2GXX2#`vcy5^UL|&bAIQXn>*jVGhY5d z4gjD9tX=Qn=OGPQ1povm004~iqWK6b&YjJbGTHH5J_ix&utXw6!1+4VQVN(7DTmKx zYjcGhmXyVuk?4xV$XqE&fXF~D2N6iQ(j>J=p&*haCC?Zp-asN1a|O{7%_y-jZgv34 z#4Hh$&y`4Zz80HNY0u7LW<;5j@^xamO5eA->azvZW-_&u69873S@^YCFUdYniug9(?>S_VubbfK4taCV*rV)WeH{6ci*A$>W$y9|b8& zmjMdu6UiEQ)bLv^&_D&&*8kcKq@ti9Cep)1Msq||rD#q|V-z&PbY!f72?`oBV0!{+ zih?GX&j9n8p`a-Pb|--IPylmL0RlMRolIiD0R+%|#)YY{|4YHWv>haDp*Kmz!I%Mj z;zYRJj6od(9#X+ToaMNWFv~S(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z!oKQ3E|q{ENP$<&G_WZdGUcc%uUuetp$_yx$$6 zaP1WTtD*7_ME=PBPP22qFSeB@=oIGn|0nTKYEHiwkDAfn-tzdSs*OcLfvnHc<@r7P z?Vw*p-Dr;;H_oe$&Q-o-19aI+ZM&9lyg($VS6(uY31Nc_{zNOM+f~x z>Z<g0^p{>Yueg!FX?6}PqKtdx`<@Z#4l2DQ{z6%q_nv1vS&Mh|IR9Zew(fnL z-X-t%t#@-vMvd1_ZDE|8%opuT47vsPYft#Nc}lN6)f~R%S(;4#w@M^ud7=MStLcoh z3F3F}tMnUg=N06)2bScf`YpPvy`5}uGq=^j=CkpceJ4|0Dec2dw~(e|Z}_~R@V;u^ znn=h$c-r{Z`_m)d&+oh?CVN!>eS}kdDaJW9y?Olz6}!tOvI9q`J*!`-QckWn%W9?i z?%tx%_is3!OJcHCPu}hw`LcWTv+l8r1#bagt^oVi!?yLeYaT{TF%Zb5bqa_KQ6NKz z3YkEr(0s@ovVbh1MbKi%23iW)L3C(2^c~~`t%RH*7wCIv&HwGyhD|UyNrcZG|4zW) K{{-_d0PtUOgjH|= diff --git a/build/dev/erlang/gleam_stdlib/ebin/gleam@bit_string.beam b/build/dev/erlang/gleam_stdlib/ebin/gleam@bit_string.beam deleted file mode 100644 index 71ca4f5151aa5a3b441b51fa789ec2503c164e02..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2688 zcmcgui9b|(8$V~pGNW-FGep`fiH|HJCQ7D3gzQ4DYRqzm(QM6}VH9r^DebhFQ0k?k z&850-y|ziKMAAoEgs7A#E$Y^-_jjaw`@Da^dp@7Lj3kIqj+n(2Vr&H_7fKQ)3FK1ogiaZE0)sCSa!EoyD#3(UDw&&# zp=^b4EvkdcMI1?jwn8N2p~ycq*yDsAU&-H8keNXDcSeGsIp$$uLD;MrjB2mpSa2QUMe1S4vMK($0*bG3O00>N}Ooj{F1V3wMd zri~y(A`K2xhY_f9IvlT#522gGGPR6A%|qafqh&;dcz!R@#Q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Gaf178u5wkkahPtWzLoaeozijub zol04CY*p?DabWFqvzi4N9~_w3aV};NKIHOw_Yr|P7(naeJ;`2^tym`FOWuWQ4vZ``YHNi+8G0a%RnS-SPSC?h$#a zL2#qtiUHSf`)=NoX8Yla_3OXoqz?|+r}w-Ico49PImP_=RIer3Xx3NB;YSPRZBPu> zPHA*&|EhSh&P5YQ*H5=HeKlyi>Gj4Lgxt}&om^ELPt{<0wu9N=d+^s&(3R2B)QrD) zmrCa|>B1c?`A0Iy+7>iy`K0aHYbr%UvO_xugi$ni%{1W zp|5+LT~9A5U*kEd_O*Ao+{U}5@>GOIJRRN1U}%S??V961b$?;|ho+^SDNhK#>`%|B z%1aw(@>@xzePx^bsyFqyxGsMg$vkVEF+WO2Q|^j{7*Mhzwa(j6vefKcV&pdeWY$tm zP>5!DPV8l|z+V#-u;HW!BW=aa*VVVfqFjn%46J*tLN^SR6=dyt<3d*%MH$sS?ISS zUzYjuP_Mg!bT#wKH~;Q$b!AFBFcgA>67U}e+7IyK!e`+4+@Y??{H>9UkPXR3WDBx2 ic{bUW>_m1UyOQ1hUy}e@mMX*h(*qcvxih~((0>8S6y6~K diff --git a/build/dev/erlang/gleam_stdlib/ebin/gleam@bool.beam b/build/dev/erlang/gleam_stdlib/ebin/gleam@bool.beam deleted file mode 100644 index 9a635a10b080edfb884792e3dd912172ae22bf13..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3708 zcmcJSc~lcw7RFNv#0n6M340Vn01;#fn;?sXu*oJE8%3oXl2AY(BoGn;Eh?ZgKqHMH zYV2lFSp}3$P(Viz#TjW(S{vF0X*ZNb1swrL?RgcjoiqPWo%7Yb_r34_>Q(CGrQ#jL zw#H!8B`h!ZKzB)qBL;)12hvfA79gB>CRZd9;5foa^M!bcD4Z{p5I{(hi1~mXE#-(KRpUjGQUL;{qD0H15lQ%e)gGcq1cSkC z2Wut)p+_yy7NF%2NlwC&=`@Juj0@3b+IX?-AqJCzqd-gw6ii}}Ds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#E$N+5NzpbAoqq$xrsZF9EMC0em6&--D?E`f{uS2^9z;CuTHt&k#riU4kCLlwd~K zKyV`X68s1|2s;UULM$PPAR+7_>?Qn-kWDyDI7TS^|GyM`lbV38_scsNwE9mB=09xq B6`}wD diff --git a/build/dev/erlang/gleam_stdlib/ebin/gleam@dynamic.beam b/build/dev/erlang/gleam_stdlib/ebin/gleam@dynamic.beam deleted file mode 100644 index d330144264552bb3f3594c352f08d5c4195a2a0c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32224 zcmce;2|Sct*atjgEH@bqV@bBLlr8JXni~67B9yJ{`_2%l5XrtobXy{%A|)wNQcB65 zHYH^%O4^_H_|BQ7^t{jeeZTMbEzjdW_jRswopY}9zpiuc`^-(Io42T8FndM}O$;^} zP#v@}7!Gv|29tyL3-<8{p?JrIdV~acvHC`ag>chUZc$Y4-~dk~z}qL38bFQ1M~6mv z`1-hch51B!`EW2Au!IG1c?M8{ab!TKAFsEMSD3et+aC>gcr?|`CpO&2i|XUe?h_g8 z5$eYk-{3G0DmOzxE3kTog#|BT zjtFG#D1VRO;IN%;!2wZJW(AayuyATXSg1#^hzHdTOgD<^#%M;34iENm^NEZMi{zve z0mkB_hB4;DPuI~W=jIt55bW&}$qhMT7(_8WqIJPW`^0&K#&H2h=-ozf(1%jv43CcT zcMJER`g1TQ&mQR$6&*}vg)VZ1c!V<=(CMepD>;Ab@eG&g&fut#aqM)F%{Ra&*qetr zM>krLd&$hAxaiY>XnQ_%%T-P$LOgk+`S(|ay zSr!uJ9SxWb2=xtH?&m{wTT+1*0I_iUmz}B-CoN52{nGYpm6n#sf0fk!Dyjcf(oiBO(ZZ(5m?bb?n!}p^ss@~T zgopctdNcHE8C3kM+1h_qt1^etU=Z~$dkuy?v--C^nL*>f?8yv!X7z7-bq3M@vR7x= zGpkjV1nJXetPMshRV7{}#v)>9$V$wWNMq^W)qu>XfL%UrVZLs(dQRG>8^}zoB9Dh> zR9J8{)yFNyBRJaU-%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@kI4AhE^g7gd)qi|VdRo(qOI7R zg7ICBmTF?F^0?V~Lc26>i_M$WL3g=@BX_IOW<+jVzVV#PrL=~OZ+hSKT)#&gE6?;T zxM6;yp|PzVM+=G=UPb0kl+WXIawakgj&#SBs|CMvQAKaMbZ^Ft8DsPs*QE<^4 z*;-R_b}?Gk(Tuf&JQAu|IO3#P2rII;aO;LWMQ_9;=i?mTx3dOLe50=VnOj6wSDCwL zJbdl7P;>)8RgqJby!R2yzYYv8Eae8{s)8jSf2`JcW!Wt#_^~%W)aKVnvWv-&hJCQf z%z+(|hOYOBqB9#SJ!*#1ZCdbOs+4C6=?Z}fg>#ks)N`)xoqsh5Zu9Z@~ z*6(ri2QPg8=@9vI$&Hn5Bc!9Nr)b(ee`G_yTlF4Jn~V!R_2=CwuA*~NZ_=HTFJ-%o ztU~*4=}Z;y|FBTFWVF_2VBvI|!hxJAfyKB>TF|pYOL98{>UYHU@82}h6W(E-6A{y> zS=u!28)VWwv%`HP&aWx7A$YNT^3=DA3(JF^r#r``?Pi-+fB13V+vV%|%Hu?A(pcpM z$2+t8xc%h#R-Y$#VoA3>9yWdT5|0arxwuG)xv2Y+mM_8d4|1klKKm0RlCRyF!>i!e;EnJmcnkbGycK=}-Uh!BZ-=+XJL28&+wmUw zop^sd4Nu31;W_w7JP#j@Pr&cNC*w2l`|+9hL-^zP6Zlj33-}8BC443RD*igY`v2j; a2o~WH6OOD6IqxIqV~ol#aLxy3$NvEdxQv4U diff --git a/build/dev/erlang/gleam_stdlib/ebin/gleam@function.beam b/build/dev/erlang/gleam_stdlib/ebin/gleam@function.beam deleted file mode 100644 index 8675cd187e51a474b0629ab9b257184f2a174566..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5440 zcmcgvi9gia`=7<~nTRoynJA2zNU{vZ7BNF)jZ$g1&e-=Mq>JjJR3v0oe9*?_2s=%_fhOh9~WY?85HF%c{b!D1>{%%nKsA<;-k zAUl#9!c9T~q9WtCevw=(*DqSeF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9Olw;-Aj)9@Zg#F23txMetfoDt3xXNFsWv%=ZnY;krtdz>*&7e~Qq;;1+pZXr$u hr;1yE!*`_r|2&&esP#$FFn9RB2z(c#HGZK`{{?C-Uhn__ diff --git a/build/dev/erlang/gleam_stdlib/ebin/gleam@int.beam b/build/dev/erlang/gleam_stdlib/ebin/gleam@int.beam deleted file mode 100644 index bd96a3e31c9da21075c9dc481ed22fbd923e3f6e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9828 zcmcI}c|27A_y3Hs+>5DU?CaPY+4n8RURkmvYZzuQwqfi_Ns=t7gl;L?loTRKv=SwS zENw&~NhvB)mhbCI??<2C|G#-S_dM_OdCqyAdEIlzoyXX0anZzJ6n!kL%^l2R-3%}o zHa83gV*>|=)2R^@Mr7<7YCsG#JT8{*7f%h3qjS<(;nc`rtTIOwl@&whU5WFHiKT@z z0^k+O4cVP6^17!I*!Vs`>~kJ zSgt^31Za=WMvrC-k7Wyv#YHe8aS_x+j=*qgL=+bz#*ZFPkHoR)5x5OT8#uu^lSadB zP~X5ANe`yR(m8419mGXo*W<0VDuJUp2s(z}9042!V}XmVhO#)5T$lSPg`f!a=~e;|QY5%QzyIf@rYu zyAZHW2*r^=!1^OjZ2V~?Y}C4aM45H_V0m{U3GsI%k+7*0TMURlgha9NpCMpNkyJ;5 z2DTbG#KwQ0guT1255)Ja#PecENGTVILeL|N5&}@17ehcGQ8WU9#2`Wx1`A0bkT{TqK@G|Ecqtr_!YzW9=1d;@hNCsTRRGbWshvSetP6Laspo~DWAV3BLtVbZZ z{{l+?2B;vAJP42j0jdb3fX)H#&lEsv2&4!kdC;A@0bT=Vj+4V7kWvbVMzx$fkwWAo z;nlH_h7Mj6_ort~1X{NlhlR8dhzt@HK}~H6b~R21fs_HM1ghy8;PqCktq0XGf2-+Y zAw3AC;7ve9Qv}ii#n*$b&6MyIqRgL>g(zU4DQw{SX|sdC|CwsY9D#H|jtWS( zFu+@ZcdCtBhqu%Qx6Nv{B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f%-RJiJ8aBtv9wGCx^_EJl_llgJ9>^<)*YI$49PP1Ygn zlMTqmWD~L(nL@TCTaj(a8_9NL`~UAhNMN=mMS(rT{Qb?4OM00Cewq05GFx5+Z2pwx S)z>P6#W-OoB+6eMgZV##fRIoC diff --git a/build/dev/erlang/gleam_stdlib/ebin/gleam@io.beam b/build/dev/erlang/gleam_stdlib/ebin/gleam@io.beam deleted file mode 100644 index bac1e7d11c10316da1be618cb04bdf490d6de84c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1688 zcmcIkc~BE)6yM#D#K_^2a1_NMLyGYt3AJ^CgEd4#)qxNd927O=SaOid%?41^;q<}- zMN3maA%My#h!|-VY7uFf4hSevsn@`uRZ)rziqKl=ZUBe&|9&&Syx;e}_ult5``Z^D zwIK)qD7ivWXk;iB!v_E$4TsAtl@5{V1sWsSglY_!i(@M_V@jPy?(A?$5fn9|R0r1? zT&L`$m#jqO7S&{uz>MJ)R8)<@Y(f;6v)-t*=n$#KkYJ=Bs7_{3%~2tkbcTDiQHkI^ zoWud+AXWvAIXI{wY=t4ZKMXRhOfd|AJSz{P3t>=T6^LONlvpJYeFF@}TjRwr6Es;( z5M2&~Y1T9`%mZ_+xey(N!D1H}7Lc5*#Z*{et){{}ffI=iGr(#q0MTs#*dU;j#IOYH zaO`2QS3qJAE@nJwBZfv34XxFi2pdcEgoA_w!U0Zkrx~0)gHxvXEZowjxHE2D{=*?r z%D?K*o;r8KEy0OJ62WBn-ZxW+|AJ~L8Ac2;xeifE z6A&3@K@qc78(~xs&q(9}p%{kZhW#;~lw>wIat$zmT=84%*UIc0xpS92mcbg+YJt^j z4GDO>%@I$+>r;~u)T}WY5&<%w^EoGoa2ZV)?lC*cB+qte#-R%>en>GJEvN!X1h#Y4 zMm@sST67wjfonpIT3khDu0xPJrEm~2k+C9YWs(Jjxy@3;&Yv5>-)^DyIxdw zo^DwhyIhhRA`H9z;}CR|MKd*fzo{xqe*4PbcME!*y?5^$|6TEqT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O| zd1_7$6S+^~-^L3dlNBL(lJ#%jr)p<=hovBov#GPp@3yLkoELW=)1eSMV>*X$&%{Ef zqN9DNF}(@xl)+H`kh6M_gvnRC10;-(y@Pt+vYf&%?K+{$0Uaiy>_}}yz*&A?K|DnB zzm?^8x{CPVtRy`|e1IaVxw|6=N9R@fpT;y!?h|r2woft&$EI=2Of7qDI)2)2_%s}5 QaBM%UYcE|MUlKy_7mAI?5dZ)H diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_string.cache_meta b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_string.cache_meta deleted file mode 100644 index 59b9691490c4db01a7d36c37b5d53c8f4265b8aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29 ZcmaD+eJF(i3K(IGy{Y=Vi&fT40RUBU1@Hg> diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache deleted file mode 100644 index 52e9b48afe22548f8a1c527e1ad2c41052461d2e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6104 zcmcgw&2JmW73VBPQe2y2#)=YKsG%nYupNSyD!M=cHnt=eY3#IUOfi5{HGy|Uj;OVk zyX@?)Eu$)I6g~J@6fMw?OAamq^wLWLMWxwc+1bCcM(ZyO2fr~YtzR2B_$XU%eVE0;Kl8U+|H|Xw;`G&4Z5jtZ zC~magE#lz1S!rD}aq!-WM(f=ZG&m_+)=3=vzBJ!@RKmf3XDY4#%-}$jtFymgtYCW` z#+oOMZ1Vxjab{*RjAb&sc(ZxU$YwIlY5ZmUY?Ys_^RopU&QL| zWYbq@R;==3ofpTR3j@C7tbv*EK!RWanmbkdj;Zq3IV+Nb%d;JSqg<; zo%-lhp=a+MzsmPDIQs}rJx@!RjLgemksvH^wm~?Egd9j2HB1^8fMV1}heLxtVx=WW z93(ZeR5nM7a>O#3RQ;Q z5IDWa#l)ms3R}AOF2?ir?JyM5Ghy40Fs)%`3H+YW{-H1ZuC#kS$LoS?dkAP(rNsum`)aZcC7y4Yu)GXQOPJvlVSv-UL4^qJPTo;G zZJfVwyYSjYQ1o87yCb{?E+uwUiybvIN*H-*Pv3KP1*T~s?;%LIE8MU4tU*LoBU(c! zYlsFV_F%`CA+#OYj+{`XaTD5+l$5)-T)(|r1J4gNx?bo=G2nR#)^Sc;RY26;^CKWW zY$U2nLql`4CjAQ(`C)mNfbncp>t(1^DCtfBM?WWnp)@Ktg^Rw#Vg>ba1uEBs>-sgQ zz-w33d?pMn64*w|=cwQB+C6*M{))ZF3mVLg&ar?pc7tIH#@RR5Pa1q~gP&&nOjZ3h z@b^iQGcrstqfEqPGOL4-Kd^$OY6bnAoiI;h-D zcqMi+UdyhXh)&$6(6FV58T(nPnmu=8j9u{-FBKNvqGmFt!Izl=USZKw9rD$tt9yrs zSnAANvYs){zO7d|i^(JDja9R(MHsigjtt@&hRuYfd|H(LC>aK#?R%ZWNp*UCO2(=f zEUW&Pf;a|ftl3bHm);2DD5g&diXnrum)EBZo~!aHR;HqZ0rJ7jr!!BmZ3{x_cp27> zv3|A=wV^xI)fP?GT~LcvSfc(n6qXnUE{4HBrbc~^;klt>;1reywW==G5vuaf(WvTq zl3uk!n#1JvbQB~&bamXIk}FD>%DAArtUu0vI$OZz;JEWhrHP*p^tl$I82^x?B}@ix z4lLbJjdZf~#WpNw@$Pc|Rv%J&FEesiSq>E%p@AI3@_uKSs4AHJ7pGSS@-qBN4jsx#-JV;HDs!JN+$gRrcY0* z^5Sm`e=6Kyc;a!qXRX!d2 zC(3`X_|qb1g*9wL&#zA#yj10-m-v|mKl740a-zO8S1;4s3yR;>4Rw6LbMtsV`_}Hl I>r(pif5J(Nm;e9( diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_meta b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_meta deleted file mode 100644 index 7fc5064561179f6f6f9efffbef10807f3d0b82c3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 48 ncmbPVus4MP3K$uo3~nf$o|BrGtDj$#l3LUv@>%xb-6>H3wnz%& diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache deleted file mode 100644 index 10dda4e29a2d3287c038671196a8d34da5217734..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 48078 zcmd^o4{RLQdFRe9DN3|x>S-lQmd$XqHe+&2X~kWUk{HVp*QOoGmgVJ2r6pM*m*h}f zirl4VmzL-zCs(lVTsH{<_g~IPfS!@UsZj%gFU19Fi#r!rz~`oj5ja3#^zMov!ChMi z2!ab@^seCjzVE&Hw>!He&DnaL3Yy26oqylFnfHCa@9*0mX^Cy!5qZ4xLO-pCDYFPQHHkJJuR#qP}ri(Mis2S=si)KmFGCRT%alTDxX5~FX zn%EW>+md2iqVutQsoc#pWLm-z+A}3OOd;Bw>$Tx}m6v!T9Krt^53MlK>ShDAZk86? zOwrM19qxaz)$@g`h2pisxlrfw(t;5R@dFIjy5_th(|eZxrEkc-F%_MEmGJ2lO$&w4 zA(?*kLdfciwF##l8|JVIcFSK0DzSx45f!1{PP%Bp6xNSK5C%0kcR*M#W2g|GNTJ%jU z`?|Gg63eZa7X3aJvqy`*geBIiMblVb>eHgHV3|*7(VJMtQd)Eh%jpNS=tV61TEo#e z7ISMj`Vy8~?cwN;u%tV}(J?GmG91HxEa4vfj^&jB z9E;`s6!v3zWhfkd9ZUFr?8h?oAnt+X<;TL&SFyZ4hI?U|pAJW##q$0P&ckwRHXQvv zmRIMoj^*Yeu7%~DB96fldm8t~vhOFOz_%M#aGCvxLzJ%qS zMtoqBjbpI< z9Pz9AgLB68)so&-F6t%2(67xIXNzwzuo|+@p_P&n<#8m9RBAImt}3U4MWM?VUA?i@gKMR9|1a ze)cM_@jRX`5(i@%)RtYy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vc)vnbQkOm6s?8?*P)DabA z%l{G40YYZkv4nYO0nwS*5~4NZBSo=~K(SL=w8v;rFC_d@!WtEcP;5yJsu~sK&jxot zj1N$11cF*WgrHf|@&zOy7SMQBT+5@HFlEgm1xxy70MNc-XGqAUyeP%+pcs%9NQzVv z+1w>*k2R($b$p$Sd`6SXq&sh}D|uXotZ00d1U5%%^1ae;N($rXDq(y)5E<_qA5iKz zin3Jt@ybKvttdG^M}9j__5^&Y?iNG6@b4#R1ZTM5|xe{|~ z{r{8o9O^)IJJXLGE46JaPBp(C0CXuzH8S^7z8x(5PZC(OWKY4S3{fxDKnx*GUodW~ zsJV@(IW|VykH)mLA2XzBQI72wy@4o5skHkOvu~orBI!)Lz&DYEEeA;l1+$N|?6rg! ziP?9iemSMCA*(8N%+zr9{wuqx2NHzdSM`7)IhbXiBy3KTJwx_WWanTBttCB+XC!VI zt@gU89&4Af*J9)cej8wNMK!GwU z-BP;c_9@-Tc_Ie9s~GSu81P{sqTOf)oEc`o#nBA7cxVPxxV+R554I8>Kmg!vGroZh z{q&I#0Syt4iI+G8H8$vH5lIbS`;oR!jUNnCM*wpbHQR4!9kY#1E^JEvu zewJ(nHpN47QcAa6C8b*~o6;@!N$E~Dj=cXwdH)H#|BcA|Yoon?df5AGqrJcOzj$9c z@bIpuA7c*jJD933{xWfLQfC)lp2+IO1-*DepRMV$CrX!H*Vgk3dcIn^?uBCROC~Pg X8($YbZqj=G6#8>tyE}Kq^IY%Wr8cT{ diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache_meta b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache_meta deleted file mode 100644 index 74611747293b5213e8a6d4a25c9c2a7ec62bc588..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29 ZcmbPVus4MP3K(IGw1ZcRUJLk41prY%27CYj diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache deleted file mode 100644 index 2119af036be50978ba9eeb13bf701b5e3df2bec4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18346 zcmeHPU2GdycIJ>$XwjDC>xmrOv7<4Q>{5y-nWQ9JL=stclC{*VZHh*d_3lC(iX&;9 zA%{CNv~2C72^M+SUG$+aiUMow0)~+%W4CDY)*?WIpeWFwz-ITMK(|Gk257el@|2e? zf&%Jy?wuiL_$NyKNg5RJ$RqLoo^$TG-}&yjJQ428Y(-}xXC7h0OYFpBsoL+ua`AAO z4PKQ$KOEj#Gc>h4saHahBi@&7Cp1(t^x}M9nDrNPd!)$LLgkuj=%urvsA_AHlsgcP zu<0n1mi*O25*sM8!6n9`!3zFDm%Ai!WHE0<@bdS4 z#r!|?;pOB0EBR0R@iH2X=Mz!9)b^kjh9rMHu$ljK0589eW%D1z@RHkiHGg>@UVglP zGyli?@xq3Ray%m8|Fpc>C&{s>Bp=1|(H=?u4A17EB;Uf5J|M}9cz$zGl0U(7>rqL* zizjYuzU;8Uk`-k-{849h`-|r4~6A}^sulzh9@qEg=r z{yvv?EWNT;|EOP*7+cI;qW_lIB`L*@M*Lm+tzt{Lgu0Hc>{XRD{hC%$@SEb8imKSW zRi$R5ZH0!LOi#pO%9BqjFJ4#6RYSA!TcJ?kBZ?`{qn4OeB0U;Y;;EBy{&6H03rU&e z(1oFqs%mi~rU~EfHsKBvYs~qTxh2i68Ll{Td$>G~$Jy~TJ03-`;W!&kv*Dn~q8D@{ zD5NyxF44j%NU6ciJ~6;1@z9uU<$xz1S1PKls6tlys!}y=TQ3?~ck%GqC*tWiq;v5# zE+j~=NrrBr`LpM!*o&5BS_uq$G&V<~=AyjZ|7QPI8I#wm#*Kyry%7-TE4lOBf_jup zvt_ljxPB>2X7!FRt9M{l9}W1&5tQ3E#Q?viLwL@HNoJ+3X%>Dl*EDBcvq)GA&e!pW zbxm2VRaP9`tSH*|YC1fg1|u|A`A3DZf?`%ROLa`tQ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rb=E(|`qM*{oif7nPlBDb VBm=qEcv$~YREu1EZG>-#{|k7ckK+IU diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache_meta b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache_meta deleted file mode 100644 index d3bd477bb8d403636e1cab81fe081b6b24955e6a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67 ucmZpy5=>=)0!Ah%gBwbx=cFd)>Zj%8CzhZJr@bm)Ey?tg4Rezy z(*@GDE)s6Y53Nfw8c*fW`imRCD2Da3f(BLZT9;J5q#D+r-1sfKX8oE)S)lBO2Ox$6SD|rZAkA4 zv5%JRb?mSMEW}GzbR9n4hC@GrecOw<5rUt@K@#)LZ3ZGI)&buGCyv11_rP^L1`%V> z5{s^fDWk6zcQ!u{*ADD%;4&PvS}h&w;P{mRGPtcYx9&jT2XhNLRIBh_9n!H5Se^6? zmY6I(mVc6m4L}A#Ce;X``8G%On645!qxWw6UgW#1DHTO(=W2Ac|IsZZ5nhqaTPK1%DS*#6dl?L?Lo{_Ruv8Kz#?pwCFH@ccsRVKm`Qt|1W^ zHhg8f344(SP(r3-r5E7PVXjE~BQALm9eS~Sz|*~nnWv|n2tpPop@*!nw__F}O*l{k zrbIq61#a6Or%w{$F2{qw2^a@4IukmPy}%3cIU&f(3g--;s@HWG*eO@U?-2Xc!HvCA zZDB~Sd;VS-YWH;z)8kG#-M|lH}STZI+b+Zd#|qcV|9MmfdjFBv5V6d zKE?Xl-&5p)fX?+M1>PFIHwcAjA$WH)gK%TvyLbkCuSpfpM&^VQ^O^Mw=R_)r%|1wz zdH{|kMTbcm>hZZq(at~0pHNzHz5j{M!$-H~`scg(@0oux_+FcnXhK)x)~;{c-?j**7%G?i5pY(O`KP5>=m!^H=%z4)_Klr diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache_meta b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache_meta deleted file mode 100644 index 11d9234d73009d887f340b6abde09bf038446b22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49 ocmaD+eJF(i3K$uo3?3+*o|BrGt6yAFl$n=qansB9uK$<60MaT9DF6Tf diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@iterator.cache b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@iterator.cache deleted file mode 100644 index b02c981bd76273055d668dbb5fdeb68c1f7776b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36568 zcmd6QeQX@(ncvPVX-aF!)MzEyRwQ#wSvEyeBDs`gi?&ROl5C5SZ4Ie2CE7A~Ne;!8 zmb>(RNFozQwsU{@e96IQ_>UlUQ8&Fdff^j{jKd)?e7H18+aPzi3w*}4a1TA#u#2>H z+k>07K@fobJa|n&r;C^L{*^zvp?MxjWg?xnWCk?=8n}v9>Q+caIPJ zYxA+z^y>$b*5=FU%e~3vO9eMK-i9O(+S~2iV!LgYZocx#8 ziLp;xaq?$v!(;EZ;pCGIgJU0Wz{$~6dF)sUC$(Eg#;)Irlb1~+{W^{hT8;E)INsi1 zqgTQUc&MAZX^8@ z93!@op1|=@C)&bs^Ilws zLudzwX`1PsI67O*^dOGU@VBX3%=FC-X8Ii*KiFudKfuww*-Q`PD7TyGmvMY^tC@Zq z$MAMDJ%!_!x0~tI9cKEYooIuO-DcXn3-@;79LG|ZnSLF|;QeNL1jlFl@%sTYoynjL z9Pb=9)9>M!ID%*3*m)Gs#Buo;?#1!ZFrI;KX?+)!f|s9 z=QvVNV@xOsXTbD2%920rmgJa|h&T)LJgumms zS;n(*d~_9k$MO1g{Dx!e3+N|~4{n&&2g&s1RxCY^&u(CfHYC&Lreu02j?UYX=?op| zWO^9K((TFgt2m~1;vC1|?qqrdN5;m#ILtk`4@c@={EOqG`_Lwi!EXGHW1Pfa& zb5~sO@g_6re9vgLj1;kTB4KSDcV^5aI1r=`xwL!4x_imm+l$lwPOCp-^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@h0&60q#(YW3@YOWWh;x^ zcjJYwFNkn2<=MoP5Qi)}0#uRwSS~T+dvkM~swByX*J}!mIq-iUK7Ul!z97R2wJ&&o z3#5&tRlv1=y?Mj=8L!AD>4EB!k7P&t-ZFlvNjrL0+nl%)%Q;KS2?w*`lGfrjd~y&u zlp0Sp8GWOREG{VWuIJx;UNS5rCIN=+3r@nf<*U|LbHnpIl({CS0@ur8AUMNR-)cYuB4CjH%nI+orZf`(f!!2dJ zM7FaHn%f)1mji=XdltcE8f;xFrc+7(1xWvwTd50?LFshg?IhN*cSDXOvUNOU%7p9^ zSS)})xb75y9E6;UDX!+AiZoQq`Ac}m9<&SUQ2DDeu!_0HuShRp=ES|KrUN#4h_YzP zGJ-*bK+M1=+ct04JMxaVn7qy;R;(we{$w-De+*jW+VNecb*S4qw8J_+VV%0mx-ep0 zyv=emmb=5Mbz8L^)=PudOFOLJAGCgd2S3be?Z*F1C*t+NV}$CS5D2HWahUrssHmHB zywo1A({ckfWH5OQ1 aH(zz_p;6u*W3}$IS~JO~u5_^3`TqcD{*l)J diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@iterator.cache_meta b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@iterator.cache_meta deleted file mode 100644 index 926611b8ad869a75a469738c939faf38b10b4701..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 140 zcmY#5_BDk83K-d-3?3+*o|BrGt6!8_T$)qDi6WMnSHguNkds-ArX)A90M(rQf|AVq WJZ=_8%(% diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache deleted file mode 100644 index b851c182b97c5bb17977fb60a87511ec1e705847..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 46274 zcmd6Q4R9RQo#*t7W!W-9ZVz^d!BJa4kOo;FBbyJ!*dRWw#o)0Z1{p^hjat^&qZwsB zY|B85y^sL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bi0~qeg@K}B<@#^hSX}lxCWF*o@nBT%4SX>`HDLx503>R{^?-hMS7T5Y0Lh@U z+J=!$GxvY!8=3zdp6rFrDT^Nd0>%G0cW~W#0~Uqj?&ulFz0n5RgY0dpYaFCj5A*Rh z9rZSa|J-2eaIlRsdYm0YKF>>RZA&;>GVY!C8XHoN(_s*;!zgU>`7ra{+i|zrYEXEg z${4eHm7;K7^ei`tu;>%sv6T>grZW|RU_^}nQXbiB6q@}o{%OH?4^HTjCCKIy%k9O^ z5_;f)5GDGdZL&`y(27*Tlj!g4`P)5Ic%nv~?+=`ZQ+T?}{9b8Sc)Hwq6a3kx@bnKF z_&)>iFUFYOM)fo)MJkX|5F+Ah0QO78!aWLH3u{Z9Rs`^$4pObJIW#

C&osr#Raq_2w95v88%zrq@?tVOrT)sWX=kxyu6aTQ1 diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@map.cache_meta b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@map.cache_meta deleted file mode 100644 index 12b596fe9170940fe1f7f789913859b02b3c7de6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49 ocmaD+eJF(i3K$uo3?3+*o|BrGtDj#`l9`{kAl^#Rh&{0x0L!Tf-2eap diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache deleted file mode 100644 index 0dc5521fcb3f89c6675e463c1a3e2a67082cd287..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7239 zcmcIpOKc-q6|Glg$DhRUyttD<)UCXvH6n4l+Z|_tuo&{`X%G@kcf~)kNnlWqMzCPSVuWTSG^<(kVuVA4eXce8dlJ%R8Eq)$) zzLKq3&7+-|O54hiTnRU@jR1>ZYw zs`RIM{U=1r?PzMe9cayFSf~vSUjAD^A1-gnXsK$v(X}&u<0$ z7&h$HfX&58nCBZ89$(xuS|;wb-+&pxopCmw>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6|OyoJk5Ayz?qtWZBif*p#z;@IA$;Jqj1S$#u z&fA38S-j18Wn`zLe;TSkG)MM5hMI}Jw#UNs!F10i;gb5jSF%a&rLu`!RL6m3xovm# zPepY46r$7Wbdb#qSyd(;H(n<3kT!<)38o&Q{{vv7+hBDln2wC&$5Ap8nP?4JmS-8I zzQ*(DhUK{FXz^amnLKv@9Ygz$&Rv3i2j+G+#R1Z8Le!B@7Jj!7G^@+dvX<_O#7V!F zh?r9<+BS5&zq&J{()m1{U!W^xy0XA?-UXif(|Df7OIb{}mw7TRx8cw8ylKkYD6(%& O<4Yi}-G98yDeJ#zG+vwl diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache_meta b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache_meta deleted file mode 100644 index 6d890286b5c9aa8ccd46f52d45b2d77bb69a31b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29 YcmbPVus4MP3K(IGZ;F!H!Nmpd08Bpx@c;k- diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache deleted file mode 100644 index 11913184eb6ba177ee2d2e10eff763ecea3b47d8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2695 zcmd5;QES^)6xNk2s}?oh#ke6}vfQL8q(Mz%yP;sl(s=W{fT2+x=tEa3*}iqO$x?iE zon)hsvd6J8*vlTr_8T_n_7ChU{EjIYXwk={80|mXCCg?!D*x&Uen;?yL8* zxYWg~3wZcl@%JkWIR8npl)HN|@Tohz9Wuq}QzoCDL|iHKeXqNhQL$dNGe}#x&tMoK z`z=+&6$7Jg`a=cbTovcKIB!VT^zebI!L_%p;%43c0BOY?)acwnVEm$%J1eO*;GyN`5?OhrLR zQE=|IZK;}~*crIb-JS4Qi$gGs{eZ8;sKAzWgfOn#KK$jo*hiK8rk*UCj_`sUu&_Vw z(PBhg5{!qGc|F4DF{2R;xXZmTAmLNOk0=QRmRqJtu3sn3Gk19G(+Hj%$BCCU$$Lb` zwbAA`O>(OekGIHswfnyFdZIin|(MKl5Kk162%32+k0hxT^- z;)<#vRS`dZ9^3!;!x->}{Y(P>3;-`@C%c_Sd_RC7c(g!VfL37Y1q1SQ9P|X(7KuUv zz(%+D5sY_fFC5Z{3>bAeW%8vP^iwa)OSj7pXVc_+5#NeJ#y1{SEV5&fJC7~W{j3he z$M|kQa&E!G$1bBcfrm%J#Uho*F=1NFN6+}t&{~rmwj>qmJb*Fi5SMKNIITnOg77|v zNv08M$!L{b$U8Rx_VJ5fjiGy%@cvbb_lGtlJO~D82FK+pUWRgEfVo)3i(S0@DrLVy z@Iq3vOM;G6jMwZ#$@L*{{iP;$Hyy%&9jIIMbmBf6xCELQyi<=K)g^>2K1pnZ z4iEx<(L&rrHgN_Ogd;*VBXc*Swf}v>cVUw0$lFrziXpT8>uN2&7j+WmT7afv(kbE%i-pqDQu%TL3R^pVBOKJvfx4he;9@riDx zT72RWxA@EAlsYE7bPhNG)qX>NB6)g)yDZS+AcSv-dOoKt-&6Ols<^a?OV{vf6|cU7 zcj|cOTA>k!KGrwkL|8avW4iL8>qk`1jdNvrfh0jJ(1~^*&}i&)te3%GyZ`A*ld+Kf E1xC%K_W%F@ diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache_meta b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache_meta deleted file mode 100644 index dd414f1ad5abdab1699359cf90ea34d13da80d1e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29 YcmbPVus4MP3K(GwOMy8Jo{2AO07-oXrT_o{ diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache deleted file mode 100644 index 5197de58ecd2892cfb3b5229e7cd43460f345e4f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1875 zcmb`I&rcIU6vy|?b}6hh&DcnU#PEOvr6SOx7ZQG%V2Cl1r6eRx3|-g(R+nwl-2z6v z^ADJK@PG&Z5l@=v#hb>1XQQ4xc@W>swuQ<@F?yMO^JCx6_tWoto%jKB9sELx4b@!a(}Hh+=vDOxrpx#j^h8>_E?by||Kx|Yr-FE=2Zl+rw!QfzO8i1zpu2t)R z>6&JBGD<)TmsV**?pzzU7F#<^(}B@4vl4VpMKm&vzOIsJpb|vKXxRY9dC95*(1SmP zJU5NDyR@stWf9hEevm;MeX)mC+pXcA8*XE`El}RycTjj@NBALb+qiocf$^aV`6aM5AA(){U8*!GlgaPbOYY>bdzIw%tVR%#bJv#%})Yv zz13h^XfQ?cAWS;OfiWBXzzt?$8?&YfrS00S28III(HsrwwJB>cqP0l0KCwpTcwlCn zxm+Tn?Du;YMK{hi%tVR`Bs#5}0+W~F7Nmnco7}Go?(nRNl1fYGX-mi@2DGh2<}9+J zw8RpLys4{C#Y^mt^+cnP0+e^G3g-_}>Cg$GL)pS8=38~aCci?8snXtbYk>ygzjPVs zQbNsEpNZz@P7{$!j2skonq|wAzkZ27p-%HXaq>FxV9v*akqW|QvHagYqf*DV8Nx{= zF&p(6fU|U&Z!E9(tBikJGu;YXN{tjNI~7jW%zG9kj>i_2OgpACR!juoxM1?COX$>E zf!80?ADrx}IiBj_y;HomCw;wA@wk!WMj^dYtBd{{)Ud?tvIy#4$c;W)*KgnJU#Qh8 FwVzRAn~DGc diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_meta b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_meta deleted file mode 100644 index 9243f18b1ee65d9d702e2e03fee7d3c2ff46f5af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29 ZcmbPVus4MP3K(IGNUObfc#g~c0su{021x(_ diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@queue.cache b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@queue.cache deleted file mode 100644 index 8dc536bf436874ffd0706f416634cccebfa79fa5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6994 zcmd^EO>7&-72eq;MRFxdnkY(YCx#|+jgkaonX42DgxZ$mx=Dl}(TXWl*$AX1H4-;k z?o#_>S!oRey%p#oC=j5{DF-77iWUuuoC5ULgPR-*1TD}@iyR8%(iZ5g1q!HdW_Fjm z{E=xmr}iLfxH~gD`+mOfdymhcjPeh(Jcef*_?aj1J73OxGKp~U&6!Up(aF9=jrPJ} zAmwO4#kXzGm!@_tv$2wqaaPkaNSV_ExQ&oLEi3r?0!EGWLJ8r5h6@c`To6;!xAlyy zAX!qP|0^%ZxV@%#kTUa2v{e5Eg2BJ#)%w3=7#wCc>OMSk=6Bio`u!{ng0YSI?J*eq zF~3^>LmmcYwNbCCF!=NMTK$W07`#)wQU7TX27jN_>VKPr!K#dAZor?MMKkm4Pen6J zDmpQ}ZQAbm$C4z$3r)z1ej8;mQrTBY!i5EWSym*8opq$wf>jw@sBi=1rdA!tn&U=Y zmz69+7_aH~*uMt8hibTyPd-0wr4#aP>QlFE5}SJDs73u2b&2B=+wlpE$suzBF+IZ1 ze^FJ*>n-@U7uZeTbZp`Vwnt2xG#%UX4I37jZOW#dKTodTHrgGFdhl&$XNMn9C0EGJ zH^>jJkUiIFZ(FA4voDc-V0Sm5e0uMq+G(r4V_4phWmTe$v@*A&suEiKOKvQG)uQ&k z-}-7iB{NUW3s2=o(erB6%Fn?-CIP?9&XN9{iPLN3UiKGE$vs9WWHhAroGQS=oxJq zM?sY|0v|#_<+q$p$MH;`LMrc4w?81hnzRi~%QDz^crvSy-GdxqVKgOl5C+1%R3L2XuX6y-a{xZ4;d8)S3rI#8NgmEF zaCf9|fK9SU#&|>D6|np^!19eu@>IPcu?`0YM4mS6$ioDj4=D@~0Pk_Y03gO^j<-YM zwl>gqkwp$li{-Qf+59S56pm0-6`^&6;P~h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@Thx<7{sFcWP_iJ z8zogG7cP+N2S#Vtq%M5h*x2CpP9F znJlm3AX6k+qtTqx%Ix-g&K~7kMm7!$AAI;NCj2$SbYrEDy^={^XD4w^C4>Zr^WhCb zC|g%Zw$pN5P?UJo>9j1vW9v1tWjmm*;TTQ0Pnsr}m@TrM2x)xiv2@s^2Ng2UZo!-2 z15Qy?RYK*TjsA1=iC;Z@ocw zP5(ZJ7XB?j>!Xy=Ckm{4)Z23`_Z$GL0R)X27J)QuHAT+u?@(_Ca+O^u**9De>oCqs zAeAlK8;-MqW$fWr$u2GS)-eX^3Srf(XSznSL=B-9LBI)|QJ1cGOqCT)5@ zfZAx9qB>HS*jubigEAFYWWruiF+Jk8!VK9(z5%ePB4N zt8PKKi?3Ri_gEYl`9*f)D!*GQ41*l(M2u|;yb|g>EBpOX78336UD%EJH)J+!edOiW zH=D6bVKe9}7DFqu9C62pFeWxt=h|Y;*b|fQa6CUq)?chmVbk67}2yNbD+CO@ei=?h8p?%dT1`w zQ_QnsE)y;0sT-C*n(_yUuQ=cpHn(*GHowPOD>i`(dQ~w<4wvy`#%r8+Fyp6rLkp${ z{VA9ZL+$cQ`F9FN@9-ITyGmsIN3HsaoOy|AOD~X|`L?VrJ(lIjTiI!Y^OxAE@`|SL zp^>JK!61AX{b=e47;$FcdJkc{Xp9$RLQWySO|tHI=o*?qn?K-oYxf-wFdrtB%)#z@-?~f+e4~vXO358)r@XH1E@e U&WmCmjgxP{ugaZA(|p$SZ;46Iv;Y7A diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@regex.cache_meta b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@regex.cache_meta deleted file mode 100644 index 01c34ade88be50c7fa4765d5d8bae82b8227f88b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49 ocmaD+eJF(i3K$uo3?3+*o|BrGtDj#`l9`_;Ghv%yS=Yu~0M9!M7XSbN diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache deleted file mode 100644 index 843ab93ac540b430d319bc87511b2b20d8355be7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10398 zcmd5?O>7&-73NTsDAAIoF%#KVtY}O-w#YD+N!^4vj+M4S(>BhE4usY<#HF~hR$g-H zB^6t)jRb9wCTIerMOy?p6-5f9ITS^K7J<=IV4y`$MS3Z6X%0E%R0KT)K>+oeH@nN_ za!Jar0~F9wL+;G%%zNMa`(}@_#L%~fpB&*2ZttlU2*CJQ+WCAlpgsnmNhR zxs&Y04NGsej5=f5czj6vgbj0+ip3a<#rW8Q_HukE7Sj^=WPEIij}`gY>e&@TZhnqr zp^ehL*(E+(Zq@ab#Z<|d|Jp)t+rNm>n*bqLUYN$8HJe}r9rwdSh zHpjC?o(<2eMu#4!CLJ-4e!BGdwE2Qj7y4;oVe!J=5DuZNnMb3w z?bMr4WkWX|ac$FZ4AI&&#D?jht6>>6quvsx>>&rIai)&_U)0-eALNk!I%BREyEWp1dDmI45hhq_qhM_xnA{PFF;WQ0l zJ5>Yg#;hs1tA?@O5`ZSQfbBHwrc`lV4v?F&9rLnT*R8M|PKmzQ^`KIpzeteHyRgdW znXKQg$Tn^lvzLIoWAhh_c~Q8O7Z)>?OkSWXem*Nrf*|;_BX^FRRaitw-P-8^j{Xip2_sU%km@2y^7pSjwD379#o5bQYn|t;Cx^cC6bidH{UCYuaRH2vMTh(s!CPZ&R-s{gvyf$eFicwo9)46ksvZa+kzL zeg1k@{6Jh6kBWl0oT4XZv(~l+L*<7RSH5J`Xi8-2xvF8|rYS_thqj5fwUe`G3|#Dnf9qQ(e8DIZbl`@R8)+UJcTL}j$UDntDb4E4j5Tw*UI z<$5DYx@zgj|3?@FfYSjcIsI3MBo{-2wcZmwcZtG+i$a#_jUELX7etFcPJEb{Gn;Gn z6&F9Rc6cP$>kP{M;7-O#`4ep)o}65^ZEKEf0j`UjcQN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^k%J(M~d^gVLLzy<7TYCX#jEM6^sGaN@^o; z_!?%d-q?RgQw@mrSzozIXUe`x*d^AqqPH diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache deleted file mode 100644 index 3deec23bb153e9a44a62312e5b4337f5e10a4c26..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6288 zcmcgwU2Gd!6`nh`jFs#dviw_3-f4RKm3qTOwqrMq;+vb9}Qq*c^RoSS;u z@r;=n_Xk=PRqR`l0P%o$S}psqLi>QKU1`PB3h}Vw2@nq;fdnfadEgZZ6uxukPCRzv zBr1g{9*<|{-Z}St=X~cocb277|77RK_;iEMzOeY`EGr!@GG4e*Di_(-bw^sAg+LlC zjLxqGp;6p$?DY%dCNGrhlPtx*S*v$hD%+GHWA#I3ieFsdtdSgRFrF*(T!R-D=&|Ij zdfH4e(@4eNGgrKu(lrb<(aG%Y6V-SwoBf*Y%qaUVn<@NXIB)X%<@!CAD!t8?o8M(P z`K!6y{ELZ`kJ8oVhiRPrcC6a`%@|Jpovk(hmBq;qa<%67b2vGXuQs30<794PrCFK4 z$=%6D^Bz`M`lwKDeptZC*QaXDD^obBnyj>p&%+EW{RE$fUe10~;O23?7v`VaD z(oEHV&N7_k4TCYm;JJnRnwi2Kth(=%tJycKu69btGFZ1huAGulUfZ$Q{=kvmoHiNb zyj(wuuNUEbcs@Vuc{1rT!yjj#yO1_{rp(hU+p)Tau{3MGWS+C#K>CC!E#tj`Wn8Ua zQOkgxu;y5qA4BvkFuc_;hu;$+i#zFkf`A5Rn92Ea-GNnw2LCZzEF8{gLy}RmB`zuB zf|9UY(UF~X=?mKpJrTC02xNFFpBGo!b|5x;ZY#7sSNJ_Qz$3!(u3NqxwmWu9gmy>L zlgE#Xi+8L}*O38!t*x!8xXO!{g)47Y=IG?!%NR`ls4NcsuEoCt`&%+EYHET!%SYZd zIeS6nN|jGyO>``V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hZ!VMP)_x7Xxwbrm^sW?KdiNQWiWM5#ifwl0Rm-U@Vs zR(TI@O4-HYpdKFb-*L`f---p2LDfITb+9&#+}0?J46Z`ILJf7+3bEJgKLTPPxlcfH z>)E6cL%_9V>t-O1-fl}2A|I|tTE_JVqAtcyZFTHPaR1%z#`bPT?5+x3x#IV*wV@On z9hHP9*mlthJ13wG6V<(s=zt^9M>`{`_to1YOH*TSj&ZhpZbLdUOr+ugccP|7LN>L3 z!eOw2Z&|^Igadqq$60O5AaV`aLE{u014dCjiZc!Xo)VWLVL@PSc<4E)snxDkibD?p z=E%2gWfF+())xC$s@dH5e}EqOT0yS1ytacNf#I&gedq2LWjea8_p|@NChm_cyD3)Sw36lvs3)UGC%RG+GgaL lD$mr4L?1JX0wQ@(rmu4i8T6cxXO7^J)SEYFF8aRb{|DGn0x$po diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache_meta b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache_meta deleted file mode 100644 index 79d164109d59f21d9d1820c266558467a9b06d83..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 84 zcmaD+eJF(i3K*H83@#|0o|BrGtDlouT*8SWlABn-gCbCrT3nh_vRX81=XUYE2LWfH B69fPN diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache deleted file mode 100644 index b20610d535fca18ee01a84fcde8420c359782273..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22005 zcmeHPe{37qednDdOQJ2aXGTfv#L*L-EEFq=7FEZN8e6t($FXWVCTS;`+<-cgCy_G6 zWABcZ?RIl&q-#;M=;m!jTck*4bZcOAU6B2=X2p=D7|<5|V+%T9D9`~*u@&%uwg~n| zTWr%l-}mm0cO;LJ<=9z=#d+e9_ujkr-uL^y-_Q5QyJ5LI)%W(MgPWAWC1tpGVz{?E zDnBMG1543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oh$hkjza-_Q@A;o9j<& z2HZb%_}#@Rw1d&As|oj}rt=YZQDOq{5@Boa_9 zv1{xEA`zE?2y@BiyzHg3Q=c!?+F7y=%^GiMp(7ELO-s_Oap>07%YrhE+}7uY|9F^k zTPX@a;7#PV+EFzB<_S*ty2CM+S)RiH#RTJ*E2hR+TS#QbScV;q;lx-tF!hI6EF|%$ zly3-J9ZoWuo3OOrAQI`o4TWz8)xLTH@|S+!D=G+()S9PK#S_z5B=mJ;$~R#6#hgwoHDiVTueCF ztv#FmngCOO51!5Rc}LX3v-bODD5;(tRZRh5XD-6m$=@^6nK7LPaq@H_8jC)~Yi8^l z_{o0X%o(HJHWspu9>_BS2y`1goO$Xf^} z0XxOk*7&xk#V@qpSB=j|<6l=!09A*D!tZEhxE>Oku{dgcMFjRS^=Wa1ng93LfpKE; zvYF$k+sEYdKD=|Qxf?A38jO54T@;*LBu?)3KDLFEk7yKjDu1Ag%t>&wCq(7s&v#~B zXG$Ve7sOnRTC`nObfdx#1Nt}#VXh-`2`idebyEKDGM|Pp*yuV1Se|wi)Sm_Ed2q{0 z*-)Z=66D6t0XmPnm2-fd$>H`Gk3Bc`y}Yo3%dem``)V*?)HwTl?ZFU=!+&Ka5wSVdSCP9EJM4Oe0jJU=}Vs( ydUFV`B01>p{e&`bFTECS`@Q0QB|QnHCl#SaL!80w_fjf7JMeqg)8~h{75YE*d|_b# diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_meta b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_meta deleted file mode 100644 index 26fbeb9a7ec371451e35c9b076be8b00f4adb84a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 136 zcmZpy5=>=)0!CISgAYol=cFd)>Svau7A2PC7jdD8=42L^@Sup~7nEe?=W(No6{VyW diJ%A-mlS2@rN<|gX669pR5&*-?c@qO3joF~AGH7g diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_builder.cache b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_builder.cache deleted file mode 100644 index dc5c8143aa5da65b8cd1cdbaf3ede40897bedafa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10041 zcmdT~U2Gd!6`ng|XKXi#d*dYSx}>>ryO2h0q9&~n)@Gfg+tqGViP&ycShOT#`^KKE zJ>#7j=Z{J)l@PGvsiN9ypH>megIAyhu~MmcK)mtF8(jo~H_$#nC0<~`oO@@+_Dnl% zlTB$WWtS^C1z3jcf!-t-QrfTxbZRDmxLO?4T&&Ss9~dz`X>7 zqXzD4;vw08b-)!%q69zl*F^lELJlD*@iVlY{{45Gag`A9De z=KB`%bA2$l*}stgVLuH1+P|1cA_TwJ5{85lcS9&~4~~EJpu~WT67NM&;^%NA51_;} z9Cv$B;%{)=>qm)L93^fXM2RLG*9YKSIAVivE*$R+qr?sz+lS#CIMPX!$icDj1^5le zouer6J2-X-jN!PEg8QUUtE4Zh<}$4ba^2bzglw-UWveKRQA`jJ5(FHb%AOG=_)iEv z_X0Y*XaYy4aa4{k=z4XOI|nR97=gbOvd7u4CI;sjih0cmSV%#f`E(?Cw58PRR4XkP zgiOQr8fN{EJl0>%u5jxk-1-p%k2UcL8EhIe@QY1+Y8T$~_GRNmm^Gn6Y7TKuBG!Q&Oxbss>C%YKpcMBS2h?j^JFqOc`J@ASR%hIq6NQRoJrVvZ-zh zh&of>|F}unaU;L3S>CY8WnZ%WPuG)9(eFrwxoqOIdz50AGv z1l*(I4Hm$Tx1WZGdR(4-TaX({)uHWMp2&M@#23KzKyK4n!XkMG6A0_rD194jZ%s~4 zag-700;UQk<=UDF6o2Q)r$<_r4&MU!0xCbT7)#qRma!?*A7&*x%t{bu6QOQ<0>kVg z3o@d_wFkr%u(0BOy#nNWv7(w}wV@R)Ro4iN)mptuYgDsniD-(YuG8uk1S1dAb=9x{ zG2o_RMb#*fc!^z7QOlJokdCW>V&NWp5H?*2BgL`9-GEvyGV_G z@b*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JGAzE2Jufw|!(zH&VYiMX=JuEvC zu4l4X-Qevkxy#^t8V`CqXMAH!Zl-Ca9av-ARJO55A%AIvd}qyPc$vBM{Qi`hT0%*Q z7VtsaY-*Ek>B&7FdS_9_geCKD=Jew-jtz^=I#{o~=a#e?Y3K4sUhcZneQ$0*#H(WG zJ}1Uqi`UEx?{Hsdgp*l}2h(6a zay{a W!Cx%!hYs31hTp@FJ~JV9B>oGOTr=qa diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_meta b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_meta deleted file mode 100644 index b017393eea2ac4a53cca7751a4ca0e94b389f5ff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 189 zcmaD+eJF(i3K%({3{EJWo|BrGtDl)y!i6G`lUZECgCde&P?DLShbmTFQk0pOE`p*C tA{L)inwgW5T7+t9L1JbRH;U?_)b!K}R6~nWi%WA#w5kvA+0^`83IKQWEZzVB diff --git a/build/dev/javascript/gleam_stdlib/gleam.mjs b/build/dev/javascript/gleam_stdlib/gleam.mjs deleted file mode 100644 index c69e523..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam.mjs +++ /dev/null @@ -1,424 +0,0 @@ -export class CustomType { - inspect() { - let field = (label) => { - let value = inspect(this[label]); - return isNaN(parseInt(label)) ? `${label}: ${value}` : value; - }; - let props = Object.keys(this).map(field).join(", "); - return props ? `${this.constructor.name}(${props})` : this.constructor.name; - } - - withFields(fields) { - let properties = Object.keys(this).map((label) => - label in fields ? fields[label] : this[label] - ); - return new this.constructor(...properties); - } -} - -export class List { - static fromArray(array, tail) { - let t = tail || new Empty(); - return array.reduceRight((xs, x) => new NonEmpty(x, xs), t); - } - - static isList(data) { - let variant = data?.__gleam_prelude_variant__; - return variant === "EmptyList" || variant === "NonEmptyList"; - } - - [Symbol.iterator]() { - return new ListIterator(this); - } - - inspect() { - return `[${this.toArray().map(inspect).join(", ")}]`; - } - - toArray() { - return [...this]; - } - - atLeastLength(desired) { - for (let _ of this) { - if (desired <= 0) return true; - desired--; - } - return desired <= 0; - } - - hasLength(desired) { - for (let _ of this) { - if (desired <= 0) return false; - desired--; - } - return desired === 0; - } - - countLength() { - let length = 0; - for (let _ of this) length++; - return length; - } -} - -export function toList(elements, tail) { - return List.fromArray(elements, tail); -} - -class ListIterator { - #current; - - constructor(current) { - this.#current = current; - } - - next() { - if (this.#current.isEmpty()) { - return { done: true }; - } else { - let { head, tail } = this.#current; - this.#current = tail; - return { value: head, done: false }; - } - } -} - -export class Empty extends List { - get __gleam_prelude_variant__() { - return "EmptyList"; - } - - isEmpty() { - return true; - } -} - -export class NonEmpty extends List { - constructor(head, tail) { - super(); - this.head = head; - this.tail = tail; - } - - get __gleam_prelude_variant__() { - return "NonEmptyList"; - } - - isEmpty() { - return false; - } -} - -export class BitString { - static isBitString(data) { - return data?.__gleam_prelude_variant__ === "BitString"; - } - - constructor(buffer) { - if (!(buffer instanceof Uint8Array)) { - throw "BitString can only be constructed from a Uint8Array"; - } - this.buffer = buffer; - } - - get __gleam_prelude_variant__() { - return "BitString"; - } - - inspect() { - return `<<${Array.from(this.buffer).join(", ")}>>`; - } - - get length() { - return this.buffer.length; - } - - byteAt(index) { - return this.buffer[index]; - } - - floatAt(index) { - return byteArrayToFloat(this.buffer.slice(index, index + 8)); - } - - intFromSlice(start, end) { - return byteArrayToInt(this.buffer.slice(start, end)); - } - - binaryFromSlice(start, end) { - return new BitString(this.buffer.slice(start, end)); - } - - sliceAfter(index) { - return new BitString(this.buffer.slice(index)); - } -} - -export class UtfCodepoint { - constructor(value) { - this.value = value; - } - - get __gleam_prelude_variant__() { - return "UtfCodepoint"; - } - - inspect() { - return `//utfcodepoint(${String.fromCodePoint(this.value)})`; - } -} - -export function toBitString(segments) { - let size = (segment) => - segment instanceof Uint8Array ? segment.byteLength : 1; - let bytes = segments.reduce((acc, segment) => acc + size(segment), 0); - let view = new DataView(new ArrayBuffer(bytes)); - let cursor = 0; - for (let segment of segments) { - if (segment instanceof Uint8Array) { - new Uint8Array(view.buffer).set(segment, cursor); - cursor += segment.byteLength; - } else { - view.setInt8(cursor, segment); - cursor++; - } - } - return new BitString(new Uint8Array(view.buffer)); -} - -// Derived from this answer https://stackoverflow.com/questions/8482309/converting-javascript-integer-to-byte-array-and-back -export function sizedInt(int, size) { - let value = int; - if (size < 0) { - return new Uint8Array(); - } - if (size % 8 != 0) { - throw "Needs to be a byte size" + size; - } - const byteArray = new Uint8Array(size / 8); - - for (let index = 0; index < byteArray.length; index++) { - const byte = value & 0xff; - byteArray[index] = byte; - value = (value - byte) / 256; - } - return byteArray.reverse(); -} - -export function byteArrayToInt(byteArray) { - byteArray = byteArray.reverse(); - let value = 0; - for (let i = byteArray.length - 1; i >= 0; i--) { - value = value * 256 + byteArray[i]; - } - return value; -} - -export function byteArrayToFloat(byteArray) { - return new Float64Array(byteArray.reverse().buffer)[0]; -} - -export function stringBits(string) { - return new TextEncoder().encode(string); -} - -export function codepointBits(codepoint) { - return stringBits(String.fromCodePoint(codepoint.value)); -} - -export function float64Bits(float) { - return new Uint8Array(Float64Array.from([float]).buffer).reverse(); -} - -export class Result extends CustomType { - static isResult(data) { - let variant = data?.__gleam_prelude_variant__; - return variant === "Ok" || variant === "Error"; - } -} - -export class Ok extends Result { - constructor(value) { - super(); - this[0] = value; - } - - get __gleam_prelude_variant__() { - return "Ok"; - } - - isOk() { - return true; - } -} - -export class Error extends Result { - constructor(detail) { - super(); - this[0] = detail; - } - - get __gleam_prelude_variant__() { - return "Error"; - } - - isOk() { - return false; - } -} - -export function inspect(v) { - let t = typeof v; - if (v === true) return "True"; - if (v === false) return "False"; - if (v === null) return "//js(null)"; - if (v === undefined) return "Nil"; - if (t === "string") return JSON.stringify(v); - if (t === "bigint" || t === "number") return v.toString(); - if (Array.isArray(v)) return `#(${v.map(inspect).join(", ")})`; - if (v instanceof Set) return `//js(Set(${[...v].map(inspect).join(", ")}))`; - if (v instanceof RegExp) return `//js(${v})`; - if (v instanceof Date) return `//js(Date("${v.toISOString()}"))`; - if (v instanceof Function) { - let args = []; - for (let i of Array(v.length).keys()) - args.push(String.fromCharCode(i + 97)); - return `//fn(${args.join(", ")}) { ... }`; - } - try { - return v.inspect(); - } catch (_) { - return inspectObject(v); - } -} - -function inspectObject(v) { - let [keys, get] = getters(v); - let name = Object.getPrototypeOf(v)?.constructor?.name || "Object"; - let props = []; - for (let k of keys(v)) { - props.push(`${inspect(k)}: ${inspect(get(v, k))}`); - } - let body = props.length ? " " + props.join(", ") + " " : ""; - let head = name === "Object" ? "" : name + " "; - return `//js(${head}{${body}})`; -} - -export function isEqual(x, y) { - let values = [x, y]; - - while (values.length) { - let a = values.pop(); - let b = values.pop(); - if (a === b) continue; - - if (!isObject(a) || !isObject(b)) return false; - let unequal = - !structurallyCompatibleObjects(a, b) || - unequalDates(a, b) || - unequalBuffers(a, b) || - unequalArrays(a, b) || - unequalMaps(a, b) || - unequalSets(a, b); - if (unequal) return false; - - const proto = Object.getPrototypeOf(a); - if (proto !== null && typeof proto.equals === "function") { - try { - if (a.equals(b)) continue; - else return false; - } catch {} - } - - let [keys, get] = getters(a); - for (let k of keys(a)) { - values.push(get(a, k), get(b, k)); - } - } - - return true; -} - -function getters(object) { - if (object instanceof Map) { - return [(x) => x.keys(), (x, y) => x.get(y)]; - } else { - let extra = object instanceof globalThis.Error ? ["message"] : []; - return [(x) => [...extra, ...Object.keys(x)], (x, y) => x[y]]; - } -} - -function unequalDates(a, b) { - return a instanceof Date && (a > b || a < b); -} - -function unequalBuffers(a, b) { - return ( - a.buffer instanceof ArrayBuffer && - a.BYTES_PER_ELEMENT && - !(a.byteLength === b.byteLength && a.every((n, i) => n === b[i])) - ); -} - -function unequalArrays(a, b) { - return Array.isArray(a) && a.length !== b.length; -} - -function unequalMaps(a, b) { - return a instanceof Map && a.size !== b.size; -} - -function unequalSets(a, b) { - return ( - a instanceof Set && (a.size != b.size || [...a].some((e) => !b.has(e))) - ); -} - -function isObject(a) { - return typeof a === "object" && a !== null; -} - -function structurallyCompatibleObjects(a, b) { - if (typeof a !== "object" && typeof b !== "object" && (!a || !b)) - return false; - - let nonstructural = [Promise, WeakSet, WeakMap, Function]; - if (nonstructural.some((c) => a instanceof c)) return false; - - return ( - a.constructor === b.constructor || - (a.__gleam_prelude_variant__ && - a.__gleam_prelude_variant__ === b.__gleam_prelude_variant__) - ); -} - -export function remainderInt(a, b) { - if (b === 0) { - return 0; - } else { - return a % b; - } -} - -export function divideInt(a, b) { - return Math.trunc(divideFloat(a, b)); -} - -export function divideFloat(a, b) { - if (b === 0) { - return 0; - } else { - return a / b; - } -} - -export function makeError(variant, module, line, fn, message, extra) { - let error = new globalThis.Error(message); - error.gleam_error = variant; - error.module = module; - error.line = line; - error.fn = fn; - for (let k in extra) error[k] = extra[k]; - return error; -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/base.mjs b/build/dev/javascript/gleam_stdlib/gleam/base.mjs deleted file mode 100644 index e973764..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/base.mjs +++ /dev/null @@ -1,51 +0,0 @@ -import { makeError, remainderInt } from "../gleam.mjs"; -import * as $bit_string from "../gleam/bit_string.mjs"; -import * as $string from "../gleam/string.mjs"; -import { encode64 as do_encode64, decode64 as do_decode64 } from "../gleam_stdlib.mjs"; - -export function encode64(input, padding) { - let encoded = do_encode64(input); - if (padding) { - return encoded; - } else if (!padding) { - return $string.replace(encoded, "=", ""); - } else { - throw makeError( - "case_no_match", - "gleam/base", - 8, - "encode64", - "No case clause matched", - { values: [padding] } - ) - } -} - -export function decode64(encoded) { - let padded = (() => { - let $ = remainderInt( - $bit_string.byte_size($bit_string.from_string(encoded)), - 4 - ); - if ($ === 0) { - return encoded; - } else { - let n = $; - return $string.append(encoded, $string.repeat("=", 4 - n)); - } - })(); - return do_decode64(padded); -} - -export function url_encode64(input, padding) { - let _pipe = encode64(input, padding); - let _pipe$1 = $string.replace(_pipe, "+", "-"); - return $string.replace(_pipe$1, "/", "_"); -} - -export function url_decode64(encoded) { - let _pipe = encoded; - let _pipe$1 = $string.replace(_pipe, "-", "+"); - let _pipe$2 = $string.replace(_pipe$1, "_", "/"); - return decode64(_pipe$2); -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/bit_builder.mjs b/build/dev/javascript/gleam_stdlib/gleam/bit_builder.mjs deleted file mode 100644 index 04873c9..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/bit_builder.mjs +++ /dev/null @@ -1,177 +0,0 @@ -import { toList, CustomType as $CustomType, makeError } from "../gleam.mjs"; -import * as $bit_string from "../gleam/bit_string.mjs"; -import * as $list from "../gleam/list.mjs"; -import * as $string_builder from "../gleam/string_builder.mjs"; - -class Bits extends $CustomType { - constructor(x0) { - super(); - this[0] = x0; - } -} - -class Text extends $CustomType { - constructor(x0) { - super(); - this[0] = x0; - } -} - -class Many extends $CustomType { - constructor(x0) { - super(); - this[0] = x0; - } -} - -function do_append_builder(first, second) { - if (second instanceof Many) { - let builders = second[0]; - return new Many(toList([first], builders)); - } else { - return new Many(toList([first, second])); - } -} - -export function append_builder(first, second) { - return do_append_builder(first, second); -} - -export function prepend_builder(to, prefix) { - return append_builder(prefix, to); -} - -function do_concat(builders) { - return new Many(builders); -} - -export function new$() { - return do_concat(toList([])); -} - -export function concat(builders) { - return do_concat(builders); -} - -function do_from_string(string) { - return new Text($string_builder.from_string(string)); -} - -export function from_string(string) { - return do_from_string(string); -} - -export function prepend_string(to, prefix) { - return append_builder(from_string(prefix), to); -} - -export function append_string(to, suffix) { - return append_builder(to, from_string(suffix)); -} - -function do_from_string_builder(builder) { - return new Text(builder); -} - -export function from_string_builder(builder) { - return do_from_string_builder(builder); -} - -function do_from_bit_string(bits) { - return new Bits(bits); -} - -export function from_bit_string(bits) { - return do_from_bit_string(bits); -} - -export function prepend(to, prefix) { - return append_builder(from_bit_string(prefix), to); -} - -export function append(to, suffix) { - return append_builder(to, from_bit_string(suffix)); -} - -function do_concat_bit_strings(bits) { - let _pipe = bits; - let _pipe$1 = $list.map(_pipe, (b) => { return from_bit_string(b); }); - return concat(_pipe$1); -} - -export function concat_bit_strings(bits) { - return do_concat_bit_strings(bits); -} - -function to_list(loop$stack, loop$acc) { - while (true) { - let stack = loop$stack; - let acc = loop$acc; - if (stack.hasLength(0)) { - return acc; - } else if (stack.atLeastLength(1) && stack.head.hasLength(0)) { - let remaining_stack = stack.tail; - loop$stack = remaining_stack; - loop$acc = acc; - } else if (stack.atLeastLength(1) && - stack.head.atLeastLength(1) && - stack.head.head instanceof Bits) { - let bits = stack.head.head[0]; - let rest = stack.head.tail; - let remaining_stack = stack.tail; - loop$stack = toList([rest], remaining_stack); - loop$acc = toList([bits], acc); - } else if (stack.atLeastLength(1) && - stack.head.atLeastLength(1) && - stack.head.head instanceof Text) { - let builder = stack.head.head[0]; - let rest = stack.head.tail; - let remaining_stack = stack.tail; - let bits = $bit_string.from_string($string_builder.to_string(builder)); - loop$stack = toList([rest], remaining_stack); - loop$acc = toList([bits], acc); - } else if (stack.atLeastLength(1) && - stack.head.atLeastLength(1) && - stack.head.head instanceof Many) { - let builders = stack.head.head[0]; - let rest = stack.head.tail; - let remaining_stack = stack.tail; - loop$stack = toList([builders, rest], remaining_stack); - loop$acc = acc; - } else { - throw makeError( - "case_no_match", - "gleam/bit_builder", - 220, - "to_list", - "No case clause matched", - { values: [stack] } - ) - } - } -} - -function do_to_bit_string(builder) { - let _pipe = toList([toList([builder])]); - let _pipe$1 = to_list(_pipe, toList([])); - let _pipe$2 = $list.reverse(_pipe$1); - return $bit_string.concat(_pipe$2); -} - -export function to_bit_string(builder) { - return do_to_bit_string(builder); -} - -function do_byte_size(builder) { - let _pipe = toList([toList([builder])]); - let _pipe$1 = to_list(_pipe, toList([])); - return $list.fold( - _pipe$1, - 0, - (acc, builder) => { return $bit_string.byte_size(builder) + acc; }, - ); -} - -export function byte_size(builder) { - return do_byte_size(builder); -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/bit_string.mjs b/build/dev/javascript/gleam_stdlib/gleam/bit_string.mjs deleted file mode 100644 index 9bc01af..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/bit_string.mjs +++ /dev/null @@ -1,45 +0,0 @@ -import { toList } from "../gleam.mjs"; -import { - bit_string_from_string as do_from_string, - length as do_byte_size, - bit_string_slice as do_slice, - bit_string_to_string as do_to_string, - bit_string_concat as do_concat, -} from "../gleam_stdlib.mjs"; - -export function from_string(x) { - return do_from_string(x); -} - -export function byte_size(x) { - return do_byte_size(x); -} - -export function slice(string, position, length) { - return do_slice(string, position, length); -} - -export function to_string(bits) { - return do_to_string(bits); -} - -function do_is_utf8(bits) { - let $ = to_string(bits); - if ($.isOk()) { - return true; - } else { - return false; - } -} - -export function is_utf8(bits) { - return do_is_utf8(bits); -} - -export function concat(bit_strings) { - return do_concat(bit_strings); -} - -export function append(first, second) { - return concat(toList([first, second])); -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/bool.mjs b/build/dev/javascript/gleam_stdlib/gleam/bool.mjs deleted file mode 100644 index def043f..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/bool.mjs +++ /dev/null @@ -1,217 +0,0 @@ -import { makeError } from "../gleam.mjs"; -import * as $order from "../gleam/order.mjs"; - -export function and(a, b) { - return a && b; -} - -export function or(a, b) { - return a || b; -} - -export function negate(bool) { - if (bool) { - return false; - } else if (!bool) { - return true; - } else { - throw makeError( - "case_no_match", - "gleam/bool", - 80, - "negate", - "No case clause matched", - { values: [bool] } - ) - } -} - -export function nor(a, b) { - if (!a && !b) { - return true; - } else if (!a && b) { - return false; - } else if (a && !b) { - return false; - } else if (a && b) { - return false; - } else { - throw makeError( - "case_no_match", - "gleam/bool", - 111, - "nor", - "No case clause matched", - { values: [a, b] } - ) - } -} - -export function nand(a, b) { - if (!a && !b) { - return true; - } else if (!a && b) { - return true; - } else if (a && !b) { - return true; - } else if (a && b) { - return false; - } else { - throw makeError( - "case_no_match", - "gleam/bool", - 144, - "nand", - "No case clause matched", - { values: [a, b] } - ) - } -} - -export function exclusive_or(a, b) { - if (!a && !b) { - return false; - } else if (!a && b) { - return true; - } else if (a && !b) { - return true; - } else if (a && b) { - return false; - } else { - throw makeError( - "case_no_match", - "gleam/bool", - 177, - "exclusive_or", - "No case clause matched", - { values: [a, b] } - ) - } -} - -export function exclusive_nor(a, b) { - if (!a && !b) { - return true; - } else if (!a && b) { - return false; - } else if (a && !b) { - return false; - } else if (a && b) { - return true; - } else { - throw makeError( - "case_no_match", - "gleam/bool", - 210, - "exclusive_nor", - "No case clause matched", - { values: [a, b] } - ) - } -} - -export function compare(a, b) { - if (a && b) { - return new $order.Eq(); - } else if (a && !b) { - return new $order.Gt(); - } else if (!a && !b) { - return new $order.Eq(); - } else if (!a && b) { - return new $order.Lt(); - } else { - throw makeError( - "case_no_match", - "gleam/bool", - 229, - "compare", - "No case clause matched", - { values: [a, b] } - ) - } -} - -export function max(a, b) { - if (a) { - return true; - } else if (!a) { - return b; - } else { - throw makeError( - "case_no_match", - "gleam/bool", - 257, - "max", - "No case clause matched", - { values: [a] } - ) - } -} - -export function min(a, b) { - if (!a) { - return false; - } else if (a) { - return b; - } else { - throw makeError( - "case_no_match", - "gleam/bool", - 281, - "min", - "No case clause matched", - { values: [a] } - ) - } -} - -export function to_int(bool) { - if (!bool) { - return 0; - } else if (bool) { - return 1; - } else { - throw makeError( - "case_no_match", - "gleam/bool", - 300, - "to_int", - "No case clause matched", - { values: [bool] } - ) - } -} - -export function to_string(bool) { - if (!bool) { - return "False"; - } else if (bool) { - return "True"; - } else { - throw makeError( - "case_no_match", - "gleam/bool", - 321, - "to_string", - "No case clause matched", - { values: [bool] } - ) - } -} - -export function guard(requirement, consequence, alternative) { - if (requirement) { - return consequence; - } else if (!requirement) { - return alternative(); - } else { - throw makeError( - "case_no_match", - "gleam/bool", - 384, - "guard", - "No case clause matched", - { values: [requirement] } - ) - } -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/dynamic.mjs b/build/dev/javascript/gleam_stdlib/gleam/dynamic.mjs deleted file mode 100644 index 3753a71..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/dynamic.mjs +++ /dev/null @@ -1,935 +0,0 @@ -import { Ok, Error, toList, CustomType as $CustomType, makeError } from "../gleam.mjs"; -import * as $int from "../gleam/int.mjs"; -import * as $list from "../gleam/list.mjs"; -import * as $map from "../gleam/map.mjs"; -import * as $option from "../gleam/option.mjs"; -import * as $result from "../gleam/result.mjs"; -import * as $string_builder from "../gleam/string_builder.mjs"; -import { - identity as do_from, - identity as do_unsafe_coerce, - decode_bit_string, - decode_string, - classify_dynamic as do_classify, - decode_int, - decode_float, - decode_bool, - decode_list, - decode_result, - decode_option as decode_optional, - decode_field, - decode_tuple, - decode_tuple2, - decode_tuple3, - decode_tuple4, - decode_tuple5, - decode_tuple6, - tuple_get, - length as tuple_size, - decode_map, -} from "../gleam_stdlib.mjs"; - -export class DecodeError extends $CustomType { - constructor(expected, found, path) { - super(); - this.expected = expected; - this.found = found; - this.path = path; - } -} - -export function from(a) { - return do_from(a); -} - -export function unsafe_coerce(a) { - return do_unsafe_coerce(a); -} - -export function dynamic(value) { - return new Ok(value); -} - -export function bit_string(data) { - return decode_bit_string(data); -} - -export function string(data) { - return decode_string(data); -} - -export function classify(data) { - return do_classify(data); -} - -export function int(data) { - return decode_int(data); -} - -export function float(data) { - return decode_float(data); -} - -export function bool(data) { - return decode_bool(data); -} - -export function shallow_list(value) { - return decode_list(value); -} - -export function optional(decode) { - return (value) => { return decode_optional(value, decode); }; -} - -function at_least_decode_tuple_error(size, data) { - let s = (() => { - if (size === 1) { - return ""; - } else { - return "s"; - } - })(); - let error = (() => { - let _pipe = toList([ - "Tuple of at least ", - $int.to_string(size), - " element", - s, - ]); - let _pipe$1 = $string_builder.from_strings(_pipe); - let _pipe$2 = $string_builder.to_string(_pipe$1); - return new DecodeError(_pipe$2, classify(data), toList([])); - })(); - return new Error(toList([error])); -} - -export function any(decoders) { - return (data) => { - if (decoders.hasLength(0)) { - return new Error( - toList([new DecodeError("another type", classify(data), toList([]))]), - ); - } else if (decoders.atLeastLength(1)) { - let decoder = decoders.head; - let decoders$1 = decoders.tail; - let $ = decoder(data); - if ($.isOk()) { - let decoded = $[0]; - return new Ok(decoded); - } else if (!$.isOk()) { - return any(decoders$1)(data); - } else { - throw makeError( - "case_no_match", - "gleam/dynamic", - 1009, - "", - "No case clause matched", - { values: [$] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/dynamic", - 1002, - "", - "No case clause matched", - { values: [decoders] } - ) - } - }; -} - -function all_errors(result) { - if (result.isOk()) { - return toList([]); - } else if (!result.isOk()) { - let errors = result[0]; - return errors; - } else { - throw makeError( - "case_no_match", - "gleam/dynamic", - 1487, - "all_errors", - "No case clause matched", - { values: [result] } - ) - } -} - -export function decode1(constructor, t1) { - return (value) => { - let $ = t1(value); - if ($.isOk()) { - let a = $[0]; - return new Ok(constructor(a)); - } else { - let a = $; - return new Error(all_errors(a)); - } - }; -} - -export function result(decode_ok, decode_error) { - return (value) => { - return $result.try$( - decode_result(value), - (inner_result) => { - if (inner_result.isOk()) { - let raw = inner_result[0]; - return $result.try$( - (() => { - let _pipe = decode_ok(raw); - return map_errors( - _pipe, - (_capture) => { return push_path(_capture, "ok"); }, - ); - })(), - (value) => { return new Ok(new Ok(value)); }, - ); - } else if (!inner_result.isOk()) { - let raw = inner_result[0]; - return $result.try$( - (() => { - let _pipe = decode_error(raw); - return map_errors( - _pipe, - (_capture) => { return push_path(_capture, "error"); }, - ); - })(), - (value) => { return new Ok(new Error(value)); }, - ); - } else { - throw makeError( - "case_no_match", - "gleam/dynamic", - 281, - "", - "No case clause matched", - { values: [inner_result] } - ) - } - }, - ); - }; -} - -function push_path(error, name) { - let name$1 = from(name); - let decoder = any( - toList([string, (x) => { return $result.map(int(x), $int.to_string); }]), - ); - let name$2 = (() => { - let $ = decoder(name$1); - if ($.isOk()) { - let name$2 = $[0]; - return name$2; - } else if (!$.isOk()) { - let _pipe = toList(["<", classify(name$1), ">"]); - let _pipe$1 = $string_builder.from_strings(_pipe); - return $string_builder.to_string(_pipe$1); - } else { - throw makeError( - "case_no_match", - "gleam/dynamic", - 593, - "push_path", - "No case clause matched", - { values: [$] } - ) - } - })(); - return error.withFields({ path: toList([name$2], error.path) }); -} - -export function list(decoder_type) { - return (dynamic) => { - return $result.try$( - shallow_list(dynamic), - (list) => { - let _pipe = list; - let _pipe$1 = $list.try_map(_pipe, decoder_type); - return map_errors( - _pipe$1, - (_capture) => { return push_path(_capture, "*"); }, - ); - }, - ); - }; -} - -function map_errors(result, f) { - return $result.map_error( - result, - (_capture) => { return $list.map(_capture, f); }, - ); -} - -export function field(name, inner_type) { - return (value) => { - let missing_field_error = new DecodeError("field", "nothing", toList([])); - return $result.try$( - decode_field(value, name), - (maybe_inner) => { - let _pipe = maybe_inner; - let _pipe$1 = $option.to_result(_pipe, toList([missing_field_error])); - let _pipe$2 = $result.try$(_pipe$1, inner_type); - return map_errors( - _pipe$2, - (_capture) => { return push_path(_capture, name); }, - ); - }, - ); - }; -} - -export function optional_field(name, inner_type) { - return (value) => { - return $result.try$( - decode_field(value, name), - (maybe_inner) => { - if (maybe_inner instanceof $option.None) { - return new Ok(new $option.None()); - } else if (maybe_inner instanceof $option.Some) { - let dynamic_inner = maybe_inner[0]; - let _pipe = dynamic_inner; - let _pipe$1 = decode_optional(_pipe, inner_type); - return map_errors( - _pipe$1, - (_capture) => { return push_path(_capture, name); }, - ); - } else { - throw makeError( - "case_no_match", - "gleam/dynamic", - 460, - "", - "No case clause matched", - { values: [maybe_inner] } - ) - } - }, - ); - }; -} - -export function element(index, inner_type) { - return (data) => { - return $result.try$( - decode_tuple(data), - (tuple) => { - let size = tuple_size(tuple); - return $result.try$( - (() => { - let $ = index >= 0; - if ($) { - let $1 = index < size; - if ($1) { - return tuple_get(tuple, index); - } else if (!$1) { - return at_least_decode_tuple_error(index + 1, data); - } else { - throw makeError( - "case_no_match", - "gleam/dynamic", - 503, - "", - "No case clause matched", - { values: [$1] } - ) - } - } else if (!$) { - let $1 = $int.absolute_value(index) <= size; - if ($1) { - return tuple_get(tuple, size + index); - } else if (!$1) { - return at_least_decode_tuple_error( - $int.absolute_value(index), - data, - ); - } else { - throw makeError( - "case_no_match", - "gleam/dynamic", - 508, - "", - "No case clause matched", - { values: [$1] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/dynamic", - 501, - "", - "No case clause matched", - { values: [$] } - ) - } - })(), - (data) => { - let _pipe = inner_type(data); - return map_errors( - _pipe, - (_capture) => { return push_path(_capture, index); }, - ); - }, - ); - }, - ); - }; -} - -function tuple_errors(result, name) { - if (result.isOk()) { - return toList([]); - } else if (!result.isOk()) { - let errors = result[0]; - return $list.map( - errors, - (_capture) => { return push_path(_capture, name); }, - ); - } else { - throw makeError( - "case_no_match", - "gleam/dynamic", - 584, - "tuple_errors", - "No case clause matched", - { values: [result] } - ) - } -} - -export function tuple2(decode1, decode2) { - return (value) => { - return $result.try$( - decode_tuple2(value), - (_use0) => { - let a = _use0[0]; - let b = _use0[1]; - let $ = decode1(a); - let $1 = decode2(b); - if ($.isOk() && $1.isOk()) { - let a$1 = $[0]; - let b$1 = $1[0]; - return new Ok([a$1, b$1]); - } else { - let a$1 = $; - let b$1 = $1; - let _pipe = tuple_errors(a$1, "0"); - let _pipe$1 = $list.append(_pipe, tuple_errors(b$1, "1")); - return new Error(_pipe$1); - } - }, - ); - }; -} - -export function tuple3(decode1, decode2, decode3) { - return (value) => { - return $result.try$( - decode_tuple3(value), - (_use0) => { - let a = _use0[0]; - let b = _use0[1]; - let c = _use0[2]; - let $ = decode1(a); - let $1 = decode2(b); - let $2 = decode3(c); - if ($.isOk() && $1.isOk() && $2.isOk()) { - let a$1 = $[0]; - let b$1 = $1[0]; - let c$1 = $2[0]; - return new Ok([a$1, b$1, c$1]); - } else { - let a$1 = $; - let b$1 = $1; - let c$1 = $2; - let _pipe = tuple_errors(a$1, "0"); - let _pipe$1 = $list.append(_pipe, tuple_errors(b$1, "1")); - let _pipe$2 = $list.append(_pipe$1, tuple_errors(c$1, "2")); - return new Error(_pipe$2); - } - }, - ); - }; -} - -export function tuple4(decode1, decode2, decode3, decode4) { - return (value) => { - return $result.try$( - decode_tuple4(value), - (_use0) => { - let a = _use0[0]; - let b = _use0[1]; - let c = _use0[2]; - let d = _use0[3]; - let $ = decode1(a); - let $1 = decode2(b); - let $2 = decode3(c); - let $3 = decode4(d); - if ($.isOk() && $1.isOk() && $2.isOk() && $3.isOk()) { - let a$1 = $[0]; - let b$1 = $1[0]; - let c$1 = $2[0]; - let d$1 = $3[0]; - return new Ok([a$1, b$1, c$1, d$1]); - } else { - let a$1 = $; - let b$1 = $1; - let c$1 = $2; - let d$1 = $3; - let _pipe = tuple_errors(a$1, "0"); - let _pipe$1 = $list.append(_pipe, tuple_errors(b$1, "1")); - let _pipe$2 = $list.append(_pipe$1, tuple_errors(c$1, "2")); - let _pipe$3 = $list.append(_pipe$2, tuple_errors(d$1, "3")); - return new Error(_pipe$3); - } - }, - ); - }; -} - -export function tuple5(decode1, decode2, decode3, decode4, decode5) { - return (value) => { - return $result.try$( - decode_tuple5(value), - (_use0) => { - let a = _use0[0]; - let b = _use0[1]; - let c = _use0[2]; - let d = _use0[3]; - let e = _use0[4]; - let $ = decode1(a); - let $1 = decode2(b); - let $2 = decode3(c); - let $3 = decode4(d); - let $4 = decode5(e); - if ($.isOk() && $1.isOk() && $2.isOk() && $3.isOk() && $4.isOk()) { - let a$1 = $[0]; - let b$1 = $1[0]; - let c$1 = $2[0]; - let d$1 = $3[0]; - let e$1 = $4[0]; - return new Ok([a$1, b$1, c$1, d$1, e$1]); - } else { - let a$1 = $; - let b$1 = $1; - let c$1 = $2; - let d$1 = $3; - let e$1 = $4; - let _pipe = tuple_errors(a$1, "0"); - let _pipe$1 = $list.append(_pipe, tuple_errors(b$1, "1")); - let _pipe$2 = $list.append(_pipe$1, tuple_errors(c$1, "2")); - let _pipe$3 = $list.append(_pipe$2, tuple_errors(d$1, "3")); - let _pipe$4 = $list.append(_pipe$3, tuple_errors(e$1, "4")); - return new Error(_pipe$4); - } - }, - ); - }; -} - -export function tuple6(decode1, decode2, decode3, decode4, decode5, decode6) { - return (value) => { - return $result.try$( - decode_tuple6(value), - (_use0) => { - let a = _use0[0]; - let b = _use0[1]; - let c = _use0[2]; - let d = _use0[3]; - let e = _use0[4]; - let f = _use0[5]; - let $ = decode1(a); - let $1 = decode2(b); - let $2 = decode3(c); - let $3 = decode4(d); - let $4 = decode5(e); - let $5 = decode6(f); - if ($.isOk() && - $1.isOk() && - $2.isOk() && - $3.isOk() && - $4.isOk() && - $5.isOk()) { - let a$1 = $[0]; - let b$1 = $1[0]; - let c$1 = $2[0]; - let d$1 = $3[0]; - let e$1 = $4[0]; - let f$1 = $5[0]; - return new Ok([a$1, b$1, c$1, d$1, e$1, f$1]); - } else { - let a$1 = $; - let b$1 = $1; - let c$1 = $2; - let d$1 = $3; - let e$1 = $4; - let f$1 = $5; - let _pipe = tuple_errors(a$1, "0"); - let _pipe$1 = $list.append(_pipe, tuple_errors(b$1, "1")); - let _pipe$2 = $list.append(_pipe$1, tuple_errors(c$1, "2")); - let _pipe$3 = $list.append(_pipe$2, tuple_errors(d$1, "3")); - let _pipe$4 = $list.append(_pipe$3, tuple_errors(e$1, "4")); - let _pipe$5 = $list.append(_pipe$4, tuple_errors(f$1, "5")); - return new Error(_pipe$5); - } - }, - ); - }; -} - -export function map(key_type, value_type) { - return (value) => { - return $result.try$( - decode_map(value), - (map) => { - return $result.try$( - (() => { - let _pipe = map; - let _pipe$1 = $map.to_list(_pipe); - return $list.try_map( - _pipe$1, - (pair) => { - let k = pair[0]; - let v = pair[1]; - return $result.try$( - (() => { - let _pipe$2 = key_type(k); - return map_errors( - _pipe$2, - (_capture) => { return push_path(_capture, "keys"); }, - ); - })(), - (k) => { - return $result.try$( - (() => { - let _pipe$2 = value_type(v); - return map_errors( - _pipe$2, - (_capture) => { return push_path(_capture, "values"); }, - ); - })(), - (v) => { return new Ok([k, v]); }, - ); - }, - ); - }, - ); - })(), - (pairs) => { return new Ok($map.from_list(pairs)); }, - ); - }, - ); - }; -} - -export function decode2(constructor, t1, t2) { - return (value) => { - let $ = t1(value); - let $1 = t2(value); - if ($.isOk() && $1.isOk()) { - let a = $[0]; - let b = $1[0]; - return new Ok(constructor(a, b)); - } else { - let a = $; - let b = $1; - return new Error($list.concat(toList([all_errors(a), all_errors(b)]))); - } - }; -} - -export function decode3(constructor, t1, t2, t3) { - return (value) => { - let $ = t1(value); - let $1 = t2(value); - let $2 = t3(value); - if ($.isOk() && $1.isOk() && $2.isOk()) { - let a = $[0]; - let b = $1[0]; - let c = $2[0]; - return new Ok(constructor(a, b, c)); - } else { - let a = $; - let b = $1; - let c = $2; - return new Error( - $list.concat(toList([all_errors(a), all_errors(b), all_errors(c)])), - ); - } - }; -} - -export function decode4(constructor, t1, t2, t3, t4) { - return (x) => { - let $ = t1(x); - let $1 = t2(x); - let $2 = t3(x); - let $3 = t4(x); - if ($.isOk() && $1.isOk() && $2.isOk() && $3.isOk()) { - let a = $[0]; - let b = $1[0]; - let c = $2[0]; - let d = $3[0]; - return new Ok(constructor(a, b, c, d)); - } else { - let a = $; - let b = $1; - let c = $2; - let d = $3; - return new Error( - $list.concat( - toList([all_errors(a), all_errors(b), all_errors(c), all_errors(d)]), - ), - ); - } - }; -} - -export function decode5(constructor, t1, t2, t3, t4, t5) { - return (x) => { - let $ = t1(x); - let $1 = t2(x); - let $2 = t3(x); - let $3 = t4(x); - let $4 = t5(x); - if ($.isOk() && $1.isOk() && $2.isOk() && $3.isOk() && $4.isOk()) { - let a = $[0]; - let b = $1[0]; - let c = $2[0]; - let d = $3[0]; - let e = $4[0]; - return new Ok(constructor(a, b, c, d, e)); - } else { - let a = $; - let b = $1; - let c = $2; - let d = $3; - let e = $4; - return new Error( - $list.concat( - toList([ - all_errors(a), - all_errors(b), - all_errors(c), - all_errors(d), - all_errors(e), - ]), - ), - ); - } - }; -} - -export function decode6(constructor, t1, t2, t3, t4, t5, t6) { - return (x) => { - let $ = t1(x); - let $1 = t2(x); - let $2 = t3(x); - let $3 = t4(x); - let $4 = t5(x); - let $5 = t6(x); - if ($.isOk() && - $1.isOk() && - $2.isOk() && - $3.isOk() && - $4.isOk() && - $5.isOk()) { - let a = $[0]; - let b = $1[0]; - let c = $2[0]; - let d = $3[0]; - let e = $4[0]; - let f = $5[0]; - return new Ok(constructor(a, b, c, d, e, f)); - } else { - let a = $; - let b = $1; - let c = $2; - let d = $3; - let e = $4; - let f = $5; - return new Error( - $list.concat( - toList([ - all_errors(a), - all_errors(b), - all_errors(c), - all_errors(d), - all_errors(e), - all_errors(f), - ]), - ), - ); - } - }; -} - -export function decode7(constructor, t1, t2, t3, t4, t5, t6, t7) { - return (x) => { - let $ = t1(x); - let $1 = t2(x); - let $2 = t3(x); - let $3 = t4(x); - let $4 = t5(x); - let $5 = t6(x); - let $6 = t7(x); - if ($.isOk() && - $1.isOk() && - $2.isOk() && - $3.isOk() && - $4.isOk() && - $5.isOk() && - $6.isOk()) { - let a = $[0]; - let b = $1[0]; - let c = $2[0]; - let d = $3[0]; - let e = $4[0]; - let f = $5[0]; - let g = $6[0]; - return new Ok(constructor(a, b, c, d, e, f, g)); - } else { - let a = $; - let b = $1; - let c = $2; - let d = $3; - let e = $4; - let f = $5; - let g = $6; - return new Error( - $list.concat( - toList([ - all_errors(a), - all_errors(b), - all_errors(c), - all_errors(d), - all_errors(e), - all_errors(f), - all_errors(g), - ]), - ), - ); - } - }; -} - -export function decode8(constructor, t1, t2, t3, t4, t5, t6, t7, t8) { - return (x) => { - let $ = t1(x); - let $1 = t2(x); - let $2 = t3(x); - let $3 = t4(x); - let $4 = t5(x); - let $5 = t6(x); - let $6 = t7(x); - let $7 = t8(x); - if ($.isOk() && - $1.isOk() && - $2.isOk() && - $3.isOk() && - $4.isOk() && - $5.isOk() && - $6.isOk() && - $7.isOk()) { - let a = $[0]; - let b = $1[0]; - let c = $2[0]; - let d = $3[0]; - let e = $4[0]; - let f = $5[0]; - let g = $6[0]; - let h = $7[0]; - return new Ok(constructor(a, b, c, d, e, f, g, h)); - } else { - let a = $; - let b = $1; - let c = $2; - let d = $3; - let e = $4; - let f = $5; - let g = $6; - let h = $7; - return new Error( - $list.concat( - toList([ - all_errors(a), - all_errors(b), - all_errors(c), - all_errors(d), - all_errors(e), - all_errors(f), - all_errors(g), - all_errors(h), - ]), - ), - ); - } - }; -} - -export function decode9(constructor, t1, t2, t3, t4, t5, t6, t7, t8, t9) { - return (x) => { - let $ = t1(x); - let $1 = t2(x); - let $2 = t3(x); - let $3 = t4(x); - let $4 = t5(x); - let $5 = t6(x); - let $6 = t7(x); - let $7 = t8(x); - let $8 = t9(x); - if ($.isOk() && - $1.isOk() && - $2.isOk() && - $3.isOk() && - $4.isOk() && - $5.isOk() && - $6.isOk() && - $7.isOk() && - $8.isOk()) { - let a = $[0]; - let b = $1[0]; - let c = $2[0]; - let d = $3[0]; - let e = $4[0]; - let f = $5[0]; - let g = $6[0]; - let h = $7[0]; - let i = $8[0]; - return new Ok(constructor(a, b, c, d, e, f, g, h, i)); - } else { - let a = $; - let b = $1; - let c = $2; - let d = $3; - let e = $4; - let f = $5; - let g = $6; - let h = $7; - let i = $8; - return new Error( - $list.concat( - toList([ - all_errors(a), - all_errors(b), - all_errors(c), - all_errors(d), - all_errors(e), - all_errors(f), - all_errors(g), - all_errors(h), - all_errors(i), - ]), - ), - ); - } - }; -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/float.mjs b/build/dev/javascript/gleam_stdlib/gleam/float.mjs deleted file mode 100644 index 84c6e18..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/float.mjs +++ /dev/null @@ -1,265 +0,0 @@ -import { Ok, Error, makeError, divideFloat } from "../gleam.mjs"; -import * as $order from "../gleam/order.mjs"; -import { - parse_float as do_parse, - float_to_string as do_to_string, - ceiling as do_ceiling, - floor as do_floor, - round as js_round, - truncate as do_truncate, - power as do_power, - random_uniform as do_random_uniform, -} from "../gleam_stdlib.mjs"; - -export function parse(string) { - return do_parse(string); -} - -export function to_string(x) { - return do_to_string(x); -} - -export function compare(a, b) { - let $ = a === b; - if ($) { - return new $order.Eq(); - } else if (!$) { - let $1 = a < b; - if ($1) { - return new $order.Lt(); - } else if (!$1) { - return new $order.Gt(); - } else { - throw makeError( - "case_no_match", - "gleam/float", - 76, - "compare", - "No case clause matched", - { values: [$1] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/float", - 73, - "compare", - "No case clause matched", - { values: [$] } - ) - } -} - -export function min(a, b) { - let $ = a < b; - if ($) { - return a; - } else if (!$) { - return b; - } else { - throw makeError( - "case_no_match", - "gleam/float", - 154, - "min", - "No case clause matched", - { values: [$] } - ) - } -} - -export function max(a, b) { - let $ = a > b; - if ($) { - return a; - } else if (!$) { - return b; - } else { - throw makeError( - "case_no_match", - "gleam/float", - 170, - "max", - "No case clause matched", - { values: [$] } - ) - } -} - -export function clamp(x, min_bound, max_bound) { - let _pipe = x; - let _pipe$1 = min(_pipe, max_bound); - return max(_pipe$1, min_bound); -} - -export function ceiling(x) { - return do_ceiling(x); -} - -export function floor(x) { - return do_floor(x); -} - -export function truncate(x) { - return do_truncate(x); -} - -export function absolute_value(x) { - let $ = x >= 0.0; - if ($) { - return x; - } else { - return 0.0 - x; - } -} - -export function loosely_compare(a, b, tolerance) { - let difference = absolute_value(a - b); - let $ = difference <= tolerance; - if ($) { - return new $order.Eq(); - } else if (!$) { - return compare(a, b); - } else { - throw makeError( - "case_no_match", - "gleam/float", - 108, - "loosely_compare", - "No case clause matched", - { values: [$] } - ) - } -} - -export function loosely_equals(a, b, tolerance) { - let difference = absolute_value(a - b); - return difference <= tolerance; -} - -export function power(base, exponent) { - let fractional = (ceiling(exponent) - exponent) > 0.0; - let $ = ((base < 0.0) && fractional) || ((base === 0.0) && (exponent < 0.0)); - if ($) { - return new Error(undefined); - } else if (!$) { - return new Ok(do_power(base, exponent)); - } else { - throw makeError( - "case_no_match", - "gleam/float", - 320, - "power", - "No case clause matched", - { values: [$] } - ) - } -} - -export function square_root(x) { - return power(x, 0.5); -} - -export function negate(x) { - return -1.0 * x; -} - -function do_round(x) { - let $ = x >= 0.0; - if ($) { - return js_round(x); - } else { - return 0 - js_round(negate(x)); - } -} - -export function round(x) { - return do_round(x); -} - -function do_sum(loop$numbers, loop$initial) { - while (true) { - let numbers = loop$numbers; - let initial = loop$initial; - if (numbers.hasLength(0)) { - return initial; - } else if (numbers.atLeastLength(1)) { - let x = numbers.head; - let rest = numbers.tail; - loop$numbers = rest; - loop$initial = x + initial; - } else { - throw makeError( - "case_no_match", - "gleam/float", - 376, - "do_sum", - "No case clause matched", - { values: [numbers] } - ) - } - } -} - -export function sum(numbers) { - let _pipe = numbers; - return do_sum(_pipe, 0.0); -} - -function do_product(loop$numbers, loop$initial) { - while (true) { - let numbers = loop$numbers; - let initial = loop$initial; - if (numbers.hasLength(0)) { - return initial; - } else if (numbers.atLeastLength(1)) { - let x = numbers.head; - let rest = numbers.tail; - loop$numbers = rest; - loop$initial = x * initial; - } else { - throw makeError( - "case_no_match", - "gleam/float", - 399, - "do_product", - "No case clause matched", - { values: [numbers] } - ) - } - } -} - -export function product(numbers) { - if (numbers.hasLength(0)) { - return 1.0; - } else { - return do_product(numbers, 1.0); - } -} - -export function random(min, max) { - return (do_random_uniform() * (max - min)) + min; -} - -export function divide(a, b) { - if (b === 0.0) { - return new Error(undefined); - } else { - let b$1 = b; - return new Ok(divideFloat(a, b$1)); - } -} - -export function add(a, b) { - return a + b; -} - -export function multiply(a, b) { - return a * b; -} - -export function subtract(a, b) { - return a - b; -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/function.mjs b/build/dev/javascript/gleam_stdlib/gleam/function.mjs deleted file mode 100644 index a6bafc5..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/function.mjs +++ /dev/null @@ -1,70 +0,0 @@ -export function compose(fun1, fun2) { - return (a) => { return fun2(fun1(a)); }; -} - -export function curry2(fun) { - return (a) => { return (b) => { return fun(a, b); }; }; -} - -export function curry3(fun) { - return (a) => { return (b) => { return (c) => { return fun(a, b, c); }; }; }; -} - -export function curry4(fun) { - return (a) => { - return (b) => { - return (c) => { return (d) => { return fun(a, b, c, d); }; }; - }; - }; -} - -export function curry5(fun) { - return (a) => { - return (b) => { - return (c) => { - return (d) => { return (e) => { return fun(a, b, c, d, e); }; }; - }; - }; - }; -} - -export function curry6(fun) { - return (a) => { - return (b) => { - return (c) => { - return (d) => { - return (e) => { return (f) => { return fun(a, b, c, d, e, f); }; }; - }; - }; - }; - }; -} - -export function flip(fun) { - return (b, a) => { return fun(a, b); }; -} - -export function identity(x) { - return x; -} - -export function constant(value) { - return (_) => { return value; }; -} - -export function tap(arg, effect) { - effect(arg); - return arg; -} - -export function apply1(fun, arg1) { - return fun(arg1); -} - -export function apply2(fun, arg1, arg2) { - return fun(arg1, arg2); -} - -export function apply3(fun, arg1, arg2, arg3) { - return fun(arg1, arg2, arg3); -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/int.mjs b/build/dev/javascript/gleam_stdlib/gleam/int.mjs deleted file mode 100644 index 0f11823..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/int.mjs +++ /dev/null @@ -1,448 +0,0 @@ -import { - Ok, - Error, - toList, - CustomType as $CustomType, - makeError, - remainderInt, - divideInt, -} from "../gleam.mjs"; -import * as $float from "../gleam/float.mjs"; -import * as $order from "../gleam/order.mjs"; -import { - parse_int as do_parse, - int_from_base_string as do_base_parse, - to_string as do_to_string, - int_to_base_string as do_to_base_string, - identity as do_to_float, - bitwise_and, - bitwise_not, - bitwise_or, - bitwise_exclusive_or, - bitwise_shift_left, - bitwise_shift_right, -} from "../gleam_stdlib.mjs"; - -export { - bitwise_and, - bitwise_exclusive_or, - bitwise_not, - bitwise_or, - bitwise_shift_left, - bitwise_shift_right, -}; - -export class InvalidBase extends $CustomType {} - -export function absolute_value(x) { - let $ = x >= 0; - if ($) { - return x; - } else if (!$) { - return x * -1; - } else { - throw makeError( - "case_no_match", - "gleam/int", - 19, - "absolute_value", - "No case clause matched", - { values: [$] } - ) - } -} - -export function parse(string) { - return do_parse(string); -} - -export function base_parse(string, base) { - let $ = (base >= 2) && (base <= 36); - if ($) { - return do_base_parse(string, base); - } else if (!$) { - return new Error(undefined); - } else { - throw makeError( - "case_no_match", - "gleam/int", - 126, - "base_parse", - "No case clause matched", - { values: [$] } - ) - } -} - -export function to_string(x) { - return do_to_string(x); -} - -export function to_base_string(x, base) { - let $ = (base >= 2) && (base <= 36); - if ($) { - return new Ok(do_to_base_string(x, base)); - } else if (!$) { - return new Error(new InvalidBase()); - } else { - throw makeError( - "case_no_match", - "gleam/int", - 191, - "to_base_string", - "No case clause matched", - { values: [$] } - ) - } -} - -export function to_base2(x) { - return do_to_base_string(x, 2); -} - -export function to_base8(x) { - return do_to_base_string(x, 8); -} - -export function to_base16(x) { - return do_to_base_string(x, 16); -} - -export function to_base36(x) { - return do_to_base_string(x, 36); -} - -export function to_float(x) { - return do_to_float(x); -} - -export function power(base, exponent) { - let _pipe = base; - let _pipe$1 = to_float(_pipe); - return $float.power(_pipe$1, exponent); -} - -export function square_root(x) { - let _pipe = x; - let _pipe$1 = to_float(_pipe); - return $float.square_root(_pipe$1); -} - -export function compare(a, b) { - let $ = a === b; - if ($) { - return new $order.Eq(); - } else if (!$) { - let $1 = a < b; - if ($1) { - return new $order.Lt(); - } else if (!$1) { - return new $order.Gt(); - } else { - throw makeError( - "case_no_match", - "gleam/int", - 318, - "compare", - "No case clause matched", - { values: [$1] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/int", - 315, - "compare", - "No case clause matched", - { values: [$] } - ) - } -} - -export function min(a, b) { - let $ = a < b; - if ($) { - return a; - } else if (!$) { - return b; - } else { - throw makeError( - "case_no_match", - "gleam/int", - 335, - "min", - "No case clause matched", - { values: [$] } - ) - } -} - -export function max(a, b) { - let $ = a > b; - if ($) { - return a; - } else if (!$) { - return b; - } else { - throw makeError( - "case_no_match", - "gleam/int", - 351, - "max", - "No case clause matched", - { values: [$] } - ) - } -} - -export function clamp(x, min_bound, max_bound) { - let _pipe = x; - let _pipe$1 = min(_pipe, max_bound); - return max(_pipe$1, min_bound); -} - -export function is_even(x) { - return (remainderInt(x, 2)) === 0; -} - -export function is_odd(x) { - return (remainderInt(x, 2)) !== 0; -} - -export function negate(x) { - return -1 * x; -} - -function do_sum(loop$numbers, loop$initial) { - while (true) { - let numbers = loop$numbers; - let initial = loop$initial; - if (numbers.hasLength(0)) { - return initial; - } else if (numbers.atLeastLength(1)) { - let x = numbers.head; - let rest = numbers.tail; - loop$numbers = rest; - loop$initial = x + initial; - } else { - throw makeError( - "case_no_match", - "gleam/int", - 421, - "do_sum", - "No case clause matched", - { values: [numbers] } - ) - } - } -} - -export function sum(numbers) { - let _pipe = numbers; - return do_sum(_pipe, 0); -} - -function do_product(loop$numbers, loop$initial) { - while (true) { - let numbers = loop$numbers; - let initial = loop$initial; - if (numbers.hasLength(0)) { - return initial; - } else if (numbers.atLeastLength(1)) { - let x = numbers.head; - let rest = numbers.tail; - loop$numbers = rest; - loop$initial = x * initial; - } else { - throw makeError( - "case_no_match", - "gleam/int", - 444, - "do_product", - "No case clause matched", - { values: [numbers] } - ) - } - } -} - -export function product(numbers) { - if (numbers.hasLength(0)) { - return 1; - } else { - return do_product(numbers, 1); - } -} - -function do_digits(loop$x, loop$base, loop$acc) { - while (true) { - let x = loop$x; - let base = loop$base; - let acc = loop$acc; - let $ = absolute_value(x) < base; - if ($) { - return toList([x], acc); - } else if (!$) { - loop$x = divideInt(x, base); - loop$base = base; - loop$acc = toList([remainderInt(x, base)], acc); - } else { - throw makeError( - "case_no_match", - "gleam/int", - 472, - "do_digits", - "No case clause matched", - { values: [$] } - ) - } - } -} - -export function digits(x, base) { - let $ = base < 2; - if ($) { - return new Error(new InvalidBase()); - } else if (!$) { - return new Ok(do_digits(x, base, toList([]))); - } else { - throw makeError( - "case_no_match", - "gleam/int", - 465, - "digits", - "No case clause matched", - { values: [$] } - ) - } -} - -function do_undigits(loop$numbers, loop$base, loop$acc) { - while (true) { - let numbers = loop$numbers; - let base = loop$base; - let acc = loop$acc; - if (numbers.hasLength(0)) { - return new Ok(acc); - } else if (numbers.atLeastLength(1) && numbers.head >= base) { - let digit = numbers.head; - return new Error(new InvalidBase()); - } else if (numbers.atLeastLength(1)) { - let digit = numbers.head; - let rest = numbers.tail; - loop$numbers = rest; - loop$base = base; - loop$acc = acc * base + digit; - } else { - throw makeError( - "case_no_match", - "gleam/int", - 510, - "do_undigits", - "No case clause matched", - { values: [numbers] } - ) - } - } -} - -export function undigits(numbers, base) { - let $ = base < 2; - if ($) { - return new Error(new InvalidBase()); - } else if (!$) { - return do_undigits(numbers, base, 0); - } else { - throw makeError( - "case_no_match", - "gleam/int", - 499, - "undigits", - "No case clause matched", - { values: [$] } - ) - } -} - -export function random(min, max) { - let _pipe = $float.random(to_float(min), to_float(max)); - let _pipe$1 = $float.floor(_pipe); - return $float.round(_pipe$1); -} - -export function divide(dividend, divisor) { - if (divisor === 0) { - return new Error(undefined); - } else { - let divisor$1 = divisor; - return new Ok(divideInt(dividend, divisor$1)); - } -} - -export function remainder(dividend, divisor) { - if (divisor === 0) { - return new Error(undefined); - } else { - let divisor$1 = divisor; - return new Ok(remainderInt(dividend, divisor$1)); - } -} - -export function modulo(dividend, divisor) { - if (divisor === 0) { - return new Error(undefined); - } else { - let remainder$1 = remainderInt(dividend, divisor); - let $ = remainder$1 * divisor < 0; - if ($) { - return new Ok(remainder$1 + divisor); - } else if (!$) { - return new Ok(remainder$1); - } else { - throw makeError( - "case_no_match", - "gleam/int", - 668, - "modulo", - "No case clause matched", - { values: [$] } - ) - } - } -} - -export function floor_divide(dividend, divisor) { - if (divisor === 0) { - return new Error(undefined); - } else { - let divisor$1 = divisor; - let $ = (dividend * divisor$1 < 0) && ((remainderInt(dividend, divisor$1)) !== 0); - if ($) { - return new Ok((divideInt(dividend, divisor$1)) - 1); - } else if (!$) { - return new Ok(divideInt(dividend, divisor$1)); - } else { - throw makeError( - "case_no_match", - "gleam/int", - 711, - "floor_divide", - "No case clause matched", - { values: [$] } - ) - } - } -} - -export function add(a, b) { - return a + b; -} - -export function multiply(a, b) { - return a * b; -} - -export function subtract(a, b) { - return a - b; -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/io.mjs b/build/dev/javascript/gleam_stdlib/gleam/io.mjs deleted file mode 100644 index 46d0944..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/io.mjs +++ /dev/null @@ -1,31 +0,0 @@ -import * as $string from "../gleam/string.mjs"; -import { - print as do_print, - print_error as do_print_error, - console_log as do_println, - console_error as do_println_error, - print_debug as do_debug_println, -} from "../gleam_stdlib.mjs"; - -export function print(string) { - return do_print(string); -} - -export function print_error(string) { - return do_print_error(string); -} - -export function println(string) { - return do_println(string); -} - -export function println_error(string) { - return do_println_error(string); -} - -export function debug(term) { - let _pipe = term; - let _pipe$1 = $string.inspect(_pipe); - do_debug_println(_pipe$1) - return term; -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/iterator.mjs b/build/dev/javascript/gleam_stdlib/gleam/iterator.mjs deleted file mode 100644 index e3863ab..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/iterator.mjs +++ /dev/null @@ -1,1312 +0,0 @@ -import { Ok, Error, toList, CustomType as $CustomType, makeError, isEqual } from "../gleam.mjs"; -import * as $int from "../gleam/int.mjs"; -import * as $list from "../gleam/list.mjs"; -import * as $map from "../gleam/map.mjs"; -import * as $option from "../gleam/option.mjs"; -import { None, Some } from "../gleam/option.mjs"; -import * as $order from "../gleam/order.mjs"; -import * as $result from "../gleam/result.mjs"; - -class Stop extends $CustomType {} - -class Continue extends $CustomType { - constructor(x0, x1) { - super(); - this[0] = x0; - this[1] = x1; - } -} - -class Iterator extends $CustomType { - constructor(continuation) { - super(); - this.continuation = continuation; - } -} - -export class Next extends $CustomType { - constructor(element, accumulator) { - super(); - this.element = element; - this.accumulator = accumulator; - } -} - -export class Done extends $CustomType {} - -class AnotherBy extends $CustomType { - constructor(x0, x1, x2, x3) { - super(); - this[0] = x0; - this[1] = x1; - this[2] = x2; - this[3] = x3; - } -} - -class LastBy extends $CustomType { - constructor(x0) { - super(); - this[0] = x0; - } -} - -class Another extends $CustomType { - constructor(x0, x1) { - super(); - this[0] = x0; - this[1] = x1; - } -} - -class Last extends $CustomType { - constructor(x0) { - super(); - this[0] = x0; - } -} - -class NoMore extends $CustomType {} - -function stop() { - return new Stop(); -} - -function do_unfold(initial, f) { - return () => { - let $ = f(initial); - if ($ instanceof Next) { - let x = $.element; - let acc = $.accumulator; - return new Continue(x, do_unfold(acc, f)); - } else if ($ instanceof Done) { - return new Stop(); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 48, - "", - "No case clause matched", - { values: [$] } - ) - } - }; -} - -export function unfold(initial, f) { - let _pipe = initial; - let _pipe$1 = do_unfold(_pipe, f); - return new Iterator(_pipe$1); -} - -export function repeatedly(f) { - return unfold(undefined, (_) => { return new Next(f(), undefined); }); -} - -export function repeat(x) { - return repeatedly(() => { return x; }); -} - -export function from_list(list) { - let yield$1 = (acc) => { - if (acc.hasLength(0)) { - return new Done(); - } else if (acc.atLeastLength(1)) { - let head = acc.head; - let tail = acc.tail; - return new Next(head, tail); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 120, - "", - "No case clause matched", - { values: [acc] } - ) - } - }; - return unfold(list, yield$1); -} - -function do_transform(continuation, state, f) { - return () => { - let $ = continuation(); - if ($ instanceof Stop) { - return new Stop(); - } else if ($ instanceof Continue) { - let el = $[0]; - let next = $[1]; - let $1 = f(state, el); - if ($1 instanceof Done) { - return new Stop(); - } else if ($1 instanceof Next) { - let yield$1 = $1.element; - let next_state = $1.accumulator; - return new Continue(yield$1, do_transform(next, next_state, f)); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 138, - "", - "No case clause matched", - { values: [$1] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 135, - "", - "No case clause matched", - { values: [$] } - ) - } - }; -} - -export function transform(iterator, initial, f) { - let _pipe = do_transform(iterator.continuation, initial, f); - return new Iterator(_pipe); -} - -function do_fold(loop$continuation, loop$f, loop$accumulator) { - while (true) { - let continuation = loop$continuation; - let f = loop$f; - let accumulator = loop$accumulator; - let $ = continuation(); - if ($ instanceof Continue) { - let elem = $[0]; - let next = $[1]; - loop$continuation = next; - loop$f = f; - loop$accumulator = f(accumulator, elem); - } else if ($ instanceof Stop) { - return accumulator; - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 177, - "do_fold", - "No case clause matched", - { values: [$] } - ) - } - } -} - -export function fold(iterator, initial, f) { - let _pipe = iterator.continuation; - return do_fold(_pipe, f, initial); -} - -export function run(iterator) { - return fold(iterator, undefined, (_, _1) => { return undefined; }); -} - -export function to_list(iterator) { - let _pipe = iterator; - let _pipe$1 = fold( - _pipe, - toList([]), - (acc, e) => { return toList([e], acc); }, - ); - return $list.reverse(_pipe$1); -} - -export function step(iterator) { - let $ = iterator.continuation(); - if ($ instanceof Stop) { - return new Done(); - } else if ($ instanceof Continue) { - let e = $[0]; - let a = $[1]; - return new Next(e, new Iterator(a)); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 266, - "step", - "No case clause matched", - { values: [$] } - ) - } -} - -function do_take(continuation, desired) { - return () => { - let $ = desired > 0; - if (!$) { - return new Stop(); - } else if ($) { - let $1 = continuation(); - if ($1 instanceof Stop) { - return new Stop(); - } else if ($1 instanceof Continue) { - let e = $1[0]; - let next = $1[1]; - return new Continue(e, do_take(next, desired - 1)); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 277, - "", - "No case clause matched", - { values: [$1] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 274, - "", - "No case clause matched", - { values: [$] } - ) - } - }; -} - -export function take(iterator, desired) { - let _pipe = iterator.continuation; - let _pipe$1 = do_take(_pipe, desired); - return new Iterator(_pipe$1); -} - -function do_drop(loop$continuation, loop$desired) { - while (true) { - let continuation = loop$continuation; - let desired = loop$desired; - let $ = continuation(); - if ($ instanceof Stop) { - return new Stop(); - } else if ($ instanceof Continue) { - let e = $[0]; - let next = $[1]; - let $1 = desired > 0; - if ($1) { - loop$continuation = next; - loop$desired = desired - 1; - } else if (!$1) { - return new Continue(e, next); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 317, - "do_drop", - "No case clause matched", - { values: [$1] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 314, - "do_drop", - "No case clause matched", - { values: [$] } - ) - } - } -} - -export function drop(iterator, desired) { - let _pipe = () => { return do_drop(iterator.continuation, desired); }; - return new Iterator(_pipe); -} - -function do_map(continuation, f) { - return () => { - let $ = continuation(); - if ($ instanceof Stop) { - return new Stop(); - } else if ($ instanceof Continue) { - let e = $[0]; - let continuation$1 = $[1]; - return new Continue(f(e), do_map(continuation$1, f)); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 358, - "", - "No case clause matched", - { values: [$] } - ) - } - }; -} - -export function map(iterator, f) { - let _pipe = iterator.continuation; - let _pipe$1 = do_map(_pipe, f); - return new Iterator(_pipe$1); -} - -function do_append(first, second) { - let $ = first(); - if ($ instanceof Continue) { - let e = $[0]; - let first$1 = $[1]; - return new Continue(e, () => { return do_append(first$1, second); }); - } else if ($ instanceof Stop) { - return second(); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 390, - "do_append", - "No case clause matched", - { values: [$] } - ) - } -} - -export function append(first, second) { - let _pipe = () => { - return do_append(first.continuation, second.continuation); - }; - return new Iterator(_pipe); -} - -function do_flatten(flattened) { - let $ = flattened(); - if ($ instanceof Stop) { - return new Stop(); - } else if ($ instanceof Continue) { - let it = $[0]; - let next_iterator = $[1]; - return do_append( - it.continuation, - () => { return do_flatten(next_iterator); }, - ); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 417, - "do_flatten", - "No case clause matched", - { values: [$] } - ) - } -} - -export function flatten(iterator) { - let _pipe = () => { return do_flatten(iterator.continuation); }; - return new Iterator(_pipe); -} - -export function concat(iterators) { - return flatten(from_list(iterators)); -} - -export function flat_map(iterator, f) { - let _pipe = iterator; - let _pipe$1 = map(_pipe, f); - return flatten(_pipe$1); -} - -function do_filter(loop$continuation, loop$predicate) { - while (true) { - let continuation = loop$continuation; - let predicate = loop$predicate; - let $ = continuation(); - if ($ instanceof Stop) { - return new Stop(); - } else if ($ instanceof Continue) { - let e = $[0]; - let iterator = $[1]; - let $1 = predicate(e); - if ($1) { - return new Continue(e, () => { return do_filter(iterator, predicate); }); - } else if (!$1) { - loop$continuation = iterator; - loop$predicate = predicate; - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 498, - "do_filter", - "No case clause matched", - { values: [$1] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 495, - "do_filter", - "No case clause matched", - { values: [$] } - ) - } - } -} - -export function filter(iterator, predicate) { - let _pipe = () => { return do_filter(iterator.continuation, predicate); }; - return new Iterator(_pipe); -} - -export function cycle(iterator) { - let _pipe = repeat(iterator); - return flatten(_pipe); -} - -function do_find(loop$continuation, loop$f) { - while (true) { - let continuation = loop$continuation; - let f = loop$f; - let $ = continuation(); - if ($ instanceof Stop) { - return new Error(undefined); - } else if ($ instanceof Continue) { - let e = $[0]; - let next = $[1]; - let $1 = f(e); - if ($1) { - return new Ok(e); - } else if (!$1) { - loop$continuation = next; - loop$f = f; - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 601, - "do_find", - "No case clause matched", - { values: [$1] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 598, - "do_find", - "No case clause matched", - { values: [$] } - ) - } - } -} - -export function find(haystack, is_desired) { - let _pipe = haystack.continuation; - return do_find(_pipe, is_desired); -} - -function do_index(continuation, next) { - return () => { - let $ = continuation(); - if ($ instanceof Stop) { - return new Stop(); - } else if ($ instanceof Continue) { - let e = $[0]; - let continuation$1 = $[1]; - return new Continue([next, e], do_index(continuation$1, next + 1)); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 644, - "", - "No case clause matched", - { values: [$] } - ) - } - }; -} - -export function index(iterator) { - let _pipe = iterator.continuation; - let _pipe$1 = do_index(_pipe, 0); - return new Iterator(_pipe$1); -} - -export function iterate(initial, f) { - return unfold(initial, (element) => { return new Next(element, f(element)); }); -} - -function do_take_while(continuation, predicate) { - return () => { - let $ = continuation(); - if ($ instanceof Stop) { - return new Stop(); - } else if ($ instanceof Continue) { - let e = $[0]; - let next = $[1]; - let $1 = predicate(e); - if (!$1) { - return new Stop(); - } else if ($1) { - return new Continue(e, do_take_while(next, predicate)); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 691, - "", - "No case clause matched", - { values: [$1] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 688, - "", - "No case clause matched", - { values: [$] } - ) - } - }; -} - -export function take_while(iterator, predicate) { - let _pipe = iterator.continuation; - let _pipe$1 = do_take_while(_pipe, predicate); - return new Iterator(_pipe$1); -} - -function do_drop_while(loop$continuation, loop$predicate) { - while (true) { - let continuation = loop$continuation; - let predicate = loop$predicate; - let $ = continuation(); - if ($ instanceof Stop) { - return new Stop(); - } else if ($ instanceof Continue) { - let e = $[0]; - let next = $[1]; - let $1 = predicate(e); - if (!$1) { - return new Continue(e, next); - } else if ($1) { - loop$continuation = next; - loop$predicate = predicate; - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 726, - "do_drop_while", - "No case clause matched", - { values: [$1] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 723, - "do_drop_while", - "No case clause matched", - { values: [$] } - ) - } - } -} - -export function drop_while(iterator, predicate) { - let _pipe = () => { return do_drop_while(iterator.continuation, predicate); }; - return new Iterator(_pipe); -} - -function do_scan(continuation, f, accumulator) { - return () => { - let $ = continuation(); - if ($ instanceof Stop) { - return new Stop(); - } else if ($ instanceof Continue) { - let el = $[0]; - let next = $[1]; - let accumulated = f(accumulator, el); - return new Continue(accumulated, do_scan(next, f, accumulated)); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 759, - "", - "No case clause matched", - { values: [$] } - ) - } - }; -} - -export function scan(iterator, initial, f) { - let _pipe = iterator.continuation; - let _pipe$1 = do_scan(_pipe, f, initial); - return new Iterator(_pipe$1); -} - -function do_zip(left, right) { - return () => { - let $ = left(); - if ($ instanceof Stop) { - return new Stop(); - } else if ($ instanceof Continue) { - let el_left = $[0]; - let next_left = $[1]; - let $1 = right(); - if ($1 instanceof Stop) { - return new Stop(); - } else if ($1 instanceof Continue) { - let el_right = $1[0]; - let next_right = $1[1]; - return new Continue([el_left, el_right], do_zip(next_left, next_right)); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 801, - "", - "No case clause matched", - { values: [$1] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 798, - "", - "No case clause matched", - { values: [$] } - ) - } - }; -} - -export function zip(left, right) { - let _pipe = do_zip(left.continuation, right.continuation); - return new Iterator(_pipe); -} - -function next_chunk( - loop$continuation, - loop$f, - loop$previous_key, - loop$current_chunk -) { - while (true) { - let continuation = loop$continuation; - let f = loop$f; - let previous_key = loop$previous_key; - let current_chunk = loop$current_chunk; - let $ = continuation(); - if ($ instanceof Stop) { - return new LastBy($list.reverse(current_chunk)); - } else if ($ instanceof Continue) { - let e = $[0]; - let next = $[1]; - let key = f(e); - let $1 = isEqual(key, previous_key); - if ($1) { - loop$continuation = next; - loop$f = f; - loop$previous_key = key; - loop$current_chunk = toList([e], current_chunk); - } else if (!$1) { - return new AnotherBy($list.reverse(current_chunk), key, e, next); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 843, - "next_chunk", - "No case clause matched", - { values: [$1] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 839, - "next_chunk", - "No case clause matched", - { values: [$] } - ) - } - } -} - -function do_chunk(continuation, f, previous_key, previous_element) { - let $ = next_chunk(continuation, f, previous_key, toList([previous_element])); - if ($ instanceof LastBy) { - let chunk$1 = $[0]; - return new Continue(chunk$1, stop); - } else if ($ instanceof AnotherBy) { - let chunk$1 = $[0]; - let key = $[1]; - let el = $[2]; - let next = $[3]; - return new Continue(chunk$1, () => { return do_chunk(next, f, key, el); }); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 857, - "do_chunk", - "No case clause matched", - { values: [$] } - ) - } -} - -export function chunk(iterator, f) { - let _pipe = () => { - let $ = iterator.continuation(); - if ($ instanceof Stop) { - return new Stop(); - } else if ($ instanceof Continue) { - let e = $[0]; - let next = $[1]; - return do_chunk(next, f, f(e), e); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 881, - "", - "No case clause matched", - { values: [$] } - ) - } - }; - return new Iterator(_pipe); -} - -function next_sized_chunk(loop$continuation, loop$left, loop$current_chunk) { - while (true) { - let continuation = loop$continuation; - let left = loop$left; - let current_chunk = loop$current_chunk; - let $ = continuation(); - if ($ instanceof Stop) { - if (current_chunk.hasLength(0)) { - return new NoMore(); - } else { - let remaining = current_chunk; - return new Last($list.reverse(remaining)); - } - } else if ($ instanceof Continue) { - let e = $[0]; - let next = $[1]; - let chunk$1 = toList([e], current_chunk); - let $1 = left > 1; - if (!$1) { - return new Another($list.reverse(chunk$1), next); - } else if ($1) { - loop$continuation = next; - loop$left = left - 1; - loop$current_chunk = chunk$1; - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 909, - "next_sized_chunk", - "No case clause matched", - { values: [$1] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 901, - "next_sized_chunk", - "No case clause matched", - { values: [$] } - ) - } - } -} - -function do_sized_chunk(continuation, count) { - return () => { - let $ = next_sized_chunk(continuation, count, toList([])); - if ($ instanceof NoMore) { - return new Stop(); - } else if ($ instanceof Last) { - let chunk$1 = $[0]; - return new Continue(chunk$1, stop); - } else if ($ instanceof Another) { - let chunk$1 = $[0]; - let next_element = $[1]; - return new Continue(chunk$1, do_sized_chunk(next_element, count)); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 922, - "", - "No case clause matched", - { values: [$] } - ) - } - }; -} - -export function sized_chunk(iterator, count) { - let _pipe = iterator.continuation; - let _pipe$1 = do_sized_chunk(_pipe, count); - return new Iterator(_pipe$1); -} - -function do_intersperse(continuation, separator) { - let $ = continuation(); - if ($ instanceof Stop) { - return new Stop(); - } else if ($ instanceof Continue) { - let e = $[0]; - let next = $[1]; - let next_interspersed = () => { return do_intersperse(next, separator); }; - return new Continue( - separator, - () => { return new Continue(e, next_interspersed); }, - ); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 967, - "do_intersperse", - "No case clause matched", - { values: [$] } - ) - } -} - -export function intersperse(iterator, elem) { - let _pipe = () => { - let $ = iterator.continuation(); - if ($ instanceof Stop) { - return new Stop(); - } else if ($ instanceof Continue) { - let e = $[0]; - let next = $[1]; - return new Continue(e, () => { return do_intersperse(next, elem); }); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 1003, - "", - "No case clause matched", - { values: [$] } - ) - } - }; - return new Iterator(_pipe); -} - -function do_any(loop$continuation, loop$predicate) { - while (true) { - let continuation = loop$continuation; - let predicate = loop$predicate; - let $ = continuation(); - if ($ instanceof Stop) { - return false; - } else if ($ instanceof Continue) { - let e = $[0]; - let next = $[1]; - let $1 = predicate(e); - if ($1) { - return true; - } else if (!$1) { - loop$continuation = next; - loop$predicate = predicate; - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 1018, - "do_any", - "No case clause matched", - { values: [$1] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 1015, - "do_any", - "No case clause matched", - { values: [$] } - ) - } - } -} - -export function any(iterator, predicate) { - let _pipe = iterator.continuation; - return do_any(_pipe, predicate); -} - -function do_all(loop$continuation, loop$predicate) { - while (true) { - let continuation = loop$continuation; - let predicate = loop$predicate; - let $ = continuation(); - if ($ instanceof Stop) { - return true; - } else if ($ instanceof Continue) { - let e = $[0]; - let next = $[1]; - let $1 = predicate(e); - if ($1) { - loop$continuation = next; - loop$predicate = predicate; - } else if (!$1) { - return false; - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 1064, - "do_all", - "No case clause matched", - { values: [$1] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 1061, - "do_all", - "No case clause matched", - { values: [$] } - ) - } - } -} - -export function all(iterator, predicate) { - let _pipe = iterator.continuation; - return do_all(_pipe, predicate); -} - -function update_group_with(el) { - return (maybe_group) => { - if (maybe_group instanceof Some) { - let group$1 = maybe_group[0]; - return toList([el], group$1); - } else if (maybe_group instanceof None) { - return toList([el]); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 1105, - "", - "No case clause matched", - { values: [maybe_group] } - ) - } - }; -} - -function group_updater(f) { - return (groups, elem) => { - let _pipe = groups; - return $map.update(_pipe, f(elem), update_group_with(elem)); - }; -} - -export function group(iterator, key) { - let _pipe = iterator; - let _pipe$1 = fold(_pipe, $map.new$(), group_updater(key)); - return $map.map_values( - _pipe$1, - (_, group) => { return $list.reverse(group); }, - ); -} - -export function reduce(iterator, f) { - let $ = iterator.continuation(); - if ($ instanceof Stop) { - return new Error(undefined); - } else if ($ instanceof Continue) { - let e = $[0]; - let next = $[1]; - let _pipe = do_fold(next, f, e); - return new Ok(_pipe); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 1165, - "reduce", - "No case clause matched", - { values: [$] } - ) - } -} - -export function last(iterator) { - let _pipe = iterator; - return reduce(_pipe, (_, elem) => { return elem; }); -} - -export function empty() { - return new Iterator(stop); -} - -export function once(f) { - let _pipe = () => { return new Continue(f(), stop); }; - return new Iterator(_pipe); -} - -export function range(start, stop) { - let $ = $int.compare(start, stop); - if ($ instanceof $order.Eq) { - return once(() => { return start; }); - } else if ($ instanceof $order.Gt) { - return unfold( - start, - (current) => { - let $1 = current < stop; - if (!$1) { - return new Next(current, current - 1); - } else if ($1) { - return new Done(); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 577, - "", - "No case clause matched", - { values: [$1] } - ) - } - }, - ); - } else if ($ instanceof $order.Lt) { - return unfold( - start, - (current) => { - let $1 = current > stop; - if (!$1) { - return new Next(current, current + 1); - } else if ($1) { - return new Done(); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 588, - "", - "No case clause matched", - { values: [$1] } - ) - } - }, - ); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 571, - "range", - "No case clause matched", - { values: [$] } - ) - } -} - -export function single(elem) { - return once(() => { return elem; }); -} - -function do_interleave(current, next) { - let $ = current(); - if ($ instanceof Stop) { - return next(); - } else if ($ instanceof Continue) { - let e = $[0]; - let next_other = $[1]; - return new Continue(e, () => { return do_interleave(next, next_other); }); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 1240, - "do_interleave", - "No case clause matched", - { values: [$] } - ) - } -} - -export function interleave(left, right) { - let _pipe = () => { - return do_interleave(left.continuation, right.continuation); - }; - return new Iterator(_pipe); -} - -function do_fold_until(loop$continuation, loop$f, loop$accumulator) { - while (true) { - let continuation = loop$continuation; - let f = loop$f; - let accumulator = loop$accumulator; - let $ = continuation(); - if ($ instanceof Stop) { - return accumulator; - } else if ($ instanceof Continue) { - let elem = $[0]; - let next = $[1]; - let $1 = f(accumulator, elem); - if ($1 instanceof $list.Continue) { - let accumulator$1 = $1[0]; - loop$continuation = next; - loop$f = f; - loop$accumulator = accumulator$1; - } else if ($1 instanceof $list.Stop) { - let accumulator$1 = $1[0]; - return accumulator$1; - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 1278, - "do_fold_until", - "No case clause matched", - { values: [$1] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 1275, - "do_fold_until", - "No case clause matched", - { values: [$] } - ) - } - } -} - -export function fold_until(iterator, initial, f) { - let _pipe = iterator.continuation; - return do_fold_until(_pipe, f, initial); -} - -function do_try_fold(continuation, f, accumulator) { - let $ = continuation(); - if ($ instanceof Stop) { - return new Ok(accumulator); - } else if ($ instanceof Continue) { - let elem = $[0]; - let next = $[1]; - return $result.try$( - f(accumulator, elem), - (accumulator) => { return do_try_fold(next, f, accumulator); }, - ); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 1323, - "do_try_fold", - "No case clause matched", - { values: [$] } - ) - } -} - -export function try_fold(iterator, initial, f) { - let _pipe = iterator.continuation; - return do_try_fold(_pipe, f, initial); -} - -export function first(iterator) { - let $ = iterator.continuation(); - if ($ instanceof Stop) { - return new Error(undefined); - } else if ($ instanceof Continue) { - let e = $[0]; - return new Ok(e); - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 1376, - "first", - "No case clause matched", - { values: [$] } - ) - } -} - -export function at(iterator, index) { - let _pipe = iterator; - let _pipe$1 = drop(_pipe, index); - return first(_pipe$1); -} - -function do_length(loop$continuation, loop$length) { - while (true) { - let continuation = loop$continuation; - let length = loop$length; - let $ = continuation(); - if ($ instanceof Stop) { - return length; - } else if ($ instanceof Continue) { - let next = $[1]; - loop$continuation = next; - loop$length = length + 1; - } else { - throw makeError( - "case_no_match", - "gleam/iterator", - 1412, - "do_length", - "No case clause matched", - { values: [$] } - ) - } - } -} - -export function length(iterator) { - let _pipe = iterator.continuation; - return do_length(_pipe, 0); -} - -export function each(iterator, f) { - let _pipe = iterator; - let _pipe$1 = map(_pipe, f); - return run(_pipe$1); -} - -export function yield$(element, next) { - return new Iterator( - () => { return new Continue(element, next().continuation); }, - ); -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/list.mjs b/build/dev/javascript/gleam_stdlib/gleam/list.mjs deleted file mode 100644 index 7ff34a1..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/list.mjs +++ /dev/null @@ -1,2153 +0,0 @@ -import { - Ok, - Error, - toList, - CustomType as $CustomType, - makeError, - divideInt, - isEqual, -} from "../gleam.mjs"; -import * as $float from "../gleam/float.mjs"; -import * as $int from "../gleam/int.mjs"; -import * as $map from "../gleam/map.mjs"; -import * as $order from "../gleam/order.mjs"; -import * as $pair from "../gleam/pair.mjs"; - -export class LengthMismatch extends $CustomType {} - -export class Continue extends $CustomType { - constructor(x0) { - super(); - this[0] = x0; - } -} - -export class Stop extends $CustomType { - constructor(x0) { - super(); - this[0] = x0; - } -} - -function do_length_acc(loop$list, loop$count) { - while (true) { - let list = loop$list; - let count = loop$count; - if (list.atLeastLength(1)) { - let list$1 = list.tail; - loop$list = list$1; - loop$count = count + 1; - } else { - return count; - } - } -} - -function do_length(list) { - return do_length_acc(list, 0); -} - -export function length(list) { - return do_length(list); -} - -function do_reverse_acc(loop$remaining, loop$accumulator) { - while (true) { - let remaining = loop$remaining; - let accumulator = loop$accumulator; - if (remaining.hasLength(0)) { - return accumulator; - } else if (remaining.atLeastLength(1)) { - let item = remaining.head; - let rest$1 = remaining.tail; - loop$remaining = rest$1; - loop$accumulator = toList([item], accumulator); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 124, - "do_reverse_acc", - "No case clause matched", - { values: [remaining] } - ) - } - } -} - -function do_reverse(list) { - return do_reverse_acc(list, toList([])); -} - -export function reverse(xs) { - return do_reverse(xs); -} - -export function is_empty(list) { - return isEqual(list, toList([])); -} - -export function contains(loop$list, loop$elem) { - while (true) { - let list = loop$list; - let elem = loop$elem; - if (list.hasLength(0)) { - return false; - } else if (list.atLeastLength(1) && isEqual(list.head, elem)) { - let first$1 = list.head; - return true; - } else if (list.atLeastLength(1)) { - let rest$1 = list.tail; - loop$list = rest$1; - loop$elem = elem; - } else { - throw makeError( - "case_no_match", - "gleam/list", - 188, - "contains", - "No case clause matched", - { values: [list] } - ) - } - } -} - -export function first(list) { - if (list.hasLength(0)) { - return new Error(undefined); - } else if (list.atLeastLength(1)) { - let x = list.head; - return new Ok(x); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 215, - "first", - "No case clause matched", - { values: [list] } - ) - } -} - -export function rest(list) { - if (list.hasLength(0)) { - return new Error(undefined); - } else if (list.atLeastLength(1)) { - let xs = list.tail; - return new Ok(xs); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 244, - "rest", - "No case clause matched", - { values: [list] } - ) - } -} - -function do_filter(loop$list, loop$fun, loop$acc) { - while (true) { - let list = loop$list; - let fun = loop$fun; - let acc = loop$acc; - if (list.hasLength(0)) { - return reverse(acc); - } else if (list.atLeastLength(1)) { - let x = list.head; - let xs = list.tail; - let new_acc = (() => { - let $ = fun(x); - if ($) { - return toList([x], acc); - } else if (!$) { - return acc; - } else { - throw makeError( - "case_no_match", - "gleam/list", - 296, - "do_filter", - "No case clause matched", - { values: [$] } - ) - } - })(); - loop$list = xs; - loop$fun = fun; - loop$acc = new_acc; - } else { - throw makeError( - "case_no_match", - "gleam/list", - 293, - "do_filter", - "No case clause matched", - { values: [list] } - ) - } - } -} - -export function filter(list, predicate) { - return do_filter(list, predicate, toList([])); -} - -function do_filter_map(loop$list, loop$fun, loop$acc) { - while (true) { - let list = loop$list; - let fun = loop$fun; - let acc = loop$acc; - if (list.hasLength(0)) { - return reverse(acc); - } else if (list.atLeastLength(1)) { - let x = list.head; - let xs = list.tail; - let new_acc = (() => { - let $ = fun(x); - if ($.isOk()) { - let x$1 = $[0]; - return toList([x$1], acc); - } else if (!$.isOk()) { - return acc; - } else { - throw makeError( - "case_no_match", - "gleam/list", - 332, - "do_filter_map", - "No case clause matched", - { values: [$] } - ) - } - })(); - loop$list = xs; - loop$fun = fun; - loop$acc = new_acc; - } else { - throw makeError( - "case_no_match", - "gleam/list", - 329, - "do_filter_map", - "No case clause matched", - { values: [list] } - ) - } - } -} - -export function filter_map(list, fun) { - return do_filter_map(list, fun, toList([])); -} - -function do_map(loop$list, loop$fun, loop$acc) { - while (true) { - let list = loop$list; - let fun = loop$fun; - let acc = loop$acc; - if (list.hasLength(0)) { - return reverse(acc); - } else if (list.atLeastLength(1)) { - let x = list.head; - let xs = list.tail; - loop$list = xs; - loop$fun = fun; - loop$acc = toList([fun(x)], acc); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 361, - "do_map", - "No case clause matched", - { values: [list] } - ) - } - } -} - -export function map(list, fun) { - return do_map(list, fun, toList([])); -} - -function update_group(f) { - return (groups, elem) => { - let $ = $map.get(groups, f(elem)); - if ($.isOk()) { - let existing = $[0]; - return $map.insert(groups, f(elem), toList([elem], existing)); - } else if (!$.isOk()) { - return $map.insert(groups, f(elem), toList([elem])); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 254, - "", - "No case clause matched", - { values: [$] } - ) - } - }; -} - -function do_map2(loop$list1, loop$list2, loop$fun, loop$acc) { - while (true) { - let list1 = loop$list1; - let list2 = loop$list2; - let fun = loop$fun; - let acc = loop$acc; - if (list1.hasLength(0)) { - return reverse(acc); - } else if (list2.hasLength(0)) { - return reverse(acc); - } else if (list1.atLeastLength(1) && list2.atLeastLength(1)) { - let a = list1.head; - let as_ = list1.tail; - let b = list2.head; - let bs = list2.tail; - loop$list1 = as_; - loop$list2 = bs; - loop$fun = fun; - loop$acc = toList([fun(a, b)], acc); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 407, - "do_map2", - "No case clause matched", - { values: [list1, list2] } - ) - } - } -} - -export function map2(list1, list2, fun) { - return do_map2(list1, list2, fun, toList([])); -} - -function do_index_map(loop$list, loop$fun, loop$index, loop$acc) { - while (true) { - let list = loop$list; - let fun = loop$fun; - let index = loop$index; - let acc = loop$acc; - if (list.hasLength(0)) { - return reverse(acc); - } else if (list.atLeastLength(1)) { - let x = list.head; - let xs = list.tail; - let acc$1 = toList([fun(index, x)], acc); - loop$list = xs; - loop$fun = fun; - loop$index = index + 1; - loop$acc = acc$1; - } else { - throw makeError( - "case_no_match", - "gleam/list", - 449, - "do_index_map", - "No case clause matched", - { values: [list] } - ) - } - } -} - -export function index_map(list, fun) { - return do_index_map(list, fun, 0, toList([])); -} - -function do_try_map(loop$list, loop$fun, loop$acc) { - while (true) { - let list = loop$list; - let fun = loop$fun; - let acc = loop$acc; - if (list.hasLength(0)) { - return new Ok(reverse(acc)); - } else if (list.atLeastLength(1)) { - let x = list.head; - let xs = list.tail; - let $ = fun(x); - if ($.isOk()) { - let y = $[0]; - loop$list = xs; - loop$fun = fun; - loop$acc = toList([y], acc); - } else if (!$.isOk()) { - let error = $[0]; - return new Error(error); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 483, - "do_try_map", - "No case clause matched", - { values: [$] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 480, - "do_try_map", - "No case clause matched", - { values: [list] } - ) - } - } -} - -export function try_map(list, fun) { - return do_try_map(list, fun, toList([])); -} - -export function drop(loop$list, loop$n) { - while (true) { - let list = loop$list; - let n = loop$n; - let $ = n <= 0; - if ($) { - return list; - } else if (!$) { - if (list.hasLength(0)) { - return toList([]); - } else if (list.atLeastLength(1)) { - let xs = list.tail; - loop$list = xs; - loop$n = n - 1; - } else { - throw makeError( - "case_no_match", - "gleam/list", - 553, - "drop", - "No case clause matched", - { values: [list] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 550, - "drop", - "No case clause matched", - { values: [$] } - ) - } - } -} - -function do_take(loop$list, loop$n, loop$acc) { - while (true) { - let list = loop$list; - let n = loop$n; - let acc = loop$acc; - let $ = n <= 0; - if ($) { - return reverse(acc); - } else if (!$) { - if (list.hasLength(0)) { - return reverse(acc); - } else if (list.atLeastLength(1)) { - let x = list.head; - let xs = list.tail; - loop$list = xs; - loop$n = n - 1; - loop$acc = toList([x], acc); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 564, - "do_take", - "No case clause matched", - { values: [list] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 561, - "do_take", - "No case clause matched", - { values: [$] } - ) - } - } -} - -export function take(list, n) { - return do_take(list, n, toList([])); -} - -export function new$() { - return toList([]); -} - -function do_append_acc(loop$first, loop$second) { - while (true) { - let first = loop$first; - let second = loop$second; - if (first.hasLength(0)) { - return second; - } else if (first.atLeastLength(1)) { - let item = first.head; - let rest$1 = first.tail; - loop$first = rest$1; - loop$second = toList([item], second); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 635, - "do_append_acc", - "No case clause matched", - { values: [first] } - ) - } - } -} - -function do_append(first, second) { - return do_append_acc(reverse(first), second); -} - -export function append(first, second) { - return do_append(first, second); -} - -export function prepend(list, item) { - return toList([item], list); -} - -function reverse_and_prepend(loop$prefix, loop$suffix) { - while (true) { - let prefix = loop$prefix; - let suffix = loop$suffix; - if (prefix.hasLength(0)) { - return suffix; - } else if (prefix.atLeastLength(1)) { - let first$1 = prefix.head; - let rest$1 = prefix.tail; - loop$prefix = rest$1; - loop$suffix = toList([first$1], suffix); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 654, - "reverse_and_prepend", - "No case clause matched", - { values: [prefix] } - ) - } - } -} - -function do_concat(loop$lists, loop$acc) { - while (true) { - let lists = loop$lists; - let acc = loop$acc; - if (lists.hasLength(0)) { - return reverse(acc); - } else if (lists.atLeastLength(1)) { - let list = lists.head; - let further_lists = lists.tail; - loop$lists = further_lists; - loop$acc = reverse_and_prepend(list, acc); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 661, - "do_concat", - "No case clause matched", - { values: [lists] } - ) - } - } -} - -export function concat(lists) { - return do_concat(lists, toList([])); -} - -export function flatten(lists) { - return do_concat(lists, toList([])); -} - -export function flat_map(list, fun) { - let _pipe = map(list, fun); - return concat(_pipe); -} - -export function fold(loop$list, loop$initial, loop$fun) { - while (true) { - let list = loop$list; - let initial = loop$initial; - let fun = loop$fun; - if (list.hasLength(0)) { - return initial; - } else if (list.atLeastLength(1)) { - let x = list.head; - let rest$1 = list.tail; - loop$list = rest$1; - loop$initial = fun(initial, x); - loop$fun = fun; - } else { - throw makeError( - "case_no_match", - "gleam/list", - 726, - "fold", - "No case clause matched", - { values: [list] } - ) - } - } -} - -export function group(list, key) { - return fold(list, $map.new$(), update_group(key)); -} - -export function map_fold(list, acc, fun) { - let _pipe = fold( - list, - [acc, toList([])], - (acc, item) => { - let current_acc = acc[0]; - let items = acc[1]; - let $ = fun(current_acc, item); - let next_acc = $[0]; - let next_item = $[1]; - return [next_acc, toList([next_item], items)]; - }, - ); - return $pair.map_second(_pipe, reverse); -} - -export function fold_right(list, initial, fun) { - if (list.hasLength(0)) { - return initial; - } else if (list.atLeastLength(1)) { - let x = list.head; - let rest$1 = list.tail; - return fun(fold_right(rest$1, initial, fun), x); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 748, - "fold_right", - "No case clause matched", - { values: [list] } - ) - } -} - -function do_index_fold(loop$over, loop$acc, loop$with, loop$index) { - while (true) { - let over = loop$over; - let acc = loop$acc; - let with$ = loop$with; - let index = loop$index; - if (over.hasLength(0)) { - return acc; - } else if (over.atLeastLength(1)) { - let first$1 = over.head; - let rest$1 = over.tail; - loop$over = rest$1; - loop$acc = with$(acc, first$1, index); - loop$with = with$; - loop$index = index + 1; - } else { - throw makeError( - "case_no_match", - "gleam/list", - 760, - "do_index_fold", - "No case clause matched", - { values: [over] } - ) - } - } -} - -export function index_fold(over, initial, fun) { - return do_index_fold(over, initial, fun, 0); -} - -export function try_fold(loop$collection, loop$accumulator, loop$fun) { - while (true) { - let collection = loop$collection; - let accumulator = loop$accumulator; - let fun = loop$fun; - if (collection.hasLength(0)) { - return new Ok(accumulator); - } else if (collection.atLeastLength(1)) { - let first$1 = collection.head; - let rest$1 = collection.tail; - let $ = fun(accumulator, first$1); - if ($.isOk()) { - let result = $[0]; - loop$collection = rest$1; - loop$accumulator = result; - loop$fun = fun; - } else if (!$.isOk()) { - let error = $; - return error; - } else { - throw makeError( - "case_no_match", - "gleam/list", - 810, - "try_fold", - "No case clause matched", - { values: [$] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 807, - "try_fold", - "No case clause matched", - { values: [collection] } - ) - } - } -} - -export function fold_until(loop$collection, loop$accumulator, loop$fun) { - while (true) { - let collection = loop$collection; - let accumulator = loop$accumulator; - let fun = loop$fun; - if (collection.hasLength(0)) { - return accumulator; - } else if (collection.atLeastLength(1)) { - let first$1 = collection.head; - let rest$1 = collection.tail; - let $ = fun(accumulator, first$1); - if ($ instanceof Continue) { - let next_accumulator = $[0]; - loop$collection = rest$1; - loop$accumulator = next_accumulator; - loop$fun = fun; - } else if ($ instanceof Stop) { - let b = $[0]; - return b; - } else { - throw makeError( - "case_no_match", - "gleam/list", - 848, - "fold_until", - "No case clause matched", - { values: [$] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 845, - "fold_until", - "No case clause matched", - { values: [collection] } - ) - } - } -} - -export function find(loop$haystack, loop$is_desired) { - while (true) { - let haystack = loop$haystack; - let is_desired = loop$is_desired; - if (haystack.hasLength(0)) { - return new Error(undefined); - } else if (haystack.atLeastLength(1)) { - let x = haystack.head; - let rest$1 = haystack.tail; - let $ = is_desired(x); - if ($) { - return new Ok(x); - } else { - loop$haystack = rest$1; - loop$is_desired = is_desired; - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 881, - "find", - "No case clause matched", - { values: [haystack] } - ) - } - } -} - -export function find_map(loop$haystack, loop$fun) { - while (true) { - let haystack = loop$haystack; - let fun = loop$fun; - if (haystack.hasLength(0)) { - return new Error(undefined); - } else if (haystack.atLeastLength(1)) { - let x = haystack.head; - let rest$1 = haystack.tail; - let $ = fun(x); - if ($.isOk()) { - let x$1 = $[0]; - return new Ok(x$1); - } else { - loop$haystack = rest$1; - loop$fun = fun; - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 917, - "find_map", - "No case clause matched", - { values: [haystack] } - ) - } - } -} - -export function all(loop$list, loop$predicate) { - while (true) { - let list = loop$list; - let predicate = loop$predicate; - if (list.hasLength(0)) { - return true; - } else if (list.atLeastLength(1)) { - let first$1 = list.head; - let rest$1 = list.tail; - let $ = predicate(first$1); - if ($) { - loop$list = rest$1; - loop$predicate = predicate; - } else if (!$) { - return false; - } else { - throw makeError( - "case_no_match", - "gleam/list", - 952, - "all", - "No case clause matched", - { values: [$] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 949, - "all", - "No case clause matched", - { values: [list] } - ) - } - } -} - -export function any(loop$list, loop$predicate) { - while (true) { - let list = loop$list; - let predicate = loop$predicate; - if (list.hasLength(0)) { - return false; - } else if (list.atLeastLength(1)) { - let first$1 = list.head; - let rest$1 = list.tail; - let $ = predicate(first$1); - if ($) { - return true; - } else if (!$) { - loop$list = rest$1; - loop$predicate = predicate; - } else { - throw makeError( - "case_no_match", - "gleam/list", - 989, - "any", - "No case clause matched", - { values: [$] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 986, - "any", - "No case clause matched", - { values: [list] } - ) - } - } -} - -function do_zip(loop$xs, loop$ys, loop$acc) { - while (true) { - let xs = loop$xs; - let ys = loop$ys; - let acc = loop$acc; - if (xs.atLeastLength(1) && ys.atLeastLength(1)) { - let x = xs.head; - let xs$1 = xs.tail; - let y = ys.head; - let ys$1 = ys.tail; - loop$xs = xs$1; - loop$ys = ys$1; - loop$acc = toList([[x, y]], acc); - } else { - return reverse(acc); - } - } -} - -export function zip(list, other) { - return do_zip(list, other, toList([])); -} - -export function strict_zip(list, other) { - let $ = length(list) === length(other); - if ($) { - return new Ok(zip(list, other)); - } else if (!$) { - return new Error(new LengthMismatch()); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1064, - "strict_zip", - "No case clause matched", - { values: [$] } - ) - } -} - -function do_unzip(loop$input, loop$xs, loop$ys) { - while (true) { - let input = loop$input; - let xs = loop$xs; - let ys = loop$ys; - if (input.hasLength(0)) { - return [reverse(xs), reverse(ys)]; - } else if (input.atLeastLength(1)) { - let x = input.head[0]; - let y = input.head[1]; - let rest$1 = input.tail; - loop$input = rest$1; - loop$xs = toList([x], xs); - loop$ys = toList([y], ys); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1071, - "do_unzip", - "No case clause matched", - { values: [input] } - ) - } - } -} - -export function unzip(input) { - return do_unzip(input, toList([]), toList([])); -} - -function do_intersperse(loop$list, loop$separator, loop$acc) { - while (true) { - let list = loop$list; - let separator = loop$separator; - let acc = loop$acc; - if (list.hasLength(0)) { - return reverse(acc); - } else if (list.atLeastLength(1)) { - let x = list.head; - let rest$1 = list.tail; - loop$list = rest$1; - loop$separator = separator; - loop$acc = toList([x, separator], acc); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1096, - "do_intersperse", - "No case clause matched", - { values: [list] } - ) - } - } -} - -export function intersperse(list, elem) { - if (list.hasLength(0)) { - return list; - } else if (list.hasLength(1)) { - return list; - } else if (list.atLeastLength(1)) { - let x = list.head; - let rest$1 = list.tail; - return do_intersperse(rest$1, elem, toList([x])); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1119, - "intersperse", - "No case clause matched", - { values: [list] } - ) - } -} - -export function at(list, index) { - let $ = index >= 0; - if ($) { - let _pipe = list; - let _pipe$1 = drop(_pipe, index); - return first(_pipe$1); - } else if (!$) { - return new Error(undefined); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1144, - "at", - "No case clause matched", - { values: [$] } - ) - } -} - -export function unique(list) { - if (list.hasLength(0)) { - return toList([]); - } else if (list.atLeastLength(1)) { - let x = list.head; - let rest$1 = list.tail; - return toList( - [x], - unique(filter(rest$1, (y) => { return !isEqual(y, x); })), - ); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1165, - "unique", - "No case clause matched", - { values: [list] } - ) - } -} - -function merge_up(loop$na, loop$nb, loop$a, loop$b, loop$acc, loop$compare) { - while (true) { - let na = loop$na; - let nb = loop$nb; - let a = loop$a; - let b = loop$b; - let acc = loop$acc; - let compare = loop$compare; - if (na === 0 && nb === 0) { - return acc; - } else if (nb === 0 && a.atLeastLength(1)) { - let ax = a.head; - let ar = a.tail; - loop$na = na - 1; - loop$nb = nb; - loop$a = ar; - loop$b = b; - loop$acc = toList([ax], acc); - loop$compare = compare; - } else if (na === 0 && b.atLeastLength(1)) { - let bx = b.head; - let br = b.tail; - loop$na = na; - loop$nb = nb - 1; - loop$a = a; - loop$b = br; - loop$acc = toList([bx], acc); - loop$compare = compare; - } else if (a.atLeastLength(1) && b.atLeastLength(1)) { - let ax = a.head; - let ar = a.tail; - let bx = b.head; - let br = b.tail; - let $ = compare(ax, bx); - if ($ instanceof $order.Gt) { - loop$na = na; - loop$nb = nb - 1; - loop$a = a; - loop$b = br; - loop$acc = toList([bx], acc); - loop$compare = compare; - } else { - loop$na = na - 1; - loop$nb = nb; - loop$a = ar; - loop$b = b; - loop$acc = toList([ax], acc); - loop$compare = compare; - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1182, - "merge_up", - "No case clause matched", - { values: [na, nb, a, b] } - ) - } - } -} - -function merge_down(loop$na, loop$nb, loop$a, loop$b, loop$acc, loop$compare) { - while (true) { - let na = loop$na; - let nb = loop$nb; - let a = loop$a; - let b = loop$b; - let acc = loop$acc; - let compare = loop$compare; - if (na === 0 && nb === 0) { - return acc; - } else if (nb === 0 && a.atLeastLength(1)) { - let ax = a.head; - let ar = a.tail; - loop$na = na - 1; - loop$nb = nb; - loop$a = ar; - loop$b = b; - loop$acc = toList([ax], acc); - loop$compare = compare; - } else if (na === 0 && b.atLeastLength(1)) { - let bx = b.head; - let br = b.tail; - loop$na = na; - loop$nb = nb - 1; - loop$a = a; - loop$b = br; - loop$acc = toList([bx], acc); - loop$compare = compare; - } else if (a.atLeastLength(1) && b.atLeastLength(1)) { - let ax = a.head; - let ar = a.tail; - let bx = b.head; - let br = b.tail; - let $ = compare(bx, ax); - if ($ instanceof $order.Lt) { - loop$na = na - 1; - loop$nb = nb; - loop$a = ar; - loop$b = b; - loop$acc = toList([ax], acc); - loop$compare = compare; - } else { - loop$na = na; - loop$nb = nb - 1; - loop$a = a; - loop$b = br; - loop$acc = toList([bx], acc); - loop$compare = compare; - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1205, - "merge_down", - "No case clause matched", - { values: [na, nb, a, b] } - ) - } - } -} - -function merge_sort(l, ln, compare, down) { - let n = divideInt(ln, 2); - let a = l; - let b = drop(l, n); - let $ = ln < 3; - if ($) { - if (down) { - return merge_down(n, ln - n, a, b, toList([]), compare); - } else if (!down) { - return merge_up(n, ln - n, a, b, toList([]), compare); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1234, - "merge_sort", - "No case clause matched", - { values: [down] } - ) - } - } else if (!$) { - if (down) { - return merge_down( - n, - ln - n, - merge_sort(a, n, compare, false), - merge_sort(b, ln - n, compare, false), - toList([]), - compare, - ); - } else if (!down) { - return merge_up( - n, - ln - n, - merge_sort(a, n, compare, true), - merge_sort(b, ln - n, compare, true), - toList([]), - compare, - ); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1239, - "merge_sort", - "No case clause matched", - { values: [down] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1232, - "merge_sort", - "No case clause matched", - { values: [$] } - ) - } -} - -export function sort(list, compare) { - return merge_sort(list, length(list), compare, true); -} - -function tail_recursive_range(loop$start, loop$stop, loop$acc) { - while (true) { - let start = loop$start; - let stop = loop$stop; - let acc = loop$acc; - let $ = $int.compare(start, stop); - if ($ instanceof $order.Eq) { - return toList([stop], acc); - } else if ($ instanceof $order.Gt) { - loop$start = start; - loop$stop = stop + 1; - loop$acc = toList([stop], acc); - } else if ($ instanceof $order.Lt) { - loop$start = start; - loop$stop = stop - 1; - loop$acc = toList([stop], acc); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1301, - "tail_recursive_range", - "No case clause matched", - { values: [$] } - ) - } - } -} - -export function range(start, stop) { - return tail_recursive_range(start, stop, toList([])); -} - -function do_repeat(loop$a, loop$times, loop$acc) { - while (true) { - let a = loop$a; - let times = loop$times; - let acc = loop$acc; - let $ = times <= 0; - if ($) { - return acc; - } else if (!$) { - loop$a = a; - loop$times = times - 1; - loop$acc = toList([a], acc); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1309, - "do_repeat", - "No case clause matched", - { values: [$] } - ) - } - } -} - -export function repeat(a, times) { - return do_repeat(a, times, toList([])); -} - -function do_split(loop$list, loop$n, loop$taken) { - while (true) { - let list = loop$list; - let n = loop$n; - let taken = loop$taken; - let $ = n <= 0; - if ($) { - return [reverse(taken), list]; - } else if (!$) { - if (list.hasLength(0)) { - return [reverse(taken), toList([])]; - } else if (list.atLeastLength(1)) { - let x = list.head; - let xs = list.tail; - loop$list = xs; - loop$n = n - 1; - loop$taken = toList([x], taken); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1337, - "do_split", - "No case clause matched", - { values: [list] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1334, - "do_split", - "No case clause matched", - { values: [$] } - ) - } - } -} - -export function split(list, index) { - return do_split(list, index, toList([])); -} - -function do_split_while(loop$list, loop$f, loop$acc) { - while (true) { - let list = loop$list; - let f = loop$f; - let acc = loop$acc; - if (list.hasLength(0)) { - return [reverse(acc), toList([])]; - } else if (list.atLeastLength(1)) { - let x = list.head; - let xs = list.tail; - let $ = f(x); - if (!$) { - return [reverse(acc), list]; - } else { - loop$list = xs; - loop$f = f; - loop$acc = toList([x], acc); - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1375, - "do_split_while", - "No case clause matched", - { values: [list] } - ) - } - } -} - -export function split_while(list, predicate) { - return do_split_while(list, predicate, toList([])); -} - -export function key_find(keyword_list, desired_key) { - return find_map( - keyword_list, - (keyword) => { - let key = keyword[0]; - let value = keyword[1]; - let $ = isEqual(key, desired_key); - if ($) { - return new Ok(value); - } else if (!$) { - return new Error(undefined); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1443, - "", - "No case clause matched", - { values: [$] } - ) - } - }, - ); -} - -function do_pop(loop$haystack, loop$predicate, loop$checked) { - while (true) { - let haystack = loop$haystack; - let predicate = loop$predicate; - let checked = loop$checked; - if (haystack.hasLength(0)) { - return new Error(undefined); - } else if (haystack.atLeastLength(1)) { - let x = haystack.head; - let rest$1 = haystack.tail; - let $ = predicate(x); - if ($) { - return new Ok([x, append(reverse(checked), rest$1)]); - } else if (!$) { - loop$haystack = rest$1; - loop$predicate = predicate; - loop$checked = toList([x], checked); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1455, - "do_pop", - "No case clause matched", - { values: [$] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1452, - "do_pop", - "No case clause matched", - { values: [haystack] } - ) - } - } -} - -export function pop(haystack, is_desired) { - return do_pop(haystack, is_desired, toList([])); -} - -function do_pop_map(loop$haystack, loop$mapper, loop$checked) { - while (true) { - let haystack = loop$haystack; - let mapper = loop$mapper; - let checked = loop$checked; - if (haystack.hasLength(0)) { - return new Error(undefined); - } else if (haystack.atLeastLength(1)) { - let x = haystack.head; - let rest$1 = haystack.tail; - let $ = mapper(x); - if ($.isOk()) { - let y = $[0]; - return new Ok([y, append(reverse(checked), rest$1)]); - } else if (!$.isOk()) { - loop$haystack = rest$1; - loop$mapper = mapper; - loop$checked = toList([x], checked); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1494, - "do_pop_map", - "No case clause matched", - { values: [$] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1491, - "do_pop_map", - "No case clause matched", - { values: [haystack] } - ) - } - } -} - -export function pop_map(haystack, is_desired) { - return do_pop_map(haystack, is_desired, toList([])); -} - -export function key_pop(haystack, key) { - return pop_map( - haystack, - (entry) => { - let k = entry[0]; - let v = entry[1]; - if (isEqual(k, key)) { - let k$1 = k; - return new Ok(v); - } else { - return new Error(undefined); - } - }, - ); -} - -export function key_set(list, key, value) { - if (list.hasLength(0)) { - return toList([[key, value]]); - } else if (list.atLeastLength(1) && isEqual(list.head[0], key)) { - let k = list.head[0]; - let rest$1 = list.tail; - return toList([[key, value]], rest$1); - } else if (list.atLeastLength(1)) { - let first$1 = list.head; - let rest$1 = list.tail; - return toList([first$1], key_set(rest$1, key, value)); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1587, - "key_set", - "No case clause matched", - { values: [list] } - ) - } -} - -export function each(loop$list, loop$f) { - while (true) { - let list = loop$list; - let f = loop$f; - if (list.hasLength(0)) { - return undefined; - } else if (list.atLeastLength(1)) { - let x = list.head; - let xs = list.tail; - f(x); - loop$list = xs; - loop$f = f; - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1604, - "each", - "No case clause matched", - { values: [list] } - ) - } - } -} - -export function try_each(loop$list, loop$fun) { - while (true) { - let list = loop$list; - let fun = loop$fun; - if (list.hasLength(0)) { - return new Ok(undefined); - } else if (list.atLeastLength(1)) { - let x = list.head; - let xs = list.tail; - let $ = fun(x); - if ($.isOk()) { - loop$list = xs; - loop$fun = fun; - } else if (!$.isOk()) { - let e = $[0]; - return new Error(e); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1636, - "try_each", - "No case clause matched", - { values: [$] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1633, - "try_each", - "No case clause matched", - { values: [list] } - ) - } - } -} - -function do_partition(loop$list, loop$categorise, loop$trues, loop$falses) { - while (true) { - let list = loop$list; - let categorise = loop$categorise; - let trues = loop$trues; - let falses = loop$falses; - if (list.hasLength(0)) { - return [reverse(trues), reverse(falses)]; - } else if (list.atLeastLength(1)) { - let x = list.head; - let xs = list.tail; - let $ = categorise(x); - if ($) { - loop$list = xs; - loop$categorise = categorise; - loop$trues = toList([x], trues); - loop$falses = falses; - } else if (!$) { - loop$list = xs; - loop$categorise = categorise; - loop$trues = trues; - loop$falses = toList([x], falses); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1647, - "do_partition", - "No case clause matched", - { values: [$] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1644, - "do_partition", - "No case clause matched", - { values: [list] } - ) - } - } -} - -export function partition(list, categorise) { - return do_partition(list, categorise, toList([]), toList([])); -} - -export function permutations(l) { - if (l.hasLength(0)) { - return toList([toList([])]); - } else { - let _pipe = l; - let _pipe$1 = index_map( - _pipe, - (i_idx, i) => { - let _pipe$1 = l; - let _pipe$2 = index_fold( - _pipe$1, - toList([]), - (acc, j, j_idx) => { - let $ = i_idx === j_idx; - if ($) { - return acc; - } else if (!$) { - return toList([j], acc); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1690, - "", - "No case clause matched", - { values: [$] } - ) - } - }, - ); - let _pipe$3 = reverse(_pipe$2); - let _pipe$4 = permutations(_pipe$3); - return map( - _pipe$4, - (permutation) => { return toList([i], permutation); }, - ); - }, - ); - return concat(_pipe$1); - } -} - -function do_window(loop$acc, loop$l, loop$n) { - while (true) { - let acc = loop$acc; - let l = loop$l; - let n = loop$n; - let window$1 = take(l, n); - let $ = length(window$1) === n; - if ($) { - loop$acc = toList([window$1], acc); - loop$l = drop(l, 1); - loop$n = n; - } else if (!$) { - return acc; - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1707, - "do_window", - "No case clause matched", - { values: [$] } - ) - } - } -} - -export function window(l, n) { - let _pipe = do_window(toList([]), l, n); - return reverse(_pipe); -} - -export function window_by_2(l) { - return zip(l, drop(l, 1)); -} - -export function drop_while(loop$list, loop$predicate) { - while (true) { - let list = loop$list; - let predicate = loop$predicate; - if (list.hasLength(0)) { - return toList([]); - } else if (list.atLeastLength(1)) { - let x = list.head; - let xs = list.tail; - let $ = predicate(x); - if ($) { - loop$list = xs; - loop$predicate = predicate; - } else if (!$) { - return toList([x], xs); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1766, - "drop_while", - "No case clause matched", - { values: [$] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1763, - "drop_while", - "No case clause matched", - { values: [list] } - ) - } - } -} - -function do_take_while(loop$list, loop$predicate, loop$acc) { - while (true) { - let list = loop$list; - let predicate = loop$predicate; - let acc = loop$acc; - if (list.hasLength(0)) { - return reverse(acc); - } else if (list.atLeastLength(1)) { - let first$1 = list.head; - let rest$1 = list.tail; - let $ = predicate(first$1); - if ($) { - loop$list = rest$1; - loop$predicate = predicate; - loop$acc = toList([first$1], acc); - } else if (!$) { - return reverse(acc); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1781, - "do_take_while", - "No case clause matched", - { values: [$] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1778, - "do_take_while", - "No case clause matched", - { values: [list] } - ) - } - } -} - -export function take_while(list, predicate) { - return do_take_while(list, predicate, toList([])); -} - -function do_chunk( - loop$list, - loop$f, - loop$previous_key, - loop$current_chunk, - loop$acc -) { - while (true) { - let list = loop$list; - let f = loop$f; - let previous_key = loop$previous_key; - let current_chunk = loop$current_chunk; - let acc = loop$acc; - if (list.atLeastLength(1)) { - let first$1 = list.head; - let rest$1 = list.tail; - let key = f(first$1); - let $ = isEqual(key, previous_key); - if (!$) { - let new_acc = toList([reverse(current_chunk)], acc); - loop$list = rest$1; - loop$f = f; - loop$previous_key = key; - loop$current_chunk = toList([first$1]); - loop$acc = new_acc; - } else { - loop$list = rest$1; - loop$f = f; - loop$previous_key = key; - loop$current_chunk = toList([first$1], current_chunk); - loop$acc = acc; - } - } else { - return reverse(toList([reverse(current_chunk)], acc)); - } - } -} - -export function chunk(list, f) { - if (list.hasLength(0)) { - return toList([]); - } else if (list.atLeastLength(1)) { - let first$1 = list.head; - let rest$1 = list.tail; - return do_chunk(rest$1, f, f(first$1), toList([first$1]), toList([])); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1837, - "chunk", - "No case clause matched", - { values: [list] } - ) - } -} - -function do_sized_chunk( - loop$list, - loop$count, - loop$left, - loop$current_chunk, - loop$acc -) { - while (true) { - let list = loop$list; - let count = loop$count; - let left = loop$left; - let current_chunk = loop$current_chunk; - let acc = loop$acc; - if (list.hasLength(0)) { - if (current_chunk.hasLength(0)) { - return reverse(acc); - } else { - let remaining = current_chunk; - return reverse(toList([reverse(remaining)], acc)); - } - } else if (list.atLeastLength(1)) { - let first$1 = list.head; - let rest$1 = list.tail; - let chunk$1 = toList([first$1], current_chunk); - let $ = left > 1; - if (!$) { - loop$list = rest$1; - loop$count = count; - loop$left = count; - loop$current_chunk = toList([]); - loop$acc = toList([reverse(chunk$1)], acc); - } else if ($) { - loop$list = rest$1; - loop$count = count; - loop$left = left - 1; - loop$current_chunk = chunk$1; - loop$acc = acc; - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1858, - "do_sized_chunk", - "No case clause matched", - { values: [$] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1850, - "do_sized_chunk", - "No case clause matched", - { values: [list] } - ) - } - } -} - -export function sized_chunk(list, count) { - return do_sized_chunk(list, count, count, toList([]), toList([])); -} - -export function reduce(list, fun) { - if (list.hasLength(0)) { - return new Error(undefined); - } else if (list.atLeastLength(1)) { - let first$1 = list.head; - let rest$1 = list.tail; - return new Ok(fold(rest$1, first$1, fun)); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1910, - "reduce", - "No case clause matched", - { values: [list] } - ) - } -} - -function do_scan(loop$list, loop$accumulator, loop$accumulated, loop$fun) { - while (true) { - let list = loop$list; - let accumulator = loop$accumulator; - let accumulated = loop$accumulated; - let fun = loop$fun; - if (list.hasLength(0)) { - return reverse(accumulated); - } else if (list.atLeastLength(1)) { - let x = list.head; - let xs = list.tail; - let next = fun(accumulator, x); - loop$list = xs; - loop$accumulator = next; - loop$accumulated = toList([next], accumulated); - loop$fun = fun; - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1922, - "do_scan", - "No case clause matched", - { values: [list] } - ) - } - } -} - -export function scan(list, initial, fun) { - return do_scan(list, initial, toList([]), fun); -} - -export function last(list) { - let _pipe = list; - return reduce(_pipe, (_, elem) => { return elem; }); -} - -export function combinations(items, n) { - if (n === 0) { - return toList([toList([])]); - } else { - if (items.hasLength(0)) { - return toList([]); - } else if (items.atLeastLength(1)) { - let x = items.head; - let xs = items.tail; - let first_combinations = (() => { - let _pipe = map( - combinations(xs, n - 1), - (com) => { return toList([x], com); }, - ); - return reverse(_pipe); - })(); - return fold( - first_combinations, - combinations(xs, n), - (acc, c) => { return toList([c], acc); }, - ); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 1991, - "combinations", - "No case clause matched", - { values: [items] } - ) - } - } -} - -function do_combination_pairs(items) { - if (items.hasLength(0)) { - return toList([]); - } else if (items.atLeastLength(1)) { - let x = items.head; - let xs = items.tail; - let first_combinations = map(xs, (other) => { return [x, other]; }); - return toList([first_combinations], do_combination_pairs(xs)); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 2008, - "do_combination_pairs", - "No case clause matched", - { values: [items] } - ) - } -} - -export function combination_pairs(items) { - let _pipe = do_combination_pairs(items); - return concat(_pipe); -} - -export function transpose(loop$list_of_list) { - while (true) { - let list_of_list = loop$list_of_list; - let take_first = (list) => { - if (list.hasLength(0)) { - return toList([]); - } else if (list.hasLength(1)) { - let f = list.head; - return toList([f]); - } else if (list.atLeastLength(1)) { - let f = list.head; - return toList([f]); - } else { - throw makeError( - "case_no_match", - "gleam/list", - 2060, - "", - "No case clause matched", - { values: [list] } - ) - } - }; - if (list_of_list.hasLength(0)) { - return toList([]); - } else if (list_of_list.atLeastLength(1) && list_of_list.head.hasLength(0)) { - let xss = list_of_list.tail; - loop$list_of_list = xss; - } else { - let rows = list_of_list; - let firsts = (() => { - let _pipe = rows; - let _pipe$1 = map(_pipe, take_first); - return concat(_pipe$1); - })(); - let rest$1 = transpose( - map(rows, (_capture) => { return drop(_capture, 1); }), - ); - return toList([firsts], rest$1); - } - } -} - -export function interleave(list) { - let _pipe = transpose(list); - return concat(_pipe); -} - -function do_shuffle_pair_unwrap(loop$list, loop$acc) { - while (true) { - let list = loop$list; - let acc = loop$acc; - if (list.hasLength(0)) { - return acc; - } else { - if (!list.atLeastLength(1)) { - throw makeError( - "assignment_no_match", - "gleam/list", - 2085, - "do_shuffle_pair_unwrap", - "Assignment pattern did not match", - { value: list } - ) - } - let elem_pair = list.head; - let enumerable = list.tail; - loop$list = enumerable; - loop$acc = toList([elem_pair[1]], acc); - } - } -} - -function do_shuffle_by_pair_indexes(list_of_pairs) { - return sort( - list_of_pairs, - (a_pair, b_pair) => { return $float.compare(a_pair[0], b_pair[0]); }, - ); -} - -export function shuffle(list) { - let _pipe = list; - let _pipe$1 = fold( - _pipe, - toList([]), - (acc, a) => { return toList([[$float.random(0.0, 1.0), a]], acc); }, - ); - let _pipe$2 = do_shuffle_by_pair_indexes(_pipe$1); - return do_shuffle_pair_unwrap(_pipe$2, toList([])); -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/map.mjs b/build/dev/javascript/gleam_stdlib/gleam/map.mjs deleted file mode 100644 index 1d20c51..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/map.mjs +++ /dev/null @@ -1,343 +0,0 @@ -import { Error, toList, makeError, isEqual } from "../gleam.mjs"; -import * as $option from "../gleam/option.mjs"; -import { - map_size as do_size, - map_to_list as do_to_list, - new_map as do_new, - map_get as do_get, - map_insert as do_insert, - map_remove as do_delete, -} from "../gleam_stdlib.mjs"; - -export function size(map) { - return do_size(map); -} - -export function to_list(map) { - return do_to_list(map); -} - -export function new$() { - return do_new(); -} - -export function get(from, get) { - return do_get(from, get); -} - -function do_has_key(key, map) { - return !isEqual(get(map, key), new Error(undefined)); -} - -export function has_key(map, key) { - return do_has_key(key, map); -} - -export function insert(map, key, value) { - return do_insert(key, value, map); -} - -function fold_list_of_pair(loop$list, loop$initial) { - while (true) { - let list = loop$list; - let initial = loop$initial; - if (list.hasLength(0)) { - return initial; - } else if (list.atLeastLength(1)) { - let x = list.head; - let rest = list.tail; - loop$list = rest; - loop$initial = insert(initial, x[0], x[1]); - } else { - throw makeError( - "case_no_match", - "gleam/map", - 85, - "fold_list_of_pair", - "No case clause matched", - { values: [list] } - ) - } - } -} - -function do_from_list(list) { - return fold_list_of_pair(list, new$()); -} - -export function from_list(list) { - return do_from_list(list); -} - -function reverse_and_concat(loop$remaining, loop$accumulator) { - while (true) { - let remaining = loop$remaining; - let accumulator = loop$accumulator; - if (remaining.hasLength(0)) { - return accumulator; - } else if (remaining.atLeastLength(1)) { - let item = remaining.head; - let rest = remaining.tail; - loop$remaining = rest; - loop$accumulator = toList([item], accumulator); - } else { - throw makeError( - "case_no_match", - "gleam/map", - 233, - "reverse_and_concat", - "No case clause matched", - { values: [remaining] } - ) - } - } -} - -function do_keys_acc(loop$list, loop$acc) { - while (true) { - let list = loop$list; - let acc = loop$acc; - if (list.hasLength(0)) { - return reverse_and_concat(acc, toList([])); - } else if (list.atLeastLength(1)) { - let x = list.head; - let xs = list.tail; - loop$list = xs; - loop$acc = toList([x[0]], acc); - } else { - throw makeError( - "case_no_match", - "gleam/map", - 241, - "do_keys_acc", - "No case clause matched", - { values: [list] } - ) - } - } -} - -function do_keys(map) { - let list_of_pairs = (() => { - let _pipe = map; - return to_list(_pipe); - })(); - return do_keys_acc(list_of_pairs, toList([])); -} - -export function keys(map) { - return do_keys(map); -} - -function do_values_acc(loop$list, loop$acc) { - while (true) { - let list = loop$list; - let acc = loop$acc; - if (list.hasLength(0)) { - return reverse_and_concat(acc, toList([])); - } else if (list.atLeastLength(1)) { - let x = list.head; - let xs = list.tail; - loop$list = xs; - loop$acc = toList([x[1]], acc); - } else { - throw makeError( - "case_no_match", - "gleam/map", - 278, - "do_values_acc", - "No case clause matched", - { values: [list] } - ) - } - } -} - -function do_values(map) { - let list_of_pairs = (() => { - let _pipe = map; - return to_list(_pipe); - })(); - return do_values_acc(list_of_pairs, toList([])); -} - -export function values(map) { - return do_values(map); -} - -function insert_taken(loop$map, loop$desired_keys, loop$acc) { - while (true) { - let map = loop$map; - let desired_keys = loop$desired_keys; - let acc = loop$acc; - let insert$1 = (taken, key) => { - let $ = get(map, key); - if ($.isOk()) { - let value = $[0]; - return insert(taken, key, value); - } else { - return taken; - } - }; - if (desired_keys.hasLength(0)) { - return acc; - } else if (desired_keys.atLeastLength(1)) { - let x = desired_keys.head; - let xs = desired_keys.tail; - loop$map = map; - loop$desired_keys = xs; - loop$acc = insert$1(acc, x); - } else { - throw makeError( - "case_no_match", - "gleam/map", - 366, - "insert_taken", - "No case clause matched", - { values: [desired_keys] } - ) - } - } -} - -function do_take(desired_keys, map) { - return insert_taken(map, desired_keys, new$()); -} - -export function take(map, desired_keys) { - return do_take(desired_keys, map); -} - -function insert_pair(map, pair) { - return insert(map, pair[0], pair[1]); -} - -function fold_inserts(loop$new_entries, loop$map) { - while (true) { - let new_entries = loop$new_entries; - let map = loop$map; - if (new_entries.hasLength(0)) { - return map; - } else if (new_entries.atLeastLength(1)) { - let x = new_entries.head; - let xs = new_entries.tail; - loop$new_entries = xs; - loop$map = insert_pair(map, x); - } else { - throw makeError( - "case_no_match", - "gleam/map", - 406, - "fold_inserts", - "No case clause matched", - { values: [new_entries] } - ) - } - } -} - -function do_merge(map, new_entries) { - let _pipe = new_entries; - let _pipe$1 = to_list(_pipe); - return fold_inserts(_pipe$1, map); -} - -export function merge(map, new_entries) { - return do_merge(map, new_entries); -} - -export function delete$(map, key) { - return do_delete(key, map); -} - -export function drop(loop$map, loop$disallowed_keys) { - while (true) { - let map = loop$map; - let disallowed_keys = loop$disallowed_keys; - if (disallowed_keys.hasLength(0)) { - return map; - } else if (disallowed_keys.atLeastLength(1)) { - let x = disallowed_keys.head; - let xs = disallowed_keys.tail; - loop$map = delete$(map, x); - loop$disallowed_keys = xs; - } else { - throw makeError( - "case_no_match", - "gleam/map", - 463, - "drop", - "No case clause matched", - { values: [disallowed_keys] } - ) - } - } -} - -export function update(map, key, fun) { - let _pipe = map; - let _pipe$1 = get(_pipe, key); - let _pipe$2 = $option.from_result(_pipe$1); - let _pipe$3 = fun(_pipe$2); - return ((_capture) => { return insert(map, key, _capture); })(_pipe$3); -} - -function do_fold(loop$list, loop$initial, loop$fun) { - while (true) { - let list = loop$list; - let initial = loop$initial; - let fun = loop$fun; - if (list.hasLength(0)) { - return initial; - } else if (list.atLeastLength(1)) { - let k = list.head[0]; - let v = list.head[1]; - let rest = list.tail; - loop$list = rest; - loop$initial = fun(initial, k, v); - loop$fun = fun; - } else { - throw makeError( - "case_no_match", - "gleam/map", - 507, - "do_fold", - "No case clause matched", - { values: [list] } - ) - } - } -} - -export function fold(map, initial, fun) { - let _pipe = map; - let _pipe$1 = to_list(_pipe); - return do_fold(_pipe$1, initial, fun); -} - -function do_map_values(f, map) { - let f$1 = (map, k, v) => { return insert(map, k, f(k, v)); }; - let _pipe = map; - return fold(_pipe, new$(), f$1); -} - -export function map_values(map, fun) { - return do_map_values(fun, map); -} - -function do_filter(f, map) { - let insert$1 = (map, k, v) => { - let $ = f(k, v); - if ($) { - return insert(map, k, v); - } else { - return map; - } - }; - let _pipe = map; - return fold(_pipe, new$(), insert$1); -} - -export function filter(map, property) { - return do_filter(property, map); -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/option.mjs b/build/dev/javascript/gleam_stdlib/gleam/option.mjs deleted file mode 100644 index f7417c6..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/option.mjs +++ /dev/null @@ -1,232 +0,0 @@ -import { Ok, Error, toList, CustomType as $CustomType, makeError, isEqual } from "../gleam.mjs"; - -export class Some extends $CustomType { - constructor(x0) { - super(); - this[0] = x0; - } -} - -export class None extends $CustomType {} - -function do_all(list, acc) { - if (list.hasLength(0)) { - return new Some(acc); - } else if (list.atLeastLength(1)) { - let x = list.head; - let rest = list.tail; - let accumulate = (acc, item) => { - if (acc instanceof Some && item instanceof Some) { - let values$1 = acc[0]; - let value = item[0]; - return new Some(toList([value], values$1)); - } else { - return new None(); - } - }; - return accumulate(do_all(rest, acc), x); - } else { - throw makeError( - "case_no_match", - "gleam/option", - 13, - "do_all", - "No case clause matched", - { values: [list] } - ) - } -} - -export function all(list) { - return do_all(list, toList([])); -} - -export function is_some(option) { - return !isEqual(option, new None()); -} - -export function is_none(option) { - return isEqual(option, new None()); -} - -export function to_result(option, e) { - if (option instanceof Some) { - let a = option[0]; - return new Ok(a); - } else { - return new Error(e); - } -} - -export function from_result(result) { - if (result.isOk()) { - let a = result[0]; - return new Some(a); - } else { - return new None(); - } -} - -export function unwrap(option, default$) { - if (option instanceof Some) { - let x = option[0]; - return x; - } else if (option instanceof None) { - return default$; - } else { - throw makeError( - "case_no_match", - "gleam/option", - 140, - "unwrap", - "No case clause matched", - { values: [option] } - ) - } -} - -export function lazy_unwrap(option, default$) { - if (option instanceof Some) { - let x = option[0]; - return x; - } else if (option instanceof None) { - return default$(); - } else { - throw makeError( - "case_no_match", - "gleam/option", - 161, - "lazy_unwrap", - "No case clause matched", - { values: [option] } - ) - } -} - -export function map(option, fun) { - if (option instanceof Some) { - let x = option[0]; - return new Some(fun(x)); - } else if (option instanceof None) { - return new None(); - } else { - throw makeError( - "case_no_match", - "gleam/option", - 186, - "map", - "No case clause matched", - { values: [option] } - ) - } -} - -export function flatten(option) { - if (option instanceof Some) { - let x = option[0]; - return x; - } else if (option instanceof None) { - return new None(); - } else { - throw makeError( - "case_no_match", - "gleam/option", - 212, - "flatten", - "No case clause matched", - { values: [option] } - ) - } -} - -export function then$(option, fun) { - if (option instanceof Some) { - let x = option[0]; - return fun(x); - } else if (option instanceof None) { - return new None(); - } else { - throw makeError( - "case_no_match", - "gleam/option", - 251, - "then", - "No case clause matched", - { values: [option] } - ) - } -} - -export function or(first, second) { - if (first instanceof Some) { - return first; - } else if (first instanceof None) { - return second; - } else { - throw makeError( - "case_no_match", - "gleam/option", - 282, - "or", - "No case clause matched", - { values: [first] } - ) - } -} - -export function lazy_or(first, second) { - if (first instanceof Some) { - return first; - } else if (first instanceof None) { - return second(); - } else { - throw makeError( - "case_no_match", - "gleam/option", - 313, - "lazy_or", - "No case clause matched", - { values: [first] } - ) - } -} - -function do_values(list, acc) { - if (list.hasLength(0)) { - return acc; - } else if (list.atLeastLength(1)) { - let x = list.head; - let xs = list.tail; - let accumulate = (acc, item) => { - if (item instanceof Some) { - let value = item[0]; - return toList([value], acc); - } else if (item instanceof None) { - return acc; - } else { - throw makeError( - "case_no_match", - "gleam/option", - 324, - "", - "No case clause matched", - { values: [item] } - ) - } - }; - return accumulate(do_values(xs, acc), x); - } else { - throw makeError( - "case_no_match", - "gleam/option", - 320, - "do_values", - "No case clause matched", - { values: [list] } - ) - } -} - -export function values(options) { - return do_values(options, toList([])); -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/order.mjs b/build/dev/javascript/gleam_stdlib/gleam/order.mjs deleted file mode 100644 index 8514dce..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/order.mjs +++ /dev/null @@ -1,83 +0,0 @@ -import { CustomType as $CustomType, makeError, isEqual } from "../gleam.mjs"; - -export class Lt extends $CustomType {} - -export class Eq extends $CustomType {} - -export class Gt extends $CustomType {} - -export function negate(order) { - if (order instanceof Lt) { - return new Gt(); - } else if (order instanceof Eq) { - return new Eq(); - } else if (order instanceof Gt) { - return new Lt(); - } else { - throw makeError( - "case_no_match", - "gleam/order", - 36, - "negate", - "No case clause matched", - { values: [order] } - ) - } -} - -export function to_int(order) { - if (order instanceof Lt) { - return -1; - } else if (order instanceof Eq) { - return 0; - } else if (order instanceof Gt) { - return 1; - } else { - throw makeError( - "case_no_match", - "gleam/order", - 63, - "to_int", - "No case clause matched", - { values: [order] } - ) - } -} - -export function compare(a, b) { - if (isEqual(a, b)) { - let x = a; - let y = b; - return new Eq(); - } else if (a instanceof Lt) { - return new Lt(); - } else if (a instanceof Eq && b instanceof Gt) { - return new Lt(); - } else { - return new Gt(); - } -} - -export function max(a, b) { - if (a instanceof Gt) { - return new Gt(); - } else if (a instanceof Eq && b instanceof Lt) { - return new Eq(); - } else { - return b; - } -} - -export function min(a, b) { - if (a instanceof Lt) { - return new Lt(); - } else if (a instanceof Eq && b instanceof Gt) { - return new Eq(); - } else { - return b; - } -} - -export function reverse(orderer) { - return (a, b) => { return orderer(b, a); }; -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/pair.mjs b/build/dev/javascript/gleam_stdlib/gleam/pair.mjs deleted file mode 100644 index d15a9d2..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/pair.mjs +++ /dev/null @@ -1,31 +0,0 @@ -export function first(pair) { - let a = pair[0]; - return a; -} - -export function second(pair) { - let a = pair[1]; - return a; -} - -export function swap(pair) { - let a = pair[0]; - let b = pair[1]; - return [b, a]; -} - -export function map_first(pair, fun) { - let a = pair[0]; - let b = pair[1]; - return [fun(a), b]; -} - -export function map_second(pair, fun) { - let a = pair[0]; - let b = pair[1]; - return [a, fun(b)]; -} - -export function new$(first, second) { - return [first, second]; -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/queue.mjs b/build/dev/javascript/gleam_stdlib/gleam/queue.mjs deleted file mode 100644 index 5982bf5..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/queue.mjs +++ /dev/null @@ -1,169 +0,0 @@ -import { Ok, Error, toList, CustomType as $CustomType, makeError, isEqual } from "../gleam.mjs"; -import * as $list from "../gleam/list.mjs"; - -class Queue extends $CustomType { - constructor(in$, out) { - super(); - this.in = in$; - this.out = out; - } -} - -export function new$() { - return new Queue(toList([]), toList([])); -} - -export function from_list(list) { - return new Queue(toList([]), list); -} - -export function to_list(queue) { - let _pipe = queue.out; - return $list.append(_pipe, $list.reverse(queue.in)); -} - -export function is_empty(queue) { - return (isEqual(queue.in, toList([]))) && (isEqual(queue.out, toList([]))); -} - -export function length(queue) { - return $list.length(queue.in) + $list.length(queue.out); -} - -export function push_back(queue, item) { - return new Queue(toList([item], queue.in), queue.out); -} - -export function push_front(queue, item) { - return new Queue(queue.in, toList([item], queue.out)); -} - -export function pop_back(loop$queue) { - while (true) { - let queue = loop$queue; - if (queue instanceof Queue && - queue.in.hasLength(0) && - queue.out.hasLength(0)) { - return new Error(undefined); - } else if (queue instanceof Queue && queue.in.hasLength(0)) { - let out = queue.out; - loop$queue = new Queue($list.reverse(out), toList([])); - } else if (queue instanceof Queue && queue.in.atLeastLength(1)) { - let first = queue.in.head; - let rest = queue.in.tail; - let out = queue.out; - let queue$1 = new Queue(rest, out); - return new Ok([first, queue$1]); - } else { - throw makeError( - "case_no_match", - "gleam/queue", - 166, - "pop_back", - "No case clause matched", - { values: [queue] } - ) - } - } -} - -export function pop_front(loop$queue) { - while (true) { - let queue = loop$queue; - if (queue instanceof Queue && - queue.in.hasLength(0) && - queue.out.hasLength(0)) { - return new Error(undefined); - } else if (queue instanceof Queue && queue.out.hasLength(0)) { - let in$ = queue.in; - loop$queue = new Queue(toList([]), $list.reverse(in$)); - } else if (queue instanceof Queue && queue.out.atLeastLength(1)) { - let in$ = queue.in; - let first = queue.out.head; - let rest = queue.out.tail; - let queue$1 = new Queue(in$, rest); - return new Ok([first, queue$1]); - } else { - throw makeError( - "case_no_match", - "gleam/queue", - 206, - "pop_front", - "No case clause matched", - { values: [queue] } - ) - } - } -} - -export function reverse(queue) { - return new Queue(queue.out, queue.in); -} - -function check_equal(loop$xs, loop$x_tail, loop$ys, loop$y_tail, loop$eq) { - while (true) { - let xs = loop$xs; - let x_tail = loop$x_tail; - let ys = loop$ys; - let y_tail = loop$y_tail; - let eq = loop$eq; - if (xs.hasLength(0) && - x_tail.hasLength(0) && - ys.hasLength(0) && - y_tail.hasLength(0)) { - return true; - } else if (xs.atLeastLength(1) && ys.atLeastLength(1)) { - let x = xs.head; - let xs$1 = xs.tail; - let y = ys.head; - let ys$1 = ys.tail; - let $ = eq(x, y); - if (!$) { - return false; - } else if ($) { - loop$xs = xs$1; - loop$x_tail = x_tail; - loop$ys = ys$1; - loop$y_tail = y_tail; - loop$eq = eq; - } else { - throw makeError( - "case_no_match", - "gleam/queue", - 252, - "check_equal", - "No case clause matched", - { values: [$] } - ) - } - } else if (xs.hasLength(0) && x_tail.atLeastLength(1)) { - loop$xs = $list.reverse(x_tail); - loop$x_tail = toList([]); - loop$ys = ys; - loop$y_tail = y_tail; - loop$eq = eq; - } else if (ys.hasLength(0) && y_tail.atLeastLength(1)) { - loop$xs = xs; - loop$x_tail = x_tail; - loop$ys = $list.reverse(y_tail); - loop$y_tail = toList([]); - loop$eq = eq; - } else { - return false; - } - } -} - -export function is_logically_equal(a, b, element_is_equal) { - return check_equal(a.out, a.in, b.out, b.in, element_is_equal); -} - -export function is_equal(a, b) { - return check_equal( - a.out, - a.in, - b.out, - b.in, - (a, b) => { return isEqual(a, b); }, - ); -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/regex.mjs b/build/dev/javascript/gleam_stdlib/gleam/regex.mjs deleted file mode 100644 index b73028e..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/regex.mjs +++ /dev/null @@ -1,56 +0,0 @@ -import { CustomType as $CustomType } from "../gleam.mjs"; -import * as $option from "../gleam/option.mjs"; -import { - compile_regex as do_compile, - regex_check as do_check, - split as js_split, - regex_scan as do_scan, -} from "../gleam_stdlib.mjs"; - -export class Match extends $CustomType { - constructor(content, submatches) { - super(); - this.content = content; - this.submatches = submatches; - } -} - -export class CompileError extends $CustomType { - constructor(error, byte_index) { - super(); - this.error = error; - this.byte_index = byte_index; - } -} - -export class Options extends $CustomType { - constructor(case_insensitive, multi_line) { - super(); - this.case_insensitive = case_insensitive; - this.multi_line = multi_line; - } -} - -export function compile(pattern, options) { - return do_compile(pattern, options); -} - -export function from_string(pattern) { - return compile(pattern, new Options(false, false)); -} - -export function check(regex, content) { - return do_check(regex, content); -} - -function do_split(regex, string) { - return js_split(string, regex); -} - -export function split(regex, string) { - return do_split(regex, string); -} - -export function scan(regex, string) { - return do_scan(regex, string); -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/result.mjs b/build/dev/javascript/gleam_stdlib/gleam/result.mjs deleted file mode 100644 index 2b84474..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/result.mjs +++ /dev/null @@ -1,326 +0,0 @@ -import { Ok, Error, toList, makeError } from "../gleam.mjs"; -import * as $list from "../gleam/list.mjs"; - -export function is_ok(result) { - if (!result.isOk()) { - return false; - } else if (result.isOk()) { - return true; - } else { - throw makeError( - "case_no_match", - "gleam/result", - 21, - "is_ok", - "No case clause matched", - { values: [result] } - ) - } -} - -export function is_error(result) { - if (result.isOk()) { - return false; - } else if (!result.isOk()) { - return true; - } else { - throw makeError( - "case_no_match", - "gleam/result", - 42, - "is_error", - "No case clause matched", - { values: [result] } - ) - } -} - -export function map(result, fun) { - if (result.isOk()) { - let x = result[0]; - return new Ok(fun(x)); - } else if (!result.isOk()) { - let e = result[0]; - return new Error(e); - } else { - throw makeError( - "case_no_match", - "gleam/result", - 67, - "map", - "No case clause matched", - { values: [result] } - ) - } -} - -export function map_error(result, fun) { - if (result.isOk()) { - let x = result[0]; - return new Ok(x); - } else if (!result.isOk()) { - let error = result[0]; - return new Error(fun(error)); - } else { - throw makeError( - "case_no_match", - "gleam/result", - 95, - "map_error", - "No case clause matched", - { values: [result] } - ) - } -} - -export function flatten(result) { - if (result.isOk()) { - let x = result[0]; - return x; - } else if (!result.isOk()) { - let error = result[0]; - return new Error(error); - } else { - throw makeError( - "case_no_match", - "gleam/result", - 121, - "flatten", - "No case clause matched", - { values: [result] } - ) - } -} - -export function try$(result, fun) { - if (result.isOk()) { - let x = result[0]; - return fun(x); - } else if (!result.isOk()) { - let e = result[0]; - return new Error(e); - } else { - throw makeError( - "case_no_match", - "gleam/result", - 163, - "try", - "No case clause matched", - { values: [result] } - ) - } -} - -export function then$(result, fun) { - return try$(result, fun); -} - -export function unwrap(result, default$) { - if (result.isOk()) { - let v = result[0]; - return v; - } else if (!result.isOk()) { - return default$; - } else { - throw makeError( - "case_no_match", - "gleam/result", - 194, - "unwrap", - "No case clause matched", - { values: [result] } - ) - } -} - -export function lazy_unwrap(result, default$) { - if (result.isOk()) { - let v = result[0]; - return v; - } else if (!result.isOk()) { - return default$(); - } else { - throw makeError( - "case_no_match", - "gleam/result", - 216, - "lazy_unwrap", - "No case clause matched", - { values: [result] } - ) - } -} - -export function unwrap_error(result, default$) { - if (result.isOk()) { - return default$; - } else if (!result.isOk()) { - let e = result[0]; - return e; - } else { - throw makeError( - "case_no_match", - "gleam/result", - 238, - "unwrap_error", - "No case clause matched", - { values: [result] } - ) - } -} - -export function unwrap_both(result) { - if (result.isOk()) { - let a = result[0]; - return a; - } else if (!result.isOk()) { - let a = result[0]; - return a; - } else { - throw makeError( - "case_no_match", - "gleam/result", - 260, - "unwrap_both", - "No case clause matched", - { values: [result] } - ) - } -} - -export function nil_error(result) { - return map_error(result, (_) => { return undefined; }); -} - -export function or(first, second) { - if (first.isOk()) { - return first; - } else if (!first.isOk()) { - return second; - } else { - throw makeError( - "case_no_match", - "gleam/result", - 309, - "or", - "No case clause matched", - { values: [first] } - ) - } -} - -export function lazy_or(first, second) { - if (first.isOk()) { - return first; - } else if (!first.isOk()) { - return second(); - } else { - throw makeError( - "case_no_match", - "gleam/result", - 343, - "lazy_or", - "No case clause matched", - { values: [first] } - ) - } -} - -export function all(results) { - return $list.try_map(results, (x) => { return x; }); -} - -function do_partition(loop$results, loop$oks, loop$errors) { - while (true) { - let results = loop$results; - let oks = loop$oks; - let errors = loop$errors; - if (results.hasLength(0)) { - return [oks, errors]; - } else if (results.atLeastLength(1) && results.head.isOk()) { - let a = results.head[0]; - let rest = results.tail; - loop$results = rest; - loop$oks = toList([a], oks); - loop$errors = errors; - } else if (results.atLeastLength(1) && !results.head.isOk()) { - let e = results.head[0]; - let rest = results.tail; - loop$results = rest; - loop$oks = oks; - loop$errors = toList([e], errors); - } else { - throw makeError( - "case_no_match", - "gleam/result", - 386, - "do_partition", - "No case clause matched", - { values: [results] } - ) - } - } -} - -export function partition(results) { - return do_partition(results, toList([]), toList([])); -} - -export function replace(result, value) { - if (result.isOk()) { - return new Ok(value); - } else if (!result.isOk()) { - let error = result[0]; - return new Error(error); - } else { - throw makeError( - "case_no_match", - "gleam/result", - 408, - "replace", - "No case clause matched", - { values: [result] } - ) - } -} - -export function replace_error(result, error) { - if (result.isOk()) { - let x = result[0]; - return new Ok(x); - } else if (!result.isOk()) { - return new Error(error); - } else { - throw makeError( - "case_no_match", - "gleam/result", - 429, - "replace_error", - "No case clause matched", - { values: [result] } - ) - } -} - -export function values(results) { - return $list.filter_map(results, (r) => { return r; }); -} - -export function try_recover(result, fun) { - if (result.isOk()) { - let value = result[0]; - return new Ok(value); - } else if (!result.isOk()) { - let error = result[0]; - return fun(error); - } else { - throw makeError( - "case_no_match", - "gleam/result", - 479, - "try_recover", - "No case clause matched", - { values: [result] } - ) - } -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/set.mjs b/build/dev/javascript/gleam_stdlib/gleam/set.mjs deleted file mode 100644 index 4107149..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/set.mjs +++ /dev/null @@ -1,96 +0,0 @@ -import { CustomType as $CustomType, makeError } from "../gleam.mjs"; -import * as $list from "../gleam/list.mjs"; -import * as $map from "../gleam/map.mjs"; -import * as $result from "../gleam/result.mjs"; - -class Set extends $CustomType { - constructor(map) { - super(); - this.map = map; - } -} - -const token = undefined; - -export function new$() { - return new Set($map.new$()); -} - -export function size(set) { - return $map.size(set.map); -} - -export function insert(set, member) { - return new Set($map.insert(set.map, member, token)); -} - -export function contains(set, member) { - let _pipe = set.map; - let _pipe$1 = $map.get(_pipe, member); - return $result.is_ok(_pipe$1); -} - -export function delete$(set, member) { - return new Set($map.delete$(set.map, member)); -} - -export function to_list(set) { - return $map.keys(set.map); -} - -export function from_list(members) { - let map = $list.fold( - members, - $map.new$(), - (m, k) => { return $map.insert(m, k, token); }, - ); - return new Set(map); -} - -export function fold(set, initial, reducer) { - return $map.fold(set.map, initial, (a, k, _) => { return reducer(a, k); }); -} - -export function filter(set, property) { - return new Set($map.filter(set.map, (m, _) => { return property(m); })); -} - -export function drop(set, disallowed) { - return $list.fold(disallowed, set, delete$); -} - -export function take(set, desired) { - return new Set($map.take(set.map, desired)); -} - -function order(first, second) { - let $ = $map.size(first.map) > $map.size(second.map); - if ($) { - return [first, second]; - } else if (!$) { - return [second, first]; - } else { - throw makeError( - "case_no_match", - "gleam/set", - 225, - "order", - "No case clause matched", - { values: [$] } - ) - } -} - -export function union(first, second) { - let $ = order(first, second); - let larger = $[0]; - let smaller = $[1]; - return fold(smaller, larger, insert); -} - -export function intersection(first, second) { - let $ = order(first, second); - let larger = $[0]; - let smaller = $[1]; - return take(larger, to_list(smaller)); -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/string.mjs b/build/dev/javascript/gleam_stdlib/gleam/string.mjs deleted file mode 100644 index e662693..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/string.mjs +++ /dev/null @@ -1,411 +0,0 @@ -import { - inspect as do_inspect, - Ok, - Error, - toList, - makeError, - remainderInt, - divideInt, -} from "../gleam.mjs"; -import * as $iterator from "../gleam/iterator.mjs"; -import * as $list from "../gleam/list.mjs"; -import * as $option from "../gleam/option.mjs"; -import { None, Some } from "../gleam/option.mjs"; -import * as $order from "../gleam/order.mjs"; -import * as $string_builder from "../gleam/string_builder.mjs"; -import { - string_length as do_length, - lowercase as do_lowercase, - uppercase as do_uppercase, - less_than, - crop_string as do_crop, - index_of, - starts_with as do_starts_with, - ends_with as do_ends_with, - split_once as do_split_once, - join as do_join, - trim as do_trim, - trim_left as do_trim_left, - trim_right as do_trim_right, - pop_grapheme as do_pop_grapheme, - codepoint as unsafe_int_to_utf_codepoint, - string_to_codepoint_integer_list, - utf_codepoint_list_to_string, - utf_codepoint_to_int as do_utf_codepoint_to_int, - byte_size as do_byte_size, -} from "../gleam_stdlib.mjs"; - -export function is_empty(str) { - return str === ""; -} - -export function length(string) { - return do_length(string); -} - -export function replace(string, pattern, substitute) { - let _pipe = string; - let _pipe$1 = $string_builder.from_string(_pipe); - let _pipe$2 = $string_builder.replace(_pipe$1, pattern, substitute); - return $string_builder.to_string(_pipe$2); -} - -export function lowercase(string) { - return do_lowercase(string); -} - -export function uppercase(string) { - return do_uppercase(string); -} - -export function compare(a, b) { - let $ = a === b; - if ($) { - return new $order.Eq(); - } else { - let $1 = less_than(a, b); - if ($1) { - return new $order.Lt(); - } else { - return new $order.Gt(); - } - } -} - -export function crop(string, substring) { - return do_crop(string, substring); -} - -function do_contains(haystack, needle) { - return index_of(haystack, needle) !== -1; -} - -export function contains(haystack, needle) { - return do_contains(haystack, needle); -} - -export function starts_with(string, prefix) { - return do_starts_with(string, prefix); -} - -export function ends_with(string, suffix) { - return do_ends_with(string, suffix); -} - -export function split_once(x, substring) { - return do_split_once(x, substring); -} - -export function append(first, second) { - let _pipe = first; - let _pipe$1 = $string_builder.from_string(_pipe); - let _pipe$2 = $string_builder.append(_pipe$1, second); - return $string_builder.to_string(_pipe$2); -} - -export function concat(strings) { - let _pipe = strings; - let _pipe$1 = $string_builder.from_strings(_pipe); - return $string_builder.to_string(_pipe$1); -} - -export function repeat(string, times) { - let _pipe = $iterator.repeat(string); - let _pipe$1 = $iterator.take(_pipe, times); - let _pipe$2 = $iterator.to_list(_pipe$1); - return concat(_pipe$2); -} - -export function join(strings, separator) { - return do_join(strings, separator); -} - -export function trim(string) { - return do_trim(string); -} - -export function trim_left(string) { - return do_trim_left(string); -} - -export function trim_right(string) { - return do_trim_right(string); -} - -export function pop_grapheme(string) { - return do_pop_grapheme(string); -} - -function do_to_graphemes(loop$string, loop$acc) { - while (true) { - let string = loop$string; - let acc = loop$acc; - let $ = pop_grapheme(string); - if ($.isOk()) { - let grapheme = $[0][0]; - let rest = $[0][1]; - loop$string = rest; - loop$acc = toList([grapheme], acc); - } else { - return acc; - } - } -} - -export function to_graphemes(string) { - let _pipe = do_to_graphemes(string, toList([])); - return $list.reverse(_pipe); -} - -function do_reverse(string) { - let _pipe = string; - let _pipe$1 = to_graphemes(_pipe); - let _pipe$2 = $list.reverse(_pipe$1); - return concat(_pipe$2); -} - -export function reverse(string) { - return do_reverse(string); -} - -function do_slice(string, idx, len) { - let _pipe = string; - let _pipe$1 = to_graphemes(_pipe); - let _pipe$2 = $list.drop(_pipe$1, idx); - let _pipe$3 = $list.take(_pipe$2, len); - return concat(_pipe$3); -} - -export function slice(string, idx, len) { - let $ = len < 0; - if ($) { - return ""; - } else if (!$) { - let $1 = idx < 0; - if ($1) { - let translated_idx = length(string) + idx; - let $2 = translated_idx < 0; - if ($2) { - return ""; - } else if (!$2) { - return do_slice(string, translated_idx, len); - } else { - throw makeError( - "case_no_match", - "gleam/string", - 229, - "slice", - "No case clause matched", - { values: [$2] } - ) - } - } else if (!$1) { - return do_slice(string, idx, len); - } else { - throw makeError( - "case_no_match", - "gleam/string", - 226, - "slice", - "No case clause matched", - { values: [$1] } - ) - } - } else { - throw makeError( - "case_no_match", - "gleam/string", - 223, - "slice", - "No case clause matched", - { values: [$] } - ) - } -} - -export function drop_left(string, num_graphemes) { - let $ = num_graphemes < 0; - if ($) { - return string; - } else if (!$) { - return slice(string, num_graphemes, length(string) - num_graphemes); - } else { - throw makeError( - "case_no_match", - "gleam/string", - 292, - "drop_left", - "No case clause matched", - { values: [$] } - ) - } -} - -export function drop_right(string, num_graphemes) { - let $ = num_graphemes < 0; - if ($) { - return string; - } else if (!$) { - return slice(string, 0, length(string) - num_graphemes); - } else { - throw makeError( - "case_no_match", - "gleam/string", - 308, - "drop_right", - "No case clause matched", - { values: [$] } - ) - } -} - -export function split(x, substring) { - if (substring === "") { - return to_graphemes(x); - } else { - let _pipe = x; - let _pipe$1 = $string_builder.from_string(_pipe); - let _pipe$2 = $string_builder.split(_pipe$1, substring); - return $list.map(_pipe$2, $string_builder.to_string); - } -} - -function padding(size, pad_string) { - let pad_length = length(pad_string); - let num_pads = divideInt(size, pad_length); - let extra = remainderInt(size, pad_length); - let _pipe = $iterator.repeat(pad_string); - let _pipe$1 = $iterator.take(_pipe, num_pads); - return $iterator.append( - _pipe$1, - $iterator.single(slice(pad_string, 0, extra)), - ); -} - -export function pad_left(string, desired_length, pad_string) { - let current_length = length(string); - let to_pad_length = desired_length - current_length; - let _pipe = padding(to_pad_length, pad_string); - let _pipe$1 = $iterator.append(_pipe, $iterator.single(string)); - let _pipe$2 = $iterator.to_list(_pipe$1); - return concat(_pipe$2); -} - -export function pad_right(string, desired_length, pad_string) { - let current_length = length(string); - let to_pad_length = desired_length - current_length; - let _pipe = $iterator.single(string); - let _pipe$1 = $iterator.append(_pipe, padding(to_pad_length, pad_string)); - let _pipe$2 = $iterator.to_list(_pipe$1); - return concat(_pipe$2); -} - -function do_to_utf_codepoints(string) { - let _pipe = string; - let _pipe$1 = string_to_codepoint_integer_list(_pipe); - return $list.map(_pipe$1, unsafe_int_to_utf_codepoint); -} - -export function to_utf_codepoints(string) { - return do_to_utf_codepoints(string); -} - -function do_from_utf_codepoints(utf_codepoints) { - return utf_codepoint_list_to_string(utf_codepoints); -} - -export function from_utf_codepoints(utf_codepoints) { - return do_from_utf_codepoints(utf_codepoints); -} - -export function utf_codepoint(value) { - if (value > 1_114_111) { - let i = value; - return new Error(undefined); - } else if (value === 65_534) { - return new Error(undefined); - } else if (value === 65_535) { - return new Error(undefined); - } else if ((value >= 55_296) && (value <= 57_343)) { - let i = value; - return new Error(undefined); - } else { - let i = value; - return new Ok(unsafe_int_to_utf_codepoint(i)); - } -} - -export function utf_codepoint_to_int(cp) { - return do_utf_codepoint_to_int(cp); -} - -export function to_option(s) { - if (s === "") { - return new None(); - } else { - return new Some(s); - } -} - -export function first(s) { - let $ = pop_grapheme(s); - if ($.isOk()) { - let first$1 = $[0][0]; - return new Ok(first$1); - } else if (!$.isOk()) { - let e = $[0]; - return new Error(e); - } else { - throw makeError( - "case_no_match", - "gleam/string", - 906, - "first", - "No case clause matched", - { values: [$] } - ) - } -} - -export function last(s) { - let $ = pop_grapheme(s); - if ($.isOk() && $[0][1] === "") { - let first$1 = $[0][0]; - return new Ok(first$1); - } else if ($.isOk()) { - let rest = $[0][1]; - return new Ok(slice(rest, -1, 1)); - } else if (!$.isOk()) { - let e = $[0]; - return new Error(e); - } else { - throw makeError( - "case_no_match", - "gleam/string", - 929, - "last", - "No case clause matched", - { values: [$] } - ) - } -} - -export function capitalise(s) { - let $ = pop_grapheme(s); - if ($.isOk()) { - let first$1 = $[0][0]; - let rest = $[0][1]; - return append(uppercase(first$1), lowercase(rest)); - } else { - return ""; - } -} - -export function inspect(term) { - let _pipe = do_inspect(term); - return $string_builder.to_string(_pipe); -} - -export function byte_size(string) { - return do_byte_size(string); -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/string_builder.mjs b/build/dev/javascript/gleam_stdlib/gleam/string_builder.mjs deleted file mode 100644 index 728eae0..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/string_builder.mjs +++ /dev/null @@ -1,102 +0,0 @@ -import { toList, isEqual } from "../gleam.mjs"; -import * as $list from "../gleam/list.mjs"; -import { - add as do_append, - concat as do_from_strings, - concat as do_concat, - identity as do_from_string, - identity as do_to_string, - length as do_byte_size, - lowercase as do_lowercase, - uppercase as do_uppercase, - graphemes as do_to_graphemes, - split as do_split, - string_replace as do_replace, - equal as do_is_equal, -} from "../gleam_stdlib.mjs"; - -export function prepend_builder(builder, prefix) { - return do_append(prefix, builder); -} - -export function append_builder(builder, suffix) { - return do_append(builder, suffix); -} - -export function new$() { - return do_from_strings(toList([])); -} - -export function from_strings(strings) { - return do_from_strings(strings); -} - -export function concat(builders) { - return do_concat(builders); -} - -export function from_string(string) { - return do_from_string(string); -} - -export function prepend(builder, prefix) { - return append_builder(from_string(prefix), builder); -} - -export function append(builder, second) { - return append_builder(builder, from_string(second)); -} - -export function to_string(builder) { - return do_to_string(builder); -} - -export function byte_size(builder) { - return do_byte_size(builder); -} - -export function join(builders, sep) { - let _pipe = builders; - let _pipe$1 = $list.intersperse(_pipe, from_string(sep)); - return concat(_pipe$1); -} - -export function lowercase(builder) { - return do_lowercase(builder); -} - -export function uppercase(builder) { - return do_uppercase(builder); -} - -function do_reverse(builder) { - let _pipe = builder; - let _pipe$1 = to_string(_pipe); - let _pipe$2 = do_to_graphemes(_pipe$1); - let _pipe$3 = $list.reverse(_pipe$2); - return from_strings(_pipe$3); -} - -export function reverse(builder) { - return do_reverse(builder); -} - -export function split(iodata, pattern) { - return do_split(iodata, pattern); -} - -export function replace(builder, pattern, substitute) { - return do_replace(builder, pattern, substitute); -} - -export function is_equal(a, b) { - return do_is_equal(a, b); -} - -function do_is_empty(builder) { - return isEqual(from_string(""), builder); -} - -export function is_empty(builder) { - return do_is_empty(builder); -} diff --git a/build/dev/javascript/gleam_stdlib/gleam/uri.mjs b/build/dev/javascript/gleam_stdlib/gleam/uri.mjs deleted file mode 100644 index 60344cf..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam/uri.mjs +++ /dev/null @@ -1,511 +0,0 @@ -import { Ok, Error, toList, CustomType as $CustomType, makeError, isEqual } from "../gleam.mjs"; -import * as $int from "../gleam/int.mjs"; -import * as $list from "../gleam/list.mjs"; -import * as $option from "../gleam/option.mjs"; -import { None, Some } from "../gleam/option.mjs"; -import * as $pair from "../gleam/pair.mjs"; -import * as $regex from "../gleam/regex.mjs"; -import * as $result from "../gleam/result.mjs"; -import * as $string from "../gleam/string.mjs"; -import * as $string_builder from "../gleam/string_builder.mjs"; -import { - parse_query as do_parse_query, - percent_encode as do_percent_encode, - percent_decode as do_percent_decode, -} from "../gleam_stdlib.mjs"; - -export class Uri extends $CustomType { - constructor(scheme, userinfo, host, port, path, query, fragment) { - super(); - this.scheme = scheme; - this.userinfo = userinfo; - this.host = host; - this.port = port; - this.path = path; - this.query = query; - this.fragment = fragment; - } -} - -function regex_submatches(pattern, string) { - let _pipe = pattern; - let _pipe$1 = $regex.compile(_pipe, new $regex.Options(true, false)); - let _pipe$2 = $result.nil_error(_pipe$1); - let _pipe$3 = $result.map( - _pipe$2, - (_capture) => { return $regex.scan(_capture, string); }, - ); - let _pipe$4 = $result.try$(_pipe$3, $list.first); - let _pipe$5 = $result.map(_pipe$4, (m) => { return m.submatches; }); - return $result.unwrap(_pipe$5, toList([])); -} - -function noneify_query(x) { - if (x instanceof None) { - return new None(); - } else if (x instanceof Some) { - let x$1 = x[0]; - let $ = $string.pop_grapheme(x$1); - if ($.isOk() && $[0][0] === "?") { - let query = $[0][1]; - return new Some(query); - } else { - return new None(); - } - } else { - throw makeError( - "case_no_match", - "gleam/uri", - 136, - "noneify_query", - "No case clause matched", - { values: [x] } - ) - } -} - -function noneify_empty_string(x) { - if (x instanceof Some && x[0] === "") { - return new None(); - } else if (x instanceof None) { - return new None(); - } else if (x instanceof Some) { - return x; - } else { - throw makeError( - "case_no_match", - "gleam/uri", - 148, - "noneify_empty_string", - "No case clause matched", - { values: [x] } - ) - } -} - -function extra_required(loop$list, loop$remaining) { - while (true) { - let list = loop$list; - let remaining = loop$remaining; - if (remaining === 0) { - return 0; - } else if (list.hasLength(0)) { - return remaining; - } else if (list.atLeastLength(1)) { - let xs = list.tail; - loop$list = xs; - loop$remaining = remaining - 1; - } else { - throw makeError( - "case_no_match", - "gleam/uri", - 192, - "extra_required", - "No case clause matched", - { values: [list] } - ) - } - } -} - -function pad_list(list, size) { - let _pipe = list; - return $list.append( - _pipe, - $list.repeat(new None(), extra_required(list, size)), - ); -} - -function split_authority(authority) { - let $ = $option.unwrap(authority, ""); - if ($ === "") { - return [new None(), new None(), new None()]; - } else if ($ === "//") { - return [new None(), new Some(""), new None()]; - } else { - let authority$1 = $; - let matches = (() => { - let _pipe = "^(//)?((.*)@)?(\\[[a-zA-Z0-9:.]*\\]|[^:]*)(:(\\d*))?"; - let _pipe$1 = regex_submatches(_pipe, authority$1); - return pad_list(_pipe$1, 6); - })(); - if (matches.hasLength(6)) { - let userinfo = matches.tail.tail.head; - let host = matches.tail.tail.tail.head; - let port = matches.tail.tail.tail.tail.tail.head; - let userinfo$1 = noneify_empty_string(userinfo); - let host$1 = noneify_empty_string(host); - let port$1 = (() => { - let _pipe = port; - let _pipe$1 = $option.unwrap(_pipe, ""); - let _pipe$2 = $int.parse(_pipe$1); - return $option.from_result(_pipe$2); - })(); - return [userinfo$1, host$1, port$1]; - } else { - return [new None(), new None(), new None()]; - } - } -} - -function do_parse(uri_string) { - let pattern = "^(([a-z][a-z0-9\\+\\-\\.]*):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#.*)?"; - let matches = (() => { - let _pipe = pattern; - let _pipe$1 = regex_submatches(_pipe, uri_string); - return pad_list(_pipe$1, 8); - })(); - let $ = (() => { - if (matches.hasLength(8)) { - let scheme = matches.tail.head; - let authority_with_slashes = matches.tail.tail.head; - let path = matches.tail.tail.tail.tail.head; - let query_with_question_mark = matches.tail.tail.tail.tail.tail.head; - let fragment = matches.tail.tail.tail.tail.tail.tail.tail.head; - return [ - scheme, - authority_with_slashes, - path, - query_with_question_mark, - fragment, - ]; - } else { - return [new None(), new None(), new None(), new None(), new None()]; - } - })(); - let scheme = $[0]; - let authority = $[1]; - let path = $[2]; - let query = $[3]; - let fragment = $[4]; - let scheme$1 = noneify_empty_string(scheme); - let path$1 = $option.unwrap(path, ""); - let query$1 = noneify_query(query); - let $1 = split_authority(authority); - let userinfo = $1[0]; - let host = $1[1]; - let port = $1[2]; - let fragment$1 = (() => { - let _pipe = fragment; - let _pipe$1 = $option.to_result(_pipe, undefined); - let _pipe$2 = $result.try$(_pipe$1, $string.pop_grapheme); - let _pipe$3 = $result.map(_pipe$2, $pair.second); - return $option.from_result(_pipe$3); - })(); - let scheme$2 = (() => { - let _pipe = scheme$1; - let _pipe$1 = noneify_empty_string(_pipe); - return $option.map(_pipe$1, $string.lowercase); - })(); - return new Ok( - new Uri(scheme$2, userinfo, host, port, path$1, query$1, fragment$1), - ); -} - -export function parse(uri_string) { - return do_parse(uri_string); -} - -export function parse_query(query) { - return do_parse_query(query); -} - -export function percent_encode(value) { - return do_percent_encode(value); -} - -function query_pair(pair) { - return $string_builder.from_strings( - toList([percent_encode(pair[0]), "=", percent_encode(pair[1])]), - ); -} - -export function query_to_string(query) { - let _pipe = query; - let _pipe$1 = $list.map(_pipe, query_pair); - let _pipe$2 = $list.intersperse(_pipe$1, $string_builder.from_string("&")); - let _pipe$3 = $string_builder.concat(_pipe$2); - return $string_builder.to_string(_pipe$3); -} - -export function percent_decode(value) { - return do_percent_decode(value); -} - -function do_remove_dot_segments(loop$input, loop$accumulator) { - while (true) { - let input = loop$input; - let accumulator = loop$accumulator; - if (input.hasLength(0)) { - return $list.reverse(accumulator); - } else if (input.atLeastLength(1)) { - let segment = input.head; - let rest = input.tail; - let accumulator$1 = (() => { - if (segment === "") { - let accumulator$1 = accumulator; - return accumulator$1; - } else if (segment === ".") { - let accumulator$1 = accumulator; - return accumulator$1; - } else if (segment === ".." && accumulator.hasLength(0)) { - return toList([]); - } else if (segment === ".." && accumulator.atLeastLength(1)) { - let accumulator$1 = accumulator.tail; - return accumulator$1; - } else { - let segment$1 = segment; - let accumulator$1 = accumulator; - return toList([segment$1], accumulator$1); - } - })(); - loop$input = rest; - loop$accumulator = accumulator$1; - } else { - throw makeError( - "case_no_match", - "gleam/uri", - 284, - "do_remove_dot_segments", - "No case clause matched", - { values: [input] } - ) - } - } -} - -function remove_dot_segments(input) { - return do_remove_dot_segments(input, toList([])); -} - -export function path_segments(path) { - return remove_dot_segments($string.split(path, "/")); -} - -export function to_string(uri) { - let parts = (() => { - let $ = uri.fragment; - if ($ instanceof Some) { - let fragment = $[0]; - return toList(["#", fragment]); - } else { - return toList([]); - } - })(); - let parts$1 = (() => { - let $ = uri.query; - if ($ instanceof Some) { - let query = $[0]; - return toList(["?", query], parts); - } else { - return parts; - } - })(); - let parts$2 = toList([uri.path], parts$1); - let parts$3 = (() => { - let $ = uri.host; - let $1 = $string.starts_with(uri.path, "/"); - if ($ instanceof Some && !$1 && $[0] !== "") { - let host = $[0]; - return toList(["/"], parts$2); - } else { - return parts$2; - } - })(); - let parts$4 = (() => { - let $ = uri.host; - let $1 = uri.port; - if ($ instanceof Some && $1 instanceof Some) { - let port = $1[0]; - return toList([":", $int.to_string(port)], parts$3); - } else { - return parts$3; - } - })(); - let parts$5 = (() => { - let $ = uri.scheme; - let $1 = uri.userinfo; - let $2 = uri.host; - if ($ instanceof Some && $1 instanceof Some && $2 instanceof Some) { - let s = $[0]; - let u = $1[0]; - let h = $2[0]; - return toList([s, "://", u, "@", h], parts$4); - } else if ($ instanceof Some && $1 instanceof None && $2 instanceof Some) { - let s = $[0]; - let h = $2[0]; - return toList([s, "://", h], parts$4); - } else if ($ instanceof Some && $1 instanceof Some && $2 instanceof None) { - let s = $[0]; - return toList([s, ":"], parts$4); - } else if ($ instanceof Some && $1 instanceof None && $2 instanceof None) { - let s = $[0]; - return toList([s, ":"], parts$4); - } else if ($ instanceof None && $1 instanceof None && $2 instanceof Some) { - let h = $2[0]; - return toList(["//", h], parts$4); - } else if ($ instanceof None && $1 instanceof Some && $2 instanceof None) { - return parts$4; - } else if ($ instanceof None && $1 instanceof None && $2 instanceof None) { - return parts$4; - } else { - throw makeError( - "case_no_match", - "gleam/uri", - 349, - "to_string", - "No case clause matched", - { values: [$, $1, $2] } - ) - } - })(); - return $string.concat(parts$5); -} - -export function origin(uri) { - if (!(uri instanceof Uri)) { - throw makeError( - "assignment_no_match", - "gleam/uri", - 376, - "origin", - "Assignment pattern did not match", - { value: uri } - ) - } - let scheme = uri.scheme; - let host = uri.host; - let port = uri.port; - if (scheme instanceof Some && - scheme[0] === "https" && - isEqual(port, new Some(443))) { - let origin$1 = new Uri( - scheme, - new None(), - host, - new None(), - "", - new None(), - new None(), - ); - return new Ok(to_string(origin$1)); - } else if (scheme instanceof Some && - scheme[0] === "http" && - isEqual(port, new Some(80))) { - let origin$1 = new Uri( - scheme, - new None(), - host, - new None(), - "", - new None(), - new None(), - ); - return new Ok(to_string(origin$1)); - } else if (scheme instanceof Some && - (scheme[0] === "http") || (scheme[0] === "https")) { - let s = scheme[0]; - let origin$1 = new Uri( - scheme, - new None(), - host, - port, - "", - new None(), - new None(), - ); - return new Ok(to_string(origin$1)); - } else { - return new Error(undefined); - } -} - -function drop_last(elements) { - return $list.take(elements, $list.length(elements) - 1); -} - -function join_segments(segments) { - return $string.join(toList([""], segments), "/"); -} - -export function merge(base, relative) { - if (base instanceof Uri && - base.scheme instanceof Some && - base.host instanceof Some) { - if (relative instanceof Uri && relative.host instanceof Some) { - let path = (() => { - let _pipe = $string.split(relative.path, "/"); - let _pipe$1 = remove_dot_segments(_pipe); - return join_segments(_pipe$1); - })(); - let resolved = new Uri( - $option.or(relative.scheme, base.scheme), - new None(), - relative.host, - $option.or(relative.port, base.port), - path, - relative.query, - relative.fragment, - ); - return new Ok(resolved); - } else if (relative instanceof Uri && - relative.scheme instanceof None && - relative.host instanceof None) { - let $ = (() => { - let $1 = relative.path; - if ($1 === "") { - return [base.path, $option.or(relative.query, base.query)]; - } else { - let path_segments$1 = (() => { - let $2 = $string.starts_with(relative.path, "/"); - if ($2) { - return $string.split(relative.path, "/"); - } else if (!$2) { - let _pipe = $string.split(base.path, "/"); - let _pipe$1 = drop_last(_pipe); - return $list.append(_pipe$1, $string.split(relative.path, "/")); - } else { - throw makeError( - "case_no_match", - "gleam/uri", - 433, - "merge", - "No case clause matched", - { values: [$2] } - ) - } - })(); - let path = (() => { - let _pipe = path_segments$1; - let _pipe$1 = remove_dot_segments(_pipe); - return join_segments(_pipe$1); - })(); - return [path, relative.query]; - } - })(); - let new_path = $[0]; - let new_query = $[1]; - let resolved = new Uri( - base.scheme, - new None(), - base.host, - base.port, - new_path, - new_query, - relative.fragment, - ); - return new Ok(resolved); - } else { - throw makeError( - "case_no_match", - "gleam/uri", - 411, - "merge", - "No case clause matched", - { values: [relative] } - ) - } - } else { - return new Error(undefined); - } -} diff --git a/build/dev/javascript/gleam_stdlib/gleam@base.erl b/build/dev/javascript/gleam_stdlib/gleam@base.erl deleted file mode 100644 index 1ebe7c7..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@base.erl +++ /dev/null @@ -1,45 +0,0 @@ --module(gleam@base). --compile([no_auto_import, nowarn_unused_vars]). - --export([encode64/2, decode64/1, url_encode64/2, url_decode64/1]). - --spec encode64(bitstring(), boolean()) -> binary(). -encode64(Input, Padding) -> - Encoded = base64:encode(Input), - case Padding of - true -> - Encoded; - - false -> - gleam@string:replace(Encoded, <<"="/utf8>>, <<""/utf8>>) - end. - --spec decode64(binary()) -> {ok, bitstring()} | {error, nil}. -decode64(Encoded) -> - Padded = case gleam@bit_string:byte_size( - gleam@bit_string:from_string(Encoded) - ) - rem 4 of - 0 -> - Encoded; - - N -> - gleam@string:append( - Encoded, - gleam@string:repeat(<<"="/utf8>>, 4 - N) - ) - end, - gleam_stdlib:base_decode64(Padded). - --spec url_encode64(bitstring(), boolean()) -> binary(). -url_encode64(Input, Padding) -> - _pipe = encode64(Input, Padding), - _pipe@1 = gleam@string:replace(_pipe, <<"+"/utf8>>, <<"-"/utf8>>), - gleam@string:replace(_pipe@1, <<"/"/utf8>>, <<"_"/utf8>>). - --spec url_decode64(binary()) -> {ok, bitstring()} | {error, nil}. -url_decode64(Encoded) -> - _pipe = Encoded, - _pipe@1 = gleam@string:replace(_pipe, <<"-"/utf8>>, <<"+"/utf8>>), - _pipe@2 = gleam@string:replace(_pipe@1, <<"_"/utf8>>, <<"/"/utf8>>), - decode64(_pipe@2). diff --git a/build/dev/javascript/gleam_stdlib/gleam@bit_builder.erl b/build/dev/javascript/gleam_stdlib/gleam@bit_builder.erl deleted file mode 100644 index 8cc9d32..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@bit_builder.erl +++ /dev/null @@ -1,63 +0,0 @@ --module(gleam@bit_builder). --compile([no_auto_import, nowarn_unused_vars]). - --export([append_builder/2, prepend_builder/2, new/0, concat/1, concat_bit_strings/1, from_string/1, prepend_string/2, append_string/2, from_string_builder/1, from_bit_string/1, prepend/2, append/2, to_bit_string/1, byte_size/1]). --export_type([bit_builder/0]). - --type bit_builder() :: any(). - --spec append_builder(bit_builder(), bit_builder()) -> bit_builder(). -append_builder(First, Second) -> - gleam_stdlib:iodata_append(First, Second). - --spec prepend_builder(bit_builder(), bit_builder()) -> bit_builder(). -prepend_builder(To, Prefix) -> - append_builder(Prefix, To). - --spec new() -> bit_builder(). -new() -> - gleam_stdlib:identity([]). - --spec concat(list(bit_builder())) -> bit_builder(). -concat(Builders) -> - gleam_stdlib:identity(Builders). - --spec concat_bit_strings(list(bitstring())) -> bit_builder(). -concat_bit_strings(Bits) -> - gleam_stdlib:identity(Bits). - --spec from_string(binary()) -> bit_builder(). -from_string(String) -> - gleam_stdlib:wrap_list(String). - --spec prepend_string(bit_builder(), binary()) -> bit_builder(). -prepend_string(To, Prefix) -> - append_builder(from_string(Prefix), To). - --spec append_string(bit_builder(), binary()) -> bit_builder(). -append_string(To, Suffix) -> - append_builder(To, from_string(Suffix)). - --spec from_string_builder(gleam@string_builder:string_builder()) -> bit_builder(). -from_string_builder(Builder) -> - gleam_stdlib:wrap_list(Builder). - --spec from_bit_string(bitstring()) -> bit_builder(). -from_bit_string(Bits) -> - gleam_stdlib:wrap_list(Bits). - --spec prepend(bit_builder(), bitstring()) -> bit_builder(). -prepend(To, Prefix) -> - append_builder(from_bit_string(Prefix), To). - --spec append(bit_builder(), bitstring()) -> bit_builder(). -append(To, Suffix) -> - append_builder(To, from_bit_string(Suffix)). - --spec to_bit_string(bit_builder()) -> bitstring(). -to_bit_string(Builder) -> - erlang:list_to_bitstring(Builder). - --spec byte_size(bit_builder()) -> integer(). -byte_size(Builder) -> - erlang:iolist_size(Builder). diff --git a/build/dev/javascript/gleam_stdlib/gleam@bit_string.erl b/build/dev/javascript/gleam_stdlib/gleam@bit_string.erl deleted file mode 100644 index f3ce77a..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@bit_string.erl +++ /dev/null @@ -1,56 +0,0 @@ --module(gleam@bit_string). --compile([no_auto_import, nowarn_unused_vars]). - --export([from_string/1, byte_size/1, slice/3, is_utf8/1, to_string/1, concat/1, append/2]). - --spec from_string(binary()) -> bitstring(). -from_string(X) -> - gleam_stdlib:identity(X). - --spec byte_size(bitstring()) -> integer(). -byte_size(X) -> - erlang:byte_size(X). - --spec slice(bitstring(), integer(), integer()) -> {ok, bitstring()} | - {error, nil}. -slice(String, Position, Length) -> - gleam_stdlib:bit_string_slice(String, Position, Length). - --spec do_is_utf8(bitstring()) -> boolean(). -do_is_utf8(Bits) -> - case Bits of - <<>> -> - true; - - <<_/utf8, Rest/binary>> -> - do_is_utf8(Rest); - - _ -> - false - end. - --spec is_utf8(bitstring()) -> boolean(). -is_utf8(Bits) -> - do_is_utf8(Bits). - --spec do_to_string(bitstring()) -> {ok, binary()} | {error, nil}. -do_to_string(Bits) -> - case is_utf8(Bits) of - true -> - {ok, gleam_stdlib:identity(Bits)}; - - false -> - {error, nil} - end. - --spec to_string(bitstring()) -> {ok, binary()} | {error, nil}. -to_string(Bits) -> - do_to_string(Bits). - --spec concat(list(bitstring())) -> bitstring(). -concat(Bit_strings) -> - gleam_stdlib:bit_string_concat(Bit_strings). - --spec append(bitstring(), bitstring()) -> bitstring(). -append(First, Second) -> - concat([First, Second]). diff --git a/build/dev/javascript/gleam_stdlib/gleam@bool.erl b/build/dev/javascript/gleam_stdlib/gleam@bool.erl deleted file mode 100644 index c3e94a7..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@bool.erl +++ /dev/null @@ -1,152 +0,0 @@ --module(gleam@bool). --compile([no_auto_import, nowarn_unused_vars]). - --export(['and'/2, 'or'/2, negate/1, nor/2, nand/2, exclusive_or/2, exclusive_nor/2, compare/2, max/2, min/2, to_int/1, to_string/1, guard/3]). - --spec 'and'(boolean(), boolean()) -> boolean(). -'and'(A, B) -> - A andalso B. - --spec 'or'(boolean(), boolean()) -> boolean(). -'or'(A, B) -> - A orelse B. - --spec negate(boolean()) -> boolean(). -negate(Bool) -> - case Bool of - true -> - false; - - false -> - true - end. - --spec nor(boolean(), boolean()) -> boolean(). -nor(A, B) -> - case {A, B} of - {false, false} -> - true; - - {false, true} -> - false; - - {true, false} -> - false; - - {true, true} -> - false - end. - --spec nand(boolean(), boolean()) -> boolean(). -nand(A, B) -> - case {A, B} of - {false, false} -> - true; - - {false, true} -> - true; - - {true, false} -> - true; - - {true, true} -> - false - end. - --spec exclusive_or(boolean(), boolean()) -> boolean(). -exclusive_or(A, B) -> - case {A, B} of - {false, false} -> - false; - - {false, true} -> - true; - - {true, false} -> - true; - - {true, true} -> - false - end. - --spec exclusive_nor(boolean(), boolean()) -> boolean(). -exclusive_nor(A, B) -> - case {A, B} of - {false, false} -> - true; - - {false, true} -> - false; - - {true, false} -> - false; - - {true, true} -> - true - end. - --spec compare(boolean(), boolean()) -> gleam@order:order(). -compare(A, B) -> - case {A, B} of - {true, true} -> - eq; - - {true, false} -> - gt; - - {false, false} -> - eq; - - {false, true} -> - lt - end. - --spec max(boolean(), boolean()) -> boolean(). -max(A, B) -> - case A of - true -> - true; - - false -> - B - end. - --spec min(boolean(), boolean()) -> boolean(). -min(A, B) -> - case A of - false -> - false; - - true -> - B - end. - --spec to_int(boolean()) -> integer(). -to_int(Bool) -> - case Bool of - false -> - 0; - - true -> - 1 - end. - --spec to_string(boolean()) -> binary(). -to_string(Bool) -> - case Bool of - false -> - <<"False"/utf8>>; - - true -> - <<"True"/utf8>> - end. - --spec guard(boolean(), ETF, fun(() -> ETF)) -> ETF. -guard(Requirement, Consequence, Alternative) -> - case Requirement of - true -> - Consequence; - - false -> - Alternative() - end. diff --git a/build/dev/javascript/gleam_stdlib/gleam@dynamic.erl b/build/dev/javascript/gleam_stdlib/gleam@dynamic.erl deleted file mode 100644 index 0576be4..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@dynamic.erl +++ /dev/null @@ -1,796 +0,0 @@ --module(gleam@dynamic). --compile([no_auto_import, nowarn_unused_vars]). - --export([from/1, unsafe_coerce/1, dynamic/1, bit_string/1, classify/1, int/1, float/1, bool/1, shallow_list/1, optional/1, any/1, decode1/2, result/2, list/1, string/1, field/2, optional_field/2, element/2, tuple2/2, tuple3/3, tuple4/4, tuple5/5, tuple6/6, map/2, decode2/3, decode3/4, decode4/5, decode5/6, decode6/7, decode7/8, decode8/9, decode9/10]). --export_type([dynamic_/0, decode_error/0, unknown_tuple/0]). - --type dynamic_() :: any(). - --type decode_error() :: {decode_error, binary(), binary(), list(binary())}. - --type unknown_tuple() :: any(). - --spec from(any()) -> dynamic_(). -from(A) -> - gleam_stdlib:identity(A). - --spec unsafe_coerce(dynamic_()) -> any(). -unsafe_coerce(A) -> - gleam_stdlib:identity(A). - --spec dynamic(dynamic_()) -> {ok, dynamic_()} | {error, list(decode_error())}. -dynamic(Value) -> - {ok, Value}. - --spec bit_string(dynamic_()) -> {ok, bitstring()} | - {error, list(decode_error())}. -bit_string(Data) -> - gleam_stdlib:decode_bit_string(Data). - --spec put_expected(decode_error(), binary()) -> decode_error(). -put_expected(Error, Expected) -> - erlang:setelement(2, Error, Expected). - --spec classify(dynamic_()) -> binary(). -classify(Data) -> - gleam_stdlib:classify_dynamic(Data). - --spec int(dynamic_()) -> {ok, integer()} | {error, list(decode_error())}. -int(Data) -> - gleam_stdlib:decode_int(Data). - --spec float(dynamic_()) -> {ok, float()} | {error, list(decode_error())}. -float(Data) -> - gleam_stdlib:decode_float(Data). - --spec bool(dynamic_()) -> {ok, boolean()} | {error, list(decode_error())}. -bool(Data) -> - gleam_stdlib:decode_bool(Data). - --spec shallow_list(dynamic_()) -> {ok, list(dynamic_())} | - {error, list(decode_error())}. -shallow_list(Value) -> - gleam_stdlib:decode_list(Value). - --spec optional(fun((dynamic_()) -> {ok, CUI} | {error, list(decode_error())})) -> fun((dynamic_()) -> {ok, - gleam@option:option(CUI)} | - {error, list(decode_error())}). -optional(Decode) -> - fun(Value) -> gleam_stdlib:decode_option(Value, Decode) end. - --spec at_least_decode_tuple_error(integer(), dynamic_()) -> {ok, any()} | - {error, list(decode_error())}. -at_least_decode_tuple_error(Size, Data) -> - S = case Size of - 1 -> - <<""/utf8>>; - - _ -> - <<"s"/utf8>> - end, - Error = begin - _pipe = [<<"Tuple of at least "/utf8>>, - gleam@int:to_string(Size), - <<" element"/utf8>>, - S], - _pipe@1 = gleam@string_builder:from_strings(_pipe), - _pipe@2 = gleam@string_builder:to_string(_pipe@1), - {decode_error, _pipe@2, classify(Data), []} - end, - {error, [Error]}. - --spec any(list(fun((dynamic_()) -> {ok, CYI} | {error, list(decode_error())}))) -> fun((dynamic_()) -> {ok, - CYI} | - {error, list(decode_error())}). -any(Decoders) -> - fun(Data) -> case Decoders of - [] -> - {error, - [{decode_error, <<"another type"/utf8>>, classify(Data), []}]}; - - [Decoder | Decoders@1] -> - case Decoder(Data) of - {ok, Decoded} -> - {ok, Decoded}; - - {error, _} -> - (any(Decoders@1))(Data) - end - end end. - --spec all_errors({ok, any()} | {error, list(decode_error())}) -> list(decode_error()). -all_errors(Result) -> - case Result of - {ok, _} -> - []; - - {error, Errors} -> - Errors - end. - --spec decode1( - fun((CYM) -> CYN), - fun((dynamic_()) -> {ok, CYM} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, CYN} | {error, list(decode_error())}). -decode1(Constructor, T1) -> - fun(Value) -> case T1(Value) of - {ok, A} -> - {ok, Constructor(A)}; - - A@1 -> - {error, all_errors(A@1)} - end end. - --spec push_path(decode_error(), any()) -> decode_error(). -push_path(Error, Name) -> - Name@1 = from(Name), - Decoder = any( - [fun string/1, - fun(X) -> gleam@result:map(int(X), fun gleam@int:to_string/1) end] - ), - Name@3 = case Decoder(Name@1) of - {ok, Name@2} -> - Name@2; - - {error, _} -> - _pipe = [<<"<"/utf8>>, classify(Name@1), <<">"/utf8>>], - _pipe@1 = gleam@string_builder:from_strings(_pipe), - gleam@string_builder:to_string(_pipe@1) - end, - erlang:setelement(4, Error, [Name@3 | erlang:element(4, Error)]). - --spec result( - fun((dynamic_()) -> {ok, CTW} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CTY} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, {ok, CTW} | {error, CTY}} | - {error, list(decode_error())}). -result(Decode_ok, Decode_error) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_result(Value), - fun(Inner_result) -> case Inner_result of - {ok, Raw} -> - gleam@result:'try'( - begin - _pipe = Decode_ok(Raw), - map_errors( - _pipe, - fun(_capture) -> - push_path(_capture, <<"ok"/utf8>>) - end - ) - end, - fun(Value@1) -> {ok, {ok, Value@1}} end - ); - - {error, Raw@1} -> - gleam@result:'try'( - begin - _pipe@1 = Decode_error(Raw@1), - map_errors( - _pipe@1, - fun(_capture@1) -> - push_path(_capture@1, <<"error"/utf8>>) - end - ) - end, - fun(Value@2) -> {ok, {error, Value@2}} end - ) - end end - ) - end. - --spec list(fun((dynamic_()) -> {ok, CUD} | {error, list(decode_error())})) -> fun((dynamic_()) -> {ok, - list(CUD)} | - {error, list(decode_error())}). -list(Decoder_type) -> - fun(Dynamic) -> - gleam@result:'try'(shallow_list(Dynamic), fun(List) -> _pipe = List, - _pipe@1 = gleam@list:try_map(_pipe, Decoder_type), - map_errors( - _pipe@1, - fun(_capture) -> push_path(_capture, <<"*"/utf8>>) end - ) end) - end. - --spec map_errors( - {ok, CSR} | {error, list(decode_error())}, - fun((decode_error()) -> decode_error()) -) -> {ok, CSR} | {error, list(decode_error())}. -map_errors(Result, F) -> - gleam@result:map_error( - Result, - fun(_capture) -> gleam@list:map(_capture, F) end - ). - --spec decode_string(dynamic_()) -> {ok, binary()} | - {error, list(decode_error())}. -decode_string(Data) -> - _pipe = bit_string(Data), - _pipe@1 = map_errors( - _pipe, - fun(_capture) -> put_expected(_capture, <<"String"/utf8>>) end - ), - gleam@result:'try'( - _pipe@1, - fun(Raw) -> case gleam@bit_string:to_string(Raw) of - {ok, String} -> - {ok, String}; - - {error, nil} -> - {error, - [{decode_error, - <<"String"/utf8>>, - <<"BitString"/utf8>>, - []}]} - end end - ). - --spec string(dynamic_()) -> {ok, binary()} | {error, list(decode_error())}. -string(Data) -> - decode_string(Data). - --spec field( - any(), - fun((dynamic_()) -> {ok, CUS} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, CUS} | {error, list(decode_error())}). -field(Name, Inner_type) -> - fun(Value) -> - Missing_field_error = {decode_error, - <<"field"/utf8>>, - <<"nothing"/utf8>>, - []}, - gleam@result:'try'( - gleam_stdlib:decode_field(Value, Name), - fun(Maybe_inner) -> _pipe = Maybe_inner, - _pipe@1 = gleam@option:to_result(_pipe, [Missing_field_error]), - _pipe@2 = gleam@result:'try'(_pipe@1, Inner_type), - map_errors( - _pipe@2, - fun(_capture) -> push_path(_capture, Name) end - ) end - ) - end. - --spec optional_field( - any(), - fun((dynamic_()) -> {ok, CUW} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, gleam@option:option(CUW)} | - {error, list(decode_error())}). -optional_field(Name, Inner_type) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_field(Value, Name), - fun(Maybe_inner) -> case Maybe_inner of - none -> - {ok, none}; - - {some, Dynamic_inner} -> - _pipe = Dynamic_inner, - _pipe@1 = gleam_stdlib:decode_option(_pipe, Inner_type), - map_errors( - _pipe@1, - fun(_capture) -> push_path(_capture, Name) end - ) - end end - ) - end. - --spec element( - integer(), - fun((dynamic_()) -> {ok, CVE} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, CVE} | {error, list(decode_error())}). -element(Index, Inner_type) -> - fun(Data) -> - gleam@result:'try'( - gleam_stdlib:decode_tuple(Data), - fun(Tuple) -> - Size = gleam_stdlib:size_of_tuple(Tuple), - gleam@result:'try'(case Index >= 0 of - true -> - case Index < Size of - true -> - gleam_stdlib:tuple_get(Tuple, Index); - - false -> - at_least_decode_tuple_error(Index + 1, Data) - end; - - false -> - case gleam@int:absolute_value(Index) =< Size of - true -> - gleam_stdlib:tuple_get(Tuple, Size + Index); - - false -> - at_least_decode_tuple_error( - gleam@int:absolute_value(Index), - Data - ) - end - end, fun(Data@1) -> _pipe = Inner_type(Data@1), - map_errors( - _pipe, - fun(_capture) -> push_path(_capture, Index) end - ) end) - end - ) - end. - --spec tuple_errors({ok, any()} | {error, list(decode_error())}, binary()) -> list(decode_error()). -tuple_errors(Result, Name) -> - case Result of - {ok, _} -> - []; - - {error, Errors} -> - gleam@list:map( - Errors, - fun(_capture) -> push_path(_capture, Name) end - ) - end. - --spec tuple2( - fun((dynamic_()) -> {ok, CWE} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CWG} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, {CWE, CWG}} | {error, list(decode_error())}). -tuple2(Decode1, Decode2) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_tuple2(Value), - fun(_use0) -> - {A, B} = _use0, - case {Decode1(A), Decode2(B)} of - {{ok, A@1}, {ok, B@1}} -> - {ok, {A@1, B@1}}; - - {A@2, B@2} -> - _pipe = tuple_errors(A@2, <<"0"/utf8>>), - _pipe@1 = gleam@list:append( - _pipe, - tuple_errors(B@2, <<"1"/utf8>>) - ), - {error, _pipe@1} - end - end - ) - end. - --spec tuple3( - fun((dynamic_()) -> {ok, CWJ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CWL} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CWN} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, {CWJ, CWL, CWN}} | {error, list(decode_error())}). -tuple3(Decode1, Decode2, Decode3) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_tuple3(Value), - fun(_use0) -> - {A, B, C} = _use0, - case {Decode1(A), Decode2(B), Decode3(C)} of - {{ok, A@1}, {ok, B@1}, {ok, C@1}} -> - {ok, {A@1, B@1, C@1}}; - - {A@2, B@2, C@2} -> - _pipe = tuple_errors(A@2, <<"0"/utf8>>), - _pipe@1 = gleam@list:append( - _pipe, - tuple_errors(B@2, <<"1"/utf8>>) - ), - _pipe@2 = gleam@list:append( - _pipe@1, - tuple_errors(C@2, <<"2"/utf8>>) - ), - {error, _pipe@2} - end - end - ) - end. - --spec tuple4( - fun((dynamic_()) -> {ok, CWQ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CWS} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CWU} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CWW} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, {CWQ, CWS, CWU, CWW}} | - {error, list(decode_error())}). -tuple4(Decode1, Decode2, Decode3, Decode4) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_tuple4(Value), - fun(_use0) -> - {A, B, C, D} = _use0, - case {Decode1(A), Decode2(B), Decode3(C), Decode4(D)} of - {{ok, A@1}, {ok, B@1}, {ok, C@1}, {ok, D@1}} -> - {ok, {A@1, B@1, C@1, D@1}}; - - {A@2, B@2, C@2, D@2} -> - _pipe = tuple_errors(A@2, <<"0"/utf8>>), - _pipe@1 = gleam@list:append( - _pipe, - tuple_errors(B@2, <<"1"/utf8>>) - ), - _pipe@2 = gleam@list:append( - _pipe@1, - tuple_errors(C@2, <<"2"/utf8>>) - ), - _pipe@3 = gleam@list:append( - _pipe@2, - tuple_errors(D@2, <<"3"/utf8>>) - ), - {error, _pipe@3} - end - end - ) - end. - --spec tuple5( - fun((dynamic_()) -> {ok, CWZ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXB} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXD} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXF} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXH} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, {CWZ, CXB, CXD, CXF, CXH}} | - {error, list(decode_error())}). -tuple5(Decode1, Decode2, Decode3, Decode4, Decode5) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_tuple5(Value), - fun(_use0) -> - {A, B, C, D, E} = _use0, - case {Decode1(A), - Decode2(B), - Decode3(C), - Decode4(D), - Decode5(E)} of - {{ok, A@1}, {ok, B@1}, {ok, C@1}, {ok, D@1}, {ok, E@1}} -> - {ok, {A@1, B@1, C@1, D@1, E@1}}; - - {A@2, B@2, C@2, D@2, E@2} -> - _pipe = tuple_errors(A@2, <<"0"/utf8>>), - _pipe@1 = gleam@list:append( - _pipe, - tuple_errors(B@2, <<"1"/utf8>>) - ), - _pipe@2 = gleam@list:append( - _pipe@1, - tuple_errors(C@2, <<"2"/utf8>>) - ), - _pipe@3 = gleam@list:append( - _pipe@2, - tuple_errors(D@2, <<"3"/utf8>>) - ), - _pipe@4 = gleam@list:append( - _pipe@3, - tuple_errors(E@2, <<"4"/utf8>>) - ), - {error, _pipe@4} - end - end - ) - end. - --spec tuple6( - fun((dynamic_()) -> {ok, CXK} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXM} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXO} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXQ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXS} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXU} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, {CXK, CXM, CXO, CXQ, CXS, CXU}} | - {error, list(decode_error())}). -tuple6(Decode1, Decode2, Decode3, Decode4, Decode5, Decode6) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_tuple6(Value), - fun(_use0) -> - {A, B, C, D, E, F} = _use0, - case {Decode1(A), - Decode2(B), - Decode3(C), - Decode4(D), - Decode5(E), - Decode6(F)} of - {{ok, A@1}, - {ok, B@1}, - {ok, C@1}, - {ok, D@1}, - {ok, E@1}, - {ok, F@1}} -> - {ok, {A@1, B@1, C@1, D@1, E@1, F@1}}; - - {A@2, B@2, C@2, D@2, E@2, F@2} -> - _pipe = tuple_errors(A@2, <<"0"/utf8>>), - _pipe@1 = gleam@list:append( - _pipe, - tuple_errors(B@2, <<"1"/utf8>>) - ), - _pipe@2 = gleam@list:append( - _pipe@1, - tuple_errors(C@2, <<"2"/utf8>>) - ), - _pipe@3 = gleam@list:append( - _pipe@2, - tuple_errors(D@2, <<"3"/utf8>>) - ), - _pipe@4 = gleam@list:append( - _pipe@3, - tuple_errors(E@2, <<"4"/utf8>>) - ), - _pipe@5 = gleam@list:append( - _pipe@4, - tuple_errors(F@2, <<"5"/utf8>>) - ), - {error, _pipe@5} - end - end - ) - end. - --spec map( - fun((dynamic_()) -> {ok, CXX} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXZ} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, gleam@map:map_(CXX, CXZ)} | - {error, list(decode_error())}). -map(Key_type, Value_type) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_map(Value), - fun(Map) -> - gleam@result:'try'( - begin - _pipe = Map, - _pipe@1 = gleam@map:to_list(_pipe), - gleam@list:try_map( - _pipe@1, - fun(Pair) -> - {K, V} = Pair, - gleam@result:'try'( - begin - _pipe@2 = Key_type(K), - map_errors( - _pipe@2, - fun(_capture) -> - push_path( - _capture, - <<"keys"/utf8>> - ) - end - ) - end, - fun(K@1) -> - gleam@result:'try'( - begin - _pipe@3 = Value_type(V), - map_errors( - _pipe@3, - fun(_capture@1) -> - push_path( - _capture@1, - <<"values"/utf8>> - ) - end - ) - end, - fun(V@1) -> {ok, {K@1, V@1}} end - ) - end - ) - end - ) - end, - fun(Pairs) -> {ok, gleam@map:from_list(Pairs)} end - ) - end - ) - end. - --spec decode2( - fun((CYQ, CYR) -> CYS), - fun((dynamic_()) -> {ok, CYQ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CYR} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, CYS} | {error, list(decode_error())}). -decode2(Constructor, T1, T2) -> - fun(Value) -> case {T1(Value), T2(Value)} of - {{ok, A}, {ok, B}} -> - {ok, Constructor(A, B)}; - - {A@1, B@1} -> - {error, gleam@list:concat([all_errors(A@1), all_errors(B@1)])} - end end. - --spec decode3( - fun((CYW, CYX, CYY) -> CYZ), - fun((dynamic_()) -> {ok, CYW} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CYX} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CYY} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, CYZ} | {error, list(decode_error())}). -decode3(Constructor, T1, T2, T3) -> - fun(Value) -> case {T1(Value), T2(Value), T3(Value)} of - {{ok, A}, {ok, B}, {ok, C}} -> - {ok, Constructor(A, B, C)}; - - {A@1, B@1, C@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), all_errors(B@1), all_errors(C@1)] - )} - end end. - --spec decode4( - fun((CZE, CZF, CZG, CZH) -> CZI), - fun((dynamic_()) -> {ok, CZE} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CZF} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CZG} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CZH} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, CZI} | {error, list(decode_error())}). -decode4(Constructor, T1, T2, T3, T4) -> - fun(X) -> case {T1(X), T2(X), T3(X), T4(X)} of - {{ok, A}, {ok, B}, {ok, C}, {ok, D}} -> - {ok, Constructor(A, B, C, D)}; - - {A@1, B@1, C@1, D@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), - all_errors(B@1), - all_errors(C@1), - all_errors(D@1)] - )} - end end. - --spec decode5( - fun((CZO, CZP, CZQ, CZR, CZS) -> CZT), - fun((dynamic_()) -> {ok, CZO} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CZP} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CZQ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CZR} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CZS} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, CZT} | {error, list(decode_error())}). -decode5(Constructor, T1, T2, T3, T4, T5) -> - fun(X) -> case {T1(X), T2(X), T3(X), T4(X), T5(X)} of - {{ok, A}, {ok, B}, {ok, C}, {ok, D}, {ok, E}} -> - {ok, Constructor(A, B, C, D, E)}; - - {A@1, B@1, C@1, D@1, E@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), - all_errors(B@1), - all_errors(C@1), - all_errors(D@1), - all_errors(E@1)] - )} - end end. - --spec decode6( - fun((DAA, DAB, DAC, DAD, DAE, DAF) -> DAG), - fun((dynamic_()) -> {ok, DAA} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAB} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAC} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAD} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAE} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAF} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DAG} | {error, list(decode_error())}). -decode6(Constructor, T1, T2, T3, T4, T5, T6) -> - fun(X) -> case {T1(X), T2(X), T3(X), T4(X), T5(X), T6(X)} of - {{ok, A}, {ok, B}, {ok, C}, {ok, D}, {ok, E}, {ok, F}} -> - {ok, Constructor(A, B, C, D, E, F)}; - - {A@1, B@1, C@1, D@1, E@1, F@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), - all_errors(B@1), - all_errors(C@1), - all_errors(D@1), - all_errors(E@1), - all_errors(F@1)] - )} - end end. - --spec decode7( - fun((DAO, DAP, DAQ, DAR, DAS, DAT, DAU) -> DAV), - fun((dynamic_()) -> {ok, DAO} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAP} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAQ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAR} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAS} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAT} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAU} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DAV} | {error, list(decode_error())}). -decode7(Constructor, T1, T2, T3, T4, T5, T6, T7) -> - fun(X) -> case {T1(X), T2(X), T3(X), T4(X), T5(X), T6(X), T7(X)} of - {{ok, A}, {ok, B}, {ok, C}, {ok, D}, {ok, E}, {ok, F}, {ok, G}} -> - {ok, Constructor(A, B, C, D, E, F, G)}; - - {A@1, B@1, C@1, D@1, E@1, F@1, G@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), - all_errors(B@1), - all_errors(C@1), - all_errors(D@1), - all_errors(E@1), - all_errors(F@1), - all_errors(G@1)] - )} - end end. - --spec decode8( - fun((DBE, DBF, DBG, DBH, DBI, DBJ, DBK, DBL) -> DBM), - fun((dynamic_()) -> {ok, DBE} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBF} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBG} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBH} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBI} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBJ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBK} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBL} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DBM} | {error, list(decode_error())}). -decode8(Constructor, T1, T2, T3, T4, T5, T6, T7, T8) -> - fun(X) -> case {T1(X), T2(X), T3(X), T4(X), T5(X), T6(X), T7(X), T8(X)} of - {{ok, A}, - {ok, B}, - {ok, C}, - {ok, D}, - {ok, E}, - {ok, F}, - {ok, G}, - {ok, H}} -> - {ok, Constructor(A, B, C, D, E, F, G, H)}; - - {A@1, B@1, C@1, D@1, E@1, F@1, G@1, H@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), - all_errors(B@1), - all_errors(C@1), - all_errors(D@1), - all_errors(E@1), - all_errors(F@1), - all_errors(G@1), - all_errors(H@1)] - )} - end end. - --spec decode9( - fun((DBW, DBX, DBY, DBZ, DCA, DCB, DCC, DCD, DCE) -> DCF), - fun((dynamic_()) -> {ok, DBW} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBX} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBY} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBZ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DCA} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DCB} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DCC} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DCD} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DCE} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DCF} | {error, list(decode_error())}). -decode9(Constructor, T1, T2, T3, T4, T5, T6, T7, T8, T9) -> - fun(X) -> - case {T1(X), T2(X), T3(X), T4(X), T5(X), T6(X), T7(X), T8(X), T9(X)} of - {{ok, A}, - {ok, B}, - {ok, C}, - {ok, D}, - {ok, E}, - {ok, F}, - {ok, G}, - {ok, H}, - {ok, I}} -> - {ok, Constructor(A, B, C, D, E, F, G, H, I)}; - - {A@1, B@1, C@1, D@1, E@1, F@1, G@1, H@1, I@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), - all_errors(B@1), - all_errors(C@1), - all_errors(D@1), - all_errors(E@1), - all_errors(F@1), - all_errors(G@1), - all_errors(H@1), - all_errors(I@1)] - )} - end - end. diff --git a/build/dev/javascript/gleam_stdlib/gleam@float.erl b/build/dev/javascript/gleam_stdlib/gleam@float.erl deleted file mode 100644 index 5f6c0ab..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@float.erl +++ /dev/null @@ -1,180 +0,0 @@ --module(gleam@float). --compile([no_auto_import, nowarn_unused_vars]). - --export([parse/1, to_string/1, compare/2, min/2, max/2, clamp/3, ceiling/1, floor/1, round/1, truncate/1, absolute_value/1, loosely_compare/3, loosely_equals/3, power/2, square_root/1, negate/1, sum/1, product/1, random/2, divide/2, add/2, multiply/2, subtract/2]). - --spec parse(binary()) -> {ok, float()} | {error, nil}. -parse(String) -> - gleam_stdlib:parse_float(String). - --spec to_string(float()) -> binary(). -to_string(X) -> - gleam_stdlib:float_to_string(X). - --spec compare(float(), float()) -> gleam@order:order(). -compare(A, B) -> - case A =:= B of - true -> - eq; - - false -> - case A < B of - true -> - lt; - - false -> - gt - end - end. - --spec min(float(), float()) -> float(). -min(A, B) -> - case A < B of - true -> - A; - - false -> - B - end. - --spec max(float(), float()) -> float(). -max(A, B) -> - case A > B of - true -> - A; - - false -> - B - end. - --spec clamp(float(), float(), float()) -> float(). -clamp(X, Min_bound, Max_bound) -> - _pipe = X, - _pipe@1 = min(_pipe, Max_bound), - max(_pipe@1, Min_bound). - --spec ceiling(float()) -> float(). -ceiling(X) -> - math:ceil(X). - --spec floor(float()) -> float(). -floor(X) -> - math:floor(X). - --spec round(float()) -> integer(). -round(X) -> - erlang:round(X). - --spec truncate(float()) -> integer(). -truncate(X) -> - erlang:trunc(X). - --spec absolute_value(float()) -> float(). -absolute_value(X) -> - case X >= 0.0 of - true -> - X; - - _ -> - 0.0 - X - end. - --spec loosely_compare(float(), float(), float()) -> gleam@order:order(). -loosely_compare(A, B, Tolerance) -> - Difference = absolute_value(A - B), - case Difference =< Tolerance of - true -> - eq; - - false -> - compare(A, B) - end. - --spec loosely_equals(float(), float(), float()) -> boolean(). -loosely_equals(A, B, Tolerance) -> - Difference = absolute_value(A - B), - Difference =< Tolerance. - --spec power(float(), float()) -> {ok, float()} | {error, nil}. -power(Base, Exponent) -> - Fractional = (ceiling(Exponent) - Exponent) > 0.0, - case ((Base < 0.0) andalso Fractional) orelse ((Base =:= 0.0) andalso (Exponent - < 0.0)) of - true -> - {error, nil}; - - false -> - {ok, math:pow(Base, Exponent)} - end. - --spec square_root(float()) -> {ok, float()} | {error, nil}. -square_root(X) -> - power(X, 0.5). - --spec negate(float()) -> float(). -negate(X) -> - -1.0 * X. - --spec do_sum(list(float()), float()) -> float(). -do_sum(Numbers, Initial) -> - case Numbers of - [] -> - Initial; - - [X | Rest] -> - do_sum(Rest, X + Initial) - end. - --spec sum(list(float())) -> float(). -sum(Numbers) -> - _pipe = Numbers, - do_sum(_pipe, 0.0). - --spec do_product(list(float()), float()) -> float(). -do_product(Numbers, Initial) -> - case Numbers of - [] -> - Initial; - - [X | Rest] -> - do_product(Rest, X * Initial) - end. - --spec product(list(float())) -> float(). -product(Numbers) -> - case Numbers of - [] -> - 1.0; - - _ -> - do_product(Numbers, 1.0) - end. - --spec random(float(), float()) -> float(). -random(Min, Max) -> - (rand:uniform() * (Max - Min)) + Min. - --spec divide(float(), float()) -> {ok, float()} | {error, nil}. -divide(A, B) -> - case B of - 0.0 -> - {error, nil}; - - B@1 -> - {ok, case B@1 of - 0.0 -> 0.0; - Gleam@denominator -> A / Gleam@denominator - end} - end. - --spec add(float(), float()) -> float(). -add(A, B) -> - A + B. - --spec multiply(float(), float()) -> float(). -multiply(A, B) -> - A * B. - --spec subtract(float(), float()) -> float(). -subtract(A, B) -> - A - B. diff --git a/build/dev/javascript/gleam_stdlib/gleam@function.erl b/build/dev/javascript/gleam_stdlib/gleam@function.erl deleted file mode 100644 index b3fcc5c..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@function.erl +++ /dev/null @@ -1,67 +0,0 @@ --module(gleam@function). --compile([no_auto_import, nowarn_unused_vars]). - --export([compose/2, curry2/1, curry3/1, curry4/1, curry5/1, curry6/1, flip/1, identity/1, constant/1, tap/2, apply1/2, apply2/3, apply3/4]). - --spec compose(fun((EUC) -> EUD), fun((EUD) -> EUE)) -> fun((EUC) -> EUE). -compose(Fun1, Fun2) -> - fun(A) -> Fun2(Fun1(A)) end. - --spec curry2(fun((EUF, EUG) -> EUH)) -> fun((EUF) -> fun((EUG) -> EUH)). -curry2(Fun) -> - fun(A) -> fun(B) -> Fun(A, B) end end. - --spec curry3(fun((EUJ, EUK, EUL) -> EUM)) -> fun((EUJ) -> fun((EUK) -> fun((EUL) -> EUM))). -curry3(Fun) -> - fun(A) -> fun(B) -> fun(C) -> Fun(A, B, C) end end end. - --spec curry4(fun((EUO, EUP, EUQ, EUR) -> EUS)) -> fun((EUO) -> fun((EUP) -> fun((EUQ) -> fun((EUR) -> EUS)))). -curry4(Fun) -> - fun(A) -> fun(B) -> fun(C) -> fun(D) -> Fun(A, B, C, D) end end end end. - --spec curry5(fun((EUU, EUV, EUW, EUX, EUY) -> EUZ)) -> fun((EUU) -> fun((EUV) -> fun((EUW) -> fun((EUX) -> fun((EUY) -> EUZ))))). -curry5(Fun) -> - fun(A) -> - fun(B) -> - fun(C) -> fun(D) -> fun(E) -> Fun(A, B, C, D, E) end end end - end - end. - --spec curry6(fun((EVB, EVC, EVD, EVE, EVF, EVG) -> EVH)) -> fun((EVB) -> fun((EVC) -> fun((EVD) -> fun((EVE) -> fun((EVF) -> fun((EVG) -> EVH)))))). -curry6(Fun) -> - fun(A) -> - fun(B) -> - fun(C) -> - fun(D) -> fun(E) -> fun(F) -> Fun(A, B, C, D, E, F) end end end - end - end - end. - --spec flip(fun((EVJ, EVK) -> EVL)) -> fun((EVK, EVJ) -> EVL). -flip(Fun) -> - fun(B, A) -> Fun(A, B) end. - --spec identity(EVM) -> EVM. -identity(X) -> - X. - --spec constant(EVN) -> fun((any()) -> EVN). -constant(Value) -> - fun(_) -> Value end. - --spec tap(EVP, fun((EVP) -> any())) -> EVP. -tap(Arg, Effect) -> - Effect(Arg), - Arg. - --spec apply1(fun((EVR) -> EVS), EVR) -> EVS. -apply1(Fun, Arg1) -> - Fun(Arg1). - --spec apply2(fun((EVT, EVU) -> EVV), EVT, EVU) -> EVV. -apply2(Fun, Arg1, Arg2) -> - Fun(Arg1, Arg2). - --spec apply3(fun((EVW, EVX, EVY) -> EVZ), EVW, EVX, EVY) -> EVZ. -apply3(Fun, Arg1, Arg2, Arg3) -> - Fun(Arg1, Arg2, Arg3). diff --git a/build/dev/javascript/gleam_stdlib/gleam@int.erl b/build/dev/javascript/gleam_stdlib/gleam@int.erl deleted file mode 100644 index 3d0bdd8..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@int.erl +++ /dev/null @@ -1,332 +0,0 @@ --module(gleam@int). --compile([no_auto_import, nowarn_unused_vars]). - --export([absolute_value/1, parse/1, base_parse/2, to_string/1, to_base_string/2, to_base2/1, to_base8/1, to_base16/1, to_base36/1, to_float/1, power/2, square_root/1, compare/2, min/2, max/2, clamp/3, is_even/1, is_odd/1, negate/1, sum/1, product/1, digits/2, undigits/2, random/2, divide/2, remainder/2, modulo/2, floor_divide/2, add/2, multiply/2, subtract/2, bitwise_and/2, bitwise_not/1, bitwise_or/2, bitwise_exclusive_or/2, bitwise_shift_left/2, bitwise_shift_right/2]). --export_type([invalid_base/0]). - --type invalid_base() :: invalid_base. - --spec absolute_value(integer()) -> integer(). -absolute_value(X) -> - case X >= 0 of - true -> - X; - - false -> - X * -1 - end. - --spec parse(binary()) -> {ok, integer()} | {error, nil}. -parse(String) -> - gleam_stdlib:parse_int(String). - --spec base_parse(binary(), integer()) -> {ok, integer()} | {error, nil}. -base_parse(String, Base) -> - case (Base >= 2) andalso (Base =< 36) of - true -> - gleam_stdlib:int_from_base_string(String, Base); - - false -> - {error, nil} - end. - --spec to_string(integer()) -> binary(). -to_string(X) -> - erlang:integer_to_binary(X). - --spec to_base_string(integer(), integer()) -> {ok, binary()} | - {error, invalid_base()}. -to_base_string(X, Base) -> - case (Base >= 2) andalso (Base =< 36) of - true -> - {ok, erlang:integer_to_binary(X, Base)}; - - false -> - {error, invalid_base} - end. - --spec to_base2(integer()) -> binary(). -to_base2(X) -> - erlang:integer_to_binary(X, 2). - --spec to_base8(integer()) -> binary(). -to_base8(X) -> - erlang:integer_to_binary(X, 8). - --spec to_base16(integer()) -> binary(). -to_base16(X) -> - erlang:integer_to_binary(X, 16). - --spec to_base36(integer()) -> binary(). -to_base36(X) -> - erlang:integer_to_binary(X, 36). - --spec to_float(integer()) -> float(). -to_float(X) -> - erlang:float(X). - --spec power(integer(), float()) -> {ok, float()} | {error, nil}. -power(Base, Exponent) -> - _pipe = Base, - _pipe@1 = to_float(_pipe), - gleam@float:power(_pipe@1, Exponent). - --spec square_root(integer()) -> {ok, float()} | {error, nil}. -square_root(X) -> - _pipe = X, - _pipe@1 = to_float(_pipe), - gleam@float:square_root(_pipe@1). - --spec compare(integer(), integer()) -> gleam@order:order(). -compare(A, B) -> - case A =:= B of - true -> - eq; - - false -> - case A < B of - true -> - lt; - - false -> - gt - end - end. - --spec min(integer(), integer()) -> integer(). -min(A, B) -> - case A < B of - true -> - A; - - false -> - B - end. - --spec max(integer(), integer()) -> integer(). -max(A, B) -> - case A > B of - true -> - A; - - false -> - B - end. - --spec clamp(integer(), integer(), integer()) -> integer(). -clamp(X, Min_bound, Max_bound) -> - _pipe = X, - _pipe@1 = min(_pipe, Max_bound), - max(_pipe@1, Min_bound). - --spec is_even(integer()) -> boolean(). -is_even(X) -> - (X rem 2) =:= 0. - --spec is_odd(integer()) -> boolean(). -is_odd(X) -> - (X rem 2) /= 0. - --spec negate(integer()) -> integer(). -negate(X) -> - -1 * X. - --spec do_sum(list(integer()), integer()) -> integer(). -do_sum(Numbers, Initial) -> - case Numbers of - [] -> - Initial; - - [X | Rest] -> - do_sum(Rest, X + Initial) - end. - --spec sum(list(integer())) -> integer(). -sum(Numbers) -> - _pipe = Numbers, - do_sum(_pipe, 0). - --spec do_product(list(integer()), integer()) -> integer(). -do_product(Numbers, Initial) -> - case Numbers of - [] -> - Initial; - - [X | Rest] -> - do_product(Rest, X * Initial) - end. - --spec product(list(integer())) -> integer(). -product(Numbers) -> - case Numbers of - [] -> - 1; - - _ -> - do_product(Numbers, 1) - end. - --spec do_digits(integer(), integer(), list(integer())) -> list(integer()). -do_digits(X, Base, Acc) -> - case absolute_value(X) < Base of - true -> - [X | Acc]; - - false -> - do_digits(case Base of - 0 -> 0; - Gleam@denominator -> X div Gleam@denominator - end, Base, [case Base of - 0 -> 0; - Gleam@denominator@1 -> X rem Gleam@denominator@1 - end | Acc]) - end. - --spec digits(integer(), integer()) -> {ok, list(integer())} | - {error, invalid_base()}. -digits(X, Base) -> - case Base < 2 of - true -> - {error, invalid_base}; - - false -> - {ok, do_digits(X, Base, [])} - end. - --spec do_undigits(list(integer()), integer(), integer()) -> {ok, integer()} | - {error, invalid_base()}. -do_undigits(Numbers, Base, Acc) -> - case Numbers of - [] -> - {ok, Acc}; - - [Digit | _] when Digit >= Base -> - {error, invalid_base}; - - [Digit@1 | Rest] -> - do_undigits(Rest, Base, (Acc * Base) + Digit@1) - end. - --spec undigits(list(integer()), integer()) -> {ok, integer()} | - {error, invalid_base()}. -undigits(Numbers, Base) -> - case Base < 2 of - true -> - {error, invalid_base}; - - false -> - do_undigits(Numbers, Base, 0) - end. - --spec random(integer(), integer()) -> integer(). -random(Min, Max) -> - _pipe = gleam@float:random(to_float(Min), to_float(Max)), - _pipe@1 = gleam@float:floor(_pipe), - gleam@float:round(_pipe@1). - --spec divide(integer(), integer()) -> {ok, integer()} | {error, nil}. -divide(Dividend, Divisor) -> - case Divisor of - 0 -> - {error, nil}; - - Divisor@1 -> - {ok, case Divisor@1 of - 0 -> 0; - Gleam@denominator -> Dividend div Gleam@denominator - end} - end. - --spec remainder(integer(), integer()) -> {ok, integer()} | {error, nil}. -remainder(Dividend, Divisor) -> - case Divisor of - 0 -> - {error, nil}; - - Divisor@1 -> - {ok, case Divisor@1 of - 0 -> 0; - Gleam@denominator -> Dividend rem Gleam@denominator - end} - end. - --spec modulo(integer(), integer()) -> {ok, integer()} | {error, nil}. -modulo(Dividend, Divisor) -> - case Divisor of - 0 -> - {error, nil}; - - _ -> - Remainder = case Divisor of - 0 -> 0; - Gleam@denominator -> Dividend rem Gleam@denominator - end, - case (Remainder * Divisor) < 0 of - true -> - {ok, Remainder + Divisor}; - - false -> - {ok, Remainder} - end - end. - --spec floor_divide(integer(), integer()) -> {ok, integer()} | {error, nil}. -floor_divide(Dividend, Divisor) -> - case Divisor of - 0 -> - {error, nil}; - - Divisor@1 -> - case ((Dividend * Divisor@1) < 0) andalso ((case Divisor@1 of - 0 -> 0; - Gleam@denominator -> Dividend rem Gleam@denominator - end) /= 0) of - true -> - {ok, (case Divisor@1 of - 0 -> 0; - Gleam@denominator@1 -> Dividend div Gleam@denominator@1 - end) - 1}; - - false -> - {ok, case Divisor@1 of - 0 -> 0; - Gleam@denominator@2 -> Dividend div Gleam@denominator@2 - end} - end - end. - --spec add(integer(), integer()) -> integer(). -add(A, B) -> - A + B. - --spec multiply(integer(), integer()) -> integer(). -multiply(A, B) -> - A * B. - --spec subtract(integer(), integer()) -> integer(). -subtract(A, B) -> - A - B. - --spec bitwise_and(integer(), integer()) -> integer(). -bitwise_and(X, Y) -> - erlang:'band'(X, Y). - --spec bitwise_not(integer()) -> integer(). -bitwise_not(X) -> - erlang:'bnot'(X). - --spec bitwise_or(integer(), integer()) -> integer(). -bitwise_or(X, Y) -> - erlang:'bor'(X, Y). - --spec bitwise_exclusive_or(integer(), integer()) -> integer(). -bitwise_exclusive_or(X, Y) -> - erlang:'bxor'(X, Y). - --spec bitwise_shift_left(integer(), integer()) -> integer(). -bitwise_shift_left(X, Y) -> - erlang:'bsl'(X, Y). - --spec bitwise_shift_right(integer(), integer()) -> integer(). -bitwise_shift_right(X, Y) -> - erlang:'bsr'(X, Y). diff --git a/build/dev/javascript/gleam_stdlib/gleam@io.erl b/build/dev/javascript/gleam_stdlib/gleam@io.erl deleted file mode 100644 index f8c8b7f..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@io.erl +++ /dev/null @@ -1,27 +0,0 @@ --module(gleam@io). --compile([no_auto_import, nowarn_unused_vars]). - --export([print/1, print_error/1, println/1, println_error/1, debug/1]). - --spec print(binary()) -> nil. -print(String) -> - gleam_stdlib:print(String). - --spec print_error(binary()) -> nil. -print_error(String) -> - gleam_stdlib:print_error(String). - --spec println(binary()) -> nil. -println(String) -> - gleam_stdlib:println(String). - --spec println_error(binary()) -> nil. -println_error(String) -> - gleam_stdlib:println_error(String). - --spec debug(ETS) -> ETS. -debug(Term) -> - _pipe = Term, - _pipe@1 = gleam@string:inspect(_pipe), - gleam_stdlib:println_error(_pipe@1), - Term. diff --git a/build/dev/javascript/gleam_stdlib/gleam@iterator.erl b/build/dev/javascript/gleam_stdlib/gleam@iterator.erl deleted file mode 100644 index 2f2ee29..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@iterator.erl +++ /dev/null @@ -1,715 +0,0 @@ --module(gleam@iterator). --compile([no_auto_import, nowarn_unused_vars]). - --export([unfold/2, repeatedly/1, repeat/1, from_list/1, transform/3, fold/3, run/1, to_list/1, step/1, take/2, drop/2, map/2, append/2, flatten/1, concat/1, flat_map/2, filter/2, cycle/1, find/2, index/1, iterate/2, take_while/2, drop_while/2, scan/3, zip/2, chunk/2, sized_chunk/2, intersperse/2, any/2, all/2, group/2, reduce/2, last/1, empty/0, once/1, range/2, single/1, interleave/2, fold_until/3, try_fold/3, first/1, at/2, length/1, each/2, yield/2]). --export_type([action/1, iterator/1, step/2, chunk/2, sized_chunk/1]). - --type action(BPX) :: stop | {continue, BPX, fun(() -> action(BPX))}. - --opaque iterator(BPY) :: {iterator, fun(() -> action(BPY))}. - --type step(BPZ, BQA) :: {next, BPZ, BQA} | done. - --type chunk(BQB, BQC) :: {another_by, - list(BQB), - BQC, - BQB, - fun(() -> action(BQB))} | - {last_by, list(BQB)}. - --type sized_chunk(BQD) :: {another, list(BQD), fun(() -> action(BQD))} | - {last, list(BQD)} | - no_more. - --spec stop() -> action(any()). -stop() -> - stop. - --spec do_unfold(BQG, fun((BQG) -> step(BQH, BQG))) -> fun(() -> action(BQH)). -do_unfold(Initial, F) -> - fun() -> case F(Initial) of - {next, X, Acc} -> - {continue, X, do_unfold(Acc, F)}; - - done -> - stop - end end. - --spec unfold(BQL, fun((BQL) -> step(BQM, BQL))) -> iterator(BQM). -unfold(Initial, F) -> - _pipe = Initial, - _pipe@1 = do_unfold(_pipe, F), - {iterator, _pipe@1}. - --spec repeatedly(fun(() -> BQQ)) -> iterator(BQQ). -repeatedly(F) -> - unfold(nil, fun(_) -> {next, F(), nil} end). - --spec repeat(BQS) -> iterator(BQS). -repeat(X) -> - repeatedly(fun() -> X end). - --spec from_list(list(BQU)) -> iterator(BQU). -from_list(List) -> - Yield = fun(Acc) -> case Acc of - [] -> - done; - - [Head | Tail] -> - {next, Head, Tail} - end end, - unfold(List, Yield). - --spec do_transform( - fun(() -> action(BQX)), - BQZ, - fun((BQZ, BQX) -> step(BRA, BQZ)) -) -> fun(() -> action(BRA)). -do_transform(Continuation, State, F) -> - fun() -> case Continuation() of - stop -> - stop; - - {continue, El, Next} -> - case F(State, El) of - done -> - stop; - - {next, Yield, Next_state} -> - {continue, Yield, do_transform(Next, Next_state, F)} - end - end end. - --spec transform(iterator(BRE), BRG, fun((BRG, BRE) -> step(BRH, BRG))) -> iterator(BRH). -transform(Iterator, Initial, F) -> - _pipe = do_transform(erlang:element(2, Iterator), Initial, F), - {iterator, _pipe}. - --spec do_fold(fun(() -> action(BRL)), fun((BRN, BRL) -> BRN), BRN) -> BRN. -do_fold(Continuation, F, Accumulator) -> - case Continuation() of - {continue, Elem, Next} -> - do_fold(Next, F, F(Accumulator, Elem)); - - stop -> - Accumulator - end. - --spec fold(iterator(BRO), BRQ, fun((BRQ, BRO) -> BRQ)) -> BRQ. -fold(Iterator, Initial, F) -> - _pipe = erlang:element(2, Iterator), - do_fold(_pipe, F, Initial). - --spec run(iterator(any())) -> nil. -run(Iterator) -> - fold(Iterator, nil, fun(_, _) -> nil end). - --spec to_list(iterator(BRT)) -> list(BRT). -to_list(Iterator) -> - _pipe = Iterator, - _pipe@1 = fold(_pipe, [], fun(Acc, E) -> [E | Acc] end), - gleam@list:reverse(_pipe@1). - --spec step(iterator(BRW)) -> step(BRW, iterator(BRW)). -step(Iterator) -> - case (erlang:element(2, Iterator))() of - stop -> - done; - - {continue, E, A} -> - {next, E, {iterator, A}} - end. - --spec do_take(fun(() -> action(BSB)), integer()) -> fun(() -> action(BSB)). -do_take(Continuation, Desired) -> - fun() -> case Desired > 0 of - false -> - stop; - - true -> - case Continuation() of - stop -> - stop; - - {continue, E, Next} -> - {continue, E, do_take(Next, Desired - 1)} - end - end end. - --spec take(iterator(BSE), integer()) -> iterator(BSE). -take(Iterator, Desired) -> - _pipe = erlang:element(2, Iterator), - _pipe@1 = do_take(_pipe, Desired), - {iterator, _pipe@1}. - --spec do_drop(fun(() -> action(BSH)), integer()) -> action(BSH). -do_drop(Continuation, Desired) -> - case Continuation() of - stop -> - stop; - - {continue, E, Next} -> - case Desired > 0 of - true -> - do_drop(Next, Desired - 1); - - false -> - {continue, E, Next} - end - end. - --spec drop(iterator(BSK), integer()) -> iterator(BSK). -drop(Iterator, Desired) -> - _pipe = fun() -> do_drop(erlang:element(2, Iterator), Desired) end, - {iterator, _pipe}. - --spec do_map(fun(() -> action(BSN)), fun((BSN) -> BSP)) -> fun(() -> action(BSP)). -do_map(Continuation, F) -> - fun() -> case Continuation() of - stop -> - stop; - - {continue, E, Continuation@1} -> - {continue, F(E), do_map(Continuation@1, F)} - end end. - --spec map(iterator(BSR), fun((BSR) -> BST)) -> iterator(BST). -map(Iterator, F) -> - _pipe = erlang:element(2, Iterator), - _pipe@1 = do_map(_pipe, F), - {iterator, _pipe@1}. - --spec do_append(fun(() -> action(BSV)), fun(() -> action(BSV))) -> action(BSV). -do_append(First, Second) -> - case First() of - {continue, E, First@1} -> - {continue, E, fun() -> do_append(First@1, Second) end}; - - stop -> - Second() - end. - --spec append(iterator(BSZ), iterator(BSZ)) -> iterator(BSZ). -append(First, Second) -> - _pipe = fun() -> - do_append(erlang:element(2, First), erlang:element(2, Second)) - end, - {iterator, _pipe}. - --spec do_flatten(fun(() -> action(iterator(BTD)))) -> action(BTD). -do_flatten(Flattened) -> - case Flattened() of - stop -> - stop; - - {continue, It, Next_iterator} -> - do_append( - erlang:element(2, It), - fun() -> do_flatten(Next_iterator) end - ) - end. - --spec flatten(iterator(iterator(BTH))) -> iterator(BTH). -flatten(Iterator) -> - _pipe = fun() -> do_flatten(erlang:element(2, Iterator)) end, - {iterator, _pipe}. - --spec concat(list(iterator(BTL))) -> iterator(BTL). -concat(Iterators) -> - flatten(from_list(Iterators)). - --spec flat_map(iterator(BTP), fun((BTP) -> iterator(BTR))) -> iterator(BTR). -flat_map(Iterator, F) -> - _pipe = Iterator, - _pipe@1 = map(_pipe, F), - flatten(_pipe@1). - --spec do_filter(fun(() -> action(BTU)), fun((BTU) -> boolean())) -> action(BTU). -do_filter(Continuation, Predicate) -> - case Continuation() of - stop -> - stop; - - {continue, E, Iterator} -> - case Predicate(E) of - true -> - {continue, E, fun() -> do_filter(Iterator, Predicate) end}; - - false -> - do_filter(Iterator, Predicate) - end - end. - --spec filter(iterator(BTX), fun((BTX) -> boolean())) -> iterator(BTX). -filter(Iterator, Predicate) -> - _pipe = fun() -> do_filter(erlang:element(2, Iterator), Predicate) end, - {iterator, _pipe}. - --spec cycle(iterator(BUA)) -> iterator(BUA). -cycle(Iterator) -> - _pipe = repeat(Iterator), - flatten(_pipe). - --spec do_find(fun(() -> action(BUE)), fun((BUE) -> boolean())) -> {ok, BUE} | - {error, nil}. -do_find(Continuation, F) -> - case Continuation() of - stop -> - {error, nil}; - - {continue, E, Next} -> - case F(E) of - true -> - {ok, E}; - - false -> - do_find(Next, F) - end - end. - --spec find(iterator(BUI), fun((BUI) -> boolean())) -> {ok, BUI} | {error, nil}. -find(Haystack, Is_desired) -> - _pipe = erlang:element(2, Haystack), - do_find(_pipe, Is_desired). - --spec do_index(fun(() -> action(BUM)), integer()) -> fun(() -> action({integer(), - BUM})). -do_index(Continuation, Next) -> - fun() -> case Continuation() of - stop -> - stop; - - {continue, E, Continuation@1} -> - {continue, {Next, E}, do_index(Continuation@1, Next + 1)} - end end. - --spec index(iterator(BUP)) -> iterator({integer(), BUP}). -index(Iterator) -> - _pipe = erlang:element(2, Iterator), - _pipe@1 = do_index(_pipe, 0), - {iterator, _pipe@1}. - --spec iterate(BUS, fun((BUS) -> BUS)) -> iterator(BUS). -iterate(Initial, F) -> - unfold(Initial, fun(Element) -> {next, Element, F(Element)} end). - --spec do_take_while(fun(() -> action(BUU)), fun((BUU) -> boolean())) -> fun(() -> action(BUU)). -do_take_while(Continuation, Predicate) -> - fun() -> case Continuation() of - stop -> - stop; - - {continue, E, Next} -> - case Predicate(E) of - false -> - stop; - - true -> - {continue, E, do_take_while(Next, Predicate)} - end - end end. - --spec take_while(iterator(BUX), fun((BUX) -> boolean())) -> iterator(BUX). -take_while(Iterator, Predicate) -> - _pipe = erlang:element(2, Iterator), - _pipe@1 = do_take_while(_pipe, Predicate), - {iterator, _pipe@1}. - --spec do_drop_while(fun(() -> action(BVA)), fun((BVA) -> boolean())) -> action(BVA). -do_drop_while(Continuation, Predicate) -> - case Continuation() of - stop -> - stop; - - {continue, E, Next} -> - case Predicate(E) of - false -> - {continue, E, Next}; - - true -> - do_drop_while(Next, Predicate) - end - end. - --spec drop_while(iterator(BVD), fun((BVD) -> boolean())) -> iterator(BVD). -drop_while(Iterator, Predicate) -> - _pipe = fun() -> do_drop_while(erlang:element(2, Iterator), Predicate) end, - {iterator, _pipe}. - --spec do_scan(fun(() -> action(BVG)), fun((BVI, BVG) -> BVI), BVI) -> fun(() -> action(BVI)). -do_scan(Continuation, F, Accumulator) -> - fun() -> case Continuation() of - stop -> - stop; - - {continue, El, Next} -> - Accumulated = F(Accumulator, El), - {continue, Accumulated, do_scan(Next, F, Accumulated)} - end end. - --spec scan(iterator(BVK), BVM, fun((BVM, BVK) -> BVM)) -> iterator(BVM). -scan(Iterator, Initial, F) -> - _pipe = erlang:element(2, Iterator), - _pipe@1 = do_scan(_pipe, F, Initial), - {iterator, _pipe@1}. - --spec do_zip(fun(() -> action(BVO)), fun(() -> action(BVQ))) -> fun(() -> action({BVO, - BVQ})). -do_zip(Left, Right) -> - fun() -> case Left() of - stop -> - stop; - - {continue, El_left, Next_left} -> - case Right() of - stop -> - stop; - - {continue, El_right, Next_right} -> - {continue, - {El_left, El_right}, - do_zip(Next_left, Next_right)} - end - end end. - --spec zip(iterator(BVT), iterator(BVV)) -> iterator({BVT, BVV}). -zip(Left, Right) -> - _pipe = do_zip(erlang:element(2, Left), erlang:element(2, Right)), - {iterator, _pipe}. - --spec next_chunk(fun(() -> action(BVY)), fun((BVY) -> BWA), BWA, list(BVY)) -> chunk(BVY, BWA). -next_chunk(Continuation, F, Previous_key, Current_chunk) -> - case Continuation() of - stop -> - {last_by, gleam@list:reverse(Current_chunk)}; - - {continue, E, Next} -> - Key = F(E), - case Key =:= Previous_key of - true -> - next_chunk(Next, F, Key, [E | Current_chunk]); - - false -> - {another_by, - gleam@list:reverse(Current_chunk), - Key, - E, - Next} - end - end. - --spec do_chunk(fun(() -> action(BWE)), fun((BWE) -> BWG), BWG, BWE) -> action(list(BWE)). -do_chunk(Continuation, F, Previous_key, Previous_element) -> - case next_chunk(Continuation, F, Previous_key, [Previous_element]) of - {last_by, Chunk} -> - {continue, Chunk, fun stop/0}; - - {another_by, Chunk@1, Key, El, Next} -> - {continue, Chunk@1, fun() -> do_chunk(Next, F, Key, El) end} - end. - --spec chunk(iterator(BWJ), fun((BWJ) -> any())) -> iterator(list(BWJ)). -chunk(Iterator, F) -> - _pipe = fun() -> case (erlang:element(2, Iterator))() of - stop -> - stop; - - {continue, E, Next} -> - do_chunk(Next, F, F(E), E) - end end, - {iterator, _pipe}. - --spec next_sized_chunk(fun(() -> action(BWO)), integer(), list(BWO)) -> sized_chunk(BWO). -next_sized_chunk(Continuation, Left, Current_chunk) -> - case Continuation() of - stop -> - case Current_chunk of - [] -> - no_more; - - Remaining -> - {last, gleam@list:reverse(Remaining)} - end; - - {continue, E, Next} -> - Chunk = [E | Current_chunk], - case Left > 1 of - false -> - {another, gleam@list:reverse(Chunk), Next}; - - true -> - next_sized_chunk(Next, Left - 1, Chunk) - end - end. - --spec do_sized_chunk(fun(() -> action(BWS)), integer()) -> fun(() -> action(list(BWS))). -do_sized_chunk(Continuation, Count) -> - fun() -> case next_sized_chunk(Continuation, Count, []) of - no_more -> - stop; - - {last, Chunk} -> - {continue, Chunk, fun stop/0}; - - {another, Chunk@1, Next_element} -> - {continue, Chunk@1, do_sized_chunk(Next_element, Count)} - end end. - --spec sized_chunk(iterator(BWW), integer()) -> iterator(list(BWW)). -sized_chunk(Iterator, Count) -> - _pipe = erlang:element(2, Iterator), - _pipe@1 = do_sized_chunk(_pipe, Count), - {iterator, _pipe@1}. - --spec do_intersperse(fun(() -> action(BXA)), BXA) -> action(BXA). -do_intersperse(Continuation, Separator) -> - case Continuation() of - stop -> - stop; - - {continue, E, Next} -> - Next_interspersed = fun() -> do_intersperse(Next, Separator) end, - {continue, Separator, fun() -> {continue, E, Next_interspersed} end} - end. - --spec intersperse(iterator(BXD), BXD) -> iterator(BXD). -intersperse(Iterator, Elem) -> - _pipe = fun() -> case (erlang:element(2, Iterator))() of - stop -> - stop; - - {continue, E, Next} -> - {continue, E, fun() -> do_intersperse(Next, Elem) end} - end end, - {iterator, _pipe}. - --spec do_any(fun(() -> action(BXG)), fun((BXG) -> boolean())) -> boolean(). -do_any(Continuation, Predicate) -> - case Continuation() of - stop -> - false; - - {continue, E, Next} -> - case Predicate(E) of - true -> - true; - - false -> - do_any(Next, Predicate) - end - end. - --spec any(iterator(BXI), fun((BXI) -> boolean())) -> boolean(). -any(Iterator, Predicate) -> - _pipe = erlang:element(2, Iterator), - do_any(_pipe, Predicate). - --spec do_all(fun(() -> action(BXK)), fun((BXK) -> boolean())) -> boolean(). -do_all(Continuation, Predicate) -> - case Continuation() of - stop -> - true; - - {continue, E, Next} -> - case Predicate(E) of - true -> - do_all(Next, Predicate); - - false -> - false - end - end. - --spec all(iterator(BXM), fun((BXM) -> boolean())) -> boolean(). -all(Iterator, Predicate) -> - _pipe = erlang:element(2, Iterator), - do_all(_pipe, Predicate). - --spec update_group_with(BXO) -> fun((gleam@option:option(list(BXO))) -> list(BXO)). -update_group_with(El) -> - fun(Maybe_group) -> case Maybe_group of - {some, Group} -> - [El | Group]; - - none -> - [El] - end end. - --spec group_updater(fun((BXS) -> BXT)) -> fun((gleam@map:map_(BXT, list(BXS)), BXS) -> gleam@map:map_(BXT, list(BXS))). -group_updater(F) -> - fun(Groups, Elem) -> _pipe = Groups, - gleam@map:update(_pipe, F(Elem), update_group_with(Elem)) end. - --spec group(iterator(BYA), fun((BYA) -> BYC)) -> gleam@map:map_(BYC, list(BYA)). -group(Iterator, Key) -> - _pipe = Iterator, - _pipe@1 = fold(_pipe, gleam@map:new(), group_updater(Key)), - gleam@map:map_values( - _pipe@1, - fun(_, Group) -> gleam@list:reverse(Group) end - ). - --spec reduce(iterator(BYG), fun((BYG, BYG) -> BYG)) -> {ok, BYG} | {error, nil}. -reduce(Iterator, F) -> - case (erlang:element(2, Iterator))() of - stop -> - {error, nil}; - - {continue, E, Next} -> - _pipe = do_fold(Next, F, E), - {ok, _pipe} - end. - --spec last(iterator(BYK)) -> {ok, BYK} | {error, nil}. -last(Iterator) -> - _pipe = Iterator, - reduce(_pipe, fun(_, Elem) -> Elem end). - --spec empty() -> iterator(any()). -empty() -> - {iterator, fun stop/0}. - --spec once(fun(() -> BYQ)) -> iterator(BYQ). -once(F) -> - _pipe = fun() -> {continue, F(), fun stop/0} end, - {iterator, _pipe}. - --spec range(integer(), integer()) -> iterator(integer()). -range(Start, Stop) -> - case gleam@int:compare(Start, Stop) of - eq -> - once(fun() -> Start end); - - gt -> - unfold(Start, fun(Current) -> case Current < Stop of - false -> - {next, Current, Current - 1}; - - true -> - done - end end); - - lt -> - unfold(Start, fun(Current@1) -> case Current@1 > Stop of - false -> - {next, Current@1, Current@1 + 1}; - - true -> - done - end end) - end. - --spec single(BYS) -> iterator(BYS). -single(Elem) -> - once(fun() -> Elem end). - --spec do_interleave(fun(() -> action(BYU)), fun(() -> action(BYU))) -> action(BYU). -do_interleave(Current, Next) -> - case Current() of - stop -> - Next(); - - {continue, E, Next_other} -> - {continue, E, fun() -> do_interleave(Next, Next_other) end} - end. - --spec interleave(iterator(BYY), iterator(BYY)) -> iterator(BYY). -interleave(Left, Right) -> - _pipe = fun() -> - do_interleave(erlang:element(2, Left), erlang:element(2, Right)) - end, - {iterator, _pipe}. - --spec do_fold_until( - fun(() -> action(BZC)), - fun((BZE, BZC) -> gleam@list:continue_or_stop(BZE)), - BZE -) -> BZE. -do_fold_until(Continuation, F, Accumulator) -> - case Continuation() of - stop -> - Accumulator; - - {continue, Elem, Next} -> - case F(Accumulator, Elem) of - {continue, Accumulator@1} -> - do_fold_until(Next, F, Accumulator@1); - - {stop, Accumulator@2} -> - Accumulator@2 - end - end. - --spec fold_until( - iterator(BZG), - BZI, - fun((BZI, BZG) -> gleam@list:continue_or_stop(BZI)) -) -> BZI. -fold_until(Iterator, Initial, F) -> - _pipe = erlang:element(2, Iterator), - do_fold_until(_pipe, F, Initial). - --spec do_try_fold( - fun(() -> action(BZK)), - fun((BZM, BZK) -> {ok, BZM} | {error, BZN}), - BZM -) -> {ok, BZM} | {error, BZN}. -do_try_fold(Continuation, F, Accumulator) -> - case Continuation() of - stop -> - {ok, Accumulator}; - - {continue, Elem, Next} -> - gleam@result:'try'( - F(Accumulator, Elem), - fun(Accumulator@1) -> do_try_fold(Next, F, Accumulator@1) end - ) - end. - --spec try_fold(iterator(BZS), BZU, fun((BZU, BZS) -> {ok, BZU} | {error, BZV})) -> {ok, - BZU} | - {error, BZV}. -try_fold(Iterator, Initial, F) -> - _pipe = erlang:element(2, Iterator), - do_try_fold(_pipe, F, Initial). - --spec first(iterator(CAA)) -> {ok, CAA} | {error, nil}. -first(Iterator) -> - case (erlang:element(2, Iterator))() of - stop -> - {error, nil}; - - {continue, E, _} -> - {ok, E} - end. - --spec at(iterator(CAE), integer()) -> {ok, CAE} | {error, nil}. -at(Iterator, Index) -> - _pipe = Iterator, - _pipe@1 = drop(_pipe, Index), - first(_pipe@1). - --spec do_length(fun(() -> action(any())), integer()) -> integer(). -do_length(Continuation, Length) -> - case Continuation() of - stop -> - Length; - - {continue, _, Next} -> - do_length(Next, Length + 1) - end. - --spec length(iterator(any())) -> integer(). -length(Iterator) -> - _pipe = erlang:element(2, Iterator), - do_length(_pipe, 0). - --spec each(iterator(CAM), fun((CAM) -> any())) -> nil. -each(Iterator, F) -> - _pipe = Iterator, - _pipe@1 = map(_pipe, F), - run(_pipe@1). - --spec yield(CAP, fun(() -> iterator(CAP))) -> iterator(CAP). -yield(Element, Next) -> - {iterator, fun() -> {continue, Element, erlang:element(2, Next())} end}. diff --git a/build/dev/javascript/gleam_stdlib/gleam@list.erl b/build/dev/javascript/gleam_stdlib/gleam@list.erl deleted file mode 100644 index 6425964..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@list.erl +++ /dev/null @@ -1,1109 +0,0 @@ --module(gleam@list). --compile([no_auto_import, nowarn_unused_vars]). - --export([length/1, reverse/1, is_empty/1, contains/2, first/1, rest/1, filter/2, filter_map/2, map/2, map2/3, index_map/2, try_map/2, drop/2, take/2, new/0, append/2, prepend/2, concat/1, flatten/1, flat_map/2, fold/3, group/2, map_fold/3, fold_right/3, index_fold/3, try_fold/3, fold_until/3, find/2, find_map/2, all/2, any/2, zip/2, strict_zip/2, unzip/1, intersperse/2, at/2, unique/1, sort/2, range/2, repeat/2, split/2, split_while/2, key_find/2, pop/2, pop_map/2, key_pop/2, key_set/3, each/2, try_each/2, partition/2, permutations/1, window/2, window_by_2/1, drop_while/2, take_while/2, chunk/2, sized_chunk/2, reduce/2, scan/3, last/1, combinations/2, combination_pairs/1, transpose/1, interleave/1, shuffle/1]). --export_type([length_mismatch/0, continue_or_stop/1]). - --type length_mismatch() :: length_mismatch. - --type continue_or_stop(VA) :: {continue, VA} | {stop, VA}. - --spec length(list(any())) -> integer(). -length(List) -> - erlang:length(List). - --spec reverse(list(VF)) -> list(VF). -reverse(Xs) -> - lists:reverse(Xs). - --spec is_empty(list(any())) -> boolean(). -is_empty(List) -> - List =:= []. - --spec contains(list(VN), VN) -> boolean(). -contains(List, Elem) -> - case List of - [] -> - false; - - [First | _] when First =:= Elem -> - true; - - [_ | Rest] -> - contains(Rest, Elem) - end. - --spec first(list(VP)) -> {ok, VP} | {error, nil}. -first(List) -> - case List of - [] -> - {error, nil}; - - [X | _] -> - {ok, X} - end. - --spec rest(list(VT)) -> {ok, list(VT)} | {error, nil}. -rest(List) -> - case List of - [] -> - {error, nil}; - - [_ | Xs] -> - {ok, Xs} - end. - --spec do_filter(list(WM), fun((WM) -> boolean()), list(WM)) -> list(WM). -do_filter(List, Fun, Acc) -> - case List of - [] -> - reverse(Acc); - - [X | Xs] -> - New_acc = case Fun(X) of - true -> - [X | Acc]; - - false -> - Acc - end, - do_filter(Xs, Fun, New_acc) - end. - --spec filter(list(WQ), fun((WQ) -> boolean())) -> list(WQ). -filter(List, Predicate) -> - do_filter(List, Predicate, []). - --spec do_filter_map(list(WT), fun((WT) -> {ok, WV} | {error, any()}), list(WV)) -> list(WV). -do_filter_map(List, Fun, Acc) -> - case List of - [] -> - reverse(Acc); - - [X | Xs] -> - New_acc = case Fun(X) of - {ok, X@1} -> - [X@1 | Acc]; - - {error, _} -> - Acc - end, - do_filter_map(Xs, Fun, New_acc) - end. - --spec filter_map(list(XB), fun((XB) -> {ok, XD} | {error, any()})) -> list(XD). -filter_map(List, Fun) -> - do_filter_map(List, Fun, []). - --spec do_map(list(XI), fun((XI) -> XK), list(XK)) -> list(XK). -do_map(List, Fun, Acc) -> - case List of - [] -> - reverse(Acc); - - [X | Xs] -> - do_map(Xs, Fun, [Fun(X) | Acc]) - end. - --spec map(list(XN), fun((XN) -> XP)) -> list(XP). -map(List, Fun) -> - do_map(List, Fun, []). - --spec update_group(fun((VY) -> VZ)) -> fun((gleam@map:map_(VZ, list(VY)), VY) -> gleam@map:map_(VZ, list(VY))). -update_group(F) -> - fun(Groups, Elem) -> case gleam@map:get(Groups, F(Elem)) of - {ok, Existing} -> - gleam@map:insert(Groups, F(Elem), [Elem | Existing]); - - {error, _} -> - gleam@map:insert(Groups, F(Elem), [Elem]) - end end. - --spec do_map2(list(XX), list(XZ), fun((XX, XZ) -> YB), list(YB)) -> list(YB). -do_map2(List1, List2, Fun, Acc) -> - case {List1, List2} of - {[], _} -> - reverse(Acc); - - {_, []} -> - reverse(Acc); - - {[A | As_], [B | Bs]} -> - do_map2(As_, Bs, Fun, [Fun(A, B) | Acc]) - end. - --spec map2(list(XR), list(XT), fun((XR, XT) -> XV)) -> list(XV). -map2(List1, List2, Fun) -> - do_map2(List1, List2, Fun, []). - --spec do_index_map(list(YJ), fun((integer(), YJ) -> YL), integer(), list(YL)) -> list(YL). -do_index_map(List, Fun, Index, Acc) -> - case List of - [] -> - reverse(Acc); - - [X | Xs] -> - Acc@1 = [Fun(Index, X) | Acc], - do_index_map(Xs, Fun, Index + 1, Acc@1) - end. - --spec index_map(list(YO), fun((integer(), YO) -> YQ)) -> list(YQ). -index_map(List, Fun) -> - do_index_map(List, Fun, 0, []). - --spec do_try_map(list(YS), fun((YS) -> {ok, YU} | {error, YV}), list(YU)) -> {ok, - list(YU)} | - {error, YV}. -do_try_map(List, Fun, Acc) -> - case List of - [] -> - {ok, reverse(Acc)}; - - [X | Xs] -> - case Fun(X) of - {ok, Y} -> - do_try_map(Xs, Fun, [Y | Acc]); - - {error, Error} -> - {error, Error} - end - end. - --spec try_map(list(AAC), fun((AAC) -> {ok, AAE} | {error, AAF})) -> {ok, - list(AAE)} | - {error, AAF}. -try_map(List, Fun) -> - do_try_map(List, Fun, []). - --spec drop(list(AAL), integer()) -> list(AAL). -drop(List, N) -> - case N =< 0 of - true -> - List; - - false -> - case List of - [] -> - []; - - [_ | Xs] -> - drop(Xs, N - 1) - end - end. - --spec do_take(list(AAO), integer(), list(AAO)) -> list(AAO). -do_take(List, N, Acc) -> - case N =< 0 of - true -> - reverse(Acc); - - false -> - case List of - [] -> - reverse(Acc); - - [X | Xs] -> - do_take(Xs, N - 1, [X | Acc]) - end - end. - --spec take(list(AAS), integer()) -> list(AAS). -take(List, N) -> - do_take(List, N, []). - --spec new() -> list(any()). -new() -> - []. - --spec append(list(AAX), list(AAX)) -> list(AAX). -append(First, Second) -> - lists:append(First, Second). - --spec prepend(list(ABF), ABF) -> list(ABF). -prepend(List, Item) -> - [Item | List]. - --spec reverse_and_prepend(list(ABI), list(ABI)) -> list(ABI). -reverse_and_prepend(Prefix, Suffix) -> - case Prefix of - [] -> - Suffix; - - [First | Rest] -> - reverse_and_prepend(Rest, [First | Suffix]) - end. - --spec do_concat(list(list(ABM)), list(ABM)) -> list(ABM). -do_concat(Lists, Acc) -> - case Lists of - [] -> - reverse(Acc); - - [List | Further_lists] -> - do_concat(Further_lists, reverse_and_prepend(List, Acc)) - end. - --spec concat(list(list(ABR))) -> list(ABR). -concat(Lists) -> - do_concat(Lists, []). - --spec flatten(list(list(ABV))) -> list(ABV). -flatten(Lists) -> - do_concat(Lists, []). - --spec flat_map(list(ABZ), fun((ABZ) -> list(ACB))) -> list(ACB). -flat_map(List, Fun) -> - _pipe = map(List, Fun), - concat(_pipe). - --spec fold(list(ACE), ACG, fun((ACG, ACE) -> ACG)) -> ACG. -fold(List, Initial, Fun) -> - case List of - [] -> - Initial; - - [X | Rest] -> - fold(Rest, Fun(Initial, X), Fun) - end. - --spec group(list(WG), fun((WG) -> WI)) -> gleam@map:map_(WI, list(WG)). -group(List, Key) -> - fold(List, gleam@map:new(), update_group(Key)). - --spec map_fold(list(YE), YG, fun((YG, YE) -> {YG, YH})) -> {YG, list(YH)}. -map_fold(List, Acc, Fun) -> - _pipe = fold( - List, - {Acc, []}, - fun(Acc@1, Item) -> - {Current_acc, Items} = Acc@1, - {Next_acc, Next_item} = Fun(Current_acc, Item), - {Next_acc, [Next_item | Items]} - end - ), - gleam@pair:map_second(_pipe, fun reverse/1). - --spec fold_right(list(ACH), ACJ, fun((ACJ, ACH) -> ACJ)) -> ACJ. -fold_right(List, Initial, Fun) -> - case List of - [] -> - Initial; - - [X | Rest] -> - Fun(fold_right(Rest, Initial, Fun), X) - end. - --spec do_index_fold( - list(ACK), - ACM, - fun((ACM, ACK, integer()) -> ACM), - integer() -) -> ACM. -do_index_fold(Over, Acc, With, Index) -> - case Over of - [] -> - Acc; - - [First | Rest] -> - do_index_fold(Rest, With(Acc, First, Index), With, Index + 1) - end. - --spec index_fold(list(ACN), ACP, fun((ACP, ACN, integer()) -> ACP)) -> ACP. -index_fold(Over, Initial, Fun) -> - do_index_fold(Over, Initial, Fun, 0). - --spec try_fold(list(ACQ), ACS, fun((ACS, ACQ) -> {ok, ACS} | {error, ACT})) -> {ok, - ACS} | - {error, ACT}. -try_fold(Collection, Accumulator, Fun) -> - case Collection of - [] -> - {ok, Accumulator}; - - [First | Rest] -> - case Fun(Accumulator, First) of - {ok, Result} -> - try_fold(Rest, Result, Fun); - - {error, _} = Error -> - Error - end - end. - --spec fold_until(list(ACY), ADA, fun((ADA, ACY) -> continue_or_stop(ADA))) -> ADA. -fold_until(Collection, Accumulator, Fun) -> - case Collection of - [] -> - Accumulator; - - [First | Rest] -> - case Fun(Accumulator, First) of - {continue, Next_accumulator} -> - fold_until(Rest, Next_accumulator, Fun); - - {stop, B} -> - B - end - end. - --spec find(list(ADC), fun((ADC) -> boolean())) -> {ok, ADC} | {error, nil}. -find(Haystack, Is_desired) -> - case Haystack of - [] -> - {error, nil}; - - [X | Rest] -> - case Is_desired(X) of - true -> - {ok, X}; - - _ -> - find(Rest, Is_desired) - end - end. - --spec find_map(list(ADG), fun((ADG) -> {ok, ADI} | {error, any()})) -> {ok, ADI} | - {error, nil}. -find_map(Haystack, Fun) -> - case Haystack of - [] -> - {error, nil}; - - [X | Rest] -> - case Fun(X) of - {ok, X@1} -> - {ok, X@1}; - - _ -> - find_map(Rest, Fun) - end - end. - --spec all(list(ADO), fun((ADO) -> boolean())) -> boolean(). -all(List, Predicate) -> - case List of - [] -> - true; - - [First | Rest] -> - case Predicate(First) of - true -> - all(Rest, Predicate); - - false -> - false - end - end. - --spec any(list(ADQ), fun((ADQ) -> boolean())) -> boolean(). -any(List, Predicate) -> - case List of - [] -> - false; - - [First | Rest] -> - case Predicate(First) of - true -> - true; - - false -> - any(Rest, Predicate) - end - end. - --spec do_zip(list(ADS), list(ADU), list({ADS, ADU})) -> list({ADS, ADU}). -do_zip(Xs, Ys, Acc) -> - case {Xs, Ys} of - {[X | Xs@1], [Y | Ys@1]} -> - do_zip(Xs@1, Ys@1, [{X, Y} | Acc]); - - {_, _} -> - reverse(Acc) - end. - --spec zip(list(ADY), list(AEA)) -> list({ADY, AEA}). -zip(List, Other) -> - do_zip(List, Other, []). - --spec strict_zip(list(AED), list(AEF)) -> {ok, list({AED, AEF})} | - {error, length_mismatch()}. -strict_zip(List, Other) -> - case length(List) =:= length(Other) of - true -> - {ok, zip(List, Other)}; - - false -> - {error, length_mismatch} - end. - --spec do_unzip(list({AUB, AUC}), list(AUB), list(AUC)) -> {list(AUB), list(AUC)}. -do_unzip(Input, Xs, Ys) -> - case Input of - [] -> - {reverse(Xs), reverse(Ys)}; - - [{X, Y} | Rest] -> - do_unzip(Rest, [X | Xs], [Y | Ys]) - end. - --spec unzip(list({AEO, AEP})) -> {list(AEO), list(AEP)}. -unzip(Input) -> - do_unzip(Input, [], []). - --spec do_intersperse(list(AET), AET, list(AET)) -> list(AET). -do_intersperse(List, Separator, Acc) -> - case List of - [] -> - reverse(Acc); - - [X | Rest] -> - do_intersperse(Rest, Separator, [X, Separator | Acc]) - end. - --spec intersperse(list(AEX), AEX) -> list(AEX). -intersperse(List, Elem) -> - case List of - [] -> - List; - - [_] -> - List; - - [X | Rest] -> - do_intersperse(Rest, Elem, [X]) - end. - --spec at(list(AFA), integer()) -> {ok, AFA} | {error, nil}. -at(List, Index) -> - case Index >= 0 of - true -> - _pipe = List, - _pipe@1 = drop(_pipe, Index), - first(_pipe@1); - - false -> - {error, nil} - end. - --spec unique(list(AFE)) -> list(AFE). -unique(List) -> - case List of - [] -> - []; - - [X | Rest] -> - [X | unique(filter(Rest, fun(Y) -> Y /= X end))] - end. - --spec merge_up( - integer(), - integer(), - list(AFH), - list(AFH), - list(AFH), - fun((AFH, AFH) -> gleam@order:order()) -) -> list(AFH). -merge_up(Na, Nb, A, B, Acc, Compare) -> - case {Na, Nb, A, B} of - {0, 0, _, _} -> - Acc; - - {_, 0, [Ax | Ar], _} -> - merge_up(Na - 1, Nb, Ar, B, [Ax | Acc], Compare); - - {0, _, _, [Bx | Br]} -> - merge_up(Na, Nb - 1, A, Br, [Bx | Acc], Compare); - - {_, _, [Ax@1 | Ar@1], [Bx@1 | Br@1]} -> - case Compare(Ax@1, Bx@1) of - gt -> - merge_up(Na, Nb - 1, A, Br@1, [Bx@1 | Acc], Compare); - - _ -> - merge_up(Na - 1, Nb, Ar@1, B, [Ax@1 | Acc], Compare) - end - end. - --spec merge_down( - integer(), - integer(), - list(AFM), - list(AFM), - list(AFM), - fun((AFM, AFM) -> gleam@order:order()) -) -> list(AFM). -merge_down(Na, Nb, A, B, Acc, Compare) -> - case {Na, Nb, A, B} of - {0, 0, _, _} -> - Acc; - - {_, 0, [Ax | Ar], _} -> - merge_down(Na - 1, Nb, Ar, B, [Ax | Acc], Compare); - - {0, _, _, [Bx | Br]} -> - merge_down(Na, Nb - 1, A, Br, [Bx | Acc], Compare); - - {_, _, [Ax@1 | Ar@1], [Bx@1 | Br@1]} -> - case Compare(Bx@1, Ax@1) of - lt -> - merge_down(Na - 1, Nb, Ar@1, B, [Ax@1 | Acc], Compare); - - _ -> - merge_down(Na, Nb - 1, A, Br@1, [Bx@1 | Acc], Compare) - end - end. - --spec merge_sort( - list(AFR), - integer(), - fun((AFR, AFR) -> gleam@order:order()), - boolean() -) -> list(AFR). -merge_sort(L, Ln, Compare, Down) -> - N = Ln div 2, - A = L, - B = drop(L, N), - case Ln < 3 of - true -> - case Down of - true -> - merge_down(N, Ln - N, A, B, [], Compare); - - false -> - merge_up(N, Ln - N, A, B, [], Compare) - end; - - false -> - case Down of - true -> - merge_down( - N, - Ln - N, - merge_sort(A, N, Compare, false), - merge_sort(B, Ln - N, Compare, false), - [], - Compare - ); - - false -> - merge_up( - N, - Ln - N, - merge_sort(A, N, Compare, true), - merge_sort(B, Ln - N, Compare, true), - [], - Compare - ) - end - end. - --spec sort(list(AFU), fun((AFU, AFU) -> gleam@order:order())) -> list(AFU). -sort(List, Compare) -> - merge_sort(List, length(List), Compare, true). - --spec tail_recursive_range(integer(), integer(), list(integer())) -> list(integer()). -tail_recursive_range(Start, Stop, Acc) -> - case gleam@int:compare(Start, Stop) of - eq -> - [Stop | Acc]; - - gt -> - tail_recursive_range(Start, Stop + 1, [Stop | Acc]); - - lt -> - tail_recursive_range(Start, Stop - 1, [Stop | Acc]) - end. - --spec range(integer(), integer()) -> list(integer()). -range(Start, Stop) -> - tail_recursive_range(Start, Stop, []). - --spec do_repeat(AGA, integer(), list(AGA)) -> list(AGA). -do_repeat(A, Times, Acc) -> - case Times =< 0 of - true -> - Acc; - - false -> - do_repeat(A, Times - 1, [A | Acc]) - end. - --spec repeat(AGD, integer()) -> list(AGD). -repeat(A, Times) -> - do_repeat(A, Times, []). - --spec do_split(list(AGF), integer(), list(AGF)) -> {list(AGF), list(AGF)}. -do_split(List, N, Taken) -> - case N =< 0 of - true -> - {reverse(Taken), List}; - - false -> - case List of - [] -> - {reverse(Taken), []}; - - [X | Xs] -> - do_split(Xs, N - 1, [X | Taken]) - end - end. - --spec split(list(AGK), integer()) -> {list(AGK), list(AGK)}. -split(List, Index) -> - do_split(List, Index, []). - --spec do_split_while(list(AGO), fun((AGO) -> boolean()), list(AGO)) -> {list(AGO), - list(AGO)}. -do_split_while(List, F, Acc) -> - case List of - [] -> - {reverse(Acc), []}; - - [X | Xs] -> - case F(X) of - false -> - {reverse(Acc), List}; - - _ -> - do_split_while(Xs, F, [X | Acc]) - end - end. - --spec split_while(list(AGT), fun((AGT) -> boolean())) -> {list(AGT), list(AGT)}. -split_while(List, Predicate) -> - do_split_while(List, Predicate, []). - --spec key_find(list({AGX, AGY}), AGX) -> {ok, AGY} | {error, nil}. -key_find(Keyword_list, Desired_key) -> - find_map( - Keyword_list, - fun(Keyword) -> - {Key, Value} = Keyword, - case Key =:= Desired_key of - true -> - {ok, Value}; - - false -> - {error, nil} - end - end - ). - --spec do_pop(list(AXL), fun((AXL) -> boolean()), list(AXL)) -> {ok, - {AXL, list(AXL)}} | - {error, nil}. -do_pop(Haystack, Predicate, Checked) -> - case Haystack of - [] -> - {error, nil}; - - [X | Rest] -> - case Predicate(X) of - true -> - {ok, {X, append(reverse(Checked), Rest)}}; - - false -> - do_pop(Rest, Predicate, [X | Checked]) - end - end. - --spec pop(list(AHG), fun((AHG) -> boolean())) -> {ok, {AHG, list(AHG)}} | - {error, nil}. -pop(Haystack, Is_desired) -> - do_pop(Haystack, Is_desired, []). - --spec do_pop_map(list(AXZ), fun((AXZ) -> {ok, AYM} | {error, any()}), list(AXZ)) -> {ok, - {AYM, list(AXZ)}} | - {error, nil}. -do_pop_map(Haystack, Mapper, Checked) -> - case Haystack of - [] -> - {error, nil}; - - [X | Rest] -> - case Mapper(X) of - {ok, Y} -> - {ok, {Y, append(reverse(Checked), Rest)}}; - - {error, _} -> - do_pop_map(Rest, Mapper, [X | Checked]) - end - end. - --spec pop_map(list(AHP), fun((AHP) -> {ok, AHR} | {error, any()})) -> {ok, - {AHR, list(AHP)}} | - {error, nil}. -pop_map(Haystack, Is_desired) -> - do_pop_map(Haystack, Is_desired, []). - --spec key_pop(list({AHY, AHZ}), AHY) -> {ok, {AHZ, list({AHY, AHZ})}} | - {error, nil}. -key_pop(Haystack, Key) -> - pop_map( - Haystack, - fun(Entry) -> - {K, V} = Entry, - case K of - K@1 when K@1 =:= Key -> - {ok, V}; - - _ -> - {error, nil} - end - end - ). - --spec key_set(list({AIE, AIF}), AIE, AIF) -> list({AIE, AIF}). -key_set(List, Key, Value) -> - case List of - [] -> - [{Key, Value}]; - - [{K, _} | Rest] when K =:= Key -> - [{Key, Value} | Rest]; - - [First | Rest@1] -> - [First | key_set(Rest@1, Key, Value)] - end. - --spec each(list(AII), fun((AII) -> any())) -> nil. -each(List, F) -> - case List of - [] -> - nil; - - [X | Xs] -> - F(X), - each(Xs, F) - end. - --spec try_each(list(AIL), fun((AIL) -> {ok, any()} | {error, AIO})) -> {ok, nil} | - {error, AIO}. -try_each(List, Fun) -> - case List of - [] -> - {ok, nil}; - - [X | Xs] -> - case Fun(X) of - {ok, _} -> - try_each(Xs, Fun); - - {error, E} -> - {error, E} - end - end. - --spec do_partition(list(AZT), fun((AZT) -> boolean()), list(AZT), list(AZT)) -> {list(AZT), - list(AZT)}. -do_partition(List, Categorise, Trues, Falses) -> - case List of - [] -> - {reverse(Trues), reverse(Falses)}; - - [X | Xs] -> - case Categorise(X) of - true -> - do_partition(Xs, Categorise, [X | Trues], Falses); - - false -> - do_partition(Xs, Categorise, Trues, [X | Falses]) - end - end. - --spec partition(list(AIY), fun((AIY) -> boolean())) -> {list(AIY), list(AIY)}. -partition(List, Categorise) -> - do_partition(List, Categorise, [], []). - --spec permutations(list(AJC)) -> list(list(AJC)). -permutations(L) -> - case L of - [] -> - [[]]; - - _ -> - _pipe = L, - _pipe@5 = index_map(_pipe, fun(I_idx, I) -> _pipe@1 = L, - _pipe@2 = index_fold( - _pipe@1, - [], - fun(Acc, J, J_idx) -> case I_idx =:= J_idx of - true -> - Acc; - - false -> - [J | Acc] - end end - ), - _pipe@3 = reverse(_pipe@2), - _pipe@4 = permutations(_pipe@3), - map(_pipe@4, fun(Permutation) -> [I | Permutation] end) end), - concat(_pipe@5) - end. - --spec do_window(list(list(AJG)), list(AJG), integer()) -> list(list(AJG)). -do_window(Acc, L, N) -> - Window = take(L, N), - case length(Window) =:= N of - true -> - do_window([Window | Acc], drop(L, 1), N); - - false -> - Acc - end. - --spec window(list(AJM), integer()) -> list(list(AJM)). -window(L, N) -> - _pipe = do_window([], L, N), - reverse(_pipe). - --spec window_by_2(list(AJQ)) -> list({AJQ, AJQ}). -window_by_2(L) -> - zip(L, drop(L, 1)). - --spec drop_while(list(AJT), fun((AJT) -> boolean())) -> list(AJT). -drop_while(List, Predicate) -> - case List of - [] -> - []; - - [X | Xs] -> - case Predicate(X) of - true -> - drop_while(Xs, Predicate); - - false -> - [X | Xs] - end - end. - --spec do_take_while(list(AJW), fun((AJW) -> boolean()), list(AJW)) -> list(AJW). -do_take_while(List, Predicate, Acc) -> - case List of - [] -> - reverse(Acc); - - [First | Rest] -> - case Predicate(First) of - true -> - do_take_while(Rest, Predicate, [First | Acc]); - - false -> - reverse(Acc) - end - end. - --spec take_while(list(AKA), fun((AKA) -> boolean())) -> list(AKA). -take_while(List, Predicate) -> - do_take_while(List, Predicate, []). - --spec do_chunk(list(AKD), fun((AKD) -> AKF), AKF, list(AKD), list(list(AKD))) -> list(list(AKD)). -do_chunk(List, F, Previous_key, Current_chunk, Acc) -> - case List of - [First | Rest] -> - Key = F(First), - case Key =:= Previous_key of - false -> - New_acc = [reverse(Current_chunk) | Acc], - do_chunk(Rest, F, Key, [First], New_acc); - - _ -> - do_chunk(Rest, F, Key, [First | Current_chunk], Acc) - end; - - _ -> - reverse([reverse(Current_chunk) | Acc]) - end. - --spec chunk(list(AKL), fun((AKL) -> any())) -> list(list(AKL)). -chunk(List, F) -> - case List of - [] -> - []; - - [First | Rest] -> - do_chunk(Rest, F, F(First), [First], []) - end. - --spec do_sized_chunk( - list(AKQ), - integer(), - integer(), - list(AKQ), - list(list(AKQ)) -) -> list(list(AKQ)). -do_sized_chunk(List, Count, Left, Current_chunk, Acc) -> - case List of - [] -> - case Current_chunk of - [] -> - reverse(Acc); - - Remaining -> - reverse([reverse(Remaining) | Acc]) - end; - - [First | Rest] -> - Chunk = [First | Current_chunk], - case Left > 1 of - false -> - do_sized_chunk( - Rest, - Count, - Count, - [], - [reverse(Chunk) | Acc] - ); - - true -> - do_sized_chunk(Rest, Count, Left - 1, Chunk, Acc) - end - end. - --spec sized_chunk(list(AKX), integer()) -> list(list(AKX)). -sized_chunk(List, Count) -> - do_sized_chunk(List, Count, Count, [], []). - --spec reduce(list(ALB), fun((ALB, ALB) -> ALB)) -> {ok, ALB} | {error, nil}. -reduce(List, Fun) -> - case List of - [] -> - {error, nil}; - - [First | Rest] -> - {ok, fold(Rest, First, Fun)} - end. - --spec do_scan(list(ALF), ALH, list(ALH), fun((ALH, ALF) -> ALH)) -> list(ALH). -do_scan(List, Accumulator, Accumulated, Fun) -> - case List of - [] -> - reverse(Accumulated); - - [X | Xs] -> - Next = Fun(Accumulator, X), - do_scan(Xs, Next, [Next | Accumulated], Fun) - end. - --spec scan(list(ALK), ALM, fun((ALM, ALK) -> ALM)) -> list(ALM). -scan(List, Initial, Fun) -> - do_scan(List, Initial, [], Fun). - --spec last(list(ALO)) -> {ok, ALO} | {error, nil}. -last(List) -> - _pipe = List, - reduce(_pipe, fun(_, Elem) -> Elem end). - --spec combinations(list(ALS), integer()) -> list(list(ALS)). -combinations(Items, N) -> - case N of - 0 -> - [[]]; - - _ -> - case Items of - [] -> - []; - - [X | Xs] -> - First_combinations = begin - _pipe = map( - combinations(Xs, N - 1), - fun(Com) -> [X | Com] end - ), - reverse(_pipe) - end, - fold( - First_combinations, - combinations(Xs, N), - fun(Acc, C) -> [C | Acc] end - ) - end - end. - --spec do_combination_pairs(list(ALW)) -> list(list({ALW, ALW})). -do_combination_pairs(Items) -> - case Items of - [] -> - []; - - [X | Xs] -> - First_combinations = map(Xs, fun(Other) -> {X, Other} end), - [First_combinations | do_combination_pairs(Xs)] - end. - --spec combination_pairs(list(AMA)) -> list({AMA, AMA}). -combination_pairs(Items) -> - _pipe = do_combination_pairs(Items), - concat(_pipe). - --spec transpose(list(list(AMH))) -> list(list(AMH)). -transpose(List_of_list) -> - Take_first = fun(List) -> case List of - [] -> - []; - - [F] -> - [F]; - - [F@1 | _] -> - [F@1] - end end, - case List_of_list of - [] -> - []; - - [[] | Xss] -> - transpose(Xss); - - Rows -> - Firsts = begin - _pipe = Rows, - _pipe@1 = map(_pipe, Take_first), - concat(_pipe@1) - end, - Rest = transpose(map(Rows, fun(_capture) -> drop(_capture, 1) end)), - [Firsts | Rest] - end. - --spec interleave(list(list(AMD))) -> list(AMD). -interleave(List) -> - _pipe = transpose(List), - concat(_pipe). - --spec do_shuffle_pair_unwrap(list({float(), AMM}), list(AMM)) -> list(AMM). -do_shuffle_pair_unwrap(List, Acc) -> - case List of - [] -> - Acc; - - _ -> - [Elem_pair | Enumerable] = List, - do_shuffle_pair_unwrap( - Enumerable, - [erlang:element(2, Elem_pair) | Acc] - ) - end. - --spec do_shuffle_by_pair_indexes(list({float(), AMQ})) -> list({float(), AMQ}). -do_shuffle_by_pair_indexes(List_of_pairs) -> - sort( - List_of_pairs, - fun(A_pair, B_pair) -> - gleam@float:compare( - erlang:element(1, A_pair), - erlang:element(1, B_pair) - ) - end - ). - --spec shuffle(list(AMT)) -> list(AMT). -shuffle(List) -> - _pipe = List, - _pipe@1 = fold( - _pipe, - [], - fun(Acc, A) -> [{gleam@float:random(0.0, 1.0), A} | Acc] end - ), - _pipe@2 = do_shuffle_by_pair_indexes(_pipe@1), - do_shuffle_pair_unwrap(_pipe@2, []). diff --git a/build/dev/javascript/gleam_stdlib/gleam@map.erl b/build/dev/javascript/gleam_stdlib/gleam@map.erl deleted file mode 100644 index 2eeed8c..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@map.erl +++ /dev/null @@ -1,97 +0,0 @@ --module(gleam@map). --compile([no_auto_import, nowarn_unused_vars]). - --export([size/1, to_list/1, from_list/1, has_key/2, new/0, get/2, insert/3, map_values/2, keys/1, values/1, filter/2, take/2, merge/2, delete/2, drop/2, update/3, fold/3]). --export_type([map_/2]). - --type map_(LP, LQ) :: any() | {gleam_phantom, LP, LQ}. - --spec size(map_(any(), any())) -> integer(). -size(Map) -> - maps:size(Map). - --spec to_list(map_(LZ, MA)) -> list({LZ, MA}). -to_list(Map) -> - maps:to_list(Map). - --spec from_list(list({MJ, MK})) -> map_(MJ, MK). -from_list(List) -> - maps:from_list(List). - --spec has_key(map_(MT, any()), MT) -> boolean(). -has_key(Map, Key) -> - maps:is_key(Key, Map). - --spec new() -> map_(any(), any()). -new() -> - maps:new(). - --spec get(map_(NJ, NK), NJ) -> {ok, NK} | {error, nil}. -get(From, Get) -> - gleam_stdlib:map_get(From, Get). - --spec insert(map_(NV, NW), NV, NW) -> map_(NV, NW). -insert(Map, Key, Value) -> - maps:put(Key, Value, Map). - --spec map_values(map_(OH, OI), fun((OH, OI) -> OL)) -> map_(OH, OL). -map_values(Map, Fun) -> - maps:map(Fun, Map). - --spec keys(map_(OV, any())) -> list(OV). -keys(Map) -> - maps:keys(Map). - --spec values(map_(any(), PG)) -> list(PG). -values(Map) -> - maps:values(Map). - --spec filter(map_(PP, PQ), fun((PP, PQ) -> boolean())) -> map_(PP, PQ). -filter(Map, Property) -> - maps:filter(Property, Map). - --spec take(map_(QB, QC), list(QB)) -> map_(QB, QC). -take(Map, Desired_keys) -> - maps:with(Desired_keys, Map). - --spec merge(map_(QP, QQ), map_(QP, QQ)) -> map_(QP, QQ). -merge(Map, New_entries) -> - maps:merge(Map, New_entries). - --spec delete(map_(RF, RG), RF) -> map_(RF, RG). -delete(Map, Key) -> - maps:remove(Key, Map). - --spec drop(map_(RR, RS), list(RR)) -> map_(RR, RS). -drop(Map, Disallowed_keys) -> - case Disallowed_keys of - [] -> - Map; - - [X | Xs] -> - drop(delete(Map, X), Xs) - end. - --spec update(map_(RY, RZ), RY, fun((gleam@option:option(RZ)) -> RZ)) -> map_(RY, RZ). -update(Map, Key, Fun) -> - _pipe = Map, - _pipe@1 = get(_pipe, Key), - _pipe@2 = gleam@option:from_result(_pipe@1), - _pipe@3 = Fun(_pipe@2), - insert(Map, Key, _pipe@3). - --spec do_fold(list({SF, SG}), SI, fun((SI, SF, SG) -> SI)) -> SI. -do_fold(List, Initial, Fun) -> - case List of - [] -> - Initial; - - [{K, V} | Rest] -> - do_fold(Rest, Fun(Initial, K, V), Fun) - end. - --spec fold(map_(SJ, SK), SN, fun((SN, SJ, SK) -> SN)) -> SN. -fold(Map, Initial, Fun) -> - _pipe = Map, - _pipe@1 = to_list(_pipe), - do_fold(_pipe@1, Initial, Fun). diff --git a/build/dev/javascript/gleam_stdlib/gleam@option.erl b/build/dev/javascript/gleam_stdlib/gleam@option.erl deleted file mode 100644 index 80f6bed..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@option.erl +++ /dev/null @@ -1,147 +0,0 @@ --module(gleam@option). --compile([no_auto_import, nowarn_unused_vars]). - --export([all/1, is_some/1, is_none/1, to_result/2, from_result/1, unwrap/2, lazy_unwrap/2, map/2, flatten/1, then/2, 'or'/2, lazy_or/2, values/1]). --export_type([option/1]). - --type option(GY) :: {some, GY} | none. - --spec do_all(list(option(GZ)), list(GZ)) -> option(list(GZ)). -do_all(List, Acc) -> - case List of - [] -> - {some, Acc}; - - [X | Rest] -> - Accumulate = fun(Acc@1, Item) -> case {Acc@1, Item} of - {{some, Values}, {some, Value}} -> - {some, [Value | Values]}; - - {_, _} -> - none - end end, - Accumulate(do_all(Rest, Acc), X) - end. - --spec all(list(option(HF))) -> option(list(HF)). -all(List) -> - do_all(List, []). - --spec is_some(option(any())) -> boolean(). -is_some(Option) -> - Option /= none. - --spec is_none(option(any())) -> boolean(). -is_none(Option) -> - Option =:= none. - --spec to_result(option(HO), HR) -> {ok, HO} | {error, HR}. -to_result(Option, E) -> - case Option of - {some, A} -> - {ok, A}; - - _ -> - {error, E} - end. - --spec from_result({ok, HU} | {error, any()}) -> option(HU). -from_result(Result) -> - case Result of - {ok, A} -> - {some, A}; - - _ -> - none - end. - --spec unwrap(option(HZ), HZ) -> HZ. -unwrap(Option, Default) -> - case Option of - {some, X} -> - X; - - none -> - Default - end. - --spec lazy_unwrap(option(IB), fun(() -> IB)) -> IB. -lazy_unwrap(Option, Default) -> - case Option of - {some, X} -> - X; - - none -> - Default() - end. - --spec map(option(ID), fun((ID) -> IF)) -> option(IF). -map(Option, Fun) -> - case Option of - {some, X} -> - {some, Fun(X)}; - - none -> - none - end. - --spec flatten(option(option(IH))) -> option(IH). -flatten(Option) -> - case Option of - {some, X} -> - X; - - none -> - none - end. - --spec then(option(IL), fun((IL) -> option(IN))) -> option(IN). -then(Option, Fun) -> - case Option of - {some, X} -> - Fun(X); - - none -> - none - end. - --spec 'or'(option(IQ), option(IQ)) -> option(IQ). -'or'(First, Second) -> - case First of - {some, _} -> - First; - - none -> - Second - end. - --spec lazy_or(option(IU), fun(() -> option(IU))) -> option(IU). -lazy_or(First, Second) -> - case First of - {some, _} -> - First; - - none -> - Second() - end. - --spec do_values(list(option(IY)), list(IY)) -> list(IY). -do_values(List, Acc) -> - case List of - [] -> - Acc; - - [X | Xs] -> - Accumulate = fun(Acc@1, Item) -> case Item of - {some, Value} -> - [Value | Acc@1]; - - none -> - Acc@1 - end end, - Accumulate(do_values(Xs, Acc), X) - end. - --spec values(list(option(JD))) -> list(JD). -values(Options) -> - do_values(Options, []). diff --git a/build/dev/javascript/gleam_stdlib/gleam@order.erl b/build/dev/javascript/gleam_stdlib/gleam@order.erl deleted file mode 100644 index c6c2124..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@order.erl +++ /dev/null @@ -1,79 +0,0 @@ --module(gleam@order). --compile([no_auto_import, nowarn_unused_vars]). - --export([negate/1, to_int/1, compare/2, max/2, min/2, reverse/1]). --export_type([order/0]). - --type order() :: lt | eq | gt. - --spec negate(order()) -> order(). -negate(Order) -> - case Order of - lt -> - gt; - - eq -> - eq; - - gt -> - lt - end. - --spec to_int(order()) -> integer(). -to_int(Order) -> - case Order of - lt -> - -1; - - eq -> - 0; - - gt -> - 1 - end. - --spec compare(order(), order()) -> order(). -compare(A, B) -> - case {A, B} of - {X, Y} when X =:= Y -> - eq; - - {lt, _} -> - lt; - - {eq, gt} -> - lt; - - {_, _} -> - gt - end. - --spec max(order(), order()) -> order(). -max(A, B) -> - case {A, B} of - {gt, _} -> - gt; - - {eq, lt} -> - eq; - - {_, _} -> - B - end. - --spec min(order(), order()) -> order(). -min(A, B) -> - case {A, B} of - {lt, _} -> - lt; - - {eq, gt} -> - eq; - - {_, _} -> - B - end. - --spec reverse(fun((I, I) -> order())) -> fun((I, I) -> order()). -reverse(Orderer) -> - fun(A, B) -> Orderer(B, A) end. diff --git a/build/dev/javascript/gleam_stdlib/gleam@pair.erl b/build/dev/javascript/gleam_stdlib/gleam@pair.erl deleted file mode 100644 index 97f31b5..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@pair.erl +++ /dev/null @@ -1,33 +0,0 @@ --module(gleam@pair). --compile([no_auto_import, nowarn_unused_vars]). - --export([first/1, second/1, swap/1, map_first/2, map_second/2, new/2]). - --spec first({GJ, any()}) -> GJ. -first(Pair) -> - {A, _} = Pair, - A. - --spec second({any(), GM}) -> GM. -second(Pair) -> - {_, A} = Pair, - A. - --spec swap({GN, GO}) -> {GO, GN}. -swap(Pair) -> - {A, B} = Pair, - {B, A}. - --spec map_first({GP, GQ}, fun((GP) -> GR)) -> {GR, GQ}. -map_first(Pair, Fun) -> - {A, B} = Pair, - {Fun(A), B}. - --spec map_second({GS, GT}, fun((GT) -> GU)) -> {GS, GU}. -map_second(Pair, Fun) -> - {A, B} = Pair, - {A, Fun(B)}. - --spec new(GV, GW) -> {GV, GW}. -new(First, Second) -> - {First, Second}. diff --git a/build/dev/javascript/gleam_stdlib/gleam@queue.erl b/build/dev/javascript/gleam_stdlib/gleam@queue.erl deleted file mode 100644 index 3e45e4d..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@queue.erl +++ /dev/null @@ -1,121 +0,0 @@ --module(gleam@queue). --compile([no_auto_import, nowarn_unused_vars]). - --export([new/0, from_list/1, to_list/1, is_empty/1, length/1, push_back/2, push_front/2, pop_back/1, pop_front/1, reverse/1, is_logically_equal/3, is_equal/2]). --export_type([queue/1]). - --opaque queue(EIY) :: {queue, list(EIY), list(EIY)}. - --spec new() -> queue(any()). -new() -> - {queue, [], []}. - --spec from_list(list(EJB)) -> queue(EJB). -from_list(List) -> - {queue, [], List}. - --spec to_list(queue(EJE)) -> list(EJE). -to_list(Queue) -> - _pipe = erlang:element(3, Queue), - gleam@list:append(_pipe, gleam@list:reverse(erlang:element(2, Queue))). - --spec is_empty(queue(any())) -> boolean(). -is_empty(Queue) -> - (erlang:element(2, Queue) =:= []) andalso (erlang:element(3, Queue) =:= []). - --spec length(queue(any())) -> integer(). -length(Queue) -> - gleam@list:length(erlang:element(2, Queue)) + gleam@list:length( - erlang:element(3, Queue) - ). - --spec push_back(queue(EJL), EJL) -> queue(EJL). -push_back(Queue, Item) -> - {queue, [Item | erlang:element(2, Queue)], erlang:element(3, Queue)}. - --spec push_front(queue(EJO), EJO) -> queue(EJO). -push_front(Queue, Item) -> - {queue, erlang:element(2, Queue), [Item | erlang:element(3, Queue)]}. - --spec pop_back(queue(EJR)) -> {ok, {EJR, queue(EJR)}} | {error, nil}. -pop_back(Queue) -> - case Queue of - {queue, [], []} -> - {error, nil}; - - {queue, [], Out} -> - pop_back({queue, gleam@list:reverse(Out), []}); - - {queue, [First | Rest], Out@1} -> - Queue@1 = {queue, Rest, Out@1}, - {ok, {First, Queue@1}} - end. - --spec pop_front(queue(EJW)) -> {ok, {EJW, queue(EJW)}} | {error, nil}. -pop_front(Queue) -> - case Queue of - {queue, [], []} -> - {error, nil}; - - {queue, In, []} -> - pop_front({queue, [], gleam@list:reverse(In)}); - - {queue, In@1, [First | Rest]} -> - Queue@1 = {queue, In@1, Rest}, - {ok, {First, Queue@1}} - end. - --spec reverse(queue(EKB)) -> queue(EKB). -reverse(Queue) -> - {queue, erlang:element(3, Queue), erlang:element(2, Queue)}. - --spec check_equal( - list(EKE), - list(EKE), - list(EKE), - list(EKE), - fun((EKE, EKE) -> boolean()) -) -> boolean(). -check_equal(Xs, X_tail, Ys, Y_tail, Eq) -> - case {Xs, X_tail, Ys, Y_tail} of - {[], [], [], []} -> - true; - - {[X | Xs@1], _, [Y | Ys@1], _} -> - case Eq(X, Y) of - false -> - false; - - true -> - check_equal(Xs@1, X_tail, Ys@1, Y_tail, Eq) - end; - - {[], [_ | _], _, _} -> - check_equal(gleam@list:reverse(X_tail), [], Ys, Y_tail, Eq); - - {_, _, [], [_ | _]} -> - check_equal(Xs, X_tail, gleam@list:reverse(Y_tail), [], Eq); - - {_, _, _, _} -> - false - end. - --spec is_logically_equal(queue(EKJ), queue(EKJ), fun((EKJ, EKJ) -> boolean())) -> boolean(). -is_logically_equal(A, B, Element_is_equal) -> - check_equal( - erlang:element(3, A), - erlang:element(2, A), - erlang:element(3, B), - erlang:element(2, B), - Element_is_equal - ). - --spec is_equal(queue(EKM), queue(EKM)) -> boolean(). -is_equal(A, B) -> - check_equal( - erlang:element(3, A), - erlang:element(2, A), - erlang:element(3, B), - erlang:element(2, B), - fun(A@1, B@1) -> A@1 =:= B@1 end - ). diff --git a/build/dev/javascript/gleam_stdlib/gleam@regex.erl b/build/dev/javascript/gleam_stdlib/gleam@regex.erl deleted file mode 100644 index 03063c9..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@regex.erl +++ /dev/null @@ -1,33 +0,0 @@ --module(gleam@regex). --compile([no_auto_import, nowarn_unused_vars]). - --export([compile/2, from_string/1, check/2, split/2, scan/2]). --export_type([regex/0, match/0, compile_error/0, options/0]). - --type regex() :: any(). - --type match() :: {match, binary(), list(gleam@option:option(binary()))}. - --type compile_error() :: {compile_error, binary(), integer()}. - --type options() :: {options, boolean(), boolean()}. - --spec compile(binary(), options()) -> {ok, regex()} | {error, compile_error()}. -compile(Pattern, Options) -> - gleam_stdlib:compile_regex(Pattern, Options). - --spec from_string(binary()) -> {ok, regex()} | {error, compile_error()}. -from_string(Pattern) -> - compile(Pattern, {options, false, false}). - --spec check(regex(), binary()) -> boolean(). -check(Regex, Content) -> - gleam_stdlib:regex_check(Regex, Content). - --spec split(regex(), binary()) -> list(binary()). -split(Regex, String) -> - gleam_stdlib:regex_split(Regex, String). - --spec scan(regex(), binary()) -> list(match()). -scan(Regex, String) -> - gleam_stdlib:regex_scan(Regex, String). diff --git a/build/dev/javascript/gleam_stdlib/gleam@result.erl b/build/dev/javascript/gleam_stdlib/gleam@result.erl deleted file mode 100644 index 9826d99..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@result.erl +++ /dev/null @@ -1,201 +0,0 @@ --module(gleam@result). --compile([no_auto_import, nowarn_unused_vars]). - --export([is_ok/1, is_error/1, map/2, map_error/2, flatten/1, 'try'/2, then/2, unwrap/2, lazy_unwrap/2, unwrap_error/2, unwrap_both/1, nil_error/1, 'or'/2, lazy_or/2, all/1, partition/1, replace/2, replace_error/2, values/1, try_recover/2]). - --spec is_ok({ok, any()} | {error, any()}) -> boolean(). -is_ok(Result) -> - case Result of - {error, _} -> - false; - - {ok, _} -> - true - end. - --spec is_error({ok, any()} | {error, any()}) -> boolean(). -is_error(Result) -> - case Result of - {ok, _} -> - false; - - {error, _} -> - true - end. - --spec map({ok, BGE} | {error, BGF}, fun((BGE) -> BGI)) -> {ok, BGI} | - {error, BGF}. -map(Result, Fun) -> - case Result of - {ok, X} -> - {ok, Fun(X)}; - - {error, E} -> - {error, E} - end. - --spec map_error({ok, BGL} | {error, BGM}, fun((BGM) -> BGP)) -> {ok, BGL} | - {error, BGP}. -map_error(Result, Fun) -> - case Result of - {ok, X} -> - {ok, X}; - - {error, Error} -> - {error, Fun(Error)} - end. - --spec flatten({ok, {ok, BGS} | {error, BGT}} | {error, BGT}) -> {ok, BGS} | - {error, BGT}. -flatten(Result) -> - case Result of - {ok, X} -> - X; - - {error, Error} -> - {error, Error} - end. - --spec 'try'({ok, BHA} | {error, BHB}, fun((BHA) -> {ok, BHE} | {error, BHB})) -> {ok, - BHE} | - {error, BHB}. -'try'(Result, Fun) -> - case Result of - {ok, X} -> - Fun(X); - - {error, E} -> - {error, E} - end. - --spec then({ok, BHJ} | {error, BHK}, fun((BHJ) -> {ok, BHN} | {error, BHK})) -> {ok, - BHN} | - {error, BHK}. -then(Result, Fun) -> - 'try'(Result, Fun). - --spec unwrap({ok, BHS} | {error, any()}, BHS) -> BHS. -unwrap(Result, Default) -> - case Result of - {ok, V} -> - V; - - {error, _} -> - Default - end. - --spec lazy_unwrap({ok, BHW} | {error, any()}, fun(() -> BHW)) -> BHW. -lazy_unwrap(Result, Default) -> - case Result of - {ok, V} -> - V; - - {error, _} -> - Default() - end. - --spec unwrap_error({ok, any()} | {error, BIB}, BIB) -> BIB. -unwrap_error(Result, Default) -> - case Result of - {ok, _} -> - Default; - - {error, E} -> - E - end. - --spec unwrap_both({ok, BIE} | {error, BIE}) -> BIE. -unwrap_both(Result) -> - case Result of - {ok, A} -> - A; - - {error, A@1} -> - A@1 - end. - --spec nil_error({ok, BIH} | {error, any()}) -> {ok, BIH} | {error, nil}. -nil_error(Result) -> - map_error(Result, fun(_) -> nil end). - --spec 'or'({ok, BIN} | {error, BIO}, {ok, BIN} | {error, BIO}) -> {ok, BIN} | - {error, BIO}. -'or'(First, Second) -> - case First of - {ok, _} -> - First; - - {error, _} -> - Second - end. - --spec lazy_or({ok, BIV} | {error, BIW}, fun(() -> {ok, BIV} | {error, BIW})) -> {ok, - BIV} | - {error, BIW}. -lazy_or(First, Second) -> - case First of - {ok, _} -> - First; - - {error, _} -> - Second() - end. - --spec all(list({ok, BJD} | {error, BJE})) -> {ok, list(BJD)} | {error, BJE}. -all(Results) -> - gleam@list:try_map(Results, fun(X) -> X end). - --spec do_partition(list({ok, BJS} | {error, BJT}), list(BJS), list(BJT)) -> {list(BJS), - list(BJT)}. -do_partition(Results, Oks, Errors) -> - case Results of - [] -> - {Oks, Errors}; - - [{ok, A} | Rest] -> - do_partition(Rest, [A | Oks], Errors); - - [{error, E} | Rest@1] -> - do_partition(Rest@1, Oks, [E | Errors]) - end. - --spec partition(list({ok, BJL} | {error, BJM})) -> {list(BJL), list(BJM)}. -partition(Results) -> - do_partition(Results, [], []). - --spec replace({ok, any()} | {error, BKB}, BKE) -> {ok, BKE} | {error, BKB}. -replace(Result, Value) -> - case Result of - {ok, _} -> - {ok, Value}; - - {error, Error} -> - {error, Error} - end. - --spec replace_error({ok, BKH} | {error, any()}, BKL) -> {ok, BKH} | {error, BKL}. -replace_error(Result, Error) -> - case Result of - {ok, X} -> - {ok, X}; - - {error, _} -> - {error, Error} - end. - --spec values(list({ok, BKO} | {error, any()})) -> list(BKO). -values(Results) -> - gleam@list:filter_map(Results, fun(R) -> R end). - --spec try_recover( - {ok, BKU} | {error, BKV}, - fun((BKV) -> {ok, BKU} | {error, BKY}) -) -> {ok, BKU} | {error, BKY}. -try_recover(Result, Fun) -> - case Result of - {ok, Value} -> - {ok, Value}; - - {error, Error} -> - Fun(Error) - end. diff --git a/build/dev/javascript/gleam_stdlib/gleam@set.erl b/build/dev/javascript/gleam_stdlib/gleam@set.erl deleted file mode 100644 index b07cea7..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@set.erl +++ /dev/null @@ -1,85 +0,0 @@ --module(gleam@set). --compile([no_auto_import, nowarn_unused_vars]). - --export([new/0, size/1, insert/2, contains/2, delete/2, to_list/1, from_list/1, fold/3, filter/2, drop/2, take/2, union/2, intersection/2]). --export_type([set/1]). - --opaque set(EWZ) :: {set, gleam@map:map_(EWZ, list(nil))}. - --spec new() -> set(any()). -new() -> - {set, gleam@map:new()}. - --spec size(set(any())) -> integer(). -size(Set) -> - gleam@map:size(erlang:element(2, Set)). - --spec insert(set(EXF), EXF) -> set(EXF). -insert(Set, Member) -> - {set, gleam@map:insert(erlang:element(2, Set), Member, [])}. - --spec contains(set(EXI), EXI) -> boolean(). -contains(Set, Member) -> - _pipe = erlang:element(2, Set), - _pipe@1 = gleam@map:get(_pipe, Member), - gleam@result:is_ok(_pipe@1). - --spec delete(set(EXK), EXK) -> set(EXK). -delete(Set, Member) -> - {set, gleam@map:delete(erlang:element(2, Set), Member)}. - --spec to_list(set(EXN)) -> list(EXN). -to_list(Set) -> - gleam@map:keys(erlang:element(2, Set)). - --spec from_list(list(EXQ)) -> set(EXQ). -from_list(Members) -> - Map = gleam@list:fold( - Members, - gleam@map:new(), - fun(M, K) -> gleam@map:insert(M, K, []) end - ), - {set, Map}. - --spec fold(set(EXT), EXV, fun((EXV, EXT) -> EXV)) -> EXV. -fold(Set, Initial, Reducer) -> - gleam@map:fold( - erlang:element(2, Set), - Initial, - fun(A, K, _) -> Reducer(A, K) end - ). - --spec filter(set(EXW), fun((EXW) -> boolean())) -> set(EXW). -filter(Set, Property) -> - {set, - gleam@map:filter(erlang:element(2, Set), fun(M, _) -> Property(M) end)}. - --spec drop(set(EXZ), list(EXZ)) -> set(EXZ). -drop(Set, Disallowed) -> - gleam@list:fold(Disallowed, Set, fun delete/2). - --spec take(set(EYD), list(EYD)) -> set(EYD). -take(Set, Desired) -> - {set, gleam@map:take(erlang:element(2, Set), Desired)}. - --spec order(set(EYH), set(EYH)) -> {set(EYH), set(EYH)}. -order(First, Second) -> - case gleam@map:size(erlang:element(2, First)) > gleam@map:size( - erlang:element(2, Second) - ) of - true -> - {First, Second}; - - false -> - {Second, First} - end. - --spec union(set(EYM), set(EYM)) -> set(EYM). -union(First, Second) -> - {Larger, Smaller} = order(First, Second), - fold(Smaller, Larger, fun insert/2). - --spec intersection(set(EYQ), set(EYQ)) -> set(EYQ). -intersection(First, Second) -> - {Larger, Smaller} = order(First, Second), - take(Larger, to_list(Smaller)). diff --git a/build/dev/javascript/gleam_stdlib/gleam@string.erl b/build/dev/javascript/gleam_stdlib/gleam@string.erl deleted file mode 100644 index f3dcc69..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@string.erl +++ /dev/null @@ -1,397 +0,0 @@ --module(gleam@string). --compile([no_auto_import, nowarn_unused_vars]). - --export([is_empty/1, length/1, reverse/1, replace/3, lowercase/1, uppercase/1, compare/2, slice/3, crop/2, drop_left/2, drop_right/2, contains/2, starts_with/2, ends_with/2, split_once/2, append/2, concat/1, repeat/2, join/2, pad_left/3, pad_right/3, trim/1, trim_left/1, trim_right/1, pop_grapheme/1, to_graphemes/1, split/2, to_utf_codepoints/1, from_utf_codepoints/1, utf_codepoint/1, utf_codepoint_to_int/1, to_option/1, first/1, last/1, capitalise/1, inspect/1, byte_size/1]). --export_type([direction/0]). - --type direction() :: leading | trailing | both. - --spec is_empty(binary()) -> boolean(). -is_empty(Str) -> - Str =:= <<""/utf8>>. - --spec length(binary()) -> integer(). -length(String) -> - string:length(String). - --spec do_reverse(binary()) -> binary(). -do_reverse(String) -> - _pipe = String, - _pipe@1 = gleam@string_builder:from_string(_pipe), - _pipe@2 = gleam@string_builder:reverse(_pipe@1), - gleam@string_builder:to_string(_pipe@2). - --spec reverse(binary()) -> binary(). -reverse(String) -> - do_reverse(String). - --spec replace(binary(), binary(), binary()) -> binary(). -replace(String, Pattern, Substitute) -> - _pipe = String, - _pipe@1 = gleam@string_builder:from_string(_pipe), - _pipe@2 = gleam@string_builder:replace(_pipe@1, Pattern, Substitute), - gleam@string_builder:to_string(_pipe@2). - --spec lowercase(binary()) -> binary(). -lowercase(String) -> - string:lowercase(String). - --spec uppercase(binary()) -> binary(). -uppercase(String) -> - string:uppercase(String). - --spec compare(binary(), binary()) -> gleam@order:order(). -compare(A, B) -> - case A =:= B of - true -> - eq; - - _ -> - case gleam_stdlib:less_than(A, B) of - true -> - lt; - - _ -> - gt - end - end. - --spec slice(binary(), integer(), integer()) -> binary(). -slice(String, Idx, Len) -> - case Len < 0 of - true -> - <<""/utf8>>; - - false -> - case Idx < 0 of - true -> - Translated_idx = length(String) + Idx, - case Translated_idx < 0 of - true -> - <<""/utf8>>; - - false -> - string:slice(String, Translated_idx, Len) - end; - - false -> - string:slice(String, Idx, Len) - end - end. - --spec do_crop(binary(), binary()) -> binary(). -do_crop(String, Substring) -> - _pipe = String, - _pipe@1 = string:find(_pipe, Substring), - _pipe@2 = gleam@dynamic:string(_pipe@1), - gleam@result:unwrap(_pipe@2, String). - --spec crop(binary(), binary()) -> binary(). -crop(String, Substring) -> - do_crop(String, Substring). - --spec drop_left(binary(), integer()) -> binary(). -drop_left(String, Num_graphemes) -> - case Num_graphemes < 0 of - true -> - String; - - false -> - slice(String, Num_graphemes, length(String) - Num_graphemes) - end. - --spec drop_right(binary(), integer()) -> binary(). -drop_right(String, Num_graphemes) -> - case Num_graphemes < 0 of - true -> - String; - - false -> - slice(String, 0, length(String) - Num_graphemes) - end. - --spec do_contains(binary(), binary()) -> boolean(). -do_contains(Haystack, Needle) -> - _pipe = Haystack, - _pipe@1 = string:find(_pipe, Needle), - _pipe@2 = gleam@dynamic:bit_string(_pipe@1), - gleam@result:is_ok(_pipe@2). - --spec contains(binary(), binary()) -> boolean(). -contains(Haystack, Needle) -> - do_contains(Haystack, Needle). - --spec starts_with(binary(), binary()) -> boolean(). -starts_with(String, Prefix) -> - gleam_stdlib:string_starts_with(String, Prefix). - --spec ends_with(binary(), binary()) -> boolean(). -ends_with(String, Suffix) -> - gleam_stdlib:string_ends_with(String, Suffix). - --spec do_split_once(binary(), binary()) -> {ok, {binary(), binary()}} | - {error, nil}. -do_split_once(X, Substring) -> - case string:split(X, Substring) of - [First, Rest] -> - {ok, {First, Rest}}; - - _ -> - {error, nil} - end. - --spec split_once(binary(), binary()) -> {ok, {binary(), binary()}} | - {error, nil}. -split_once(X, Substring) -> - do_split_once(X, Substring). - --spec append(binary(), binary()) -> binary(). -append(First, Second) -> - _pipe = First, - _pipe@1 = gleam@string_builder:from_string(_pipe), - _pipe@2 = gleam@string_builder:append(_pipe@1, Second), - gleam@string_builder:to_string(_pipe@2). - --spec concat(list(binary())) -> binary(). -concat(Strings) -> - _pipe = Strings, - _pipe@1 = gleam@string_builder:from_strings(_pipe), - gleam@string_builder:to_string(_pipe@1). - --spec repeat(binary(), integer()) -> binary(). -repeat(String, Times) -> - _pipe = gleam@iterator:repeat(String), - _pipe@1 = gleam@iterator:take(_pipe, Times), - _pipe@2 = gleam@iterator:to_list(_pipe@1), - concat(_pipe@2). - --spec do_join(list(binary()), binary()) -> binary(). -do_join(Strings, Separator) -> - _pipe = Strings, - _pipe@1 = gleam@list:intersperse(_pipe, Separator), - concat(_pipe@1). - --spec join(list(binary()), binary()) -> binary(). -join(Strings, Separator) -> - do_join(Strings, Separator). - --spec padding(integer(), binary()) -> gleam@iterator:iterator(binary()). -padding(Size, Pad_string) -> - Pad_length = length(Pad_string), - Num_pads = case Pad_length of - 0 -> 0; - Gleam@denominator -> Size div Gleam@denominator - end, - Extra = case Pad_length of - 0 -> 0; - Gleam@denominator@1 -> Size rem Gleam@denominator@1 - end, - _pipe = gleam@iterator:repeat(Pad_string), - _pipe@1 = gleam@iterator:take(_pipe, Num_pads), - gleam@iterator:append( - _pipe@1, - gleam@iterator:single(slice(Pad_string, 0, Extra)) - ). - --spec pad_left(binary(), integer(), binary()) -> binary(). -pad_left(String, Desired_length, Pad_string) -> - Current_length = length(String), - To_pad_length = Desired_length - Current_length, - _pipe = padding(To_pad_length, Pad_string), - _pipe@1 = gleam@iterator:append(_pipe, gleam@iterator:single(String)), - _pipe@2 = gleam@iterator:to_list(_pipe@1), - concat(_pipe@2). - --spec pad_right(binary(), integer(), binary()) -> binary(). -pad_right(String, Desired_length, Pad_string) -> - Current_length = length(String), - To_pad_length = Desired_length - Current_length, - _pipe = gleam@iterator:single(String), - _pipe@1 = gleam@iterator:append(_pipe, padding(To_pad_length, Pad_string)), - _pipe@2 = gleam@iterator:to_list(_pipe@1), - concat(_pipe@2). - --spec do_trim(binary()) -> binary(). -do_trim(String) -> - string:trim(String, both). - --spec trim(binary()) -> binary(). -trim(String) -> - do_trim(String). - --spec do_trim_left(binary()) -> binary(). -do_trim_left(String) -> - string:trim(String, leading). - --spec trim_left(binary()) -> binary(). -trim_left(String) -> - do_trim_left(String). - --spec do_trim_right(binary()) -> binary(). -do_trim_right(String) -> - string:trim(String, trailing). - --spec trim_right(binary()) -> binary(). -trim_right(String) -> - do_trim_right(String). - --spec pop_grapheme(binary()) -> {ok, {binary(), binary()}} | {error, nil}. -pop_grapheme(String) -> - gleam_stdlib:string_pop_grapheme(String). - --spec do_to_graphemes(binary(), list(binary())) -> list(binary()). -do_to_graphemes(String, Acc) -> - case pop_grapheme(String) of - {ok, {Grapheme, Rest}} -> - do_to_graphemes(Rest, [Grapheme | Acc]); - - _ -> - Acc - end. - --spec to_graphemes(binary()) -> list(binary()). -to_graphemes(String) -> - _pipe = do_to_graphemes(String, []), - gleam@list:reverse(_pipe). - --spec split(binary(), binary()) -> list(binary()). -split(X, Substring) -> - case Substring of - <<""/utf8>> -> - to_graphemes(X); - - _ -> - _pipe = X, - _pipe@1 = gleam@string_builder:from_string(_pipe), - _pipe@2 = gleam@string_builder:split(_pipe@1, Substring), - gleam@list:map(_pipe@2, fun gleam@string_builder:to_string/1) - end. - --spec do_to_utf_codepoints_impl(bitstring(), list(integer())) -> list(integer()). -do_to_utf_codepoints_impl(Bit_string, Acc) -> - case Bit_string of - <> -> - do_to_utf_codepoints_impl(Rest, [First | Acc]); - - <<>> -> - Acc - end. - --spec do_to_utf_codepoints(binary()) -> list(integer()). -do_to_utf_codepoints(String) -> - _pipe = do_to_utf_codepoints_impl(gleam@bit_string:from_string(String), []), - gleam@list:reverse(_pipe). - --spec to_utf_codepoints(binary()) -> list(integer()). -to_utf_codepoints(String) -> - do_to_utf_codepoints(String). - --spec do_from_utf_codepoints_impl(list(integer()), bitstring()) -> bitstring(). -do_from_utf_codepoints_impl(Utf_codepoints, Acc) -> - case Utf_codepoints of - [First | Rest] -> - do_from_utf_codepoints_impl(Rest, <>); - - [] -> - Acc - end. - --spec do_from_utf_codepoints(list(integer())) -> binary(). -do_from_utf_codepoints(Utf_codepoints) -> - _assert_subject = begin - _pipe = do_from_utf_codepoints_impl( - Utf_codepoints, - gleam@bit_string:from_string(<<""/utf8>>) - ), - gleam@bit_string:to_string(_pipe) - end, - {ok, String} = case _assert_subject of - {ok, _} -> _assert_subject; - _assert_fail -> - erlang:error(#{gleam_error => let_assert, - message => <<"Assertion pattern match failed"/utf8>>, - value => _assert_fail, - module => <<"gleam/string"/utf8>>, - function => <<"do_from_utf_codepoints"/utf8>>, - line => 807}) - end, - String. - --spec from_utf_codepoints(list(integer())) -> binary(). -from_utf_codepoints(Utf_codepoints) -> - do_from_utf_codepoints(Utf_codepoints). - --spec utf_codepoint(integer()) -> {ok, integer()} | {error, nil}. -utf_codepoint(Value) -> - case Value of - I when I > 1114111 -> - {error, nil}; - - 65534 -> - {error, nil}; - - 65535 -> - {error, nil}; - - I@1 when (I@1 >= 55296) andalso (I@1 =< 57343) -> - {error, nil}; - - I@2 -> - {ok, gleam_stdlib:identity(I@2)} - end. - --spec utf_codepoint_to_int(integer()) -> integer(). -utf_codepoint_to_int(Cp) -> - gleam_stdlib:identity(Cp). - --spec to_option(binary()) -> gleam@option:option(binary()). -to_option(S) -> - case S of - <<""/utf8>> -> - none; - - _ -> - {some, S} - end. - --spec first(binary()) -> {ok, binary()} | {error, nil}. -first(S) -> - case pop_grapheme(S) of - {ok, {First, _}} -> - {ok, First}; - - {error, E} -> - {error, E} - end. - --spec last(binary()) -> {ok, binary()} | {error, nil}. -last(S) -> - case pop_grapheme(S) of - {ok, {First, <<""/utf8>>}} -> - {ok, First}; - - {ok, {_, Rest}} -> - {ok, slice(Rest, -1, 1)}; - - {error, E} -> - {error, E} - end. - --spec capitalise(binary()) -> binary(). -capitalise(S) -> - case pop_grapheme(S) of - {ok, {First, Rest}} -> - append(uppercase(First), lowercase(Rest)); - - _ -> - <<""/utf8>> - end. - --spec inspect(any()) -> binary(). -inspect(Term) -> - _pipe = gleam_stdlib:inspect(Term), - gleam@string_builder:to_string(_pipe). - --spec byte_size(binary()) -> integer(). -byte_size(String) -> - erlang:byte_size(String). diff --git a/build/dev/javascript/gleam_stdlib/gleam@string_builder.erl b/build/dev/javascript/gleam_stdlib/gleam@string_builder.erl deleted file mode 100644 index c2ace3b..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@string_builder.erl +++ /dev/null @@ -1,91 +0,0 @@ --module(gleam@string_builder). --compile([no_auto_import, nowarn_unused_vars]). - --export([prepend_builder/2, append_builder/2, new/0, from_strings/1, concat/1, from_string/1, prepend/2, append/2, to_string/1, byte_size/1, join/2, lowercase/1, uppercase/1, reverse/1, split/2, replace/3, is_equal/2, is_empty/1]). --export_type([string_builder/0, direction/0]). - --type string_builder() :: any(). - --type direction() :: all. - --spec prepend_builder(string_builder(), string_builder()) -> string_builder(). -prepend_builder(Builder, Prefix) -> - gleam_stdlib:iodata_append(Prefix, Builder). - --spec append_builder(string_builder(), string_builder()) -> string_builder(). -append_builder(Builder, Suffix) -> - gleam_stdlib:iodata_append(Builder, Suffix). - --spec new() -> string_builder(). -new() -> - gleam_stdlib:identity([]). - --spec from_strings(list(binary())) -> string_builder(). -from_strings(Strings) -> - gleam_stdlib:identity(Strings). - --spec concat(list(string_builder())) -> string_builder(). -concat(Builders) -> - gleam_stdlib:identity(Builders). - --spec from_string(binary()) -> string_builder(). -from_string(String) -> - gleam_stdlib:identity(String). - --spec prepend(string_builder(), binary()) -> string_builder(). -prepend(Builder, Prefix) -> - append_builder(from_string(Prefix), Builder). - --spec append(string_builder(), binary()) -> string_builder(). -append(Builder, Second) -> - append_builder(Builder, from_string(Second)). - --spec to_string(string_builder()) -> binary(). -to_string(Builder) -> - unicode:characters_to_binary(Builder). - --spec byte_size(string_builder()) -> integer(). -byte_size(Builder) -> - erlang:iolist_size(Builder). - --spec join(list(string_builder()), binary()) -> string_builder(). -join(Builders, Sep) -> - _pipe = Builders, - _pipe@1 = gleam@list:intersperse(_pipe, from_string(Sep)), - concat(_pipe@1). - --spec lowercase(string_builder()) -> string_builder(). -lowercase(Builder) -> - string:lowercase(Builder). - --spec uppercase(string_builder()) -> string_builder(). -uppercase(Builder) -> - string:uppercase(Builder). - --spec reverse(string_builder()) -> string_builder(). -reverse(Builder) -> - string:reverse(Builder). - --spec do_split(string_builder(), binary()) -> list(string_builder()). -do_split(Iodata, Pattern) -> - string:split(Iodata, Pattern, all). - --spec split(string_builder(), binary()) -> list(string_builder()). -split(Iodata, Pattern) -> - do_split(Iodata, Pattern). - --spec do_replace(string_builder(), binary(), binary()) -> string_builder(). -do_replace(Iodata, Pattern, Substitute) -> - string:replace(Iodata, Pattern, Substitute, all). - --spec replace(string_builder(), binary(), binary()) -> string_builder(). -replace(Builder, Pattern, Substitute) -> - do_replace(Builder, Pattern, Substitute). - --spec is_equal(string_builder(), string_builder()) -> boolean(). -is_equal(A, B) -> - string:equal(A, B). - --spec is_empty(string_builder()) -> boolean(). -is_empty(Builder) -> - string:is_empty(Builder). diff --git a/build/dev/javascript/gleam_stdlib/gleam@uri.erl b/build/dev/javascript/gleam_stdlib/gleam@uri.erl deleted file mode 100644 index ee6ba74..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam@uri.erl +++ /dev/null @@ -1,255 +0,0 @@ --module(gleam@uri). --compile([no_auto_import, nowarn_unused_vars]). - --export([parse/1, parse_query/1, percent_encode/1, query_to_string/1, percent_decode/1, path_segments/1, to_string/1, origin/1, merge/2]). --export_type([uri/0]). - --type uri() :: {uri, - gleam@option:option(binary()), - gleam@option:option(binary()), - gleam@option:option(binary()), - gleam@option:option(integer()), - binary(), - gleam@option:option(binary()), - gleam@option:option(binary())}. - --spec parse(binary()) -> {ok, uri()} | {error, nil}. -parse(Uri_string) -> - gleam_stdlib:uri_parse(Uri_string). - --spec parse_query(binary()) -> {ok, list({binary(), binary()})} | {error, nil}. -parse_query(Query) -> - gleam_stdlib:parse_query(Query). - --spec percent_encode(binary()) -> binary(). -percent_encode(Value) -> - gleam_stdlib:percent_encode(Value). - --spec query_pair({binary(), binary()}) -> gleam@string_builder:string_builder(). -query_pair(Pair) -> - gleam@string_builder:from_strings( - [percent_encode(erlang:element(1, Pair)), - <<"="/utf8>>, - percent_encode(erlang:element(2, Pair))] - ). - --spec query_to_string(list({binary(), binary()})) -> binary(). -query_to_string(Query) -> - _pipe = Query, - _pipe@1 = gleam@list:map(_pipe, fun query_pair/1), - _pipe@2 = gleam@list:intersperse( - _pipe@1, - gleam@string_builder:from_string(<<"&"/utf8>>) - ), - _pipe@3 = gleam@string_builder:concat(_pipe@2), - gleam@string_builder:to_string(_pipe@3). - --spec percent_decode(binary()) -> {ok, binary()} | {error, nil}. -percent_decode(Value) -> - gleam_stdlib:percent_decode(Value). - --spec do_remove_dot_segments(list(binary()), list(binary())) -> list(binary()). -do_remove_dot_segments(Input, Accumulator) -> - case Input of - [] -> - gleam@list:reverse(Accumulator); - - [Segment | Rest] -> - Accumulator@5 = case {Segment, Accumulator} of - {<<""/utf8>>, Accumulator@1} -> - Accumulator@1; - - {<<"."/utf8>>, Accumulator@2} -> - Accumulator@2; - - {<<".."/utf8>>, []} -> - []; - - {<<".."/utf8>>, [_ | Accumulator@3]} -> - Accumulator@3; - - {Segment@1, Accumulator@4} -> - [Segment@1 | Accumulator@4] - end, - do_remove_dot_segments(Rest, Accumulator@5) - end. - --spec remove_dot_segments(list(binary())) -> list(binary()). -remove_dot_segments(Input) -> - do_remove_dot_segments(Input, []). - --spec path_segments(binary()) -> list(binary()). -path_segments(Path) -> - remove_dot_segments(gleam@string:split(Path, <<"/"/utf8>>)). - --spec to_string(uri()) -> binary(). -to_string(Uri) -> - Parts = case erlang:element(8, Uri) of - {some, Fragment} -> - [<<"#"/utf8>>, Fragment]; - - _ -> - [] - end, - Parts@1 = case erlang:element(7, Uri) of - {some, Query} -> - [<<"?"/utf8>>, Query | Parts]; - - _ -> - Parts - end, - Parts@2 = [erlang:element(6, Uri) | Parts@1], - Parts@3 = case {erlang:element(4, Uri), - gleam@string:starts_with(erlang:element(6, Uri), <<"/"/utf8>>)} of - {{some, Host}, false} when Host =/= <<""/utf8>> -> - [<<"/"/utf8>> | Parts@2]; - - {_, _} -> - Parts@2 - end, - Parts@4 = case {erlang:element(4, Uri), erlang:element(5, Uri)} of - {{some, _}, {some, Port}} -> - [<<":"/utf8>>, gleam@int:to_string(Port) | Parts@3]; - - {_, _} -> - Parts@3 - end, - Parts@5 = case {erlang:element(2, Uri), - erlang:element(3, Uri), - erlang:element(4, Uri)} of - {{some, S}, {some, U}, {some, H}} -> - [S, <<"://"/utf8>>, U, <<"@"/utf8>>, H | Parts@4]; - - {{some, S@1}, none, {some, H@1}} -> - [S@1, <<"://"/utf8>>, H@1 | Parts@4]; - - {{some, S@2}, {some, _}, none} -> - [S@2, <<":"/utf8>> | Parts@4]; - - {{some, S@2}, none, none} -> - [S@2, <<":"/utf8>> | Parts@4]; - - {none, none, {some, H@2}} -> - [<<"//"/utf8>>, H@2 | Parts@4]; - - {none, {some, _}, none} -> - Parts@4; - - {none, none, none} -> - Parts@4 - end, - gleam@string:concat(Parts@5). - --spec origin(uri()) -> {ok, binary()} | {error, nil}. -origin(Uri) -> - {uri, Scheme, _, Host, Port, _, _, _} = Uri, - case Scheme of - {some, <<"https"/utf8>>} when Port =:= {some, 443} -> - Origin = {uri, Scheme, none, Host, none, <<""/utf8>>, none, none}, - {ok, to_string(Origin)}; - - {some, <<"http"/utf8>>} when Port =:= {some, 80} -> - Origin@1 = {uri, Scheme, none, Host, none, <<""/utf8>>, none, none}, - {ok, to_string(Origin@1)}; - - {some, S} when (S =:= <<"http"/utf8>>) orelse (S =:= <<"https"/utf8>>) -> - Origin@2 = {uri, Scheme, none, Host, Port, <<""/utf8>>, none, none}, - {ok, to_string(Origin@2)}; - - _ -> - {error, nil} - end. - --spec drop_last(list(EOJ)) -> list(EOJ). -drop_last(Elements) -> - gleam@list:take(Elements, gleam@list:length(Elements) - 1). - --spec join_segments(list(binary())) -> binary(). -join_segments(Segments) -> - gleam@string:join([<<""/utf8>> | Segments], <<"/"/utf8>>). - --spec merge(uri(), uri()) -> {ok, uri()} | {error, nil}. -merge(Base, Relative) -> - case Base of - {uri, {some, _}, _, {some, _}, _, _, _, _} -> - case Relative of - {uri, _, _, {some, _}, _, _, _, _} -> - Path = begin - _pipe = gleam@string:split( - erlang:element(6, Relative), - <<"/"/utf8>> - ), - _pipe@1 = remove_dot_segments(_pipe), - join_segments(_pipe@1) - end, - Resolved = {uri, - gleam@option:'or'( - erlang:element(2, Relative), - erlang:element(2, Base) - ), - none, - erlang:element(4, Relative), - gleam@option:'or'( - erlang:element(5, Relative), - erlang:element(5, Base) - ), - Path, - erlang:element(7, Relative), - erlang:element(8, Relative)}, - {ok, Resolved}; - - {uri, none, _, none, _, _, _, _} -> - {New_path, New_query} = case erlang:element(6, Relative) of - <<""/utf8>> -> - {erlang:element(6, Base), - gleam@option:'or'( - erlang:element(7, Relative), - erlang:element(7, Base) - )}; - - _ -> - Path_segments = case gleam@string:starts_with( - erlang:element(6, Relative), - <<"/"/utf8>> - ) of - true -> - gleam@string:split( - erlang:element(6, Relative), - <<"/"/utf8>> - ); - - false -> - _pipe@2 = gleam@string:split( - erlang:element(6, Base), - <<"/"/utf8>> - ), - _pipe@3 = drop_last(_pipe@2), - gleam@list:append( - _pipe@3, - gleam@string:split( - erlang:element(6, Relative), - <<"/"/utf8>> - ) - ) - end, - Path@1 = begin - _pipe@4 = Path_segments, - _pipe@5 = remove_dot_segments(_pipe@4), - join_segments(_pipe@5) - end, - {Path@1, erlang:element(7, Relative)} - end, - Resolved@1 = {uri, - erlang:element(2, Base), - none, - erlang:element(4, Base), - erlang:element(5, Base), - New_path, - New_query, - erlang:element(8, Relative)}, - {ok, Resolved@1} - end; - - _ -> - {error, nil} - end. diff --git a/build/dev/javascript/gleam_stdlib/gleam_stdlib.erl b/build/dev/javascript/gleam_stdlib/gleam_stdlib.erl deleted file mode 100644 index 9f3bd02..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam_stdlib.erl +++ /dev/null @@ -1,475 +0,0 @@ --module(gleam_stdlib). - --export([map_get/2, iodata_append/2, identity/1, decode_int/1, decode_bool/1, - decode_float/1, decode_list/1, decode_option/2, - decode_field/2, parse_int/1, parse_float/1, less_than/2, - string_pop_grapheme/1, string_starts_with/2, wrap_list/1, - string_ends_with/2, string_pad/4, decode_map/1, uri_parse/1, - bit_string_int_to_u32/1, bit_string_int_from_u32/1, decode_result/1, - bit_string_slice/3, decode_bit_string/1, compile_regex/2, regex_scan/2, - percent_encode/1, percent_decode/1, regex_check/2, regex_split/2, - base_decode64/1, parse_query/1, bit_string_concat/1, size_of_tuple/1, - decode_tuple/1, decode_tuple2/1, decode_tuple3/1, decode_tuple4/1, - decode_tuple5/1, decode_tuple6/1, tuple_get/2, classify_dynamic/1, - print/1, println/1, print_error/1, println_error/1, inspect/1, - float_to_string/1, int_from_base_string/2]). - -%% Taken from OTP's uri_string module --define(DEC2HEX(X), - if ((X) >= 0) andalso ((X) =< 9) -> (X) + $0; - ((X) >= 10) andalso ((X) =< 15) -> (X) + $A - 10 - end). - -%% Taken from OTP's uri_string module --define(HEX2DEC(X), - if ((X) >= $0) andalso ((X) =< $9) -> (X) - $0; - ((X) >= $A) andalso ((X) =< $F) -> (X) - $A + 10; - ((X) >= $a) andalso ((X) =< $f) -> (X) - $a + 10 - end). - --define(is_lowercase_char(X), (X > 96 andalso X < 123)). --define(is_underscore_char(X), (X == 95)). --define(is_digit_char(X), (X > 47 andalso X < 58)). - -uppercase(X) -> X - 32. - -map_get(Map, Key) -> - case maps:find(Key, Map) of - error -> {error, nil}; - OkFound -> OkFound - end. - -iodata_append(Iodata, String) -> [Iodata, String]. - -identity(X) -> X. - -decode_error_msg(Expected, Data) when is_binary(Expected) -> - decode_error(Expected, classify_dynamic(Data)). -decode_error(Expected, Got) when is_binary(Expected) andalso is_binary(Got) -> - {error, [{decode_error, Expected, Got, []}]}. - -classify_dynamic(nil) -> <<"Nil">>; -classify_dynamic(X) when is_atom(X) -> <<"Atom">>; -classify_dynamic(X) when is_binary(X) -> <<"String">>; -classify_dynamic(X) when is_bitstring(X) -> <<"BitString">>; -classify_dynamic(X) when is_integer(X) -> <<"Int">>; -classify_dynamic(X) when is_float(X) -> <<"Float">>; -classify_dynamic(X) when is_list(X) -> <<"List">>; -classify_dynamic(X) when is_boolean(X) -> <<"Bool">>; -classify_dynamic(X) when is_map(X) -> <<"Map">>; -classify_dynamic(X) when is_tuple(X) -> - iolist_to_binary(["Tuple of ", integer_to_list(tuple_size(X)), " elements"]); -classify_dynamic(X) when - is_function(X, 0) orelse is_function(X, 1) orelse is_function(X, 2) orelse - is_function(X, 3) orelse is_function(X, 4) orelse is_function(X, 5) orelse - is_function(X, 6) orelse is_function(X, 7) orelse is_function(X, 8) orelse - is_function(X, 9) orelse is_function(X, 10) orelse is_function(X, 11) orelse - is_function(X, 12) -> <<"Function">>; -classify_dynamic(_) -> <<"Some other type">>. - -decode_map(Data) when is_map(Data) -> {ok, Data}; -decode_map(Data) -> decode_error_msg(<<"Map">>, Data). - -decode_bit_string(Data) when is_bitstring(Data) -> {ok, Data}; -decode_bit_string(Data) -> decode_error_msg(<<"BitString">>, Data). - -decode_int(Data) when is_integer(Data) -> {ok, Data}; -decode_int(Data) -> decode_error_msg(<<"Int">>, Data). - -decode_float(Data) when is_float(Data) -> {ok, Data}; -decode_float(Data) -> decode_error_msg(<<"Float">>, Data). - -decode_bool(Data) when is_boolean(Data) -> {ok, Data}; -decode_bool(Data) -> decode_error_msg(<<"Bool">>, Data). - -decode_list(Data) when is_list(Data) -> {ok, Data}; -decode_list(Data) -> decode_error_msg(<<"List">>, Data). - -decode_field(Data, Key) when is_map(Data) -> - case Data of - #{Key := Value} -> {ok, {some, Value}}; - _ -> - {ok, none} - end; -decode_field(Data, _) -> - decode_error_msg(<<"Map">>, Data). - -size_of_tuple(Data) -> tuple_size(Data). - -tuple_get(_tup, Index) when Index < 0 -> {error, nil}; -tuple_get(Data, Index) when Index >= tuple_size(Data) -> {error, nil}; -tuple_get(Data, Index) -> {ok, element(Index + 1, Data)}. - -decode_tuple(Data) when is_tuple(Data) -> {ok, Data}; -decode_tuple(Data) -> decode_error_msg(<<"Tuple">>, Data). - -decode_tuple2({_,_} = A) -> {ok, A}; -decode_tuple2([A,B]) -> {ok, {A,B}}; -decode_tuple2(Data) -> decode_error_msg(<<"Tuple of 2 elements">>, Data). - -decode_tuple3({_,_,_} = A) -> {ok, A}; -decode_tuple3([A,B,C]) -> {ok, {A,B,C}}; -decode_tuple3(Data) -> decode_error_msg(<<"Tuple of 3 elements">>, Data). - -decode_tuple4({_,_,_,_} = A) -> {ok, A}; -decode_tuple4([A,B,C,D]) -> {ok, {A,B,C,D}}; -decode_tuple4(Data) -> decode_error_msg(<<"Tuple of 4 elements">>, Data). - -decode_tuple5({_,_,_,_,_} = A) -> {ok, A}; -decode_tuple5([A,B,C,D,E]) -> {ok, {A,B,C,D,E}}; -decode_tuple5(Data) -> decode_error_msg(<<"Tuple of 5 elements">>, Data). - -decode_tuple6({_,_,_,_,_,_} = A) -> {ok, A}; -decode_tuple6([A,B,C,D,E,F]) -> {ok, {A,B,C,D,E,F}}; -decode_tuple6(Data) -> decode_error_msg(<<"Tuple of 6 elements">>, Data). - -decode_option(Term, F) -> - Decode = fun(Inner) -> - case F(Inner) of - {ok, Decoded} -> {ok, {some, Decoded}}; - Error -> Error - end - end, - case Term of - undefined -> {ok, none}; - error -> {ok, none}; - null -> {ok, none}; - none -> {ok, none}; - nil -> {ok, none}; - {some, Inner} -> Decode(Inner); - _ -> Decode(Term) - end. - -decode_result(Term) -> - case Term of - {ok, Inner} -> {ok, {ok, Inner}}; - ok -> {ok, {ok, nil}}; - {error, Inner} -> {ok, {error, Inner}}; - error -> {ok, {error, nil}}; - _ -> decode_error_msg(<<"Result">>, Term) - end. - -int_from_base_string(String, Base) -> - case catch binary_to_integer(String, Base) of - Int when is_integer(Int) -> {ok, Int}; - _ -> {error, nil} - end. - -parse_int(String) -> - case catch binary_to_integer(String) of - Int when is_integer(Int) -> {ok, Int}; - _ -> {error, nil} - end. - -parse_float(String) -> - case catch binary_to_float(String) of - Float when is_float(Float) -> {ok, Float}; - _ -> {error, nil} - end. - -less_than(Lhs, Rhs) -> - Lhs < Rhs. - -string_starts_with(_, <<>>) -> true; -string_starts_with(String, Prefix) when byte_size(Prefix) > byte_size(String) -> false; -string_starts_with(String, Prefix) -> - PrefixSize = byte_size(Prefix), - Prefix == binary_part(String, 0, PrefixSize). - -string_ends_with(_, <<>>) -> true; -string_ends_with(String, Suffix) when byte_size(Suffix) > byte_size(String) -> false; -string_ends_with(String, Suffix) -> - SuffixSize = byte_size(Suffix), - Suffix == binary_part(String, byte_size(String) - SuffixSize, SuffixSize). - -string_pad(String, Length, Dir, PadString) -> - Chars = string:pad(String, Length, Dir, binary_to_list(PadString)), - case unicode:characters_to_binary(Chars) of - Bin when is_binary(Bin) -> Bin; - Error -> erlang:error({gleam_error, {string_invalid_utf8, Error}}) - end. - -string_pop_grapheme(String) -> - case string:next_grapheme(String) of - [ Next | Rest ] -> - {ok, {unicode:characters_to_binary([Next]), unicode:characters_to_binary(Rest)}}; - _ -> {error, nil} - end. - -bit_string_concat(BitStrings) -> - list_to_bitstring(BitStrings). - -bit_string_slice(Bin, Pos, Len) -> - try {ok, binary:part(Bin, Pos, Len)} - catch error:badarg -> {error, nil} - end. - -bit_string_int_to_u32(I) when 0 =< I, I < 4294967296 -> - {ok, <>}; -bit_string_int_to_u32(_) -> - {error, nil}. - -bit_string_int_from_u32(<>) -> - {ok, I}; -bit_string_int_from_u32(_) -> - {error, nil}. - -compile_regex(String, Options) -> - {options, Caseless, Multiline} = Options, - OptionsList = [ - unicode, - ucp, - Caseless andalso caseless, - Multiline andalso multiline - ], - FilteredOptions = [Option || Option <- OptionsList, Option /= false], - case re:compile(String, FilteredOptions) of - {ok, MP} -> {ok, MP}; - {error, {Str, Pos}} -> - {error, {compile_error, unicode:characters_to_binary(Str), Pos}} - end. - -regex_check(Regex, String) -> - re:run(String, Regex) /= nomatch. - -regex_split(Regex, String) -> - re:split(String, Regex). - -regex_submatches(_, {-1, 0}) -> none; -regex_submatches(String, {Start, Length}) -> - BinarySlice = binary:part(String, {Start, Length}), - case string:is_empty(binary_to_list(BinarySlice)) of - true -> none; - false -> {some, BinarySlice} - end. - -regex_matches(String, [{Start, Length} | Submatches]) -> - Submatches1 = lists:map(fun(X) -> regex_submatches(String, X) end, Submatches), - {match, binary:part(String, Start, Length), Submatches1}. - -regex_scan(Regex, String) -> - case re:run(String, Regex, [global]) of - {match, Captured} -> lists:map(fun(X) -> regex_matches(String, X) end, Captured); - nomatch -> [] - end. - -base_decode64(S) -> - try {ok, base64:decode(S)} - catch error:_ -> {error, nil} - end. - -wrap_list(X) when is_list(X) -> X; -wrap_list(X) -> [X]. - -parse_query(Query) -> - case uri_string:dissect_query(Query) of - {error, _, _} -> {error, nil}; - Pairs -> - Pairs1 = lists:map(fun - ({K, true}) -> {K, <<"">>}; - (Pair) -> Pair - end, Pairs), - {ok, Pairs1} - end. - -percent_encode(B) -> percent_encode(B, <<>>). -percent_encode(<<>>, Acc) -> - Acc; -percent_encode(<>, Acc) -> - case percent_ok(H) of - true -> - percent_encode(T, <>); - false -> - <> = <>, - percent_encode(T, <>) - end. - -percent_decode(Cs) -> percent_decode(Cs, <<>>). -percent_decode(<<$%, C0, C1, Cs/binary>>, Acc) -> - case is_hex_digit(C0) andalso is_hex_digit(C1) of - true -> - B = ?HEX2DEC(C0)*16+?HEX2DEC(C1), - percent_decode(Cs, <>); - false -> - {error, nil} - end; -percent_decode(<>, Acc) -> - percent_decode(Cs, <>); -percent_decode(<<>>, Acc) -> - check_utf8(Acc). - -percent_ok($!) -> true; -percent_ok($$) -> true; -percent_ok($') -> true; -percent_ok($() -> true; -percent_ok($)) -> true; -percent_ok($*) -> true; -percent_ok($+) -> true; -percent_ok($-) -> true; -percent_ok($.) -> true; -percent_ok($_) -> true; -percent_ok($~) -> true; -percent_ok(C) when $0 =< C, C =< $9 -> true; -percent_ok(C) when $A =< C, C =< $Z -> true; -percent_ok(C) when $a =< C, C =< $z -> true; -percent_ok(_) -> false. - -is_hex_digit(C) -> - ($0 =< C andalso C =< $9) orelse ($a =< C andalso C =< $f) orelse ($A =< C andalso C =< $F). - -check_utf8(Cs) -> - case unicode:characters_to_list(Cs) of - {incomplete, _, _} -> {error, nil}; - {error, _, _} -> {error, nil}; - _ -> {ok, Cs} - end. - -uri_parse(String) -> - case uri_string:parse(String) of - {error, _, _} -> {error, nil}; - Uri -> - {ok, {uri, - maps_get_optional(Uri, scheme), - maps_get_optional(Uri, userinfo), - maps_get_optional(Uri, host), - maps_get_optional(Uri, port), - maps_get_or(Uri, path, <<>>), - maps_get_optional(Uri, query), - maps_get_optional(Uri, fragment) - }} - end. - -maps_get_optional(Map, Key) -> - try {some, maps:get(Key, Map)} - catch _:_ -> none - end. - -maps_get_or(Map, Key, Default) -> - try maps:get(Key, Map) - catch _:_ -> Default - end. - -print(String) -> - io:put_chars(String), - nil. - -println(String) -> - io:put_chars([String, $\n]), - nil. - -print_error(String) -> - io:put_chars(standard_error, String), - nil. - -println_error(String) -> - io:put_chars(standard_error, [String, $\n]), - nil. - -inspect(true) -> - "True"; -inspect(false) -> - "False"; -inspect(nil) -> - "Nil"; -inspect(Atom) when is_atom(Atom) -> - Binary = erlang:atom_to_binary(Atom), - case inspect_maybe_gleam_atom(Binary, none, <<>>) of - {ok, Inspected} -> Inspected; - {error, _} -> ["atom.create_from_string(\"", Binary, "\")"] - end; -inspect(Any) when is_integer(Any) -> - erlang:integer_to_list(Any); -inspect(Any) when is_float(Any) -> - io_lib_format:fwrite_g(Any); -inspect(Binary) when is_binary(Binary) -> - case inspect_maybe_utf8_string(Binary, <<>>) of - {ok, InspectedUtf8String} -> InspectedUtf8String; - {error, not_a_utf8_string} -> - Segments = [erlang:integer_to_list(X) || <> <= Binary], - ["<<", lists:join(", ", Segments), ">>"] - end; -inspect(List) when is_list(List) -> - case inspect_list(List) of - {proper, Elements} -> ["[", Elements, "]"]; - {improper, Elements} -> ["//erl([", Elements, "])"] - end; -inspect(Any) when is_tuple(Any) % Record constructors - andalso is_atom(element(1, Any)) - andalso element(1, Any) =/= false - andalso element(1, Any) =/= true - andalso element(1, Any) =/= nil --> - [Atom | ArgsList] = erlang:tuple_to_list(Any), - Args = lists:join(<<", ">>, - lists:map(fun inspect/1, ArgsList) - ), - [inspect(Atom), "(", Args, ")"]; -inspect(Tuple) when is_tuple(Tuple) -> - Elements = lists:map(fun inspect/1, erlang:tuple_to_list(Tuple)), - ["#(", lists:join(", ", Elements), ")"]; -inspect(Any) when is_function(Any) -> - {arity, Arity} = erlang:fun_info(Any, arity), - ArgsAsciiCodes = lists:seq($a, $a + Arity - 1), - Args = lists:join(<<", ">>, - lists:map(fun(Arg) -> <> end, ArgsAsciiCodes) - ), - ["//fn(", Args, ") { ... }"]; -inspect(Any) -> - ["//erl(", io_lib:format("~p", [Any]), ")"]. - - -inspect_maybe_gleam_atom(<<>>, none, _) -> - {error, nil}; -inspect_maybe_gleam_atom(<>, none, _) when ?is_digit_char(First) -> - {error, nil}; -inspect_maybe_gleam_atom(<<"_", _Rest/binary>>, none, _) -> - {error, nil}; -inspect_maybe_gleam_atom(<<"_">>, _PrevChar, _Acc) -> - {error, nil}; -inspect_maybe_gleam_atom(<<"_", _Rest/binary>>, $_, _Acc) -> - {error, nil}; -inspect_maybe_gleam_atom(<>, _PrevChar, _Acc) - when not (?is_lowercase_char(First) orelse ?is_underscore_char(First) orelse ?is_digit_char(First)) -> - {error, nil}; -inspect_maybe_gleam_atom(<>, none, Acc) -> - inspect_maybe_gleam_atom(Rest, First, <>); -inspect_maybe_gleam_atom(<<"_", Rest/binary>>, _PrevChar, Acc) -> - inspect_maybe_gleam_atom(Rest, $_, Acc); -inspect_maybe_gleam_atom(<>, $_, Acc) -> - inspect_maybe_gleam_atom(Rest, First, <>); -inspect_maybe_gleam_atom(<>, _PrevChar, Acc) -> - inspect_maybe_gleam_atom(Rest, First, <>); -inspect_maybe_gleam_atom(<<>>, _PrevChar, Acc) -> - {ok, Acc}; -inspect_maybe_gleam_atom(A, B, C) -> - erlang:display({A, B, C}), - throw({gleam_error, A, B, C}). - -inspect_list([]) -> - {proper, []}; -inspect_list([First]) -> - {proper, [inspect(First)]}; -inspect_list([First | Rest]) when is_list(Rest) -> - {Kind, Inspected} = inspect_list(Rest), - {Kind, [inspect(First), <<", ">> | Inspected]}; -inspect_list([First | ImproperTail]) -> - {improper, [inspect(First), <<" | ">>, inspect(ImproperTail)]}. - -inspect_maybe_utf8_string(Binary, Acc) -> - case Binary of - <<>> -> {ok, <<$", Acc/binary, $">>}; - <> -> - Escaped = case First of - $" -> <<$\\, $">>; - $\\ -> <<$\\, $\\>>; - $\r -> <<$\\, $r>>; - $\n -> <<$\\, $n>>; - $\t -> <<$\\, $t>>; - Other -> <> - end, - inspect_maybe_utf8_string(Rest, <>); - _ -> {error, not_a_utf8_string} - end. - -float_to_string(Float) when is_float(Float) -> - erlang:iolist_to_binary(io_lib_format:fwrite_g(Float)). diff --git a/build/dev/javascript/gleam_stdlib/gleam_stdlib.mjs b/build/dev/javascript/gleam_stdlib/gleam_stdlib.mjs deleted file mode 100644 index fb255d9..0000000 --- a/build/dev/javascript/gleam_stdlib/gleam_stdlib.mjs +++ /dev/null @@ -1,783 +0,0 @@ -import { - BitString, - Error, - List, - Ok, - Result, - UtfCodepoint, - inspect, - stringBits, - toBitString, -} from "./gleam.mjs"; -import { - CompileError as RegexCompileError, - Match as RegexMatch, -} from "./gleam/regex.mjs"; -import { DecodeError } from "./gleam/dynamic.mjs"; -import { Some, None } from "./gleam/option.mjs"; -import PMap from "./persistent-hash-map.mjs"; - -const Nil = undefined; -const NOT_FOUND = {}; - -export function identity(x) { - return x; -} - -export function parse_int(value) { - if (/^[-+]?(\d+)$/.test(value)) { - return new Ok(parseInt(value)); - } else { - return new Error(Nil); - } -} - -export function parse_float(value) { - if (/^[-+]?(\d+)\.(\d+)$/.test(value)) { - return new Ok(parseFloat(value)); - } else { - return new Error(Nil); - } -} - -export function to_string(term) { - return term.toString(); -} - -export function float_to_string(float) { - const string = float.toString(); - if (string.indexOf(".") >= 0) { - return string; - } else { - return string + ".0"; - } -} - -export function int_to_base_string(int, base) { - return int.toString(base).toUpperCase(); -} - -const int_base_patterns = { - 2: /[^0-1]/, - 3: /[^0-2]/, - 4: /[^0-3]/, - 5: /[^0-4]/, - 6: /[^0-5]/, - 7: /[^0-6]/, - 8: /[^0-7]/, - 9: /[^0-8]/, - 10: /[^0-9]/, - 11: /[^0-9a]/, - 12: /[^0-9a-b]/, - 13: /[^0-9a-c]/, - 14: /[^0-9a-d]/, - 15: /[^0-9a-e]/, - 16: /[^0-9a-f]/, - 17: /[^0-9a-g]/, - 18: /[^0-9a-h]/, - 19: /[^0-9a-i]/, - 20: /[^0-9a-j]/, - 21: /[^0-9a-k]/, - 22: /[^0-9a-l]/, - 23: /[^0-9a-m]/, - 24: /[^0-9a-n]/, - 25: /[^0-9a-o]/, - 26: /[^0-9a-p]/, - 27: /[^0-9a-q]/, - 28: /[^0-9a-r]/, - 29: /[^0-9a-s]/, - 30: /[^0-9a-t]/, - 31: /[^0-9a-u]/, - 32: /[^0-9a-v]/, - 33: /[^0-9a-w]/, - 34: /[^0-9a-x]/, - 35: /[^0-9a-y]/, - 36: /[^0-9a-z]/, -}; - -export function int_from_base_string(string, base) { - if (int_base_patterns[base].test(string.replace(/^-/, "").toLowerCase())) { - return new Error(Nil); - } - - const result = parseInt(string, base); - - if (isNaN(result)) { - return new Error(Nil); - } - - return new Ok(result); -} - -export function string_replace(string, target, substitute) { - if (typeof string.replaceAll !== "undefined") { - return string.replaceAll(target, substitute); - } - // Fallback for older Node.js versions: - // 1. - // 2. - // TODO: This fallback could be remove once Node.js 14 is EOL - // aka on or after 2024-04-30 - return string.replace( - // $& means the whole matched string - new RegExp(target.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), - substitute - ); -} - -export function string_reverse(string) { - return [...string].reverse().join(""); -} - -export function string_length(string) { - if (string === "") { - return 0; - } - const iterator = graphemes_iterator(string); - if (iterator) { - let i = 0; - for (const _ of iterator) { - i++; - } - return i; - } else { - return string.match(/./gsu).length; - } -} - -export function graphemes(string) { - return List.fromArray( - Array.from(graphemes_iterator(string)).map((item) => item.segment) - ); -} - -function graphemes_iterator(string) { - if (Intl && Intl.Segmenter) { - return new Intl.Segmenter().segment(string)[Symbol.iterator](); - } -} - -export function pop_grapheme(string) { - let first; - const iterator = graphemes_iterator(string); - if (iterator) { - first = iterator.next().value?.segment; - } else { - first = string.match(/./su)?.[0]; - } - if (first) { - return new Ok([first, string.slice(first.length)]); - } else { - return new Error(Nil); - } -} - -export function lowercase(string) { - return string.toLowerCase(); -} - -export function uppercase(string) { - return string.toUpperCase(); -} - -export function less_than(a, b) { - return a < b; -} - -export function add(a, b) { - return a + b; -} - -export function equal(a, b) { - return a === b; -} - -export function split(xs, pattern) { - return List.fromArray(xs.split(pattern)); -} - -export function join(xs, separator) { - const iterator = xs[Symbol.iterator](); - let result = iterator.next().value || ""; - let current = iterator.next(); - while (!current.done) { - result = result + separator + current.value; - current = iterator.next(); - } - return result; -} - -export function concat(xs) { - let result = ""; - for (const x of xs) { - result = result + x; - } - return result; -} - -export function length(data) { - return data.length; -} - -export function crop_string(string, substring) { - return string.substring(string.indexOf(substring)); -} - -export function index_of(haystack, needle) { - return haystack.indexOf(needle) | 0; -} - -export function starts_with(haystack, needle) { - return haystack.startsWith(needle); -} - -export function ends_with(haystack, needle) { - return haystack.endsWith(needle); -} - -export function split_once(haystack, needle) { - const index = haystack.indexOf(needle); - if (index >= 0) { - const before = haystack.slice(0, index); - const after = haystack.slice(index + needle.length); - return new Ok([before, after]); - } else { - return new Error(Nil); - } -} - -export function trim(string) { - return string.trim(); -} - -export function trim_left(string) { - return string.trimLeft(); -} - -export function trim_right(string) { - return string.trimRight(); -} - -export function bit_string_from_string(string) { - return toBitString([stringBits(string)]); -} - -export function bit_string_concat(bit_strings) { - return toBitString(bit_strings.toArray().map((b) => b.buffer)); -} - -export function console_log(term) { - console.log(term); -} - -export function console_error(term) { - console.error(term); -} - -export function crash(message) { - throw new globalThis.Error(message); -} - -export function bit_string_to_string(bit_string) { - try { - const decoder = new TextDecoder("utf-8", { fatal: true }); - return new Ok(decoder.decode(bit_string.buffer)); - } catch (_error) { - return new Error(Nil); - } -} - -export function print(string) { - if (typeof process === "object") { - process.stdout.write(string); // We can write without a trailing newline - } else if (typeof Deno === "object") { - Deno.stdout.writeSync(new TextEncoder().encode(string)); // We can write without a trailing newline - } else { - console.log(string); // We're in a browser. Newlines are mandated - } -} - -export function print_error(string) { - if (typeof process === "object" && process.stderr?.write) { - process.stderr.write(string); // We can write without a trailing newline - } else if (typeof Deno === "object") { - Deno.stderr.writeSync(new TextEncoder().encode(string)); // We can write without a trailing newline - } else { - console.error(string); // We're in a browser. Newlines are mandated - } -} - -export function print_debug(string) { - if (typeof process === "object" && process.stderr?.write) { - process.stderr.write(string + "\n"); // If we're in Node.js, use `stderr` - } else if (typeof Deno === "object") { - Deno.stderr.writeSync(new TextEncoder().encode(string + "\n")); // If we're in Deno, use `stderr` - } else { - console.log(string); // Otherwise, use `console.log` (so that it doesn't look like an error) - } -} - -export function ceiling(float) { - return Math.ceil(float); -} - -export function floor(float) { - return Math.floor(float); -} - -export function round(float) { - return Math.round(float); -} - -export function truncate(float) { - return Math.trunc(float); -} - -export function power(base, exponent) { - // It is checked in Gleam that: - // - The base is non-negative and that the exponent is not fractional. - // - The base is non-zero and the exponent is non-negative (otherwise - // the result will essentially be division by zero). - // It can thus be assumed that valid input is passed to the Math.pow - // function and a NaN or Infinity value will not be produced. - return Math.pow(base, exponent); -} - -export function random_uniform() { - const random_uniform_result = Math.random(); - // With round-to-nearest-even behavior, the ranges claimed for the functions below - // (excluding the one for Math.random() itself) aren't exact. - // If extremely large bounds are chosen (2^53 or higher), - // it's possible in extremely rare cases to calculate the usually-excluded upper bound. - // Note that as numbers in JavaScript are IEEE 754 floating point numbers - // See: - // Because of this, we just loop 'until' we get a valid result where 0.0 <= x < 1.0: - if (random_uniform_result === 1.0) { - return random_uniform(); - } - return random_uniform_result; -} - -export function bit_string_slice(bits, position, length) { - const start = Math.min(position, position + length); - const end = Math.max(position, position + length); - if (start < 0 || end > bits.length) return new Error(Nil); - const buffer = new Uint8Array(bits.buffer.buffer, start, Math.abs(length)); - return new Ok(new BitString(buffer)); -} - -export function codepoint(int) { - return new UtfCodepoint(int); -} - -export function string_to_codepoint_integer_list(string) { - return List.fromArray(Array.from(string).map((item) => item.codePointAt(0))); -} - -export function utf_codepoint_list_to_string(utf_codepoint_integer_list) { - return utf_codepoint_integer_list - .toArray() - .map((x) => String.fromCodePoint(x.value)) - .join(""); -} - -export function utf_codepoint_to_int(utf_codepoint) { - return utf_codepoint.value; -} - -export function regex_check(regex, string) { - regex.lastIndex = 0; - return regex.test(string); -} - -export function compile_regex(pattern, options) { - try { - let flags = "gu"; - if (options.case_insensitive) flags += "i"; - if (options.multi_line) flags += "m"; - return new Ok(new RegExp(pattern, flags)); - } catch (error) { - const number = (error.columnNumber || 0) | 0; - return new Error(new RegexCompileError(error.message, number)); - } -} - -export function regex_scan(regex, string) { - const matches = Array.from(string.matchAll(regex)).map((match) => { - const content = match[0]; - const submatches = []; - for (let n = match.length - 1; n > 0; n--) { - if (match[n]) { - submatches[n - 1] = new Some(match[n]); - continue; - } - if (submatches.length > 0) { - submatches[n - 1] = new None(); - } - } - return new RegexMatch(content, List.fromArray(submatches)); - }); - return List.fromArray(matches); -} - -export function new_map() { - return PMap.new(); -} - -export function map_size(map) { - return map.size; -} - -export function map_to_list(map) { - return List.fromArray(map.entries()); -} - -export function map_remove(key, map) { - return map.delete(key); -} - -export function map_get(map, key) { - const value = map.get(key, NOT_FOUND); - if (value === NOT_FOUND) { - return new Error(Nil); - } - return new Ok(value); -} - -export function map_insert(key, value, map) { - return map.set(key, value); -} - -function unsafe_percent_decode(string) { - return decodeURIComponent((string || "").replace("+", " ")); -} - -export function percent_decode(string) { - try { - return new Ok(unsafe_percent_decode(string)); - } catch (_error) { - return new Error(Nil); - } -} - -export function percent_encode(string) { - return encodeURIComponent(string); -} - -export function parse_query(query) { - try { - const pairs = []; - for (const section of query.split("&")) { - const [key, value] = section.split("="); - if (!key) continue; - pairs.push([unsafe_percent_decode(key), unsafe_percent_decode(value)]); - } - return new Ok(List.fromArray(pairs)); - } catch (_error) { - return new Error(Nil); - } -} - -// From https://developer.mozilla.org/en-US/docs/Glossary/Base64#Solution_2_%E2%80%93_rewrite_the_DOMs_atob()_and_btoa()_using_JavaScript's_TypedArrays_and_UTF-8 -export function encode64(bit_string) { - const aBytes = bit_string.buffer; - let nMod3 = 2; - let sB64Enc = ""; - - for (let nLen = aBytes.length, nUint24 = 0, nIdx = 0; nIdx < nLen; nIdx++) { - nMod3 = nIdx % 3; - if (nIdx > 0 && ((nIdx * 4) / 3) % 76 === 0) { - sB64Enc += "\r\n"; - } - nUint24 |= aBytes[nIdx] << ((16 >>> nMod3) & 24); - if (nMod3 === 2 || aBytes.length - nIdx === 1) { - sB64Enc += String.fromCharCode( - uint6ToB64((nUint24 >>> 18) & 63), - uint6ToB64((nUint24 >>> 12) & 63), - uint6ToB64((nUint24 >>> 6) & 63), - uint6ToB64(nUint24 & 63) - ); - nUint24 = 0; - } - } - - return ( - sB64Enc.substr(0, sB64Enc.length - 2 + nMod3) + - (nMod3 === 2 ? "" : nMod3 === 1 ? "=" : "==") - ); -} - -// From https://developer.mozilla.org/en-US/docs/Glossary/Base64#Solution_2_%E2%80%93_rewrite_the_DOMs_atob()_and_btoa()_using_JavaScript's_TypedArrays_and_UTF-8 -function uint6ToB64(nUint6) { - return nUint6 < 26 - ? nUint6 + 65 - : nUint6 < 52 - ? nUint6 + 71 - : nUint6 < 62 - ? nUint6 - 4 - : nUint6 === 62 - ? 43 - : nUint6 === 63 - ? 47 - : 65; -} - -// From https://developer.mozilla.org/en-US/docs/Glossary/Base64#Solution_2_%E2%80%93_rewrite_the_DOMs_atob()_and_btoa()_using_JavaScript's_TypedArrays_and_UTF-8 -function b64ToUint6(nChr) { - return nChr > 64 && nChr < 91 - ? nChr - 65 - : nChr > 96 && nChr < 123 - ? nChr - 71 - : nChr > 47 && nChr < 58 - ? nChr + 4 - : nChr === 43 - ? 62 - : nChr === 47 - ? 63 - : 0; -} - -// From https://developer.mozilla.org/en-US/docs/Glossary/Base64#Solution_2_%E2%80%93_rewrite_the_DOMs_atob()_and_btoa()_using_JavaScript's_TypedArrays_and_UTF-8 -export function decode64(sBase64) { - if (sBase64.match(/[^A-Za-z0-9\+\/=]/g)) return new Error(Nil); - const sB64Enc = sBase64.replace(/=/g, ""); - const nInLen = sB64Enc.length; - const nOutLen = (nInLen * 3 + 1) >> 2; - const taBytes = new Uint8Array(nOutLen); - - for ( - let nMod3, nMod4, nUint24 = 0, nOutIdx = 0, nInIdx = 0; - nInIdx < nInLen; - nInIdx++ - ) { - nMod4 = nInIdx & 3; - nUint24 |= b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << (6 * (3 - nMod4)); - if (nMod4 === 3 || nInLen - nInIdx === 1) { - for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) { - taBytes[nOutIdx] = (nUint24 >>> ((16 >>> nMod3) & 24)) & 255; - } - nUint24 = 0; - } - } - - return new Ok(new BitString(taBytes)); -} - -export function classify_dynamic(data) { - if (typeof data === "string") { - return "String"; - } else if (Result.isResult(data)) { - return "Result"; - } else if (List.isList(data)) { - return "List"; - } else if (Number.isInteger(data)) { - return "Int"; - } else if (Array.isArray(data)) { - return `Tuple of ${data.length} elements`; - } else if (BitString.isBitString(data)) { - return "BitString"; - } else if (data instanceof PMap) { - return "Map"; - } else if (typeof data === "number") { - return "Float"; - } else if (data === null) { - return "Null"; - } else if (data === undefined) { - return "Nil"; - } else { - const type = typeof data; - return type.charAt(0).toUpperCase() + type.slice(1); - } -} - -function decoder_error(expected, got) { - return decoder_error_no_classify(expected, classify_dynamic(got)); -} - -function decoder_error_no_classify(expected, got) { - return new Error( - List.fromArray([new DecodeError(expected, got, List.fromArray([]))]) - ); -} - -export function decode_string(data) { - return typeof data === "string" - ? new Ok(data) - : decoder_error("String", data); -} - -export function decode_int(data) { - return Number.isInteger(data) ? new Ok(data) : decoder_error("Int", data); -} - -export function decode_float(data) { - return typeof data === "number" ? new Ok(data) : decoder_error("Float", data); -} - -export function decode_bool(data) { - return typeof data === "boolean" ? new Ok(data) : decoder_error("Bool", data); -} - -export function decode_bit_string(data) { - if (BitString.isBitString(data)) { - return new Ok(data); - } - if (data instanceof Uint8Array) { - return new Ok(new BitString(data)); - } - return decoder_error("BitString", data); -} - -export function decode_tuple(data) { - return Array.isArray(data) ? new Ok(data) : decoder_error("Tuple", data); -} - -export function decode_tuple2(data) { - return decode_tupleN(data, 2); -} - -export function decode_tuple3(data) { - return decode_tupleN(data, 3); -} - -export function decode_tuple4(data) { - return decode_tupleN(data, 4); -} - -export function decode_tuple5(data) { - return decode_tupleN(data, 5); -} - -export function decode_tuple6(data) { - return decode_tupleN(data, 6); -} - -function decode_tupleN(data, n) { - if (Array.isArray(data) && data.length == n) { - return new Ok(data); - } - - const list = decode_exact_length_list(data, n); - if (list) return new Ok(list); - - return decoder_error(`Tuple of ${n} elements`, data); -} - -function decode_exact_length_list(data, n) { - if (!List.isList(data)) return; - - const elements = []; - let current = data; - - for (let i = 0; i < n; i++) { - if (current.isEmpty()) break; - elements.push(current.head); - current = current.tail; - } - - if (elements.length === n && current.isEmpty()) return elements; -} - -export function tuple_get(data, index) { - return index >= 0 && data.length > index - ? new Ok(data[index]) - : new Error(Nil); -} - -export function decode_list(data) { - if (Array.isArray(data)) { - return new Ok(List.fromArray(data)); - } - return List.isList(data) ? new Ok(data) : decoder_error("List", data); -} - -export function decode_result(data) { - return Result.isResult(data) ? new Ok(data) : decoder_error("Result", data); -} - -export function decode_map(data) { - if (data instanceof PMap) { - return new Ok(PMap.fromMap(data)); - } - if (data == null) { - return decoder_error("Map", data); - } - if (typeof data !== "object") { - return decoder_error("Map", data); - } - const proto = Object.getPrototypeOf(data); - if (proto === Object.prototype || proto === null) { - return new Ok(PMap.fromObject(data)); - } - return decoder_error("Map", data); -} - -export function decode_option(data, decoder) { - if (data === null || data === undefined || data instanceof None) - return new Ok(new None()); - if (data instanceof Some) data = data[0]; - const result = decoder(data); - if (result.isOk()) { - return new Ok(new Some(result[0])); - } else { - return result; - } -} - -export function decode_field(value, name) { - const not_a_map_error = () => decoder_error("Map", value); - - if ( - value instanceof PMap || - value instanceof WeakMap || - value instanceof Map - ) { - const entry = map_get(value, name); - return new Ok(entry.isOk() ? new Some(entry[0]) : new None()); - } else if (Object.getPrototypeOf(value) == Object.prototype) { - return try_get_field(value, name, () => new Ok(new None())); - } else { - return try_get_field(value, name, not_a_map_error); - } -} - -function try_get_field(value, field, or_else) { - try { - return field in value ? new Ok(new Some(value[field])) : or_else(); - } catch { - return or_else(); - } -} - -export function byte_size(string) { - return new TextEncoder().encode(string).length; -} - -// In Javascript bitwise operations convert numbers to a sequence of 32 bits -// while Erlang uses arbitrary precision. -// To get around this problem and get consistent results use BigInt and then -// downcast the value back to a Number value. - -export function bitwise_and(x, y) { - return Number(BigInt(x) & BigInt(y)); -} - -export function bitwise_not(x) { - return Number(~BigInt(x)); -} - -export function bitwise_or(x, y) { - return Number(BigInt(x) | BigInt(y)); -} - -export function bitwise_exclusive_or(x, y) { - return Number(BigInt(x) ^ BigInt(y)); -} - -export function bitwise_shift_left(x, y) { - return Number(BigInt(x) << BigInt(y)); -} - -export function bitwise_shift_right(x, y) { - return Number(BigInt(x) >> BigInt(y)); -} diff --git a/build/dev/javascript/gleam_stdlib/persistent-hash-map.mjs b/build/dev/javascript/gleam_stdlib/persistent-hash-map.mjs deleted file mode 100644 index ff849d8..0000000 --- a/build/dev/javascript/gleam_stdlib/persistent-hash-map.mjs +++ /dev/null @@ -1,957 +0,0 @@ -/** - * This file uses jsdoc to annotate types. - * These types can be checked using the typescript compiler with "checkjs" option. - */ - -import { isEqual } from "./gleam.mjs"; - -const referenceMap = new WeakMap(); -const tempDataView = new DataView(new ArrayBuffer(8)); -let referenceUID = 0; -/** - * hash the object by reference using a weak map and incrementing uid - * @param {any} o - * @returns {number} - */ -function hashByReference(o) { - const known = referenceMap.get(o); - if (known !== undefined) { - return known; - } - const hash = referenceUID++; - if (referenceUID === 0x7fffffff) { - referenceUID = 0; - } - referenceMap.set(o, hash); - return hash; -} -/** - * merge two hashes in an order sensitive way - * @param {number} a - * @param {number} b - * @returns {number} - */ -function hashMerge(a, b) { - return (a ^ (b + 0x9e3779b9 + (a << 6) + (a >> 2))) | 0; -} -/** - * standard string hash popularised by java - * @param {string} s - * @returns {number} - */ -function hashString(s) { - let hash = 0; - const len = s.length; - for (let i = 0; i < len; i++) { - hash = (Math.imul(31, hash) + s.charCodeAt(i)) | 0; - } - return hash; -} -/** - * hash a number by converting to two integers and do some jumbling - * @param {number} n - * @returns {number} - */ -function hashNumber(n) { - tempDataView.setFloat64(0, n); - const i = tempDataView.getInt32(0); - const j = tempDataView.getInt32(4); - return Math.imul(0x45d9f3b, (i >> 16) ^ i) ^ j; -} -/** - * hash a BigInt by converting it to a string and hashing that - * @param {BigInt} n - * @returns {number} - */ -function hashBigInt(n) { - return hashString(n.toString()); -} -/** - * hash any js object - * @param {any} o - * @returns {number} - */ -function hashObject(o) { - const proto = Object.getPrototypeOf(o); - if (proto !== null && typeof proto.hashCode === "function") { - try { - const code = o.hashCode(o); - if (typeof code === "number") { - return code; - } - } catch {} - } - if (o instanceof Promise || o instanceof WeakSet || o instanceof WeakMap) { - return hashByReference(o); - } - if (o instanceof Date) { - return hashNumber(o.getTime()); - } - let h = 0; - if (o instanceof ArrayBuffer) { - o = new Uint8Array(o); - } - if (Array.isArray(o) || o instanceof Uint8Array) { - for (let i = 0; i < o.length; i++) { - h = (Math.imul(31, h) + getHash(o[i])) | 0; - } - } else if (o instanceof Set) { - o.forEach((v) => { - h = (h + getHash(v)) | 0; - }); - } else if (o instanceof Map) { - o.forEach((v, k) => { - h = (h + hashMerge(getHash(v), getHash(k))) | 0; - }); - } else { - const keys = Object.keys(o); - for (let i = 0; i < keys.length; i++) { - const k = keys[i]; - const v = o[k]; - h = (h + hashMerge(getHash(v), hashString(k))) | 0; - } - } - return h; -} -/** - * hash any js value - * @param {any} u - * @returns {number} - */ -export function getHash(u) { - if (u === null) return 0x42108422; - if (u === undefined) return 0x42108423; - if (u === true) return 0x42108421; - if (u === false) return 0x42108420; - switch (typeof u) { - case "number": - return hashNumber(u); - case "string": - return hashString(u); - case "bigint": - return hashBigInt(u); - case "object": - return hashObject(u); - case "symbol": - return hashByReference(u); - case "function": - return hashByReference(u); - default: - return 0; // should be unreachable - } -} -/** - * @template K,V - * @typedef {ArrayNode | IndexNode | CollisionNode} Node - */ -/** - * @template K,V - * @typedef {{ type: typeof ENTRY, k: K, v: V }} Entry - */ -/** - * @template K,V - * @typedef {{ type: typeof ARRAY_NODE, size: number, array: (undefined | Entry | Node)[] }} ArrayNode - */ -/** - * @template K,V - * @typedef {{ type: typeof INDEX_NODE, bitmap: number, array: (Entry | Node)[] }} IndexNode - */ -/** - * @template K,V - * @typedef {{ type: typeof COLLISION_NODE, hash: number, array: Entry[] }} CollisionNode - */ -/** - * @typedef {{ val: boolean }} Flag - */ -const SHIFT = 5; // number of bits you need to shift by to get the next bucket -const BUCKET_SIZE = Math.pow(2, SHIFT); -const MASK = BUCKET_SIZE - 1; // used to zero out all bits not in the bucket -const MAX_INDEX_NODE = BUCKET_SIZE / 2; // when does index node grow into array node -const MIN_ARRAY_NODE = BUCKET_SIZE / 4; // when does array node shrink to index node -const ENTRY = 0; -const ARRAY_NODE = 1; -const INDEX_NODE = 2; -const COLLISION_NODE = 3; -/** @type {IndexNode} */ -const EMPTY = { - type: INDEX_NODE, - bitmap: 0, - array: [], -}; -/** - * Mask the hash to get only the bucket corresponding to shift - * @param {number} hash - * @param {number} shift - * @returns {number} - */ -function mask(hash, shift) { - return (hash >>> shift) & MASK; -} -/** - * Set only the Nth bit where N is the masked hash - * @param {number} hash - * @param {number} shift - * @returns {number} - */ -function bitpos(hash, shift) { - return 1 << mask(hash, shift); -} -/** - * Count the number of 1 bits in a number - * @param {number} x - * @returns {number} - */ -function bitcount(x) { - x -= (x >> 1) & 0x55555555; - x = (x & 0x33333333) + ((x >> 2) & 0x33333333); - x = (x + (x >> 4)) & 0x0f0f0f0f; - x += x >> 8; - x += x >> 16; - return x & 0x7f; -} -/** - * Calculate the array index of an item in a bitmap index node - * @param {number} bitmap - * @param {number} bit - * @returns {number} - */ -function index(bitmap, bit) { - return bitcount(bitmap & (bit - 1)); -} -/** - * Efficiently copy an array and set one value at an index - * @template T - * @param {T[]} arr - * @param {number} at - * @param {T} val - * @returns {T[]} - */ -function cloneAndSet(arr, at, val) { - const len = arr.length; - const out = new Array(len); - for (let i = 0; i < len; ++i) { - out[i] = arr[i]; - } - out[at] = val; - return out; -} -/** - * Efficiently copy an array and insert one value at an index - * @template T - * @param {T[]} arr - * @param {number} at - * @param {T} val - * @returns {T[]} - */ -function spliceIn(arr, at, val) { - const len = arr.length; - const out = new Array(len + 1); - let i = 0; - let g = 0; - while (i < at) { - out[g++] = arr[i++]; - } - out[g++] = val; - while (i < len) { - out[g++] = arr[i++]; - } - return out; -} -/** - * Efficiently copy an array and remove one value at an index - * @template T - * @param {T[]} arr - * @param {number} at - * @returns {T[]} - */ -function spliceOut(arr, at) { - const len = arr.length; - const out = new Array(len - 1); - let i = 0; - let g = 0; - while (i < at) { - out[g++] = arr[i++]; - } - ++i; - while (i < len) { - out[g++] = arr[i++]; - } - return out; -} -/** - * Create a new node containing two entries - * @template K,V - * @param {number} shift - * @param {K} key1 - * @param {V} val1 - * @param {number} key2hash - * @param {K} key2 - * @param {V} val2 - * @returns {Node} - */ -function createNode(shift, key1, val1, key2hash, key2, val2) { - const key1hash = getHash(key1); - if (key1hash === key2hash) { - return { - type: COLLISION_NODE, - hash: key1hash, - array: [ - { type: ENTRY, k: key1, v: val1 }, - { type: ENTRY, k: key2, v: val2 }, - ], - }; - } - const addedLeaf = { val: false }; - return assoc( - assocIndex(EMPTY, shift, key1hash, key1, val1, addedLeaf), - shift, - key2hash, - key2, - val2, - addedLeaf - ); -} -/** - * @template T,K,V - * @callback AssocFunction - * @param {T} root - * @param {number} shift - * @param {number} hash - * @param {K} key - * @param {V} val - * @param {Flag} addedLeaf - * @returns {Node} - */ -/** - * Associate a node with a new entry, creating a new node - * @template T,K,V - * @type {AssocFunction,K,V>} - */ -function assoc(root, shift, hash, key, val, addedLeaf) { - switch (root.type) { - case ARRAY_NODE: - return assocArray(root, shift, hash, key, val, addedLeaf); - case INDEX_NODE: - return assocIndex(root, shift, hash, key, val, addedLeaf); - case COLLISION_NODE: - return assocCollision(root, shift, hash, key, val, addedLeaf); - } -} -/** - * @template T,K,V - * @type {AssocFunction,K,V>} - */ -function assocArray(root, shift, hash, key, val, addedLeaf) { - const idx = mask(hash, shift); - const node = root.array[idx]; - // if the corresponding index is empty set the index to a newly created node - if (node === undefined) { - addedLeaf.val = true; - return { - type: ARRAY_NODE, - size: root.size + 1, - array: cloneAndSet(root.array, idx, { type: ENTRY, k: key, v: val }), - }; - } - if (node.type === ENTRY) { - // if keys are equal replace the entry - if (isEqual(key, node.k)) { - if (val === node.v) { - return root; - } - return { - type: ARRAY_NODE, - size: root.size, - array: cloneAndSet(root.array, idx, { - type: ENTRY, - k: key, - v: val, - }), - }; - } - // otherwise upgrade the entry to a node and insert - addedLeaf.val = true; - return { - type: ARRAY_NODE, - size: root.size, - array: cloneAndSet( - root.array, - idx, - createNode(shift + SHIFT, node.k, node.v, hash, key, val) - ), - }; - } - // otherwise call assoc on the child node - const n = assoc(node, shift + SHIFT, hash, key, val, addedLeaf); - // if the child node hasn't changed just return the old root - if (n === node) { - return root; - } - // otherwise set the index to the new node - return { - type: ARRAY_NODE, - size: root.size, - array: cloneAndSet(root.array, idx, n), - }; -} -/** - * @template T,K,V - * @type {AssocFunction,K,V>} - */ -function assocIndex(root, shift, hash, key, val, addedLeaf) { - const bit = bitpos(hash, shift); - const idx = index(root.bitmap, bit); - // if there is already a item at this hash index.. - if ((root.bitmap & bit) !== 0) { - // if there is a node at the index (not an entry), call assoc on the child node - const node = root.array[idx]; - if (node.type !== ENTRY) { - const n = assoc(node, shift + SHIFT, hash, key, val, addedLeaf); - if (n === node) { - return root; - } - return { - type: INDEX_NODE, - bitmap: root.bitmap, - array: cloneAndSet(root.array, idx, n), - }; - } - // otherwise there is an entry at the index - // if the keys are equal replace the entry with the updated value - const nodeKey = node.k; - if (isEqual(key, nodeKey)) { - if (val === node.v) { - return root; - } - return { - type: INDEX_NODE, - bitmap: root.bitmap, - array: cloneAndSet(root.array, idx, { - type: ENTRY, - k: key, - v: val, - }), - }; - } - // if the keys are not equal, replace the entry with a new child node - addedLeaf.val = true; - return { - type: INDEX_NODE, - bitmap: root.bitmap, - array: cloneAndSet( - root.array, - idx, - createNode(shift + SHIFT, nodeKey, node.v, hash, key, val) - ), - }; - } else { - // else there is currently no item at the hash index - const n = root.array.length; - // if the number of nodes is at the maximum, expand this node into an array node - if (n >= MAX_INDEX_NODE) { - // create a 32 length array for the new array node (one for each bit in the hash) - const nodes = new Array(32); - // create and insert a node for the new entry - const jdx = mask(hash, shift); - nodes[jdx] = assocIndex(EMPTY, shift + SHIFT, hash, key, val, addedLeaf); - let j = 0; - let bitmap = root.bitmap; - // place each item in the index node into the correct spot in the array node - // loop through all 32 bits / array positions - for (let i = 0; i < 32; i++) { - if ((bitmap & 1) !== 0) { - const node = root.array[j++]; - nodes[i] = node; - } - // shift the bitmap to process the next bit - bitmap = bitmap >>> 1; - } - return { - type: ARRAY_NODE, - size: n + 1, - array: nodes, - }; - } else { - // else there is still space in this index node - // simply insert a new entry at the hash index - const newArray = spliceIn(root.array, idx, { - type: ENTRY, - k: key, - v: val, - }); - addedLeaf.val = true; - return { - type: INDEX_NODE, - bitmap: root.bitmap | bit, - array: newArray, - }; - } - } -} -/** - * @template T,K,V - * @type {AssocFunction,K,V>} - */ -function assocCollision(root, shift, hash, key, val, addedLeaf) { - // if there is a hash collision - if (hash === root.hash) { - const idx = collisionIndexOf(root, key); - // if this key already exists replace the entry with the new value - if (idx !== -1) { - const entry = root.array[idx]; - if (entry.v === val) { - return root; - } - return { - type: COLLISION_NODE, - hash: hash, - array: cloneAndSet(root.array, idx, { type: ENTRY, k: key, v: val }), - }; - } - // otherwise insert the entry at the end of the array - const size = root.array.length; - addedLeaf.val = true; - return { - type: COLLISION_NODE, - hash: hash, - array: cloneAndSet(root.array, size, { type: ENTRY, k: key, v: val }), - }; - } - // if there is no hash collision, upgrade to an index node - return assoc( - { - type: INDEX_NODE, - bitmap: bitpos(root.hash, shift), - array: [root], - }, - shift, - hash, - key, - val, - addedLeaf - ); -} -/** - * Find the index of a key in the collision node's array - * @template K,V - * @param {CollisionNode} root - * @param {K} key - * @returns {number} - */ -function collisionIndexOf(root, key) { - const size = root.array.length; - for (let i = 0; i < size; i++) { - if (isEqual(key, root.array[i].k)) { - return i; - } - } - return -1; -} -/** - * @template T,K,V - * @callback FindFunction - * @param {T} root - * @param {number} shift - * @param {number} hash - * @param {K} key - * @returns {undefined | Entry} - */ -/** - * Return the found entry or undefined if not present in the root - * @template K,V - * @type {FindFunction,K,V>} - */ -function find(root, shift, hash, key) { - switch (root.type) { - case ARRAY_NODE: - return findArray(root, shift, hash, key); - case INDEX_NODE: - return findIndex(root, shift, hash, key); - case COLLISION_NODE: - return findCollision(root, key); - } -} -/** - * @template K,V - * @type {FindFunction,K,V>} - */ -function findArray(root, shift, hash, key) { - const idx = mask(hash, shift); - const node = root.array[idx]; - if (node === undefined) { - return undefined; - } - if (node.type !== ENTRY) { - return find(node, shift + SHIFT, hash, key); - } - if (isEqual(key, node.k)) { - return node; - } - return undefined; -} -/** - * @template K,V - * @type {FindFunction,K,V>} - */ -function findIndex(root, shift, hash, key) { - const bit = bitpos(hash, shift); - if ((root.bitmap & bit) === 0) { - return undefined; - } - const idx = index(root.bitmap, bit); - const node = root.array[idx]; - if (node.type !== ENTRY) { - return find(node, shift + SHIFT, hash, key); - } - if (isEqual(key, node.k)) { - return node; - } - return undefined; -} -/** - * @template K,V - * @param {CollisionNode} root - * @param {K} key - * @returns {undefined | Entry} - */ -function findCollision(root, key) { - const idx = collisionIndexOf(root, key); - if (idx < 0) { - return undefined; - } - return root.array[idx]; -} -/** - * @template T,K,V - * @callback WithoutFunction - * @param {T} root - * @param {number} shift - * @param {number} hash - * @param {K} key - * @returns {undefined | Node} - */ -/** - * Remove an entry from the root, returning the updated root. - * Returns undefined if the node should be removed from the parent. - * @template K,V - * @type {WithoutFunction,K,V>} - * */ -function without(root, shift, hash, key) { - switch (root.type) { - case ARRAY_NODE: - return withoutArray(root, shift, hash, key); - case INDEX_NODE: - return withoutIndex(root, shift, hash, key); - case COLLISION_NODE: - return withoutCollision(root, key); - } -} -/** - * @template K,V - * @type {WithoutFunction,K,V>} - */ -function withoutArray(root, shift, hash, key) { - const idx = mask(hash, shift); - const node = root.array[idx]; - if (node === undefined) { - return root; // already empty - } - let n = undefined; - // if node is an entry and the keys are not equal there is nothing to remove - // if node is not an entry do a recursive call - if (node.type === ENTRY) { - if (!isEqual(node.k, key)) { - return root; // no changes - } - } else { - n = without(node, shift + SHIFT, hash, key); - if (n === node) { - return root; // no changes - } - } - // if the recursive call returned undefined the node should be removed - if (n === undefined) { - // if the number of child nodes is at the minimum, pack into an index node - if (root.size <= MIN_ARRAY_NODE) { - const arr = root.array; - const out = new Array(root.size - 1); - let i = 0; - let j = 0; - let bitmap = 0; - while (i < idx) { - const nv = arr[i]; - if (nv !== undefined) { - out[j] = nv; - bitmap |= 1 << i; - ++j; - } - ++i; - } - ++i; // skip copying the removed node - while (i < arr.length) { - const nv = arr[i]; - if (nv !== undefined) { - out[j] = nv; - bitmap |= 1 << i; - ++j; - } - ++i; - } - return { - type: INDEX_NODE, - bitmap: bitmap, - array: out, - }; - } - return { - type: ARRAY_NODE, - size: root.size - 1, - array: cloneAndSet(root.array, idx, n), - }; - } - return { - type: ARRAY_NODE, - size: root.size, - array: cloneAndSet(root.array, idx, n), - }; -} -/** - * @template K,V - * @type {WithoutFunction,K,V>} - */ -function withoutIndex(root, shift, hash, key) { - const bit = bitpos(hash, shift); - if ((root.bitmap & bit) === 0) { - return root; // already empty - } - const idx = index(root.bitmap, bit); - const node = root.array[idx]; - // if the item is not an entry - if (node.type !== ENTRY) { - const n = without(node, shift + SHIFT, hash, key); - if (n === node) { - return root; // no changes - } - // if not undefined, the child node still has items, so update it - if (n !== undefined) { - return { - type: INDEX_NODE, - bitmap: root.bitmap, - array: cloneAndSet(root.array, idx, n), - }; - } - // otherwise the child node should be removed - // if it was the only child node, remove this node from the parent - if (root.bitmap === bit) { - return undefined; - } - // otherwise just remove the child node - return { - type: INDEX_NODE, - bitmap: root.bitmap ^ bit, - array: spliceOut(root.array, idx), - }; - } - // otherwise the item is an entry, remove it if the key matches - if (isEqual(key, node.k)) { - if (root.bitmap === bit) { - return undefined; - } - return { - type: INDEX_NODE, - bitmap: root.bitmap ^ bit, - array: spliceOut(root.array, idx), - }; - } - return root; -} -/** - * @template K,V - * @param {CollisionNode} root - * @param {K} key - * @returns {undefined | Node} - */ -function withoutCollision(root, key) { - const idx = collisionIndexOf(root, key); - // if the key not found, no changes - if (idx < 0) { - return root; - } - // otherwise the entry was found, remove it - // if it was the only entry in this node, remove the whole node - if (root.array.length === 1) { - return undefined; - } - // otherwise just remove the entry - return { - type: COLLISION_NODE, - hash: root.hash, - array: spliceOut(root.array, idx), - }; -} -/** - * @template K,V - * @param {undefined | Node} root - * @param {(value:V,key:K)=>void} fn - * @returns {void} - */ -function forEach(root, fn) { - if (root === undefined) { - return; - } - const items = root.array; - const size = items.length; - for (let i = 0; i < size; i++) { - const item = items[i]; - if (item === undefined) { - continue; - } - if (item.type === ENTRY) { - fn(item.v, item.k); - continue; - } - forEach(item, fn); - } -} -/** - * Extra wrapper to keep track of map size and clean up the API - * @template K,V - */ -export default class PMap { - /** - * @template V - * @param {Record} o - * @returns {PMap} - */ - static fromObject(o) { - const keys = Object.keys(o); - /** @type PMap */ - let m = PMap.new(); - for (let i = 0; i < keys.length; i++) { - const k = keys[i]; - m = m.set(k, o[k]); - } - return m; - } - /** - * @template K,V - * @param {Map} o - * @returns {PMap} - */ - static fromMap(o) { - /** @type PMap */ - let m = PMap.new(); - o.forEach((v, k) => { - m = m.set(k, v); - }); - return m; - } - static new() { - return new PMap(undefined, 0); - } - /** - * @param {undefined | Node} root - * @param {number} size - */ - constructor(root, size) { - this.root = root; - this.size = size; - } - /** - * @template NotFound - * @param {K} key - * @param {NotFound} notFound - * @returns {NotFound | V} - */ - get(key, notFound) { - if (this.root === undefined) { - return notFound; - } - const found = find(this.root, 0, getHash(key), key); - if (found === undefined) { - return notFound; - } - return found.v; - } - /** - * @param {K} key - * @param {V} val - * @returns {PMap} - */ - set(key, val) { - const addedLeaf = { val: false }; - const root = this.root === undefined ? EMPTY : this.root; - const newRoot = assoc(root, 0, getHash(key), key, val, addedLeaf); - if (newRoot === this.root) { - return this; - } - return new PMap(newRoot, addedLeaf.val ? this.size + 1 : this.size); - } - /** - * @param {K} key - * @returns {PMap} - */ - delete(key) { - if (this.root === undefined) { - return this; - } - const newRoot = without(this.root, 0, getHash(key), key); - if (newRoot === this.root) { - return this; - } - if (newRoot === undefined) { - return PMap.new(); - } - return new PMap(newRoot, this.size - 1); - } - /** - * @param {K} key - * @returns {boolean} - */ - has(key) { - if (this.root === undefined) { - return false; - } - return find(this.root, 0, getHash(key), key) !== undefined; - } - /** - * @returns {[K,V][]} - */ - entries() { - if (this.root === undefined) { - return []; - } - /** @type [K,V][] */ - const result = []; - this.forEach((v, k) => result.push([k, v])); - return result; - } - /** - * - * @param {(val:V,key:K)=>void} fn - */ - forEach(fn) { - forEach(this.root, fn); - } - hashCode() { - let h = 0; - this.forEach((v, k) => { - h = (h + hashMerge(getHash(v), getHash(k))) | 0; - }); - return h; - } - /** - * @param {unknown} o - * @returns {boolean} - */ - equals(o) { - if (!(o instanceof PMap)) { - return false; - } - let equal = true; - this.forEach((v, k) => { - equal = equal && isEqual(o.get(k, !v), v); - }); - return equal; - } -} diff --git a/build/dev/javascript/gleam_version b/build/dev/javascript/gleam_version deleted file mode 100644 index f0e1a43..0000000 --- a/build/dev/javascript/gleam_version +++ /dev/null @@ -1 +0,0 @@ -0.31.0 \ No newline at end of file diff --git a/build/dev/javascript/gleamy_bench/_gleam_artefacts/gleamy_bench.cache b/build/dev/javascript/gleamy_bench/_gleam_artefacts/gleamy_bench.cache deleted file mode 100644 index b1c49ba97b16f0f206dad4551c613ea6fade3d3c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7430 zcmc&(eP|o!8Nc^E$+A9d<+0+d_F`md4v9rlHK&BmUcgaOhepJm&gUYM5nRPSH&XTC zN^+BoLPxqk#@L{2jIM#gvVZnb3Z-oSl)*OELSP@HrQ4u`LbGoBXJcDf_W=X#dEUE| z?oKD!&c*_IPw(m8d*0{s_dL(51oO#1@tquk@iHU|nJWJWi={r!V5A(&&9L^96}?!! zwt7j5>b14YuG{Qh4hK@|43nX#s88V6TZ;N7lVd8&X)6pTzhg=5L!3mlRuwblp6C5Ujj7c1?T;i(hzI|q^w$>`uYmy|H+g$9kO%62Qcgb=Ck++TN*8fM!`Wv!e6+0o6D{{Arf7d86aJN#wZCzk1bxd|#D|k>zNB`Q zCdd6r?U^W%YZ^4=hA>lq3i~r#{PNNunp{yGN67R6)l^FYu#zXvKJ1Jwz)4 zXKSsvh$2+6;do*VXG4+?f@l%+*g)X1Ql+yB6$!AcPBR8jhH1Qp?EJVaC-KZg=v*k? zDqgDSCa<>~ycX0K1h43v$m>)JrWBY;<8&?sa|+C*qvuLZlS$$bpAcUZjNYE&v3_vy z62*B#(gm&6DAk^{3CjT#bw3J=0k9vhrYOB)wqb6pEv(X7-IAiUR;glGKz-LCugf-Q z7}GWZmu=!_D)nNIb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3u0-yYt(*OVf diff --git a/build/dev/javascript/gleamy_bench/_gleam_artefacts/gleamy_bench_example.cache_meta b/build/dev/javascript/gleamy_bench/_gleam_artefacts/gleamy_bench_example.cache_meta deleted file mode 100644 index de81ab0324c3e0cbc18e23dcf4236cf4cd0a3443..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 65 zcmb$BEP zk>Wv5US^mNX8w;kn&t;M*`Vj4*Ka?P2Ta?7`rB6}%h{@UA~}B^7qzUY-ZK_8Fn6w6 z4#KrKCXUZcd=TG`rBb?BYBK7jS*jT$5{C{KIk}*q85x7`iI&3|yR(JhpTQqk=G{zG zvdguc2w02MHfxs>;^4RAd!-+m%)#)mPus*g5A$`3>cX}EFj>3Pz>ogsi~!TnI-&aeEs5#{L-8huJ0~6Z&bUj0JTpL ARR910 diff --git a/build/dev/javascript/gleamy_bench/_gleam_artefacts/test.cache b/build/dev/javascript/gleamy_bench/_gleam_artefacts/test.cache deleted file mode 100644 index 735c0b74b33a8899e3f21c1f5a7510a366eee788..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1970 zcmbtV&rj4q6z-eZrR)aMyubnyHY>y!X+jFChGe7J1;q#lWh@3wFuFhk>;59$?tv2? zHO7+%F8%>r{0}t2lg5)8yz9Zllm7y~nYLuR!a`!ww9|RhdEfWV_g*Kzu|gN7OiT~r zi`~9g$w5p!?fagbHaw@{9d1;dVs-oRs%AK~wau9r!?-D8z>OQ8TLBO~jN^3+!BopN zz=WwTOD#~7BE~o{jfc;f3k>H>aT7ScH^n>PeUBh(uK*1MU$B=r4Zg;*_7_UiH{NC1 zm%3;$uaDWcbsGHCXYC(y@S!_r?{^cFYOz%Fp@;&+5t5n)plO)UMK|M`wn#SuHin5T z&FObam5icA^8kpZ7@|k7i9@s~sdn?pu*)CW0W%hxt`ls(8QI*G98P6%N>?PuE%98&)XQ5-?8}$D z?YX7e#t}^gQAu)U%$?|*&bZUpDaJ{RtWy0!AcoK0SA(c50=WTUdZveAY8d-L8dTnM zbm#Rg0AsCQ^MK{6MYrs@bl8)x56f%y>Q=qskQmaJb|I?bviPJ#Bu^-@(w3M!QtrMb zHdR!amEy4zkCTGTSK!oTDo-M!`KjN;rBxQhh_WVK{UDCBK@L*fh%=ira-HfsUuClS=qo^))pY;9Ka zHSeg3r6a~7%}Qno#X^3L?^L&3ssS%(S9_7n%VMQfufP+OjA~0>R=XqqQIB`B0uN-F zjUWsWg(yG6FUUtg?ze$d=2VTl-MG5wKhC&8dp}l6U=ZsBIu?M=ML-7tL(DH>5BxtL z-IXY^{PC(T59)-p8ZR)_y>gfuz)=%N2XMl~iGln*r_ro<7$3%XmftOB=3KY#8ng9! bg?_CxXDqo*Cv&S { - let value = inspect(this[label]); - return isNaN(parseInt(label)) ? `${label}: ${value}` : value; - }; - let props = Object.keys(this).map(field).join(", "); - return props ? `${this.constructor.name}(${props})` : this.constructor.name; - } - - withFields(fields) { - let properties = Object.keys(this).map((label) => - label in fields ? fields[label] : this[label] - ); - return new this.constructor(...properties); - } -} - -export class List { - static fromArray(array, tail) { - let t = tail || new Empty(); - return array.reduceRight((xs, x) => new NonEmpty(x, xs), t); - } - - static isList(data) { - let variant = data?.__gleam_prelude_variant__; - return variant === "EmptyList" || variant === "NonEmptyList"; - } - - [Symbol.iterator]() { - return new ListIterator(this); - } - - inspect() { - return `[${this.toArray().map(inspect).join(", ")}]`; - } - - toArray() { - return [...this]; - } - - atLeastLength(desired) { - for (let _ of this) { - if (desired <= 0) return true; - desired--; - } - return desired <= 0; - } - - hasLength(desired) { - for (let _ of this) { - if (desired <= 0) return false; - desired--; - } - return desired === 0; - } - - countLength() { - let length = 0; - for (let _ of this) length++; - return length; - } -} - -export function toList(elements, tail) { - return List.fromArray(elements, tail); -} - -class ListIterator { - #current; - - constructor(current) { - this.#current = current; - } - - next() { - if (this.#current.isEmpty()) { - return { done: true }; - } else { - let { head, tail } = this.#current; - this.#current = tail; - return { value: head, done: false }; - } - } -} - -export class Empty extends List { - get __gleam_prelude_variant__() { - return "EmptyList"; - } - - isEmpty() { - return true; - } -} - -export class NonEmpty extends List { - constructor(head, tail) { - super(); - this.head = head; - this.tail = tail; - } - - get __gleam_prelude_variant__() { - return "NonEmptyList"; - } - - isEmpty() { - return false; - } -} - -export class BitString { - static isBitString(data) { - return data?.__gleam_prelude_variant__ === "BitString"; - } - - constructor(buffer) { - if (!(buffer instanceof Uint8Array)) { - throw "BitString can only be constructed from a Uint8Array"; - } - this.buffer = buffer; - } - - get __gleam_prelude_variant__() { - return "BitString"; - } - - inspect() { - return `<<${Array.from(this.buffer).join(", ")}>>`; - } - - get length() { - return this.buffer.length; - } - - byteAt(index) { - return this.buffer[index]; - } - - floatAt(index) { - return byteArrayToFloat(this.buffer.slice(index, index + 8)); - } - - intFromSlice(start, end) { - return byteArrayToInt(this.buffer.slice(start, end)); - } - - binaryFromSlice(start, end) { - return new BitString(this.buffer.slice(start, end)); - } - - sliceAfter(index) { - return new BitString(this.buffer.slice(index)); - } -} - -export class UtfCodepoint { - constructor(value) { - this.value = value; - } - - get __gleam_prelude_variant__() { - return "UtfCodepoint"; - } - - inspect() { - return `//utfcodepoint(${String.fromCodePoint(this.value)})`; - } -} - -export function toBitString(segments) { - let size = (segment) => - segment instanceof Uint8Array ? segment.byteLength : 1; - let bytes = segments.reduce((acc, segment) => acc + size(segment), 0); - let view = new DataView(new ArrayBuffer(bytes)); - let cursor = 0; - for (let segment of segments) { - if (segment instanceof Uint8Array) { - new Uint8Array(view.buffer).set(segment, cursor); - cursor += segment.byteLength; - } else { - view.setInt8(cursor, segment); - cursor++; - } - } - return new BitString(new Uint8Array(view.buffer)); -} - -// Derived from this answer https://stackoverflow.com/questions/8482309/converting-javascript-integer-to-byte-array-and-back -export function sizedInt(int, size) { - let value = int; - if (size < 0) { - return new Uint8Array(); - } - if (size % 8 != 0) { - throw "Needs to be a byte size" + size; - } - const byteArray = new Uint8Array(size / 8); - - for (let index = 0; index < byteArray.length; index++) { - const byte = value & 0xff; - byteArray[index] = byte; - value = (value - byte) / 256; - } - return byteArray.reverse(); -} - -export function byteArrayToInt(byteArray) { - byteArray = byteArray.reverse(); - let value = 0; - for (let i = byteArray.length - 1; i >= 0; i--) { - value = value * 256 + byteArray[i]; - } - return value; -} - -export function byteArrayToFloat(byteArray) { - return new Float64Array(byteArray.reverse().buffer)[0]; -} - -export function stringBits(string) { - return new TextEncoder().encode(string); -} - -export function codepointBits(codepoint) { - return stringBits(String.fromCodePoint(codepoint.value)); -} - -export function float64Bits(float) { - return new Uint8Array(Float64Array.from([float]).buffer).reverse(); -} - -export class Result extends CustomType { - static isResult(data) { - let variant = data?.__gleam_prelude_variant__; - return variant === "Ok" || variant === "Error"; - } -} - -export class Ok extends Result { - constructor(value) { - super(); - this[0] = value; - } - - get __gleam_prelude_variant__() { - return "Ok"; - } - - isOk() { - return true; - } -} - -export class Error extends Result { - constructor(detail) { - super(); - this[0] = detail; - } - - get __gleam_prelude_variant__() { - return "Error"; - } - - isOk() { - return false; - } -} - -export function inspect(v) { - let t = typeof v; - if (v === true) return "True"; - if (v === false) return "False"; - if (v === null) return "//js(null)"; - if (v === undefined) return "Nil"; - if (t === "string") return JSON.stringify(v); - if (t === "bigint" || t === "number") return v.toString(); - if (Array.isArray(v)) return `#(${v.map(inspect).join(", ")})`; - if (v instanceof Set) return `//js(Set(${[...v].map(inspect).join(", ")}))`; - if (v instanceof RegExp) return `//js(${v})`; - if (v instanceof Date) return `//js(Date("${v.toISOString()}"))`; - if (v instanceof Function) { - let args = []; - for (let i of Array(v.length).keys()) - args.push(String.fromCharCode(i + 97)); - return `//fn(${args.join(", ")}) { ... }`; - } - try { - return v.inspect(); - } catch (_) { - return inspectObject(v); - } -} - -function inspectObject(v) { - let [keys, get] = getters(v); - let name = Object.getPrototypeOf(v)?.constructor?.name || "Object"; - let props = []; - for (let k of keys(v)) { - props.push(`${inspect(k)}: ${inspect(get(v, k))}`); - } - let body = props.length ? " " + props.join(", ") + " " : ""; - let head = name === "Object" ? "" : name + " "; - return `//js(${head}{${body}})`; -} - -export function isEqual(x, y) { - let values = [x, y]; - - while (values.length) { - let a = values.pop(); - let b = values.pop(); - if (a === b) continue; - - if (!isObject(a) || !isObject(b)) return false; - let unequal = - !structurallyCompatibleObjects(a, b) || - unequalDates(a, b) || - unequalBuffers(a, b) || - unequalArrays(a, b) || - unequalMaps(a, b) || - unequalSets(a, b); - if (unequal) return false; - - const proto = Object.getPrototypeOf(a); - if (proto !== null && typeof proto.equals === "function") { - try { - if (a.equals(b)) continue; - else return false; - } catch {} - } - - let [keys, get] = getters(a); - for (let k of keys(a)) { - values.push(get(a, k), get(b, k)); - } - } - - return true; -} - -function getters(object) { - if (object instanceof Map) { - return [(x) => x.keys(), (x, y) => x.get(y)]; - } else { - let extra = object instanceof globalThis.Error ? ["message"] : []; - return [(x) => [...extra, ...Object.keys(x)], (x, y) => x[y]]; - } -} - -function unequalDates(a, b) { - return a instanceof Date && (a > b || a < b); -} - -function unequalBuffers(a, b) { - return ( - a.buffer instanceof ArrayBuffer && - a.BYTES_PER_ELEMENT && - !(a.byteLength === b.byteLength && a.every((n, i) => n === b[i])) - ); -} - -function unequalArrays(a, b) { - return Array.isArray(a) && a.length !== b.length; -} - -function unequalMaps(a, b) { - return a instanceof Map && a.size !== b.size; -} - -function unequalSets(a, b) { - return ( - a instanceof Set && (a.size != b.size || [...a].some((e) => !b.has(e))) - ); -} - -function isObject(a) { - return typeof a === "object" && a !== null; -} - -function structurallyCompatibleObjects(a, b) { - if (typeof a !== "object" && typeof b !== "object" && (!a || !b)) - return false; - - let nonstructural = [Promise, WeakSet, WeakMap, Function]; - if (nonstructural.some((c) => a instanceof c)) return false; - - return ( - a.constructor === b.constructor || - (a.__gleam_prelude_variant__ && - a.__gleam_prelude_variant__ === b.__gleam_prelude_variant__) - ); -} - -export function remainderInt(a, b) { - if (b === 0) { - return 0; - } else { - return a % b; - } -} - -export function divideInt(a, b) { - return Math.trunc(divideFloat(a, b)); -} - -export function divideFloat(a, b) { - if (b === 0) { - return 0; - } else { - return a / b; - } -} - -export function makeError(variant, module, line, fn, message, extra) { - let error = new globalThis.Error(message); - error.gleam_error = variant; - error.module = module; - error.line = line; - error.fn = fn; - for (let k in extra) error[k] = extra[k]; - return error; -} diff --git a/build/dev/javascript/gleamy_bench/gleamy_bench.mjs b/build/dev/javascript/gleamy_bench/gleamy_bench.mjs deleted file mode 100644 index 28e7cd0..0000000 --- a/build/dev/javascript/gleamy_bench/gleamy_bench.mjs +++ /dev/null @@ -1,384 +0,0 @@ -import * as $float from "../gleam_stdlib/gleam/float.mjs"; -import * as $int from "../gleam_stdlib/gleam/int.mjs"; -import * as $io from "../gleam_stdlib/gleam/io.mjs"; -import * as $list from "../gleam_stdlib/gleam/list.mjs"; -import * as $string from "../gleam_stdlib/gleam/string.mjs"; -import { toList, CustomType as $CustomType, makeError, divideFloat, divideInt } from "./gleam.mjs"; -import { now } from "./gleamy_bench_ffi.mjs"; - -export class Input extends $CustomType { - constructor(label, value) { - super(); - this.label = label; - this.value = value; - } -} - -export class Function extends $CustomType { - constructor(label, function$) { - super(); - this.label = label; - this.function = function$; - } -} - -export class Set extends $CustomType { - constructor(input, function$, reps) { - super(); - this.input = input; - this.function = function$; - this.reps = reps; - } -} - -export class Bench extends $CustomType { - constructor(inputs, functions) { - super(); - this.inputs = inputs; - this.functions = functions; - } -} - -export class P extends $CustomType { - constructor(x0) { - super(); - this[0] = x0; - } -} - -export class IPS extends $CustomType {} - -export class Min extends $CustomType {} - -export class Max extends $CustomType {} - -export class Mean extends $CustomType {} - -export class SD extends $CustomType {} - -export class SDPercent extends $CustomType {} - -export class Stat extends $CustomType { - constructor(name, calculate) { - super(); - this.name = name; - this.calculate = calculate; - } -} - -const name_pad = 20; - -const stat_pad = 14; - -const stat_decimal = 4; - -function perf_counter(_) { - return (() => { - throw makeError( - "todo", - "gleamy_bench", - 9, - "perf_counter", - "panic expression evaluated", - {} - ) - })()("not implemented"); -} - -function mean(data) { - let count = $int.to_float($list.length(data)); - return divideFloat($float.sum(data), count); -} - -function standard_deviation(data) { - let count = $int.to_float($list.length(data)); - let mean$1 = mean(data); - let $ = (() => { - let _pipe = (divideFloat( - $float.sum( - $list.map( - data, - (x) => { - let y = x - mean$1; - return y * y; - }, - ), - ), - count - )); - return $float.square_root(_pipe); - })(); - if (!$.isOk()) { - throw makeError( - "assignment_no_match", - "gleamy_bench", - 54, - "standard_deviation", - "Assignment pattern did not match", - { value: $ } - ) - } - let value = $[0]; - return value; -} - -function min(data) { - let first = (() => { - if (data.atLeastLength(1)) { - let x = data.head; - return x; - } else { - return 0.0; - } - })(); - return $list.fold(data, first, (a, x) => { return $float.min(a, x); }); -} - -function percentile(n, data) { - let data$1 = (() => { - let _pipe = data; - let _pipe$1 = $list.sort(_pipe, $float.compare); - return $list.drop(_pipe$1, divideInt(n * $list.length(data), 100)); - })(); - if (data$1.atLeastLength(1)) { - let x = data$1.head; - return x; - } else { - return 0.0; - } -} - -function max(data) { - let first = (() => { - if (data.atLeastLength(1)) { - let x = data.head; - return x; - } else { - return 0.0; - } - })(); - return $list.fold(data, first, (a, x) => { return $float.max(a, x); }); -} - -function do_repeat_until(loop$acc, loop$stop, loop$value, loop$fun) { - while (true) { - let acc = loop$acc; - let stop = loop$stop; - let value = loop$value; - let fun = loop$fun; - let start = now(); - let $ = fun(value); - - let end = now(); - if (end < stop) { - loop$acc = toList([end - start], acc); - loop$stop = stop; - loop$value = value; - loop$fun = fun; - } else { - return acc; - } - } -} - -function repeat_until(duration, value, fun) { - return do_repeat_until(toList([]), now() + duration, value, fun); -} - -export function run(bench) { - return $list.flat_map( - bench.inputs, - (_use0) => { - if (!(_use0 instanceof Input)) { - throw makeError( - "assignment_no_match", - "gleamy_bench", - 115, - "", - "Assignment pattern did not match", - { value: _use0 } - ) - } - let input_label = _use0.label; - let input = _use0.value; - return $list.map( - bench.functions, - (function$) => { - if (function$ instanceof Function) { - let fun_label = function$.label; - let fun = function$.function; - $io.println((("benching set " + input_label) + " ") + fun_label); - let $ = repeat_until(10.0, input, fun); - - let timings = repeat_until(500.0, input, fun); - return new Set(input_label, fun_label, timings); - } else { - throw makeError( - "case_no_match", - "gleamy_bench", - 117, - "", - "No case clause matched", - { values: [function$] } - ) - } - }, - ); - }, - ); -} - -export function do_repeat(loop$n, loop$input, loop$fun) { - while (true) { - let n = loop$n; - let input = loop$input; - let fun = loop$fun; - if (n === 0) { - return undefined; - } else { - let $ = fun(input); - - loop$n = n - 1; - loop$input = input; - loop$fun = fun; - } - } -} - -export function repeat(n, fun) { - return (input) => { return do_repeat(n, input, fun); }; -} - -function format_float(f, decimals) { - let $ = $int.power(10, $int.to_float(decimals)); - if (!$.isOk()) { - throw makeError( - "assignment_no_match", - "gleamy_bench", - 148, - "format_float", - "Assignment pattern did not match", - { value: $ } - ) - } - let factor = $[0]; - let whole = $float.truncate(f); - let decimal = $float.truncate(f * factor) - whole * $float.truncate(factor); - return $string.concat( - toList([ - $string.pad_left($int.to_string(whole), (stat_pad - decimals) - 1, " "), - ".", - $string.pad_left($int.to_string(decimal), decimals, "0"), - ]), - ); -} - -function header_row(stats) { - let _pipe = toList( - [ - $string.pad_right("Input", name_pad, " "), - $string.pad_right("Function", name_pad, " "), - ], - $list.map( - stats, - (stat) => { - let stat$1 = (() => { - if (stat instanceof P) { - let n = stat[0]; - return "P" + $int.to_string(n); - } else if (stat instanceof IPS) { - return "IPS"; - } else if (stat instanceof Min) { - return "Min"; - } else if (stat instanceof Max) { - return "Max"; - } else if (stat instanceof Mean) { - return "Mean"; - } else if (stat instanceof SD) { - return "SD"; - } else if (stat instanceof SDPercent) { - return "SD%"; - } else if (stat instanceof Stat) { - let name = stat.name; - return name; - } else { - throw makeError( - "case_no_match", - "gleamy_bench", - 165, - "", - "No case clause matched", - { values: [stat] } - ) - } - })(); - return $string.pad_left(stat$1, stat_pad, " "); - }, - ), - ); - return $string.join(_pipe, "\t"); -} - -function stat_row(set, stats) { - let _pipe = toList( - [ - $string.pad_right(set.input, name_pad, " "), - $string.pad_right(set.function, name_pad, " "), - ], - $list.map( - stats, - (stat) => { - let stat$1 = (() => { - if (stat instanceof P) { - let n = stat[0]; - return percentile(n, set.reps); - } else if (stat instanceof IPS) { - return divideFloat( - 1000.0 * $int.to_float($list.length(set.reps)), - $float.sum(set.reps) - ); - } else if (stat instanceof Min) { - return min(set.reps); - } else if (stat instanceof Max) { - return max(set.reps); - } else if (stat instanceof Mean) { - return mean(set.reps); - } else if (stat instanceof SD) { - return standard_deviation(set.reps); - } else if (stat instanceof SDPercent) { - return divideFloat( - 100.0 * standard_deviation(set.reps), - mean(set.reps) - ); - } else if (stat instanceof Stat) { - let calc = stat.calculate; - return calc(set); - } else { - throw makeError( - "case_no_match", - "gleamy_bench", - 189, - "", - "No case clause matched", - { values: [stat] } - ) - } - })(); - let _pipe = stat$1; - let _pipe$1 = format_float(_pipe, stat_decimal); - return $string.pad_left(_pipe$1, stat_pad, " "); - }, - ), - ); - return $string.join(_pipe, "\t"); -} - -export function table(sets, stats) { - let header = header_row(stats); - let body = $list.map( - sets, - (_capture) => { return stat_row(_capture, stats); }, - ); - let _pipe = toList([header], body); - return $string.join(_pipe, "\n"); -} diff --git a/build/dev/javascript/gleamy_bench/gleamy_bench_example.mjs b/build/dev/javascript/gleamy_bench/gleamy_bench_example.mjs deleted file mode 100644 index d889e8a..0000000 --- a/build/dev/javascript/gleamy_bench/gleamy_bench_example.mjs +++ /dev/null @@ -1,44 +0,0 @@ -import * as $io from "../gleam_stdlib/gleam/io.mjs"; -import { toList } from "./gleam.mjs"; -import * as $gleamy_bench from "./gleamy_bench.mjs"; -import { Bench, Function, IPS, Input, Min, P, run, table } from "./gleamy_bench.mjs"; - -function fib1(n) { - if (n === 0) { - return 0; - } else if (n === 1) { - return 1; - } else { - let n$1 = n; - return fib1(n$1 - 1) + fib1(n$1 - 2); - } -} - -function do_fib2(loop$a, loop$b, loop$n) { - while (true) { - let a = loop$a; - let b = loop$b; - let n = loop$n; - if (n === 0) { - return a; - } else { - loop$a = b; - loop$b = a + b; - loop$n = n - 1; - } - } -} - -function fib2(n) { - return do_fib2(0, 1, n); -} - -export function main() { - let _pipe = new Bench( - toList([new Input("n=5", 5), new Input("n=10", 10), new Input("n=15", 15)]), - toList([new Function("fib1", fib1), new Function("fib2", fib2)]), - ); - let _pipe$1 = run(_pipe); - let _pipe$2 = table(_pipe$1, toList([new IPS(), new Min(), new P(99)])); - return $io.println(_pipe$2); -} diff --git a/build/dev/javascript/gleamy_bench/gleamy_bench_ffi.mjs b/build/dev/javascript/gleamy_bench/gleamy_bench_ffi.mjs deleted file mode 100644 index 7e9d5d6..0000000 --- a/build/dev/javascript/gleamy_bench/gleamy_bench_ffi.mjs +++ /dev/null @@ -1,3 +0,0 @@ -export function now() { - return performance.now() -} diff --git a/build/dev/javascript/gleamy_bench/gleamy_bench_test.mjs b/build/dev/javascript/gleamy_bench/gleamy_bench_test.mjs deleted file mode 100644 index 652c636..0000000 --- a/build/dev/javascript/gleamy_bench/gleamy_bench_test.mjs +++ /dev/null @@ -1,11 +0,0 @@ -import * as $gleeunit from "../gleeunit/gleeunit.mjs"; -import * as $should from "../gleeunit/gleeunit/should.mjs"; - -export function main() { - return $gleeunit.main(); -} - -export function hello_world_test() { - let _pipe = 1; - return $should.equal(_pipe, 1); -} diff --git a/build/dev/javascript/gleamy_bench/test.mjs b/build/dev/javascript/gleamy_bench/test.mjs deleted file mode 100644 index d56811a..0000000 --- a/build/dev/javascript/gleamy_bench/test.mjs +++ /dev/null @@ -1,113 +0,0 @@ -import * as $io from "../gleam_stdlib/gleam/io.mjs"; -import { CustomType as $CustomType, makeError } from "./gleam.mjs"; - -export class Pure extends $CustomType { - constructor(x0) { - super(); - this[0] = x0; - } -} - -export class Yield extends $CustomType { - constructor(marker, op, cont) { - super(); - this.marker = marker; - this.op = op; - this.cont = cont; - } -} - -export function yield$(marker, op) { - return new Yield(marker, op, (var0) => { return new Pure(var0); }); -} - -export function mprompt(marker, ctl) { - if (ctl instanceof Pure) { - let x = ctl[0]; - return new Pure(x); - } else if (ctl instanceof Yield) { - let m = ctl.marker; - let op = ctl.op; - let cont = ctl.cont; - let cont$1 = (x) => { return mprompt(marker, cont(x)); }; - let $ = marker === m; - if ($) { - return op(cont$1); - } else if (!$) { - return new Yield(m, op, cont$1); - } else { - throw makeError( - "case_no_match", - "test", - 39, - "mprompt", - "No case clause matched", - { values: [$] } - ) - } - } else { - throw makeError( - "case_no_match", - "test", - 35, - "mprompt", - "No case clause matched", - { values: [ctl] } - ) - } -} - -export function prompt(marker, action) { - return mprompt(marker, action()); -} - -function bind(ctl, f) { - if (ctl instanceof Pure) { - let x = ctl[0]; - return f(x); - } else if (ctl instanceof Yield) { - let m = ctl.marker; - let op = ctl.op; - let cont = ctl.cont; - return new Yield(m, op, kcompose(f, cont)); - } else { - throw makeError( - "case_no_match", - "test", - 20, - "bind", - "No case clause matched", - { values: [ctl] } - ) - } -} - -function kcompose(g, f) { - return (x) => { - let _pipe = f(x); - return bind(_pipe, g); - }; -} - -function run() { - return prompt( - "read", - () => { - return bind( - new Pure(5), - (a) => { - return bind( - yield$("read", (k) => { return k(2); }), - (b) => { return new Pure(a + b); }, - ); - }, - ); - }, - ); -} - -export function main() { - let _pipe = run(); - $io.debug(_pipe) - return $io.println("Hello from deli!"); -} diff --git a/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache b/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache deleted file mode 100644 index 2db346103f2b741d6f234e0c495dbe74e82b690d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 652 zcmbu7v2GJV5QcZ|WE`JzG9!yfK|!7%Bug%gl5{k2BH0KRz!7L@?B#CH+2n3F+T9}x zP3pV?Pmv-IkQbofiIP3rAXC%qjz%-z{G)%K-VC4MvkC4taktm`4NZ(EonO#q0Ns){`6Z7uFE zoupc@XZ6e(Wzu-EHdk~h-6?TWo-M6>C#Qd&yAIGG6}y!?MP`*ku;@T+_i z^;WftcX=JDnxhp>_;-Gi8hPOsop!zY&+N3aPM1rvZ#`7Pco2hwF?@yVOiycT82b-v zsJ7-OlJ_ZEIx~2^JPwd7&*3%B%Wm70O%H;HOde)-=l9?L|Cw3)gc~|soxq9#EALCs zbOQ>l(o_A`bkBF);lPVYJ?aNT{{>1X5NeRSHwkRE?faO*ua^BA)6y}voDt>)kd||W z@ZvjZJ3mEnOq}D)dB8B8Mses3_Pid#uMn~?5o&K?1~`up z#t1>KZdVB9D;lAgAO^X0$XSpxHXQk)$;EXKpAgD0258z9{#V$C3Lo=hZx9{1yYaME ztINkwv39s0A#&$3U8U0?G;ggq11gjs96T`2)d0BIRG>VbUmFj=WCVMV_5Rhr(p4IAUW~>~*~~k;Y6S zhUfr^Qa<@#@lCf%-q5)FaMe!T*dyEU?w`Ra<>rC<&`jztQZh=5y o9SVz3u0nY+X?0-Nfm!tNfw?J;i@XwmRry?Ti}#6nPh2a10ma`9CjbBd diff --git a/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache_meta b/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache_meta deleted file mode 100644 index c3e0942b4bd22224e705dc0380cdbceca3307e78..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49 ocmYdhxRAmC1&oYP1`m`@&q+ { - let value = inspect(this[label]); - return isNaN(parseInt(label)) ? `${label}: ${value}` : value; - }; - let props = Object.keys(this).map(field).join(", "); - return props ? `${this.constructor.name}(${props})` : this.constructor.name; - } - - withFields(fields) { - let properties = Object.keys(this).map((label) => - label in fields ? fields[label] : this[label] - ); - return new this.constructor(...properties); - } -} - -export class List { - static fromArray(array, tail) { - let t = tail || new Empty(); - return array.reduceRight((xs, x) => new NonEmpty(x, xs), t); - } - - static isList(data) { - let variant = data?.__gleam_prelude_variant__; - return variant === "EmptyList" || variant === "NonEmptyList"; - } - - [Symbol.iterator]() { - return new ListIterator(this); - } - - inspect() { - return `[${this.toArray().map(inspect).join(", ")}]`; - } - - toArray() { - return [...this]; - } - - atLeastLength(desired) { - for (let _ of this) { - if (desired <= 0) return true; - desired--; - } - return desired <= 0; - } - - hasLength(desired) { - for (let _ of this) { - if (desired <= 0) return false; - desired--; - } - return desired === 0; - } - - countLength() { - let length = 0; - for (let _ of this) length++; - return length; - } -} - -export function toList(elements, tail) { - return List.fromArray(elements, tail); -} - -class ListIterator { - #current; - - constructor(current) { - this.#current = current; - } - - next() { - if (this.#current.isEmpty()) { - return { done: true }; - } else { - let { head, tail } = this.#current; - this.#current = tail; - return { value: head, done: false }; - } - } -} - -export class Empty extends List { - get __gleam_prelude_variant__() { - return "EmptyList"; - } - - isEmpty() { - return true; - } -} - -export class NonEmpty extends List { - constructor(head, tail) { - super(); - this.head = head; - this.tail = tail; - } - - get __gleam_prelude_variant__() { - return "NonEmptyList"; - } - - isEmpty() { - return false; - } -} - -export class BitString { - static isBitString(data) { - return data?.__gleam_prelude_variant__ === "BitString"; - } - - constructor(buffer) { - if (!(buffer instanceof Uint8Array)) { - throw "BitString can only be constructed from a Uint8Array"; - } - this.buffer = buffer; - } - - get __gleam_prelude_variant__() { - return "BitString"; - } - - inspect() { - return `<<${Array.from(this.buffer).join(", ")}>>`; - } - - get length() { - return this.buffer.length; - } - - byteAt(index) { - return this.buffer[index]; - } - - floatAt(index) { - return byteArrayToFloat(this.buffer.slice(index, index + 8)); - } - - intFromSlice(start, end) { - return byteArrayToInt(this.buffer.slice(start, end)); - } - - binaryFromSlice(start, end) { - return new BitString(this.buffer.slice(start, end)); - } - - sliceAfter(index) { - return new BitString(this.buffer.slice(index)); - } -} - -export class UtfCodepoint { - constructor(value) { - this.value = value; - } - - get __gleam_prelude_variant__() { - return "UtfCodepoint"; - } - - inspect() { - return `//utfcodepoint(${String.fromCodePoint(this.value)})`; - } -} - -export function toBitString(segments) { - let size = (segment) => - segment instanceof Uint8Array ? segment.byteLength : 1; - let bytes = segments.reduce((acc, segment) => acc + size(segment), 0); - let view = new DataView(new ArrayBuffer(bytes)); - let cursor = 0; - for (let segment of segments) { - if (segment instanceof Uint8Array) { - new Uint8Array(view.buffer).set(segment, cursor); - cursor += segment.byteLength; - } else { - view.setInt8(cursor, segment); - cursor++; - } - } - return new BitString(new Uint8Array(view.buffer)); -} - -// Derived from this answer https://stackoverflow.com/questions/8482309/converting-javascript-integer-to-byte-array-and-back -export function sizedInt(int, size) { - let value = int; - if (size < 0) { - return new Uint8Array(); - } - if (size % 8 != 0) { - throw "Needs to be a byte size" + size; - } - const byteArray = new Uint8Array(size / 8); - - for (let index = 0; index < byteArray.length; index++) { - const byte = value & 0xff; - byteArray[index] = byte; - value = (value - byte) / 256; - } - return byteArray.reverse(); -} - -export function byteArrayToInt(byteArray) { - byteArray = byteArray.reverse(); - let value = 0; - for (let i = byteArray.length - 1; i >= 0; i--) { - value = value * 256 + byteArray[i]; - } - return value; -} - -export function byteArrayToFloat(byteArray) { - return new Float64Array(byteArray.reverse().buffer)[0]; -} - -export function stringBits(string) { - return new TextEncoder().encode(string); -} - -export function codepointBits(codepoint) { - return stringBits(String.fromCodePoint(codepoint.value)); -} - -export function float64Bits(float) { - return new Uint8Array(Float64Array.from([float]).buffer).reverse(); -} - -export class Result extends CustomType { - static isResult(data) { - let variant = data?.__gleam_prelude_variant__; - return variant === "Ok" || variant === "Error"; - } -} - -export class Ok extends Result { - constructor(value) { - super(); - this[0] = value; - } - - get __gleam_prelude_variant__() { - return "Ok"; - } - - isOk() { - return true; - } -} - -export class Error extends Result { - constructor(detail) { - super(); - this[0] = detail; - } - - get __gleam_prelude_variant__() { - return "Error"; - } - - isOk() { - return false; - } -} - -export function inspect(v) { - let t = typeof v; - if (v === true) return "True"; - if (v === false) return "False"; - if (v === null) return "//js(null)"; - if (v === undefined) return "Nil"; - if (t === "string") return JSON.stringify(v); - if (t === "bigint" || t === "number") return v.toString(); - if (Array.isArray(v)) return `#(${v.map(inspect).join(", ")})`; - if (v instanceof Set) return `//js(Set(${[...v].map(inspect).join(", ")}))`; - if (v instanceof RegExp) return `//js(${v})`; - if (v instanceof Date) return `//js(Date("${v.toISOString()}"))`; - if (v instanceof Function) { - let args = []; - for (let i of Array(v.length).keys()) - args.push(String.fromCharCode(i + 97)); - return `//fn(${args.join(", ")}) { ... }`; - } - try { - return v.inspect(); - } catch (_) { - return inspectObject(v); - } -} - -function inspectObject(v) { - let [keys, get] = getters(v); - let name = Object.getPrototypeOf(v)?.constructor?.name || "Object"; - let props = []; - for (let k of keys(v)) { - props.push(`${inspect(k)}: ${inspect(get(v, k))}`); - } - let body = props.length ? " " + props.join(", ") + " " : ""; - let head = name === "Object" ? "" : name + " "; - return `//js(${head}{${body}})`; -} - -export function isEqual(x, y) { - let values = [x, y]; - - while (values.length) { - let a = values.pop(); - let b = values.pop(); - if (a === b) continue; - - if (!isObject(a) || !isObject(b)) return false; - let unequal = - !structurallyCompatibleObjects(a, b) || - unequalDates(a, b) || - unequalBuffers(a, b) || - unequalArrays(a, b) || - unequalMaps(a, b) || - unequalSets(a, b); - if (unequal) return false; - - const proto = Object.getPrototypeOf(a); - if (proto !== null && typeof proto.equals === "function") { - try { - if (a.equals(b)) continue; - else return false; - } catch {} - } - - let [keys, get] = getters(a); - for (let k of keys(a)) { - values.push(get(a, k), get(b, k)); - } - } - - return true; -} - -function getters(object) { - if (object instanceof Map) { - return [(x) => x.keys(), (x, y) => x.get(y)]; - } else { - let extra = object instanceof globalThis.Error ? ["message"] : []; - return [(x) => [...extra, ...Object.keys(x)], (x, y) => x[y]]; - } -} - -function unequalDates(a, b) { - return a instanceof Date && (a > b || a < b); -} - -function unequalBuffers(a, b) { - return ( - a.buffer instanceof ArrayBuffer && - a.BYTES_PER_ELEMENT && - !(a.byteLength === b.byteLength && a.every((n, i) => n === b[i])) - ); -} - -function unequalArrays(a, b) { - return Array.isArray(a) && a.length !== b.length; -} - -function unequalMaps(a, b) { - return a instanceof Map && a.size !== b.size; -} - -function unequalSets(a, b) { - return ( - a instanceof Set && (a.size != b.size || [...a].some((e) => !b.has(e))) - ); -} - -function isObject(a) { - return typeof a === "object" && a !== null; -} - -function structurallyCompatibleObjects(a, b) { - if (typeof a !== "object" && typeof b !== "object" && (!a || !b)) - return false; - - let nonstructural = [Promise, WeakSet, WeakMap, Function]; - if (nonstructural.some((c) => a instanceof c)) return false; - - return ( - a.constructor === b.constructor || - (a.__gleam_prelude_variant__ && - a.__gleam_prelude_variant__ === b.__gleam_prelude_variant__) - ); -} - -export function remainderInt(a, b) { - if (b === 0) { - return 0; - } else { - return a % b; - } -} - -export function divideInt(a, b) { - return Math.trunc(divideFloat(a, b)); -} - -export function divideFloat(a, b) { - if (b === 0) { - return 0; - } else { - return a / b; - } -} - -export function makeError(variant, module, line, fn, message, extra) { - let error = new globalThis.Error(message); - error.gleam_error = variant; - error.module = module; - error.line = line; - error.fn = fn; - for (let k in extra) error[k] = extra[k]; - return error; -} diff --git a/build/dev/javascript/gleeunit/gleeunit.erl b/build/dev/javascript/gleeunit/gleeunit.erl deleted file mode 100644 index 32e1a83..0000000 --- a/build/dev/javascript/gleeunit/gleeunit.erl +++ /dev/null @@ -1,59 +0,0 @@ --module(gleeunit). --compile([no_auto_import, nowarn_unused_vars]). - --export([main/0]). --export_type([atom_/0, encoding/0, report_module_name/0, gleeunit_progress_option/0, eunit_option/0]). - --type atom_() :: any(). - --type encoding() :: utf8. - --type report_module_name() :: gleeunit_progress. - --type gleeunit_progress_option() :: {colored, boolean()}. - --type eunit_option() :: verbose | - no_tty | - {report, {report_module_name(), list(gleeunit_progress_option())}}. - --spec gleam_to_erlang_module_name(binary()) -> binary(). -gleam_to_erlang_module_name(Path) -> - _pipe = Path, - _pipe@1 = gleam@string:replace(_pipe, <<".gleam"/utf8>>, <<""/utf8>>), - _pipe@2 = gleam@string:replace(_pipe@1, <<".erl"/utf8>>, <<""/utf8>>), - gleam@string:replace(_pipe@2, <<"/"/utf8>>, <<"@"/utf8>>). - --spec do_main() -> nil. -do_main() -> - Options = [verbose, - no_tty, - {report, {gleeunit_progress, [{colored, true}]}}], - Result = begin - _pipe = gleeunit_ffi:find_files( - <<"**/*.{erl,gleam}"/utf8>>, - <<"test"/utf8>> - ), - _pipe@1 = gleam@list:map(_pipe, fun gleam_to_erlang_module_name/1), - _pipe@2 = gleam@list:map( - _pipe@1, - fun(_capture) -> erlang:binary_to_atom(_capture, utf8) end - ), - _pipe@3 = eunit:test(_pipe@2, Options), - _pipe@4 = (gleam@dynamic:result( - fun gleam@dynamic:dynamic/1, - fun gleam@dynamic:dynamic/1 - ))(_pipe@3), - gleam@result:unwrap(_pipe@4, {error, gleam@dynamic:from(nil)}) - end, - Code = case Result of - {ok, _} -> - 0; - - {error, _} -> - 1 - end, - erlang:halt(Code). - --spec main() -> nil. -main() -> - do_main(). diff --git a/build/dev/javascript/gleeunit/gleeunit.mjs b/build/dev/javascript/gleeunit/gleeunit.mjs deleted file mode 100644 index 442d1dc..0000000 --- a/build/dev/javascript/gleeunit/gleeunit.mjs +++ /dev/null @@ -1,5 +0,0 @@ -import { main as do_main } from "./gleeunit_ffi.mjs"; - -export function main() { - return do_main(); -} diff --git a/build/dev/javascript/gleeunit/gleeunit/should.mjs b/build/dev/javascript/gleeunit/gleeunit/should.mjs deleted file mode 100644 index cde8837..0000000 --- a/build/dev/javascript/gleeunit/gleeunit/should.mjs +++ /dev/null @@ -1,63 +0,0 @@ -import * as $string from "../../gleam_stdlib/gleam/string.mjs"; -import { inspect as stringify, toList, isEqual } from "../gleam.mjs"; -import { crash } from "../gleeunit_ffi.mjs"; - -export function equal(a, b) { - let $ = isEqual(a, b); - if ($) { - return undefined; - } else { - return crash( - $string.concat( - toList(["\n\t", stringify(a), "\n\tshould equal \n\t", stringify(b)]), - ), - ); - } -} - -export function not_equal(a, b) { - let $ = !isEqual(a, b); - if ($) { - return undefined; - } else { - return crash( - $string.concat( - toList(["\n", stringify(a), "\nshould not equal \n", stringify(b)]), - ), - ); - } -} - -export function be_ok(a) { - if (a.isOk()) { - let value = a[0]; - return value; - } else { - return crash($string.concat(toList(["\n", stringify(a), "\nshould be ok"]))); - } -} - -export function be_error(a) { - if (!a.isOk()) { - let error = a[0]; - return error; - } else { - return crash( - $string.concat(toList(["\n", stringify(a), "\nshould be error"])), - ); - } -} - -export function be_true(actual) { - let _pipe = actual; - return equal(_pipe, true); -} - -export function be_false(actual) { - let _pipe = actual; - return equal(_pipe, false); -} - -export function fail() { - return be_true(false); -} diff --git a/build/dev/javascript/gleeunit/gleeunit@should.erl b/build/dev/javascript/gleeunit/gleeunit@should.erl deleted file mode 100644 index acf032e..0000000 --- a/build/dev/javascript/gleeunit/gleeunit@should.erl +++ /dev/null @@ -1,34 +0,0 @@ --module(gleeunit@should). --compile([no_auto_import, nowarn_unused_vars]). - --export([equal/2, not_equal/2, be_ok/1, be_error/1, be_true/1, be_false/1, fail/0]). - --spec equal(EYG, EYG) -> nil. -equal(A, B) -> - gleeunit_ffi:should_equal(A, B). - --spec not_equal(EYH, EYH) -> nil. -not_equal(A, B) -> - gleeunit_ffi:should_not_equal(A, B). - --spec be_ok({ok, EYI} | {error, any()}) -> EYI. -be_ok(A) -> - gleeunit_ffi:should_be_ok(A). - --spec be_error({ok, any()} | {error, EYN}) -> EYN. -be_error(A) -> - gleeunit_ffi:should_be_error(A). - --spec be_true(boolean()) -> nil. -be_true(Actual) -> - _pipe = Actual, - gleeunit_ffi:should_equal(_pipe, true). - --spec be_false(boolean()) -> nil. -be_false(Actual) -> - _pipe = Actual, - gleeunit_ffi:should_equal(_pipe, false). - --spec fail() -> nil. -fail() -> - be_true(false). diff --git a/build/dev/javascript/gleeunit/gleeunit_ffi.erl b/build/dev/javascript/gleeunit/gleeunit_ffi.erl deleted file mode 100644 index 31f9ef9..0000000 --- a/build/dev/javascript/gleeunit/gleeunit_ffi.erl +++ /dev/null @@ -1,24 +0,0 @@ --module(gleeunit_ffi). - --export([find_files/2, should_equal/2, should_not_equal/2, should_be_ok/1, - should_be_error/1]). - --include_lib("eunit/include/eunit.hrl"). - -find_files(Pattern, In) -> - Results = filelib:wildcard(binary_to_list(Pattern), binary_to_list(In)), - lists:map(fun list_to_binary/1, Results). - - -should_equal(Actual, Expected) -> - ?assertEqual(Expected, Actual), - nil. -should_not_equal(Actual, Expected) -> - ?assertNotEqual(Expected, Actual), - nil. -should_be_ok(A) -> - ?assertMatch({ok, _}, A), - element(2, A). -should_be_error(A) -> - ?assertMatch({error, _}, A), - element(2, A). diff --git a/build/dev/javascript/gleeunit/gleeunit_ffi.mjs b/build/dev/javascript/gleeunit/gleeunit_ffi.mjs deleted file mode 100644 index 339a843..0000000 --- a/build/dev/javascript/gleeunit/gleeunit_ffi.mjs +++ /dev/null @@ -1,101 +0,0 @@ -async function* gleamFiles(directory) { - for (let entry of await read_dir(directory)) { - let path = join_path(directory, entry); - if (path.endsWith(".gleam")) { - yield path; - } else { - try { - yield* gleamFiles(path); - } catch (error) { - // Could not read directory, assume it's a file - } - } - } -} - -async function readRootPackageName() { - let toml = await read_file("gleam.toml", "utf-8"); - for (let line of toml.split("\n")) { - let matches = line.match(/\s*name\s*=\s*"([a-z][a-z0-9_]*)"/); // Match regexp in compiler-cli/src/new.rs in validate_name() - if (matches) return matches[1]; - } - throw new Error("Could not determine package name from gleam.toml"); -} - -export async function main() { - let passes = 0; - let failures = 0; - - let packageName = await readRootPackageName(); - let dist = `../${packageName}/`; - - for await (let path of await gleamFiles("test")) { - let js_path = path.slice("test/".length).replace(".gleam", ".mjs"); - let module = await import(join_path(dist, js_path)); - for (let fnName of Object.keys(module)) { - if (!fnName.endsWith("_test")) continue; - try { - await module[fnName](); - write(`\u001b[32m.\u001b[0m`); - passes++; - } catch (error) { - let moduleName = "\n" + js_path.slice(0, -4); - let line = error.line ? `:${error.line}` : ""; - write(`\n❌ ${moduleName}.${fnName}${line}: ${error}\n`); - failures++; - } - } - } - - console.log(` -${passes + failures} tests, ${failures} failures`); - exit(failures ? 1 : 0); -} - -export function crash(message) { - throw new Error(message); -} - -function write(message) { - if (globalThis.Deno) { - Deno.stdout.writeSync(new TextEncoder().encode(message)); - } else { - process.stdout.write(message); - } -} - -function exit(code) { - if (globalThis.Deno) { - Deno.exit(code); - } else { - process.exit(code); - } -} - -async function read_dir(path) { - if (globalThis.Deno) { - let items = []; - for await (let item of Deno.readDir(path, { withFileTypes: true })) { - items.push(item.name); - } - return items; - } else { - let { readdir } = await import("fs/promises"); - return readdir(path); - } -} - -function join_path(a, b) { - if (a.endsWith("/")) return a + b; - return a + "/" + b; -} - -async function read_file(path) { - if (globalThis.Deno) { - return Deno.readTextFile(path); - } else { - let { readFile } = await import("fs/promises"); - let contents = await readFile(path); - return contents.toString(); - } -} diff --git a/build/dev/javascript/gleeunit/gleeunit_progress.erl b/build/dev/javascript/gleeunit/gleeunit_progress.erl deleted file mode 100644 index 1f68eb9..0000000 --- a/build/dev/javascript/gleeunit/gleeunit_progress.erl +++ /dev/null @@ -1,607 +0,0 @@ -%% A formatter adapted from Sean Cribb's https://github.com/seancribbs/eunit_formatters - -%% @doc A listener/reporter for eunit that prints '.' for each -%% success, 'F' for each failure, and 'E' for each error. It can also -%% optionally summarize the failures at the end. --compile({nowarn_unused_function, [insert/2, to_list/1, to_list/2, size/1]}). --module(gleeunit_progress). --behaviour(eunit_listener). --define(NOTEST, true). --include_lib("eunit/include/eunit.hrl"). - --define(RED, "\e[0;31m"). --define(GREEN, "\e[0;32m"). --define(YELLOW, "\e[0;33m"). --define(WHITE, "\e[0;37m"). --define(CYAN, "\e[0;36m"). --define(RESET, "\e[0m"). - --record(node,{ - rank = 0 :: non_neg_integer(), - key :: term(), - value :: term(), - children = new() :: binomial_heap() - }). - --export_type([binomial_heap/0, heap_node/0]). --type binomial_heap() :: [ heap_node() ]. --type heap_node() :: #node{}. - -%% eunit_listener callbacks --export([ - init/1, - handle_begin/3, - handle_end/3, - handle_cancel/3, - terminate/2, - start/0, - start/1 - ]). - -%% -- binomial_heap.erl content start -- - --record(state, { - status = dict:new() :: euf_dict(), - failures = [] :: [[pos_integer()]], - skips = [] :: [[pos_integer()]], - timings = new() :: binomial_heap(), - colored = true :: boolean(), - profile = false :: boolean() - }). - --type euf_dict() :: dict:dict(). - --spec new() -> binomial_heap(). -new() -> - []. - -% Inserts a new pair into the heap (or creates a new heap) --spec insert(term(), term()) -> binomial_heap(). -insert(Key,Value) -> - insert(Key,Value,[]). - --spec insert(term(), term(), binomial_heap()) -> binomial_heap(). -insert(Key,Value,Forest) -> - insTree(#node{key=Key,value=Value},Forest). - -% Merges two heaps --spec merge(binomial_heap(), binomial_heap()) -> binomial_heap(). -merge(TS1,[]) when is_list(TS1) -> TS1; -merge([],TS2) when is_list(TS2) -> TS2; -merge([#node{rank=R1}=T1|TS1]=F1,[#node{rank=R2}=T2|TS2]=F2) -> - if - R1 < R2 -> - [T1 | merge(TS1,F2)]; - R2 < R1 -> - [T2 | merge(F1, TS2)]; - true -> - insTree(link(T1,T2),merge(TS1,TS2)) - end. - -% Deletes the top entry from the heap and returns it --spec delete(binomial_heap()) -> {{term(), term()}, binomial_heap()}. -delete(TS) -> - {#node{key=Key,value=Value,children=TS1},TS2} = getMin(TS), - {{Key,Value},merge(lists:reverse(TS1),TS2)}. - -% Turns the heap into list in heap order --spec to_list(binomial_heap()) -> [{term(), term()}]. -to_list([]) -> []; -to_list(List) when is_list(List) -> - to_list([],List). -to_list(Acc, []) -> - lists:reverse(Acc); -to_list(Acc,Forest) -> - {Next, Trees} = delete(Forest), - to_list([Next|Acc], Trees). - -% Take N elements from the top of the heap --spec take(non_neg_integer(), binomial_heap()) -> [{term(), term()}]. -take(N,Trees) when is_integer(N), is_list(Trees) -> - take(N,Trees,[]). -take(0,_Trees,Acc) -> - lists:reverse(Acc); -take(_N,[],Acc)-> - lists:reverse(Acc); -take(N,Trees,Acc) -> - {Top,T2} = delete(Trees), - take(N-1,T2,[Top|Acc]). - -% Get an estimate of the size based on the binomial property --spec size(binomial_heap()) -> non_neg_integer(). -size(Forest) -> - erlang:trunc(lists:sum([math:pow(2,R) || #node{rank=R} <- Forest])). - -%% Private API --spec link(heap_node(), heap_node()) -> heap_node(). -link(#node{rank=R,key=X1,children=C1}=T1,#node{key=X2,children=C2}=T2) -> - case X1 < X2 of - true -> - T1#node{rank=R+1,children=[T2|C1]}; - _ -> - T2#node{rank=R+1,children=[T1|C2]} - end. - -insTree(Tree, []) -> - [Tree]; -insTree(#node{rank=R1}=T1, [#node{rank=R2}=T2|Rest] = TS) -> - case R1 < R2 of - true -> - [T1|TS]; - _ -> - insTree(link(T1,T2),Rest) - end. - -getMin([T]) -> - {T,[]}; -getMin([#node{key=K} = T|TS]) -> - {#node{key=K1} = T1,TS1} = getMin(TS), - case K < K1 of - true -> {T,TS}; - _ -> {T1,[T|TS1]} - end. - -%% -- binomial_heap.erl content end -- - -%% Startup -start() -> - start([]). - -start(Options) -> - eunit_listener:start(?MODULE, Options). - -%%------------------------------------------ -%% eunit_listener callbacks -%%------------------------------------------ -init(Options) -> - #state{colored=proplists:get_bool(colored, Options), - profile=proplists:get_bool(profile, Options)}. - -handle_begin(group, Data, St) -> - GID = proplists:get_value(id, Data), - Dict = St#state.status, - St#state{status=dict:store(GID, orddict:from_list([{type, group}|Data]), Dict)}; -handle_begin(test, Data, St) -> - TID = proplists:get_value(id, Data), - Dict = St#state.status, - St#state{status=dict:store(TID, orddict:from_list([{type, test}|Data]), Dict)}. - -handle_end(group, Data, St) -> - St#state{status=merge_on_end(Data, St#state.status)}; -handle_end(test, Data, St) -> - NewStatus = merge_on_end(Data, St#state.status), - St1 = print_progress(Data, St), - St2 = record_timing(Data, St1), - St2#state{status=NewStatus}. - -handle_cancel(_, Data, #state{status=Status, skips=Skips}=St) -> - Status1 = merge_on_end(Data, Status), - ID = proplists:get_value(id, Data), - St#state{status=Status1, skips=[ID|Skips]}. - -terminate({ok, Data}, St) -> - print_failures(St), - print_pending(St), - print_profile(St), - print_timing(St), - print_results(Data, St); -terminate({error, Reason}, St) -> - io:nl(), io:nl(), - print_colored(io_lib:format("Eunit failed: ~25p~n", [Reason]), ?RED, St), - sync_end(error). - -sync_end(Result) -> - receive - {stop, Reference, ReplyTo} -> - ReplyTo ! {result, Reference, Result}, - ok - end. - -%%------------------------------------------ -%% Print and collect information during run -%%------------------------------------------ -print_progress(Data, St) -> - TID = proplists:get_value(id, Data), - case proplists:get_value(status, Data) of - ok -> - print_progress_success(St), - St; - {skipped, _Reason} -> - print_progress_skipped(St), - St#state{skips=[TID|St#state.skips]}; - {error, Exception} -> - print_progress_failed(Exception, St), - St#state{failures=[TID|St#state.failures]} - end. - -record_timing(Data, State=#state{timings=T, profile=true}) -> - TID = proplists:get_value(id, Data), - case lists:keyfind(time, 1, Data) of - {time, Int} -> - %% It's a min-heap, so we insert negative numbers instead - %% of the actuals and normalize when we report on them. - T1 = insert(-Int, TID, T), - State#state{timings=T1}; - false -> - State - end; -record_timing(_Data, State) -> - State. - -print_progress_success(St) -> - print_colored(".", ?GREEN, St). - -print_progress_skipped(St) -> - print_colored("*", ?YELLOW, St). - -print_progress_failed(_Exc, St) -> - print_colored("F", ?RED, St). - -merge_on_end(Data, Dict) -> - ID = proplists:get_value(id, Data), - dict:update(ID, - fun(Old) -> - orddict:merge(fun merge_data/3, Old, orddict:from_list(Data)) - end, Dict). - -merge_data(_K, undefined, X) -> X; -merge_data(_K, X, undefined) -> X; -merge_data(_K, _, X) -> X. - -%%------------------------------------------ -%% Print information at end of run -%%------------------------------------------ -print_failures(#state{failures=[]}) -> - ok; -print_failures(#state{failures=Fails}=State) -> - io:nl(), - io:fwrite("Failures:~n",[]), - lists:foldr(print_failure_fun(State), 1, Fails), - ok. - -print_failure_fun(#state{status=Status}=State) -> - fun(Key, Count) -> - TestData = dict:fetch(Key, Status), - TestId = format_test_identifier(TestData), - io:fwrite("~n ~p) ~ts~n", [Count, TestId]), - print_failure_reason(proplists:get_value(status, TestData), - proplists:get_value(output, TestData), - State), - io:nl(), - Count + 1 - end. - -print_gleam_location(#{function := Function, line := Line, module := Module }, State) -> - X = indent(5, "location: ~s.~s:~p~n", [Module, Function, Line]), - print_colored(X, ?CYAN, State); -print_gleam_location(_, _) -> - ok. - -inspect(X) -> - gleam@string:inspect(X). - -print_gleam_failure_reason( - #{gleam_error := assert, message := Message, value := Value}, - State -) -> - print_colored(indent(5, "~s~n", [Message]), ?RED, State), - print_colored(indent(5, " value: ", []), ?RED, State), - print_colored(indent(0, "~ts~n", [inspect(Value)]), ?RESET, State); -print_gleam_failure_reason( - #{gleam_error := todo, message := Message}, - State -) -> - print_colored(indent(5, "todo expression run~n", []), ?RED, State), - print_colored(indent(5, " message: ", []), ?RED, State), - print_colored(indent(0, "~s~n", [Message]), ?RESET, State); -print_gleam_failure_reason(Error, State) -> - print_colored(indent(5, "~p~n", [Error]), ?RED, State). - -% New Gleeunit specific formatters -print_failure_reason( - {error, {error, #{gleam_error := _} = Error, Stack}}, Output, State -) when is_list(Stack) -> - print_gleam_failure_reason(Error, State), - print_gleam_location(Error, State), - print_stack(Stack, State), - print_failure_output(5, Output, State); -print_failure_reason({error, {error, {case_clause, Value}, Stack}}, Output, State) when is_list(Stack) -> - print_colored(indent(5, "No case clause matched~n", []), ?RED, State), - print_colored(indent(5, "Value: ", []), ?CYAN, State), - print_colored(indent(0, "~ts~n", [inspect(Value)]), ?RESET, State), - print_stack(Stack, State), - print_failure_output(5, Output, State); -% From the original Erlang version -print_failure_reason({skipped, Reason}, _Output, State) -> - print_colored(io_lib:format(" ~ts~n", [format_pending_reason(Reason)]), - ?RED, State); -print_failure_reason({error, {_Class, Term, _}}, Output, State) when - is_tuple(Term), tuple_size(Term) == 2, is_list(element(2, Term)) -> - print_assertion_failure(Term, State), - print_failure_output(5, Output, State); -print_failure_reason({error, {error, Error, Stack}}, Output, State) when is_list(Stack) -> - print_colored(indent(5, "Failure: ~p~n", [Error]), ?RED, State), - print_stack(Stack, State), - print_failure_output(5, Output, State); -print_failure_reason({error, Reason}, Output, State) -> - print_colored(indent(5, "Failure: ~p~n", [Reason]), ?RED, State), - print_failure_output(5, Output, State). - -gleam_format_module_name(Module) -> - string:replace(atom_to_list(Module), "@", "/", all). - -print_stack(Stack, State) -> - print_colored(indent(5, "stacktrace:~n", []), ?CYAN, State), - print_stackframes(Stack, State). -print_stackframes([{eunit_test, _, _, _} | Stack], State) -> - print_stackframes(Stack, State); -print_stackframes([{eunit_proc, _, _, _} | Stack], State) -> - print_stackframes(Stack, State); -print_stackframes([{Module, Function, _Arity, _Location} | Stack], State) -> - GleamModule = gleam_format_module_name(Module), - print_colored(indent(7, "~s.~p~n", [GleamModule, Function]), ?CYAN, State), - print_stackframes(Stack, State); -print_stackframes([], _State) -> - ok. - - -print_failure_output(_, <<>>, _) -> ok; -print_failure_output(_, undefined, _) -> ok; -print_failure_output(Indent, Output, State) -> - print_colored(indent(Indent, "output: ~ts", [Output]), ?CYAN, State). - -print_assertion_failure({Type, Props}, State) -> - FailureDesc = format_assertion_failure(Type, Props, 5), - print_colored(FailureDesc, ?RED, State), - io:nl(). - -print_pending(#state{skips=[]}) -> - ok; -print_pending(#state{status=Status, skips=Skips}=State) -> - io:nl(), - io:fwrite("Pending:~n", []), - lists:foreach(fun(ID) -> - Info = dict:fetch(ID, Status), - case proplists:get_value(reason, Info) of - undefined -> - ok; - Reason -> - print_pending_reason(Reason, Info, State) - end - end, lists:reverse(Skips)), - io:nl(). - -print_pending_reason(Reason0, Data, State) -> - Text = case proplists:get_value(type, Data) of - group -> - io_lib:format(" ~ts~n", [proplists:get_value(desc, Data)]); - test -> - io_lib:format(" ~ts~n", [format_test_identifier(Data)]) - end, - Reason = io_lib:format(" %% ~ts~n", [format_pending_reason(Reason0)]), - print_colored(Text, ?YELLOW, State), - print_colored(Reason, ?CYAN, State). - -print_profile(#state{timings=T, status=Status, profile=true}=State) -> - TopN = take(10, T), - TopNTime = abs(lists:sum([ Time || {Time, _} <- TopN ])), - TLG = dict:fetch([], Status), - TotalTime = proplists:get_value(time, TLG), - if TotalTime =/= undefined andalso TotalTime > 0 andalso TopN =/= [] -> - TopNPct = (TopNTime / TotalTime) * 100, - io:nl(), io:nl(), - io:fwrite("Top ~p slowest tests (~ts, ~.1f% of total time):", [length(TopN), format_time(TopNTime), TopNPct]), - lists:foreach(print_timing_fun(State), TopN), - io:nl(); - true -> ok - end; -print_profile(#state{profile=false}) -> - ok. - -print_timing(#state{status=Status}) -> - TLG = dict:fetch([], Status), - Time = proplists:get_value(time, TLG), - io:nl(), - io:fwrite("Finished in ~ts~n", [format_time(Time)]), - ok. - -print_results(Data, State) -> - Pass = proplists:get_value(pass, Data, 0), - Fail = proplists:get_value(fail, Data, 0), - Skip = proplists:get_value(skip, Data, 0), - Cancel = proplists:get_value(cancel, Data, 0), - Total = Pass + Fail + Skip + Cancel, - {Color, Result} = if Fail > 0 -> {?RED, error}; - Skip > 0; Cancel > 0 -> {?YELLOW, error}; - Pass =:= 0 -> {?YELLOW, ok}; - true -> {?GREEN, ok} - end, - print_results(Color, Total, Fail, Skip, Cancel, State), - sync_end(Result). - -print_results(Color, 0, _, _, _, State) -> - print_colored(Color, "0 tests\n", State); -print_results(Color, Total, Fail, Skip, Cancel, State) -> - SkipText = format_optional_result(Skip, "skipped"), - CancelText = format_optional_result(Cancel, "cancelled"), - Text = io_lib:format("~p tests, ~p failures~ts~ts~n", [Total, Fail, SkipText, CancelText]), - print_colored(Text, Color, State). - -print_timing_fun(#state{status=Status}=State) -> - fun({Time, Key}) -> - TestData = dict:fetch(Key, Status), - TestId = format_test_identifier(TestData), - io:nl(), - io:fwrite(" ~ts~n", [TestId]), - print_colored([" "|format_time(abs(Time))], ?CYAN, State) - end. - -%%------------------------------------------ -%% Print to the console with the given color -%% if enabled. -%%------------------------------------------ -print_colored(Text, Color, #state{colored=true}) -> - io:fwrite("~s~ts~s", [Color, Text, ?RESET]); -print_colored(Text, _Color, #state{colored=false}) -> - io:fwrite("~ts", [Text]). - -%%------------------------------------------ -%% Generic data formatters -%%------------------------------------------ -format_function_name(M, F) -> - M1 = gleam_format_module_name(M), - io_lib:format("~ts.~ts", [M1, F]). - -format_optional_result(0, _) -> - []; -format_optional_result(Count, Text) -> - io_lib:format(", ~p ~ts", [Count, Text]). - -format_test_identifier(Data) -> - {Mod, Fun, _} = proplists:get_value(source, Data), - Line = case proplists:get_value(line, Data) of - 0 -> ""; - L -> io_lib:format(":~p", [L]) - end, - Desc = case proplists:get_value(desc, Data) of - undefined -> ""; - DescText -> io_lib:format(": ~ts", [DescText]) - end, - io_lib:format("~ts~ts~ts", [format_function_name(Mod, Fun), Line, Desc]). - -format_time(undefined) -> - "? seconds"; -format_time(Time) -> - io_lib:format("~.3f seconds", [Time / 1000]). - -format_pending_reason({module_not_found, M}) -> - M1 = gleam_format_module_name(M), - io_lib:format("Module '~ts' missing", [M1]); -format_pending_reason({no_such_function, {M,F,_}}) -> - M1 = gleam_format_module_name(M), - io_lib:format("Function ~ts undefined", [format_function_name(M1,F)]); -format_pending_reason({exit, Reason}) -> - io_lib:format("Related process exited with reason: ~p", [Reason]); -format_pending_reason(Reason) -> - io_lib:format("Unknown error: ~p", [Reason]). - -%% @doc Formats all the known eunit assertions, you're on your own if -%% you make an assertion yourself. -format_assertion_failure(Type, Props, I) when Type =:= assertion_failed - ; Type =:= assert -> - Keys = proplists:get_keys(Props), - HasEUnitProps = ([expression, value] -- Keys) =:= [], - HasHamcrestProps = ([expected, actual, matcher] -- Keys) =:= [], - if - HasEUnitProps -> - [indent(I, "Failure: ?assert(~ts)~n", [proplists:get_value(expression, Props)]), - indent(I, " expected: true~n", []), - case proplists:get_value(value, Props) of - false -> - indent(I, " got: false", []); - {not_a_boolean, V} -> - indent(I, " got: ~p", [V]) - end]; - HasHamcrestProps -> - [indent(I, "Failure: ?assertThat(~p)~n", [proplists:get_value(matcher, Props)]), - indent(I, " expected: ~ts~n", [inspect(proplists:get_value(expected, Props))]), - indent(I, " got: ~ts", [inspect(proplists:get_value(actual, Props))])]; - true -> - [indent(I, "Failure: unknown assert: ~p", [Props])] - end; - -format_assertion_failure(Type, Props, I) when Type =:= assertMatch_failed - ; Type =:= assertMatch -> - Expr = proplists:get_value(expression, Props), - Pattern = proplists:get_value(pattern, Props), - Value = proplists:get_value(value, Props), - [indent(I, "Failure: ?assertMatch(~ts, ~ts)~n", [Pattern, Expr]), - indent(I, " expected: = ~ts~n", [Pattern]), - indent(I, " got: ~p", [Value])]; - -format_assertion_failure(Type, Props, I) when Type =:= assertNotMatch_failed - ; Type =:= assertNotMatch -> - Expr = proplists:get_value(expression, Props), - Pattern = proplists:get_value(pattern, Props), - Value = proplists:get_value(value, Props), - [indent(I, "Failure: ?assertNotMatch(~ts, ~ts)~n", [Pattern, Expr]), - indent(I, " expected not: = ~ts~n", [Pattern]), - indent(I, " got: ~p", [Value])]; - -format_assertion_failure(Type, Props, I) when Type =:= assertEqual_failed - ; Type =:= assertEqual -> - Expected = inspect(proplists:get_value(expected, Props)), - Value = inspect(proplists:get_value(value, Props)), - [indent(I, "Values were not equal~n", []), - indent(I, "expected: ~ts~n", [Expected]), - indent(I, " got: ~ts", [Value])]; - -format_assertion_failure(Type, Props, I) when Type =:= assertNotEqual_failed - ; Type =:= assertNotEqual -> - Value = inspect(proplists:get_value(value, Props)), - [indent(I, "Values were equal~n", []), - indent(I, "expected: not ~ts~n,", [Value]), - indent(I, " got: ~ts", [Value])]; - -format_assertion_failure(Type, Props, I) when Type =:= assertException_failed - ; Type =:= assertException -> - Expr = proplists:get_value(expression, Props), - Pattern = proplists:get_value(pattern, Props), - {Class, Term} = extract_exception_pattern(Pattern), % I hate that we have to do this, why not just give DATA - [indent(I, "Failure: ?assertException(~ts, ~ts, ~ts)~n", [Class, Term, Expr]), - case proplists:is_defined(unexpected_success, Props) of - true -> - [indent(I, " expected: exception ~ts but nothing was raised~n", [Pattern]), - indent(I, " got: value ~p", [proplists:get_value(unexpected_success, Props)])]; - false -> - Ex = proplists:get_value(unexpected_exception, Props), - [indent(I, " expected: exception ~ts~n", [Pattern]), - indent(I, " got: exception ~p", [Ex])] - end]; - -format_assertion_failure(Type, Props, I) when Type =:= assertNotException_failed - ; Type =:= assertNotException -> - Expr = proplists:get_value(expression, Props), - Pattern = proplists:get_value(pattern, Props), - {Class, Term} = extract_exception_pattern(Pattern), % I hate that we have to do this, why not just give DAT - Ex = proplists:get_value(unexpected_exception, Props), - [indent(I, "Failure: ?assertNotException(~ts, ~ts, ~ts)~n", [Class, Term, Expr]), - indent(I, " expected not: exception ~ts~n", [Pattern]), - indent(I, " got: exception ~p", [Ex])]; - -format_assertion_failure(Type, Props, I) when Type =:= command_failed - ; Type =:= command -> - Cmd = proplists:get_value(command, Props), - Expected = proplists:get_value(expected_status, Props), - Status = proplists:get_value(status, Props), - [indent(I, "Failure: ?cmdStatus(~p, ~p)~n", [Expected, Cmd]), - indent(I, " expected: status ~p~n", [Expected]), - indent(I, " got: status ~p", [Status])]; - -format_assertion_failure(Type, Props, I) when Type =:= assertCmd_failed - ; Type =:= assertCmd -> - Cmd = proplists:get_value(command, Props), - Expected = proplists:get_value(expected_status, Props), - Status = proplists:get_value(status, Props), - [indent(I, "Failure: ?assertCmdStatus(~p, ~p)~n", [Expected, Cmd]), - indent(I, " expected: status ~p~n", [Expected]), - indent(I, " got: status ~p", [Status])]; - -format_assertion_failure(Type, Props, I) when Type =:= assertCmdOutput_failed - ; Type =:= assertCmdOutput -> - Cmd = proplists:get_value(command, Props), - Expected = proplists:get_value(expected_output, Props), - Output = proplists:get_value(output, Props), - [indent(I, "Failure: ?assertCmdOutput(~p, ~p)~n", [Expected, Cmd]), - indent(I, " expected: ~p~n", [Expected]), - indent(I, " got: ~p", [Output])]; - -format_assertion_failure(Type, Props, I) -> - indent(I, "~p", [{Type, Props}]). - -indent(I, Fmt, Args) -> - io_lib:format("~" ++ integer_to_list(I) ++ "s" ++ Fmt, [" "|Args]). - -extract_exception_pattern(Str) -> - ["{", Class, Term|_] = re:split(Str, "[, ]{1,2}", [unicode,{return,list}]), - {Class, Term}. diff --git a/build/lsp/erlang/gleam.lock b/build/lsp/erlang/gleam.lock deleted file mode 100644 index e69de29..0000000 diff --git a/build/lsp/javascript/gleam.lock b/build/lsp/javascript/gleam.lock deleted file mode 100644 index e69de29..0000000 diff --git a/build/packages/gleam.lock b/build/packages/gleam.lock deleted file mode 100644 index e69de29..0000000 diff --git a/build/packages/gleam_stdlib/LICENCE b/build/packages/gleam_stdlib/LICENCE deleted file mode 100644 index c1dabd0..0000000 --- a/build/packages/gleam_stdlib/LICENCE +++ /dev/null @@ -1,191 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2018, Louis Pilfold . - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/build/packages/gleam_stdlib/README.md b/build/packages/gleam_stdlib/README.md deleted file mode 100644 index 05c68ca..0000000 --- a/build/packages/gleam_stdlib/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# stdlib - -GitHub release -Discord chat -![CI](https://github.com/gleam-lang/stdlib/workflows/CI/badge.svg?branch=main) - -Gleam's standard library! -Documentation available on [HexDocs](https://hexdocs.pm/gleam_stdlib/). - -## Installation - -Add `gleam_stdlib` to your Gleam project. - -```sh -gleam add gleam_stdlib -``` - -## Usage - -Import the modules you want to use and write some code! - -```gleam -import gleam/string - -pub fn greet(name: String) -> String { - string.concat(["Hello ", name, "!"]) -} -``` - -## Targets - -Gleam's standard library supports both targets: Erlang and JavaScript. - -### Compatibility - -This library is compatible with all versions of Erlang/OTP, NodeJS, and -major browsers that are currently supported by their maintainers. If you -have a compatibility issue with any platform open an issue and we'll see -what we can do to help. diff --git a/build/packages/gleam_stdlib/gleam.toml b/build/packages/gleam_stdlib/gleam.toml deleted file mode 100644 index b4d51ab..0000000 --- a/build/packages/gleam_stdlib/gleam.toml +++ /dev/null @@ -1,16 +0,0 @@ -name = "gleam_stdlib" -version = "0.31.0" -gleam = ">= 0.30.0" -licences = ["Apache-2.0"] -description = "A standard library for the Gleam programming language" - -repository = { type = "github", user = "gleam-lang", repo = "stdlib" } -links = [ - { title = "Website", href = "https://gleam.run" }, - { title = "Sponsor", href = "https://github.com/sponsors/lpil" }, -] - -[javascript.deno] -allow_read = [ - "./", -] diff --git a/build/packages/gleam_stdlib/include/gleam@dynamic_DecodeError.hrl b/build/packages/gleam_stdlib/include/gleam@dynamic_DecodeError.hrl deleted file mode 100644 index b1135f2..0000000 --- a/build/packages/gleam_stdlib/include/gleam@dynamic_DecodeError.hrl +++ /dev/null @@ -1,5 +0,0 @@ --record(decode_error, { - expected :: binary(), - found :: binary(), - path :: list(binary()) -}). diff --git a/build/packages/gleam_stdlib/include/gleam@iterator_Iterator.hrl b/build/packages/gleam_stdlib/include/gleam@iterator_Iterator.hrl deleted file mode 100644 index b0d08dc..0000000 --- a/build/packages/gleam_stdlib/include/gleam@iterator_Iterator.hrl +++ /dev/null @@ -1 +0,0 @@ --record(iterator, {continuation :: fun(() -> gleam@iterator:action(any()))}). diff --git a/build/packages/gleam_stdlib/include/gleam@iterator_Next.hrl b/build/packages/gleam_stdlib/include/gleam@iterator_Next.hrl deleted file mode 100644 index 1f61922..0000000 --- a/build/packages/gleam_stdlib/include/gleam@iterator_Next.hrl +++ /dev/null @@ -1 +0,0 @@ --record(next, {element :: any(), accumulator :: any()}). diff --git a/build/packages/gleam_stdlib/include/gleam@queue_Queue.hrl b/build/packages/gleam_stdlib/include/gleam@queue_Queue.hrl deleted file mode 100644 index 88ac25e..0000000 --- a/build/packages/gleam_stdlib/include/gleam@queue_Queue.hrl +++ /dev/null @@ -1 +0,0 @@ --record(queue, {in :: list(any()), out :: list(any())}). diff --git a/build/packages/gleam_stdlib/include/gleam@regex_CompileError.hrl b/build/packages/gleam_stdlib/include/gleam@regex_CompileError.hrl deleted file mode 100644 index ad5511e..0000000 --- a/build/packages/gleam_stdlib/include/gleam@regex_CompileError.hrl +++ /dev/null @@ -1 +0,0 @@ --record(compile_error, {error :: binary(), byte_index :: integer()}). diff --git a/build/packages/gleam_stdlib/include/gleam@regex_Match.hrl b/build/packages/gleam_stdlib/include/gleam@regex_Match.hrl deleted file mode 100644 index 4216619..0000000 --- a/build/packages/gleam_stdlib/include/gleam@regex_Match.hrl +++ /dev/null @@ -1,4 +0,0 @@ --record(match, { - content :: binary(), - submatches :: list(gleam@option:option(binary())) -}). diff --git a/build/packages/gleam_stdlib/include/gleam@regex_Options.hrl b/build/packages/gleam_stdlib/include/gleam@regex_Options.hrl deleted file mode 100644 index 0074603..0000000 --- a/build/packages/gleam_stdlib/include/gleam@regex_Options.hrl +++ /dev/null @@ -1 +0,0 @@ --record(options, {case_insensitive :: boolean(), multi_line :: boolean()}). diff --git a/build/packages/gleam_stdlib/include/gleam@set_Set.hrl b/build/packages/gleam_stdlib/include/gleam@set_Set.hrl deleted file mode 100644 index 9c90312..0000000 --- a/build/packages/gleam_stdlib/include/gleam@set_Set.hrl +++ /dev/null @@ -1 +0,0 @@ --record(set, {map :: gleam@map:map_(any(), list(nil))}). diff --git a/build/packages/gleam_stdlib/include/gleam@uri_Uri.hrl b/build/packages/gleam_stdlib/include/gleam@uri_Uri.hrl deleted file mode 100644 index 50150f4..0000000 --- a/build/packages/gleam_stdlib/include/gleam@uri_Uri.hrl +++ /dev/null @@ -1,9 +0,0 @@ --record(uri, { - scheme :: gleam@option:option(binary()), - userinfo :: gleam@option:option(binary()), - host :: gleam@option:option(binary()), - port :: gleam@option:option(integer()), - path :: binary(), - 'query' :: gleam@option:option(binary()), - fragment :: gleam@option:option(binary()) -}). diff --git a/build/packages/gleam_stdlib/src/gleam/base.gleam b/build/packages/gleam_stdlib/src/gleam/base.gleam deleted file mode 100644 index a084a7c..0000000 --- a/build/packages/gleam_stdlib/src/gleam/base.gleam +++ /dev/null @@ -1,47 +0,0 @@ -import gleam/bit_string -import gleam/string - -/// Encodes a BitString into a base 64 encoded string. -/// -pub fn encode64(input: BitString, padding: Bool) -> String { - let encoded = do_encode64(input) - case padding { - True -> encoded - False -> string.replace(encoded, "=", "") - } -} - -@external(erlang, "base64", "encode") -@external(javascript, "../gleam_stdlib.mjs", "encode64") -fn do_encode64(a: BitString) -> String - -/// Decodes a base 64 encoded string into a `BitString`. -/// -pub fn decode64(encoded: String) -> Result(BitString, Nil) { - let padded = case bit_string.byte_size(bit_string.from_string(encoded)) % 4 { - 0 -> encoded - n -> string.append(encoded, string.repeat("=", 4 - n)) - } - do_decode64(padded) -} - -@external(erlang, "gleam_stdlib", "base_decode64") -@external(javascript, "../gleam_stdlib.mjs", "decode64") -fn do_decode64(a: String) -> Result(BitString, Nil) - -/// Encodes a `BitString` into a base 64 encoded string with URL and filename safe alphabet. -/// -pub fn url_encode64(input: BitString, padding: Bool) -> String { - encode64(input, padding) - |> string.replace("+", "-") - |> string.replace("/", "_") -} - -/// Decodes a base 64 encoded string with URL and filename safe alphabet into a `BitString`. -/// -pub fn url_decode64(encoded: String) -> Result(BitString, Nil) { - encoded - |> string.replace("-", "+") - |> string.replace("_", "/") - |> decode64() -} diff --git a/build/packages/gleam_stdlib/src/gleam/bit_builder.gleam b/build/packages/gleam_stdlib/src/gleam/bit_builder.gleam deleted file mode 100644 index 03f0bff..0000000 --- a/build/packages/gleam_stdlib/src/gleam/bit_builder.gleam +++ /dev/null @@ -1,255 +0,0 @@ -//// BitBuilder is a type used for efficiently concatenating bits to create bit -//// strings. -//// -//// If we append one bit string to another the bit strings must be copied to a -//// new location in memory so that they can sit together. This behaviour -//// enables efficient reading of the string but copying can be expensive, -//// especially if we want to join many bit strings together. -//// -//// BitBuilder is different in that it can be joined together in constant -//// time using minimal memory, and then can be efficiently converted to a -//// bit string using the `to_bit_string` function. -//// -//// On Erlang this type is compatible with Erlang's iolists. - -import gleam/string_builder.{StringBuilder} -@target(javascript) -import gleam/list -@target(javascript) -import gleam/bit_string - -@target(erlang) -pub type BitBuilder - -@target(javascript) -pub opaque type BitBuilder { - Bits(BitString) - Text(StringBuilder) - Many(List(BitBuilder)) -} - -/// Create an empty `BitBuilder`. Useful as the start of a pipe chaning many -/// builders together. -/// -pub fn new() -> BitBuilder { - do_concat([]) -} - -/// Prepends a bit string to the start of a builder. -/// -/// Runs in constant time. -/// -pub fn prepend(to: BitBuilder, prefix: BitString) -> BitBuilder { - append_builder(from_bit_string(prefix), to) -} - -/// Appends a bit string to the end of a builder. -/// -/// Runs in constant time. -/// -pub fn append(to: BitBuilder, suffix: BitString) -> BitBuilder { - append_builder(to, from_bit_string(suffix)) -} - -/// Prepends a builder onto the start of another. -/// -/// Runs in constant time. -/// -pub fn prepend_builder(to: BitBuilder, prefix: BitBuilder) -> BitBuilder { - append_builder(prefix, to) -} - -/// Appends a builder onto the end of another. -/// -/// Runs in constant time. -/// -pub fn append_builder( - to first: BitBuilder, - suffix second: BitBuilder, -) -> BitBuilder { - do_append_builder(first, second) -} - -@target(erlang) -@external(erlang, "gleam_stdlib", "iodata_append") -fn do_append_builder(to to: BitBuilder, suffix suffix: BitBuilder) -> BitBuilder - -@target(javascript) -fn do_append_builder(first: BitBuilder, second: BitBuilder) -> BitBuilder { - case second { - Many(builders) -> Many([first, ..builders]) - _ -> Many([first, second]) - } -} - -/// Prepends a string onto the start of a builder. -/// -/// Runs in constant time when running on Erlang. -/// Runs in linear time with the length of the string otherwise. -/// -pub fn prepend_string(to: BitBuilder, prefix: String) -> BitBuilder { - append_builder(from_string(prefix), to) -} - -/// Appends a string onto the end of a builder. -/// -/// Runs in constant time when running on Erlang. -/// Runs in linear time with the length of the string otherwise. -/// -pub fn append_string(to: BitBuilder, suffix: String) -> BitBuilder { - append_builder(to, from_string(suffix)) -} - -/// Joins a list of builders into a single builder. -/// -/// Runs in constant time. -/// -pub fn concat(builders: List(BitBuilder)) -> BitBuilder { - do_concat(builders) -} - -@target(erlang) -@external(erlang, "gleam_stdlib", "identity") -fn do_concat(a: List(BitBuilder)) -> BitBuilder - -@target(javascript) -fn do_concat(builders: List(BitBuilder)) -> BitBuilder { - Many(builders) -} - -/// Joins a list of bit strings into a single builder. -/// -/// Runs in constant time. -/// -pub fn concat_bit_strings(bits: List(BitString)) -> BitBuilder { - do_concat_bit_strings(bits) -} - -@target(erlang) -@external(erlang, "gleam_stdlib", "identity") -fn do_concat_bit_strings(a: List(BitString)) -> BitBuilder - -@target(javascript) -fn do_concat_bit_strings(bits: List(BitString)) -> BitBuilder { - bits - |> list.map(fn(b) { from_bit_string(b) }) - |> concat() -} - -/// Creates a new builder from a string. -/// -/// Runs in constant time when running on Erlang. -/// Runs in linear time otherwise. -/// -pub fn from_string(string: String) -> BitBuilder { - do_from_string(string) -} - -@target(erlang) -@external(erlang, "gleam_stdlib", "wrap_list") -fn do_from_string(a: String) -> BitBuilder - -@target(javascript) -fn do_from_string(string: String) -> BitBuilder { - Text(string_builder.from_string(string)) -} - -/// Creates a new builder from a string builder. -/// -/// Runs in constant time when running on Erlang. -/// Runs in linear time otherwise. -/// -pub fn from_string_builder(builder: StringBuilder) -> BitBuilder { - do_from_string_builder(builder) -} - -@target(erlang) -@external(erlang, "gleam_stdlib", "wrap_list") -fn do_from_string_builder(a: StringBuilder) -> BitBuilder - -@target(javascript) -fn do_from_string_builder(builder: StringBuilder) -> BitBuilder { - Text(builder) -} - -/// Creates a new builder from a bit string. -/// -/// Runs in constant time. -/// -pub fn from_bit_string(bits: BitString) -> BitBuilder { - do_from_bit_string(bits) -} - -@target(erlang) -@external(erlang, "gleam_stdlib", "wrap_list") -fn do_from_bit_string(a: BitString) -> BitBuilder - -@target(javascript) -fn do_from_bit_string(bits: BitString) -> BitBuilder { - Bits(bits) -} - -/// Turns an builder into a bit string. -/// -/// Runs in linear time. -/// -/// When running on Erlang this function is implemented natively by the -/// virtual machine and is highly optimised. -/// -pub fn to_bit_string(builder: BitBuilder) -> BitString { - do_to_bit_string(builder) -} - -@target(erlang) -@external(erlang, "erlang", "list_to_bitstring") -fn do_to_bit_string(a: BitBuilder) -> BitString - -@target(javascript) -fn do_to_bit_string(builder: BitBuilder) -> BitString { - [[builder]] - |> to_list([]) - |> list.reverse - |> bit_string.concat -} - -@target(javascript) -fn to_list( - stack: List(List(BitBuilder)), - acc: List(BitString), -) -> List(BitString) { - case stack { - [] -> acc - - [[], ..remaining_stack] -> to_list(remaining_stack, acc) - - [[Bits(bits), ..rest], ..remaining_stack] -> - to_list([rest, ..remaining_stack], [bits, ..acc]) - - [[Text(builder), ..rest], ..remaining_stack] -> { - let bits = bit_string.from_string(string_builder.to_string(builder)) - to_list([rest, ..remaining_stack], [bits, ..acc]) - } - - [[Many(builders), ..rest], ..remaining_stack] -> - to_list([builders, rest, ..remaining_stack], acc) - } -} - -/// Returns the size of the builder's content in bytes. -/// -/// Runs in linear time. -/// -pub fn byte_size(builder: BitBuilder) -> Int { - do_byte_size(builder) -} - -@target(erlang) -@external(erlang, "erlang", "iolist_size") -fn do_byte_size(a: BitBuilder) -> Int - -@target(javascript) -fn do_byte_size(builder: BitBuilder) -> Int { - [[builder]] - |> to_list([]) - |> list.fold(0, fn(acc, builder) { bit_string.byte_size(builder) + acc }) -} diff --git a/build/packages/gleam_stdlib/src/gleam/bit_string.gleam b/build/packages/gleam_stdlib/src/gleam/bit_string.gleam deleted file mode 100644 index 25ad686..0000000 --- a/build/packages/gleam_stdlib/src/gleam/bit_string.gleam +++ /dev/null @@ -1,124 +0,0 @@ -//// Working with raw bit string data. -//// The `BitString` type should be used instead of a String type when not utf8 -//// encoded. - -/// Converts a UTF-8 `String` type into a raw `BitString` type. -/// -pub fn from_string(x: String) -> BitString { - do_from_string(x) -} - -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "bit_string_from_string") -fn do_from_string(a: String) -> BitString - -/// Returns an integer which is the number of bytes in the bit string. -/// -pub fn byte_size(x: BitString) -> Int { - do_byte_size(x) -} - -@external(erlang, "erlang", "byte_size") -@external(javascript, "../gleam_stdlib.mjs", "length") -fn do_byte_size(a: BitString) -> Int - -/// Creates a new bit string by joining two binaries. -/// -/// ## Examples -/// -/// ```gleam -/// > append(to: from_string("butter"), suffix: from_string("fly")) -/// from_string("butterfly") -/// ``` -/// -pub fn append(to first: BitString, suffix second: BitString) -> BitString { - concat([first, second]) -} - -/// Extracts a sub-section of a bit string. -/// -/// The slice will start at given position and continue up to specified -/// length. -/// A negative length can be used to extract bytes at the end of a bit string. -/// -/// This function runs in constant time. -/// -pub fn slice( - from string: BitString, - at position: Int, - take length: Int, -) -> Result(BitString, Nil) { - do_slice(string, position, length) -} - -@external(erlang, "gleam_stdlib", "bit_string_slice") -@external(javascript, "../gleam_stdlib.mjs", "bit_string_slice") -fn do_slice( - string string: BitString, - position position: Int, - length length: Int, -) -> Result(BitString, Nil) - -/// Tests to see whether a bit string is valid UTF-8. -/// -pub fn is_utf8(bits: BitString) -> Bool { - do_is_utf8(bits) -} - -@target(erlang) -fn do_is_utf8(bits: BitString) -> Bool { - case bits { - <<>> -> True - <<_:utf8, rest:binary>> -> do_is_utf8(rest) - _ -> False - } -} - -@target(javascript) -fn do_is_utf8(bits: BitString) -> Bool { - case to_string(bits) { - Ok(_) -> True - _ -> False - } -} - -/// Converts a bit string to a string. -/// -/// Returns an error if the bit string is invalid UTF-8 data. -/// -pub fn to_string(bits: BitString) -> Result(String, Nil) { - do_to_string(bits) -} - -@target(erlang) -@external(erlang, "gleam_stdlib", "identity") -fn unsafe_to_string(a: BitString) -> String - -@target(erlang) -fn do_to_string(bits: BitString) -> Result(String, Nil) { - case is_utf8(bits) { - True -> Ok(unsafe_to_string(bits)) - False -> Error(Nil) - } -} - -@target(javascript) -@external(javascript, "../gleam_stdlib.mjs", "bit_string_to_string") -fn do_to_string(a: BitString) -> Result(String, Nil) - -/// Creates a new bit string by joining multiple binaries. -/// -/// ## Examples -/// -/// ```gleam -/// > concat([from_string("butter"), from_string("fly")]) -/// from_string("butterfly") -/// ``` -/// -pub fn concat(bit_strings: List(BitString)) -> BitString { - do_concat(bit_strings) -} - -@external(erlang, "gleam_stdlib", "bit_string_concat") -@external(javascript, "../gleam_stdlib.mjs", "bit_string_concat") -fn do_concat(a: List(BitString)) -> BitString diff --git a/build/packages/gleam_stdlib/src/gleam/bool.gleam b/build/packages/gleam_stdlib/src/gleam/bool.gleam deleted file mode 100644 index 66200a8..0000000 --- a/build/packages/gleam_stdlib/src/gleam/bool.gleam +++ /dev/null @@ -1,388 +0,0 @@ -//// A type with two possible values, `True` and `False`. Used to indicate whether -//// things are... true or false! -//// -//// Often is it clearer and offers more type safety to define a custom type -//// than to use `Bool`. For example, rather than having a `is_teacher: Bool` -//// field consider having a `role: SchoolRole` field where `SchoolRole` is a custom -//// type that can be either `Student` or `Teacher`. - -import gleam/order.{Order} - -/// Returns the and of two bools, but it evaluates both arguments. -/// -/// It's the function equivalent of the `&&` operator. -/// This function is useful in higher order functions or pipes. -/// -/// ## Examples -/// -/// ```gleam -/// > and(True, True) -/// True -/// ``` -/// -/// ```gleam -/// > and(False, True) -/// False -/// ``` -/// -/// ```gleam -/// > False |> and(True) -/// False -/// ``` -/// -pub fn and(a: Bool, b: Bool) -> Bool { - a && b -} - -/// Returns the or of two bools, but it evaluates both arguments. -/// -/// It's the function equivalent of the `||` operator. -/// This function is useful in higher order functions or pipes. -/// -/// ## Examples -/// -/// ```gleam -/// > or(True, True) -/// True -/// ``` -/// -/// ```gleam -/// > or(False, True) -/// True -/// ``` -/// -/// ```gleam -/// > False |> or(True) -/// True -/// ``` -/// -pub fn or(a: Bool, b: Bool) -> Bool { - a || b -} - -/// Returns the opposite bool value. -/// -/// This is the same as the `!` or `not` operators in some other languages. -/// -/// ## Examples -/// -/// ```gleam -/// > negate(True) -/// False -/// ``` -/// -/// ```gleam -/// > negate(False) -/// True -/// ``` -/// -pub fn negate(bool: Bool) -> Bool { - case bool { - True -> False - False -> True - } -} - -/// Returns the nor of two bools. -/// -/// ## Examples -/// -/// ```gleam -/// > nor(False, False) -/// True -/// ``` -/// -/// ```gleam -/// > nor(False, True) -/// False -/// ``` -/// -/// ```gleam -/// > nor(True, False) -/// False -/// ``` -/// -/// ```gleam -/// > nor(True, True) -/// False -/// ``` -/// -pub fn nor(a: Bool, b: Bool) -> Bool { - case a, b { - False, False -> True - False, True -> False - True, False -> False - True, True -> False - } -} - -/// Returns the nand of two bools. -/// -/// ## Examples -/// -/// ```gleam -/// > nand(False, False) -/// True -/// ``` -/// -/// ```gleam -/// > nand(False, True) -/// True -/// ``` -/// -/// ```gleam -/// > nand(True, False) -/// True -/// ``` -/// -/// ```gleam -/// > nand(True, True) -/// False -/// ``` -/// -pub fn nand(a: Bool, b: Bool) -> Bool { - case a, b { - False, False -> True - False, True -> True - True, False -> True - True, True -> False - } -} - -/// Returns the exclusive or of two bools. -/// -/// ## Examples -/// -/// ```gleam -/// > exclusive_or(False, False) -/// False -/// ``` -/// -/// ```gleam -/// > exclusive_or(False, True) -/// True -/// ``` -/// -/// ```gleam -/// > exclusive_or(True, False) -/// True -/// ``` -/// -/// ```gleam -/// > exclusive_or(True, True) -/// False -/// ``` -/// -pub fn exclusive_or(a: Bool, b: Bool) -> Bool { - case a, b { - False, False -> False - False, True -> True - True, False -> True - True, True -> False - } -} - -/// Returns the exclusive nor of two bools. -/// -/// ## Examples -/// -/// ```gleam -/// > exclusive_nor(False, False) -/// True -/// ``` -/// -/// ```gleam -/// > exclusive_nor(False, True) -/// False -/// ``` -/// -/// ```gleam -/// > exclusive_nor(True, False) -/// False -/// ``` -/// -/// ```gleam -/// > exclusive_nor(True, True) -/// True -/// ``` -/// -pub fn exclusive_nor(a: Bool, b: Bool) -> Bool { - case a, b { - False, False -> True - False, True -> False - True, False -> False - True, True -> True - } -} - -/// Compares two bools and returns the first value's `Order` to the second. -/// -/// ## Examples -/// -/// ```gleam -/// > import gleam/order -/// > compare(True, False) -/// order.Gt -/// ``` -/// -pub fn compare(a: Bool, with b: Bool) -> Order { - case a, b { - True, True -> order.Eq - True, False -> order.Gt - False, False -> order.Eq - False, True -> order.Lt - } -} - -/// Returns `True` if either argument's value is `True`. -/// -/// ## Examples -/// -/// ```gleam -/// > max(True, False) -/// True -/// ``` -/// -/// ```gleam -/// > max(False, True) -/// True -/// ``` -/// -/// ```gleam -/// > max(False, False) -/// False -/// ``` -/// -pub fn max(a: Bool, b: Bool) -> Bool { - case a { - True -> True - False -> b - } -} - -/// Returns `False` if either bool value is `False`. -/// -/// ## Examples -/// -/// ```gleam -/// > min(True, False) -/// False -/// ``` -/// -/// ```gleam -/// > min(False, True) -/// False -/// -/// > min(False, False) -/// False -/// ``` -/// -pub fn min(a: Bool, b: Bool) -> Bool { - case a { - False -> False - True -> b - } -} - -/// Returns a numeric representation of the given bool. -/// -/// ## Examples -/// -/// ```gleam -/// > to_int(True) -/// 1 -/// -/// > to_int(False) -/// 0 -/// ``` -/// -pub fn to_int(bool: Bool) -> Int { - case bool { - False -> 0 - True -> 1 - } -} - -/// Returns a string representation of the given bool. -/// -/// ## Examples -/// -/// ```gleam -/// > to_string(True) -/// "True" -/// ``` -/// -/// ```gleam -/// > to_string(False) -/// "False" -/// ``` -/// -pub fn to_string(bool: Bool) -> String { - case bool { - False -> "False" - True -> "True" - } -} - -/// Run a callback function if the given bool is `False`, otherwise return a -/// default value. -/// -/// With a `use` expression this function can simulate the early-return pattern -/// found in some other programming languages. -/// -/// In a procedural language: -/// -/// ```js -/// if (predicate) return value; -/// // ... -/// ``` -/// -/// In Gleam with a `use` expression: -/// -/// ```gleam -/// use <- guard(when: predicate, return: value) -/// // ... -/// ``` -/// -/// Like everything in Gleam `use` is an expression, so it short circuits the -/// current block, not the entire function. As a result you can assign the value -/// to a variable: -/// -/// ```gleam -/// let x = { -/// use <- guard(when: predicate, return: value) -/// // ... -/// } -/// ``` -/// -/// Note that unlike in procedural languages the `return` value is evaluated -/// even when the predicate is `False`, so it is advisable not to perform -/// expensive computation there. -/// -/// -/// ## Examples -/// -/// ```gleam -/// > let name = "" -/// > use <- guard(when: name == "", return: "Welcome!") -/// > "Hello, " <> name -/// "Welcome!" -/// ``` -/// -/// ```gleam -/// > let name = "Kamaka" -/// > use <- guard(when: name == "", return: "Welcome!") -/// > "Hello, " <> name -/// "Hello, Kamaka" -/// ``` -/// -pub fn guard( - when requirement: Bool, - return consequence: t, - otherwise alternative: fn() -> t, -) -> t { - case requirement { - True -> consequence - False -> alternative() - } -} diff --git a/build/packages/gleam_stdlib/src/gleam/dynamic.gleam b/build/packages/gleam_stdlib/src/gleam/dynamic.gleam deleted file mode 100644 index 80ddd87..0000000 --- a/build/packages/gleam_stdlib/src/gleam/dynamic.gleam +++ /dev/null @@ -1,1491 +0,0 @@ -import gleam/int -import gleam/list -import gleam/map.{Map} -import gleam/option.{Option} -import gleam/result -import gleam/string_builder -@target(erlang) -import gleam/bit_string - -/// `Dynamic` data is data that we don't know the type of yet. -/// We likely get data like this from interop with Erlang, or from -/// IO with the outside world. -/// -pub type Dynamic - -/// Error returned when unexpected data is encountered -/// -pub type DecodeError { - DecodeError(expected: String, found: String, path: List(String)) -} - -pub type DecodeErrors = - List(DecodeError) - -pub type Decoder(t) = - fn(Dynamic) -> Result(t, DecodeErrors) - -/// Converts any Gleam data into `Dynamic` data. -/// -pub fn from(a) -> Dynamic { - do_from(a) -} - -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "identity") -fn do_from(a: anything) -> Dynamic - -/// Unsafely casts a Dynamic value into any other type. -/// -/// This is an escape hatch for the type system that may be useful when wrapping -/// native Erlang APIs. It is to be used as a last measure only! -/// -/// If you can avoid using this function, do! -/// -pub fn unsafe_coerce(a: Dynamic) -> anything { - do_unsafe_coerce(a) -} - -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "identity") -fn do_unsafe_coerce(a: Dynamic) -> a - -/// Decodes a `Dynamic` value from a `Dynamic` value. -/// -/// This function doesn't seem very useful at first, but it can be convenient -/// when you need to give a decoder function but you don't actually care what -/// the to-decode value is. -/// -pub fn dynamic(value: Dynamic) -> Result(Dynamic, List(DecodeError)) { - Ok(value) -} - -/// Checks to see whether a `Dynamic` value is a bit_string, and returns that bit string if -/// it is. -/// -/// ## Examples -/// -/// ```gleam -/// > bit_string(from("Hello")) == bit_string.from_string("Hello") -/// True -/// ``` -/// -/// ```gleam -/// > bit_string(from(123)) -/// Error([DecodeError(expected: "BitString", found: "Int", path: [])]) -/// ``` -/// -pub fn bit_string(from data: Dynamic) -> Result(BitString, DecodeErrors) { - decode_bit_string(data) -} - -@external(erlang, "gleam_stdlib", "decode_bit_string") -@external(javascript, "../gleam_stdlib.mjs", "decode_bit_string") -fn decode_bit_string(a: Dynamic) -> Result(BitString, DecodeErrors) - -/// Checks to see whether a `Dynamic` value is a string, and returns that string if -/// it is. -/// -/// ## Examples -/// -/// ```gleam -/// > string(from("Hello")) -/// Ok("Hello") -/// ``` -/// -/// ```gleam -/// > string(from(123)) -/// Error([DecodeError(expected: "String", found: "Int", path: [])]) -/// ``` -/// -pub fn string(from data: Dynamic) -> Result(String, DecodeErrors) { - decode_string(data) -} - -fn map_errors( - result: Result(t, DecodeErrors), - f: fn(DecodeError) -> DecodeError, -) -> Result(t, DecodeErrors) { - result.map_error(result, list.map(_, f)) -} - -@target(erlang) -fn decode_string(data: Dynamic) -> Result(String, DecodeErrors) { - bit_string(data) - |> map_errors(put_expected(_, "String")) - |> result.try(fn(raw) { - case bit_string.to_string(raw) { - Ok(string) -> Ok(string) - Error(Nil) -> - Error([DecodeError(expected: "String", found: "BitString", path: [])]) - } - }) -} - -@target(erlang) -fn put_expected(error: DecodeError, expected: String) -> DecodeError { - DecodeError(..error, expected: expected) -} - -@target(javascript) -@external(javascript, "../gleam_stdlib.mjs", "decode_string") -fn decode_string(a: Dynamic) -> Result(String, DecodeErrors) - -/// Return a string indicating the type of the dynamic value. -/// -/// ```gleam -/// > classify(from("Hello")) -/// "String" -/// ``` -/// -pub fn classify(data: Dynamic) -> String { - do_classify(data) -} - -@external(erlang, "gleam_stdlib", "classify_dynamic") -@external(javascript, "../gleam_stdlib.mjs", "classify_dynamic") -fn do_classify(a: Dynamic) -> String - -/// Checks to see whether a `Dynamic` value is an int, and returns that int if it -/// is. -/// -/// ## Examples -/// -/// ```gleam -/// > int(from(123)) -/// Ok(123) -/// ``` -/// -/// ```gleam -/// > int(from("Hello")) -/// Error([DecodeError(expected: "Int", found: "String", path: [])]) -/// ``` -/// -pub fn int(from data: Dynamic) -> Result(Int, DecodeErrors) { - decode_int(data) -} - -@external(erlang, "gleam_stdlib", "decode_int") -@external(javascript, "../gleam_stdlib.mjs", "decode_int") -fn decode_int(a: Dynamic) -> Result(Int, DecodeErrors) - -/// Checks to see whether a `Dynamic` value is a float, and returns that float if -/// it is. -/// -/// ## Examples -/// -/// ```gleam -/// > float(from(2.0)) -/// Ok(2.0) -/// ``` -/// -/// ```gleam -/// > float(from(123)) -/// Error([DecodeError(expected: "Float", found: "Int", path: [])]) -/// ``` -/// -pub fn float(from data: Dynamic) -> Result(Float, DecodeErrors) { - decode_float(data) -} - -@external(erlang, "gleam_stdlib", "decode_float") -@external(javascript, "../gleam_stdlib.mjs", "decode_float") -fn decode_float(a: Dynamic) -> Result(Float, DecodeErrors) - -/// Checks to see whether a `Dynamic` value is a bool, and returns that bool if -/// it is. -/// -/// ## Examples -/// -/// ```gleam -/// > bool(from(True)) -/// Ok(True) -/// ``` -/// -/// ```gleam -/// > bool(from(123)) -/// Error([DecodeError(expected: "Bool", found: "Int", path: [])]) -/// ``` -/// -pub fn bool(from data: Dynamic) -> Result(Bool, DecodeErrors) { - decode_bool(data) -} - -@external(erlang, "gleam_stdlib", "decode_bool") -@external(javascript, "../gleam_stdlib.mjs", "decode_bool") -fn decode_bool(a: Dynamic) -> Result(Bool, DecodeErrors) - -/// Checks to see whether a `Dynamic` value is a list, and returns that list if it -/// is. The types of the elements are not checked. -/// -/// If you wish to decode all the elements in the list use the `list` function -/// instead. -/// -/// ## Examples -/// -/// ```gleam -/// > shallow_list(from(["a", "b", "c"])) -/// Ok([from("a"), from("b"), from("c")]) -/// ``` -/// -/// ```gleam -/// > shallow_list(1) -/// Error([DecodeError(expected: "List", found: "Int", path: [])]) -/// ``` -/// -pub fn shallow_list(from value: Dynamic) -> Result(List(Dynamic), DecodeErrors) { - decode_list(value) -} - -@external(erlang, "gleam_stdlib", "decode_list") -@external(javascript, "../gleam_stdlib.mjs", "decode_list") -fn decode_list(a: Dynamic) -> Result(List(Dynamic), DecodeErrors) - -@external(erlang, "gleam_stdlib", "decode_result") -@external(javascript, "../gleam_stdlib.mjs", "decode_result") -fn decode_result(a: Dynamic) -> Result(Result(a, e), DecodeErrors) - -/// Checks to see whether a `Dynamic` value is a result of a particular type, and -/// returns that result if it is. -/// -/// The `ok` and `error` arguments are decoders for decoding the `Ok` and -/// `Error` values of the result. -/// -/// ## Examples -/// -/// ```gleam -/// > from(Ok(1)) -/// > |> result(ok: int, error: string) -/// Ok(Ok(1)) -/// ``` -/// -/// ```gleam -/// > from(Error("boom")) -/// > |> result(ok: int, error: string) -/// Ok(Error("boom")) -/// ``` -/// -/// ```gleam -/// > from(123) -/// > |> result(ok: int, error: string) -/// Error([DecodeError(expected: "Result", found: "Int", path: [])]) -/// ``` -/// -pub fn result( - ok decode_ok: Decoder(a), - error decode_error: Decoder(e), -) -> Decoder(Result(a, e)) { - fn(value) { - use inner_result <- result.try(decode_result(value)) - - case inner_result { - Ok(raw) -> { - use value <- result.try( - decode_ok(raw) - |> map_errors(push_path(_, "ok")), - ) - Ok(Ok(value)) - } - Error(raw) -> { - use value <- result.try( - decode_error(raw) - |> map_errors(push_path(_, "error")), - ) - Ok(Error(value)) - } - } - } -} - -/// Checks to see whether a `Dynamic` value is a list of a particular type, and -/// returns that list if it is. -/// -/// The second argument is a decoder function used to decode the elements of -/// the list. The list is only decoded if all elements in the list can be -/// successfully decoded using this function. -/// -/// If you do not wish to decode all the elements in the list use the `shallow_list` -/// function instead. -/// -/// ## Examples -/// -/// ```gleam -/// > from(["a", "b", "c"]) -/// > |> list(of: string) -/// Ok(["a", "b", "c"]) -/// ``` -/// -/// ```gleam -/// > from([1, 2, 3]) -/// > |> list(of: string) -/// Error([DecodeError(expected: "String", found: "Int", path: ["*"])]) -/// ``` -/// -/// ```gleam -/// > from("ok") -/// > |> list(of: string) -/// Error([DecodeError(expected: "List", found: "String", path: [])]) -/// ``` -/// -pub fn list( - of decoder_type: fn(Dynamic) -> Result(inner, DecodeErrors), -) -> Decoder(List(inner)) { - fn(dynamic) { - use list <- result.try(shallow_list(dynamic)) - list - |> list.try_map(decoder_type) - |> map_errors(push_path(_, "*")) - } -} - -/// Checks to see if a `Dynamic` value is a nullable version of a particular -/// type, and returns a corresponding `Option` if it is. -/// -/// ## Examples -/// -/// ```gleam -/// > from("Hello") -/// > |> optional(string) -/// Ok(Some("Hello")) -/// ``` -/// -/// ```gleam -/// > from("Hello") -/// > |> optional(string) -/// Ok(Some("Hello")) -/// ``` -/// -/// ```gleam -/// > from(atom.from_string("null")) -/// > |> optional(string) -/// Ok(None) -/// ``` -/// -/// ```gleam -/// > from(atom.from_string("nil")) -/// > |> optional(string) -/// Ok(None) -/// ``` -/// -/// ```gleam -/// > from(atom.from_string("undefined")) -/// > |> optional(string) -/// Ok(None) -/// ``` -/// -/// ```gleam -/// > from(123) -/// > |> optional(string) -/// Error([DecodeError(expected: "String", found: "Int", path: [])]) -/// ``` -/// -pub fn optional(of decode: Decoder(inner)) -> Decoder(Option(inner)) { - fn(value) { decode_optional(value, decode) } -} - -@external(erlang, "gleam_stdlib", "decode_option") -@external(javascript, "../gleam_stdlib.mjs", "decode_option") -fn decode_optional(a: Dynamic, b: Decoder(a)) -> Result(Option(a), DecodeErrors) - -/// Checks to see if a `Dynamic` value is a map with a specific field, and returns -/// the value of that field if it is. -/// -/// This will not succeed on a record. -/// -/// ## Examples -/// -/// ```gleam -/// > import gleam/map -/// > map.new() -/// > |> map.insert("Hello", "World") -/// > |> from -/// > |> field(named: "Hello", of: string) -/// Ok("World") -/// ``` -/// -/// ```gleam -/// > from(123) -/// > |> field("Hello", string) -/// Error([DecodeError(expected: "Map", found: "Int", path: [])]) -/// ``` -/// -pub fn field(named name: a, of inner_type: Decoder(t)) -> Decoder(t) { - fn(value) { - let missing_field_error = - DecodeError(expected: "field", found: "nothing", path: []) - - use maybe_inner <- result.try(decode_field(value, name)) - maybe_inner - |> option.to_result([missing_field_error]) - |> result.try(inner_type) - |> map_errors(push_path(_, name)) - } -} - -/// Checks to see if a `Dynamic` value is a map with a specific field. -/// If the map does not have the specified field, returns an `Ok(None)` instead of failing; otherwise, -/// returns the decoded field wrapped in `Some(_)`. -/// -/// ## Examples -/// -/// ```gleam -/// > import gleam/map -/// > map.new() -/// > |> map.insert("Hello", "World") -/// > |> from -/// > |> field(named: "Hello", of: string) -/// Ok(Some("World")) -/// ``` -/// -/// ```gleam -/// > import gleam/map -/// > map.new() -/// > |> from -/// > |> field(named: "Hello", of: string) -/// Ok(None) -/// ``` -/// -/// ```gleam -/// > from(123) -/// > |> field("Hello", string) -/// Error([DecodeError(expected: "Map", found: "Int", path: [])]) -/// ``` -/// -pub fn optional_field( - named name: a, - of inner_type: Decoder(t), -) -> Decoder(Option(t)) { - fn(value) { - use maybe_inner <- result.try(decode_field(value, name)) - case maybe_inner { - option.None -> Ok(option.None) - option.Some(dynamic_inner) -> - dynamic_inner - |> decode_optional(inner_type) - |> map_errors(push_path(_, name)) - } - } -} - -@external(erlang, "gleam_stdlib", "decode_field") -@external(javascript, "../gleam_stdlib.mjs", "decode_field") -fn decode_field(a: Dynamic, b: name) -> Result(Option(Dynamic), DecodeErrors) - -/// Checks to see if a `Dynamic` value is a tuple large enough to have a certain -/// index, and returns the value of that index if it is. -/// -/// ## Examples -/// -/// ```gleam -/// > from(#(1, 2)) -/// > |> element(0, int) -/// Ok(from(1)) -/// ``` -/// -/// ```gleam -/// > from(#(1, 2)) -/// > |> element(2, int) -/// Error([ -/// DecodeError( -/// expected: "Tuple of at least 3 elements", -/// found: "Tuple of 2 elements", -/// path: [], -/// ), -/// ]) -/// ``` -/// -pub fn element(at index: Int, of inner_type: Decoder(t)) -> Decoder(t) { - fn(data: Dynamic) { - use tuple <- result.try(decode_tuple(data)) - let size = tuple_size(tuple) - use data <- result.try(case index >= 0 { - True -> - case index < size { - True -> tuple_get(tuple, index) - False -> at_least_decode_tuple_error(index + 1, data) - } - False -> - case int.absolute_value(index) <= size { - True -> tuple_get(tuple, size + index) - False -> at_least_decode_tuple_error(int.absolute_value(index), data) - } - }) - inner_type(data) - |> map_errors(push_path(_, index)) - } -} - -fn at_least_decode_tuple_error( - size: Int, - data: Dynamic, -) -> Result(a, DecodeErrors) { - let s = case size { - 1 -> "" - _ -> "s" - } - let error = - ["Tuple of at least ", int.to_string(size), " element", s] - |> string_builder.from_strings - |> string_builder.to_string - |> DecodeError(found: classify(data), path: []) - Error([error]) -} - -// A tuple of unknown size -type UnknownTuple - -@external(erlang, "gleam_stdlib", "decode_tuple") -@external(javascript, "../gleam_stdlib.mjs", "decode_tuple") -fn decode_tuple(a: Dynamic) -> Result(UnknownTuple, DecodeErrors) - -@external(erlang, "gleam_stdlib", "decode_tuple2") -@external(javascript, "../gleam_stdlib.mjs", "decode_tuple2") -fn decode_tuple2(a: Dynamic) -> Result(#(Dynamic, Dynamic), DecodeErrors) - -@external(erlang, "gleam_stdlib", "decode_tuple3") -@external(javascript, "../gleam_stdlib.mjs", "decode_tuple3") -fn decode_tuple3( - a: Dynamic, -) -> Result(#(Dynamic, Dynamic, Dynamic), DecodeErrors) - -@external(erlang, "gleam_stdlib", "decode_tuple4") -@external(javascript, "../gleam_stdlib.mjs", "decode_tuple4") -fn decode_tuple4( - a: Dynamic, -) -> Result(#(Dynamic, Dynamic, Dynamic, Dynamic), DecodeErrors) - -@external(erlang, "gleam_stdlib", "decode_tuple5") -@external(javascript, "../gleam_stdlib.mjs", "decode_tuple5") -fn decode_tuple5( - a: Dynamic, -) -> Result(#(Dynamic, Dynamic, Dynamic, Dynamic, Dynamic), DecodeErrors) - -@external(erlang, "gleam_stdlib", "decode_tuple6") -@external(javascript, "../gleam_stdlib.mjs", "decode_tuple6") -fn decode_tuple6( - a: Dynamic, -) -> Result( - #(Dynamic, Dynamic, Dynamic, Dynamic, Dynamic, Dynamic), - DecodeErrors, -) - -@external(erlang, "gleam_stdlib", "tuple_get") -@external(javascript, "../gleam_stdlib.mjs", "tuple_get") -fn tuple_get(a: UnknownTuple, b: Int) -> Result(Dynamic, DecodeErrors) - -@external(erlang, "gleam_stdlib", "size_of_tuple") -@external(javascript, "../gleam_stdlib.mjs", "length") -fn tuple_size(a: UnknownTuple) -> Int - -fn tuple_errors( - result: Result(a, List(DecodeError)), - name: String, -) -> List(DecodeError) { - case result { - Ok(_) -> [] - Error(errors) -> list.map(errors, push_path(_, name)) - } -} - -fn push_path(error: DecodeError, name: t) -> DecodeError { - let name = from(name) - let decoder = any([string, fn(x) { result.map(int(x), int.to_string) }]) - let name = case decoder(name) { - Ok(name) -> name - Error(_) -> - ["<", classify(name), ">"] - |> string_builder.from_strings - |> string_builder.to_string - } - DecodeError(..error, path: [name, ..error.path]) -} - -/// Checks to see if a `Dynamic` value is a 2-element tuple, list or array containing -/// specifically typed elements. -/// -/// ## Examples -/// -/// ```gleam -/// > from(#(1, 2)) -/// > |> tuple2(int, int) -/// Ok(#(1, 2)) -/// ``` -/// -/// ```gleam -/// > from(#(1, 2.0)) -/// > |> tuple2(int, float) -/// Ok(#(1, 2.0)) -/// ``` -/// -/// ```gleam -/// > from([1, 2]) -/// > |> tuple2(int, int) -/// Ok(#(1, 2)) -/// ``` -/// -/// ```gleam -/// > from([from(1), from(2.0)]) -/// > |> tuple2(int, float) -/// Ok(#(1, 2.0)) -/// ``` -/// -/// ```gleam -/// > from(#(1, 2, 3)) -/// > |> tuple2(int, float) -/// Error([ -/// DecodeError(expected: "Tuple of 2 elements", found: "Tuple of 3 elements", path: []), -/// ]) -/// ``` -/// -/// ```gleam -/// > from("") -/// > |> tuple2(int, float) -/// Error([DecodeError(expected: "Tuple of 2 elements", found: "String", path: [])]) -/// ``` -/// -pub fn tuple2( - first decode1: Decoder(a), - second decode2: Decoder(b), -) -> Decoder(#(a, b)) { - fn(value) { - use #(a, b) <- result.try(decode_tuple2(value)) - case decode1(a), decode2(b) { - Ok(a), Ok(b) -> Ok(#(a, b)) - a, b -> - tuple_errors(a, "0") - |> list.append(tuple_errors(b, "1")) - |> Error - } - } -} - -/// Checks to see if a `Dynamic` value is a 3-element tuple, list or array containing -/// specifically typed elements. -/// -/// ## Examples -/// -/// ```gleam -/// > from(#(1, 2, 3)) -/// > |> tuple3(int, int, int) -/// Ok(#(1, 2, 3)) -/// ``` -/// -/// ```gleam -/// > from(#(1, 2.0, "3")) -/// > |> tuple3(int, float, string) -/// Ok(#(1, 2.0, "3")) -/// ``` -/// -/// ```gleam -/// > from([1, 2, 3]) -/// > |> tuple3(int, int, int) -/// Ok(#(1, 2, 3)) -/// ``` -/// -/// ```gleam -/// > from([from(1), from(2.0), from("3")]) -/// > |> tuple3(int, float, string) -/// Ok(#(1, 2.0, "3")) -/// ``` -/// -/// ```gleam -/// > from(#(1, 2)) -/// > |> tuple3(int, float, string) -/// Error([ -/// DecodeError(expected: "Tuple of 3 elements", found: "Tuple of 2 elements", path: [])), -/// ]) -/// ``` -/// -/// ```gleam -/// > from("") -/// > |> tuple3(int, float, string) -/// Error([ -/// DecodeError(expected: "Tuple of 3 elements", found: "String", path: []), -/// ]) -/// ``` -/// -pub fn tuple3( - first decode1: Decoder(a), - second decode2: Decoder(b), - third decode3: Decoder(c), -) -> Decoder(#(a, b, c)) { - fn(value) { - use #(a, b, c) <- result.try(decode_tuple3(value)) - case decode1(a), decode2(b), decode3(c) { - Ok(a), Ok(b), Ok(c) -> Ok(#(a, b, c)) - a, b, c -> - tuple_errors(a, "0") - |> list.append(tuple_errors(b, "1")) - |> list.append(tuple_errors(c, "2")) - |> Error - } - } -} - -/// Checks to see if a `Dynamic` value is a 4-element tuple, list or array containing -/// specifically typed elements. -/// -/// ## Examples -/// -/// ```gleam -/// > from(#(1, 2, 3, 4)) -/// > |> tuple4(int, int, int, int) -/// Ok(#(1, 2, 3, 4)) -/// ``` -/// -/// ```gleam -/// > from(#(1, 2.0, "3", 4)) -/// > |> tuple4(int, float, string, int) -/// Ok(#(1, 2.0, "3", 4)) -/// -/// ```gleam -/// > from([1, 2, 3, 4]) -/// > |> tuple4(int, int, int, int) -/// Ok(#(1, 2, 3, 4)) -/// ``` -/// -/// ```gleam -/// > from([from(1), from(2.0), from("3"), from(4)]) -/// > |> tuple4(int, float, string, int) -/// Ok(#(1, 2.0, "3", 4)) -/// ``` -/// -/// > from(#(1, 2)) -/// > |> tuple4(int, float, string, int) -/// Error([ -/// DecodeError(expected: "Tuple of 4 elements", found: "Tuple of 2 elements", path: []), -/// ]) -/// ``` -/// -/// ```gleam -/// > from("") -/// > |> tuple4(int, float, string, int) -/// Error([ -/// DecodeError(expected: "Tuple of 4 elements", found: "String", path: []), -/// ]) -/// ``` -/// -pub fn tuple4( - first decode1: Decoder(a), - second decode2: Decoder(b), - third decode3: Decoder(c), - fourth decode4: Decoder(d), -) -> Decoder(#(a, b, c, d)) { - fn(value) { - use #(a, b, c, d) <- result.try(decode_tuple4(value)) - case decode1(a), decode2(b), decode3(c), decode4(d) { - Ok(a), Ok(b), Ok(c), Ok(d) -> Ok(#(a, b, c, d)) - a, b, c, d -> - tuple_errors(a, "0") - |> list.append(tuple_errors(b, "1")) - |> list.append(tuple_errors(c, "2")) - |> list.append(tuple_errors(d, "3")) - |> Error - } - } -} - -/// Checks to see if a `Dynamic` value is a 5-element tuple, list or array containing -/// specifically typed elements. -/// -/// ## Examples -/// -/// ```gleam -/// > from(#(1, 2, 3, 4, 5)) -/// > |> tuple5(int, int, int, int, int) -/// Ok(#(1, 2, 3, 4, 5)) -/// ``` -/// -/// ```gleam -/// > from(#(1, 2.0, "3", 4, 5)) -/// > |> tuple5(int, float, string, int, int) -/// Ok(#(1, 2.0, "3", 4, 5)) -/// ``` -/// -/// ```gleam -/// > from([1, 2, 3, 4, 5]) -/// > |> tuple5(int, int, int, int, int) -/// Ok(#(1, 2, 3, 4, 5)) -/// ``` -/// -/// ```gleam -/// > from([from(1), from(2.0), from("3"), from(4), from(True)]) -/// > |> tuple5(int, float, string, int, bool) -/// Ok(#(1, 2.0, "3", 4, True)) -/// ``` -/// -/// ```gleam -/// > from(#(1, 2)) -/// > |> tuple5(int, float, string, int, int) -/// Error([ -/// DecodeError(expected: "Tuple of 5 elements", found: "Tuple of 2 elements", path: [])), -/// ]) -/// -/// > from("") -/// > |> tuple5(int, float, string, int, int) -/// Error([DecodeError(expected: "Tuple of 5 elements", found: "String", path: [])]) -/// ``` -/// -pub fn tuple5( - first decode1: Decoder(a), - second decode2: Decoder(b), - third decode3: Decoder(c), - fourth decode4: Decoder(d), - fifth decode5: Decoder(e), -) -> Decoder(#(a, b, c, d, e)) { - fn(value) { - use #(a, b, c, d, e) <- result.try(decode_tuple5(value)) - case decode1(a), decode2(b), decode3(c), decode4(d), decode5(e) { - Ok(a), Ok(b), Ok(c), Ok(d), Ok(e) -> Ok(#(a, b, c, d, e)) - a, b, c, d, e -> - tuple_errors(a, "0") - |> list.append(tuple_errors(b, "1")) - |> list.append(tuple_errors(c, "2")) - |> list.append(tuple_errors(d, "3")) - |> list.append(tuple_errors(e, "4")) - |> Error - } - } -} - -/// Checks to see if a `Dynamic` value is a 6-element tuple, list or array containing -/// specifically typed elements. -/// -/// ## Examples -/// -/// ```gleam -/// > from(#(1, 2, 3, 4, 5, 6)) -/// > |> tuple6(int, int, int, int, int, int) -/// Ok(#(1, 2, 3, 4, 5, 6)) -/// ``` -/// -/// ```gleam -/// > from(#(1, 2.0, "3", 4, 5, 6)) -/// > |> tuple6(int, float, string, int, int, int) -/// Ok(#(1, 2.0, "3", 4, 5, 6)) -/// ``` -/// -/// ```gleam -/// > from([1, 2, 3, 4, 5, 6]) -/// > |> tuple6(int, int, int, int, int, int) -/// Ok(#(1, 2, 3, 4, 5, 6)) -/// ``` -/// -/// ```gleam -/// > from([from(1), from(2.0), from("3"), from(4), from(True), from(False)]) -/// > |> tuple6(int, float, string, int, bool, bool) -/// Ok(#(1, 2.0, "3", 4, True, False)) -/// ``` -/// -/// ```gleam -/// > from(#(1, 2)) -/// > |> tuple6(int, float, string, int, int, int) -/// Error([ -/// DecodeError(expected: "Tuple of 6 elements", found: "Tuple of 2 elements", path: []), -/// ]) -/// ``` -/// -/// ```gleam -/// > from("") -/// > |> tuple6(int, float, string, int, int, int) -/// Error([DecodeError(expected: "Tuple of 6 elements", found: "String", path: [])]) -/// ``` -/// -pub fn tuple6( - first decode1: Decoder(a), - second decode2: Decoder(b), - third decode3: Decoder(c), - fourth decode4: Decoder(d), - fifth decode5: Decoder(e), - sixth decode6: Decoder(f), -) -> Decoder(#(a, b, c, d, e, f)) { - fn(value) { - use #(a, b, c, d, e, f) <- result.try(decode_tuple6(value)) - case - decode1(a), - decode2(b), - decode3(c), - decode4(d), - decode5(e), - decode6(f) - { - Ok(a), Ok(b), Ok(c), Ok(d), Ok(e), Ok(f) -> Ok(#(a, b, c, d, e, f)) - a, b, c, d, e, f -> - tuple_errors(a, "0") - |> list.append(tuple_errors(b, "1")) - |> list.append(tuple_errors(c, "2")) - |> list.append(tuple_errors(d, "3")) - |> list.append(tuple_errors(e, "4")) - |> list.append(tuple_errors(f, "5")) - |> Error - } - } -} - -/// Checks to see if a `Dynamic` value is a map. -/// -/// ## Examples -/// -/// ```gleam -/// > import gleam/map -/// > map.new() |> from |> map(string, int) -/// Ok(map.new()) -/// ``` -/// -/// ```gleam -/// > from(1) |> map(string, int) -/// Error(DecodeError(expected: "Map", found: "Int", path: [])) -/// ``` -/// -/// ```gleam -/// > from("") |> map(string, int) -/// Error(DecodeError(expected: "Map", found: "String", path: [])) -/// ``` -/// -pub fn map( - of key_type: Decoder(k), - to value_type: Decoder(v), -) -> Decoder(Map(k, v)) { - fn(value) { - use map <- result.try(decode_map(value)) - use pairs <- result.try( - map - |> map.to_list - |> list.try_map(fn(pair) { - let #(k, v) = pair - use k <- result.try( - key_type(k) - |> map_errors(push_path(_, "keys")), - ) - use v <- result.try( - value_type(v) - |> map_errors(push_path(_, "values")), - ) - Ok(#(k, v)) - }), - ) - Ok(map.from_list(pairs)) - } -} - -@external(erlang, "gleam_stdlib", "decode_map") -@external(javascript, "../gleam_stdlib.mjs", "decode_map") -fn decode_map(a: Dynamic) -> Result(Map(Dynamic, Dynamic), DecodeErrors) - -/// Joins multiple decoders into one. When run they will each be tried in turn -/// until one succeeds, or they all fail. -/// -/// ## Examples -/// -/// ```gleam -/// > import gleam/result -/// > let bool_or_string = any(of: [ -/// > string, -/// > fn(x) { result.map(bool(x), fn(_) { "a bool" }) } -/// > ]) -/// > bool_or_string(from("ok")) -/// Ok("ok") -/// ``` -/// -/// ```gleam -/// > bool_or_string(from(True)) -/// Ok("a bool") -/// ``` -/// -/// ```gleam -/// > bool_or_string(from(1)) -/// Error(DecodeError(expected: "another type", found: "Int", path: [])) -/// ``` -/// -pub fn any(of decoders: List(Decoder(t))) -> Decoder(t) { - fn(data) { - case decoders { - [] -> - Error([ - DecodeError(found: classify(data), expected: "another type", path: []), - ]) - - [decoder, ..decoders] -> - case decoder(data) { - Ok(decoded) -> Ok(decoded) - Error(_) -> any(decoders)(data) - } - } - } -} - -/// Decode 1 values from a `Dynamic` value. -/// -/// ## Examples -/// -/// ```gleam -/// > from(#(1, 2.0, "3")) -/// > |> decode1(MyRecord, element(0, int)) -/// Ok(MyRecord(1)) -/// ``` -/// -/// ```gleam -/// > from(#("", "", "")) -/// > |> decode1(MyRecord, element(0, int)) -/// Error([ -/// DecodeError(expected: "Int", found: "String", path: ["0"]), -/// ]) -/// ``` -/// -pub fn decode1(constructor: fn(t1) -> t, t1: Decoder(t1)) -> Decoder(t) { - fn(value) { - case t1(value) { - Ok(a) -> Ok(constructor(a)) - a -> Error(all_errors(a)) - } - } -} - -/// Decode 2 values from a `Dynamic` value. -/// -/// ## Examples -/// -/// ```gleam -/// > from(#(1, 2.0, "3")) -/// > |> decode2(MyRecord, element(0, int), element(1, float)) -/// Ok(MyRecord(1, 2.0)) -/// ``` -/// -/// ```gleam -/// > from(#("", "", "")) -/// > |> decode2(MyRecord, element(0, int), element(1, float)) -/// Error([ -/// DecodeError(expected: "Int", found: "String", path: ["0"]), -/// DecodeError(expected: "Float", found: "String", path: ["1"]), -/// ]) -/// ``` -/// -pub fn decode2( - constructor: fn(t1, t2) -> t, - t1: Decoder(t1), - t2: Decoder(t2), -) -> Decoder(t) { - fn(value) { - case t1(value), t2(value) { - Ok(a), Ok(b) -> Ok(constructor(a, b)) - a, b -> Error(list.concat([all_errors(a), all_errors(b)])) - } - } -} - -/// Decode 3 values from a `Dynamic` value. -/// -/// ## Examples -/// -/// ```gleam -/// > from(#(1, 2.0, "3")) -/// > |> decode3(MyRecord, element(0, int), element(1, float), element(2, string)) -/// Ok(MyRecord(1, 2.0, "3")) -/// ``` -/// -/// ```gleam -/// > from(#("", "", "")) -/// > |> decode3(MyRecord, element(0, int), element(1, float), element(2, string)) -/// Error([ -/// DecodeError(expected: "Int", found: "String", path: ["0"]), -/// DecodeError(expected: "Float", found: "String", path: ["1"]), -/// ]) -/// ``` -/// -pub fn decode3( - constructor: fn(t1, t2, t3) -> t, - t1: Decoder(t1), - t2: Decoder(t2), - t3: Decoder(t3), -) -> Decoder(t) { - fn(value) { - case t1(value), t2(value), t3(value) { - Ok(a), Ok(b), Ok(c) -> Ok(constructor(a, b, c)) - a, b, c -> - Error(list.concat([all_errors(a), all_errors(b), all_errors(c)])) - } - } -} - -/// Decode 4 values from a `Dynamic` value. -/// -/// ## Examples -/// -/// ```gleam -/// > from(#(1, 2.1, "3", "4")) -/// > |> decode4( -/// > MyRecord, -/// > element(0, int), -/// > element(1, float), -/// > element(2, string), -/// > element(3, string), -/// > ) -/// Ok(MyRecord(1, 2.1, "3", "4")) -/// ``` -/// -/// ```gleam -/// > from(#("", "", "", "")) -/// > |> decode4( -/// > MyRecord, -/// > element(0, int), -/// > element(1, float), -/// > element(2, string), -/// > element(3, string), -/// > ) -/// Error([ -/// DecodeError(expected: "Int", found: "String", path: ["0"]), -/// DecodeError(expected: "Float", found: "String", path: ["1"]), -/// ]) -/// ``` -/// -pub fn decode4( - constructor: fn(t1, t2, t3, t4) -> t, - t1: Decoder(t1), - t2: Decoder(t2), - t3: Decoder(t3), - t4: Decoder(t4), -) -> Decoder(t) { - fn(x: Dynamic) { - case t1(x), t2(x), t3(x), t4(x) { - Ok(a), Ok(b), Ok(c), Ok(d) -> Ok(constructor(a, b, c, d)) - a, b, c, d -> - Error(list.concat([ - all_errors(a), - all_errors(b), - all_errors(c), - all_errors(d), - ])) - } - } -} - -/// Decode 5 values from a `Dynamic` value. -/// -/// ## Examples -/// -/// ```gleam -/// > from(#(1, 2.1, "3", "4", "5")) -/// > |> decode5( -/// > MyRecord, -/// > element(0, int), -/// > element(1, float), -/// > element(2, string), -/// > element(3, string), -/// > element(4, string), -/// > ) -/// Ok(MyRecord(1, 2.1, "3", "4", "5")) -/// ``` -/// -/// ```gleam -/// > from(#("", "", "", "", "")) -/// > |> decode5( -/// > MyRecord, -/// > element(0, int), -/// > element(1, float), -/// > element(2, string), -/// > element(3, string), -/// > element(4, string), -/// > ) -/// Error([ -/// DecodeError(expected: "Int", found: "String", path: ["0"]), -/// DecodeError(expected: "Float", found: "String", path: ["1"]), -/// ]) -/// ``` -/// -pub fn decode5( - constructor: fn(t1, t2, t3, t4, t5) -> t, - t1: Decoder(t1), - t2: Decoder(t2), - t3: Decoder(t3), - t4: Decoder(t4), - t5: Decoder(t5), -) -> Decoder(t) { - fn(x: Dynamic) { - case t1(x), t2(x), t3(x), t4(x), t5(x) { - Ok(a), Ok(b), Ok(c), Ok(d), Ok(e) -> Ok(constructor(a, b, c, d, e)) - a, b, c, d, e -> - Error(list.concat([ - all_errors(a), - all_errors(b), - all_errors(c), - all_errors(d), - all_errors(e), - ])) - } - } -} - -/// Decode 6 values from a `Dynamic` value. -/// -/// ## Examples -/// -/// ```gleam -/// > from(#(1, 2.1, "3", "4", "5", "6")) -/// > |> decode6( -/// > MyRecord, -/// > element(0, int), -/// > element(1, float), -/// > element(2, string), -/// > element(3, string), -/// > element(4, string), -/// > element(5, string), -/// > ) -/// Ok(MyRecord(1, 2.1, "3", "4", "5", "6")) -/// ``` -/// -/// ```gleam -/// > from(#("", "", "", "", "", "")) -/// > |> decode6( -/// > MyRecord, -/// > element(0, int), -/// > element(1, float), -/// > element(2, string), -/// > element(3, string), -/// > element(4, string), -/// > element(5, string), -/// > ) -/// Error([ -/// DecodeError(expected: "Int", found: "String", path: ["0"]), -/// DecodeError(expected: "Float", found: "String", path: ["1"]), -/// ]) -/// ``` -/// -pub fn decode6( - constructor: fn(t1, t2, t3, t4, t5, t6) -> t, - t1: Decoder(t1), - t2: Decoder(t2), - t3: Decoder(t3), - t4: Decoder(t4), - t5: Decoder(t5), - t6: Decoder(t6), -) -> Decoder(t) { - fn(x: Dynamic) { - case t1(x), t2(x), t3(x), t4(x), t5(x), t6(x) { - Ok(a), Ok(b), Ok(c), Ok(d), Ok(e), Ok(f) -> - Ok(constructor(a, b, c, d, e, f)) - a, b, c, d, e, f -> - Error(list.concat([ - all_errors(a), - all_errors(b), - all_errors(c), - all_errors(d), - all_errors(e), - all_errors(f), - ])) - } - } -} - -/// Decode 7 values from a `Dynamic` value. -/// -/// ## Examples -/// -/// ```gleam -/// > from(#(1, 2.1, "3", "4", "5", "6")) -/// > |> decode7( -/// > MyRecord, -/// > element(0, int), -/// > element(1, float), -/// > element(2, string), -/// > element(3, string), -/// > element(4, string), -/// > element(5, string), -/// > element(6, string), -/// > ) -/// Ok(MyRecord(1, 2.1, "3", "4", "5", "6", "7")) -/// ``` -/// -/// ```gleam -/// > from(#("", "", "", "", "", "", "")) -/// > |> decode7( -/// > MyRecord, -/// > element(0, int), -/// > element(1, float), -/// > element(2, string), -/// > element(3, string), -/// > element(4, string), -/// > element(5, string), -/// > element(6, string), -/// > ) -/// Error([ -/// DecodeError(expected: "Int", found: "String", path: ["0"]), -/// DecodeError(expected: "Float", found: "String", path: ["1"]), -/// ]) -/// ``` -/// -pub fn decode7( - constructor: fn(t1, t2, t3, t4, t5, t6, t7) -> t, - t1: Decoder(t1), - t2: Decoder(t2), - t3: Decoder(t3), - t4: Decoder(t4), - t5: Decoder(t5), - t6: Decoder(t6), - t7: Decoder(t7), -) -> Decoder(t) { - fn(x: Dynamic) { - case t1(x), t2(x), t3(x), t4(x), t5(x), t6(x), t7(x) { - Ok(a), Ok(b), Ok(c), Ok(d), Ok(e), Ok(f), Ok(g) -> - Ok(constructor(a, b, c, d, e, f, g)) - a, b, c, d, e, f, g -> - Error(list.concat([ - all_errors(a), - all_errors(b), - all_errors(c), - all_errors(d), - all_errors(e), - all_errors(f), - all_errors(g), - ])) - } - } -} - -/// Decode 8 values from a `Dynamic` value. -/// -/// ## Examples -/// -/// ```gleam -/// > from(#(1, 2.1, "3", "4", "5", "6", "7", "8")) -/// > |> decode8( -/// > MyRecord, -/// > element(0, int), -/// > element(1, float), -/// > element(2, string), -/// > element(3, string), -/// > element(4, string), -/// > element(5, string), -/// > element(6, string), -/// > element(7, string), -/// > ) -/// Ok(MyRecord(1, 2.1, "3", "4", "5", "6", "7", "8")) -/// ``` -/// -/// ```gleam -/// > from(#("", "", "", "", "", "", "", "")) -/// > |> decode8( -/// > MyRecord, -/// > element(0, int), -/// > element(1, float), -/// > element(2, string), -/// > element(3, string), -/// > element(4, string), -/// > element(5, string), -/// > element(6, string), -/// > element(7, string), -/// > ) -/// Error([ -/// DecodeError(expected: "Int", found: "String", path: ["0"]), -/// DecodeError(expected: "Float", found: "String", path: ["1"]), -/// ]) -/// ``` -/// -pub fn decode8( - constructor: fn(t1, t2, t3, t4, t5, t6, t7, t8) -> t, - t1: Decoder(t1), - t2: Decoder(t2), - t3: Decoder(t3), - t4: Decoder(t4), - t5: Decoder(t5), - t6: Decoder(t6), - t7: Decoder(t7), - t8: Decoder(t8), -) -> Decoder(t) { - fn(x: Dynamic) { - case t1(x), t2(x), t3(x), t4(x), t5(x), t6(x), t7(x), t8(x) { - Ok(a), Ok(b), Ok(c), Ok(d), Ok(e), Ok(f), Ok(g), Ok(h) -> - Ok(constructor(a, b, c, d, e, f, g, h)) - a, b, c, d, e, f, g, h -> - Error(list.concat([ - all_errors(a), - all_errors(b), - all_errors(c), - all_errors(d), - all_errors(e), - all_errors(f), - all_errors(g), - all_errors(h), - ])) - } - } -} - -/// Decode 9 values from a `Dynamic` value. -/// -/// ## Examples -/// -/// ```gleam -/// > from(#(1, 2.1, "3", "4", "5", "6", "7", "8", "9")) -/// > |> decode9( -/// > MyRecord, -/// > element(0, int), -/// > element(1, float), -/// > element(2, string), -/// > element(3, string), -/// > element(4, string), -/// > element(5, string), -/// > element(6, string), -/// > element(7, string), -/// > element(8, string), -/// > ) -/// Ok(MyRecord(1, 2.1, "3", "4", "5", "6", "7", "8", "9")) -/// ``` -/// -/// ```gleam -/// > from(#("", "", "", "", "", "", "", "", "")) -/// > |> decode9( -/// > MyRecord, -/// > element(0, int), -/// > element(1, float), -/// > element(2, string), -/// > element(3, string), -/// > element(4, string), -/// > element(5, string), -/// > element(6, string), -/// > element(7, string), -/// > element(8, string), -/// > ) -/// Error([ -/// DecodeError(expected: "Int", found: "String", path: ["0"]), -/// DecodeError(expected: "Float", found: "String", path: ["1"]), -/// ]) -/// ``` -/// -pub fn decode9( - constructor: fn(t1, t2, t3, t4, t5, t6, t7, t8, t9) -> t, - t1: Decoder(t1), - t2: Decoder(t2), - t3: Decoder(t3), - t4: Decoder(t4), - t5: Decoder(t5), - t6: Decoder(t6), - t7: Decoder(t7), - t8: Decoder(t8), - t9: Decoder(t9), -) -> Decoder(t) { - fn(x: Dynamic) { - case t1(x), t2(x), t3(x), t4(x), t5(x), t6(x), t7(x), t8(x), t9(x) { - Ok(a), Ok(b), Ok(c), Ok(d), Ok(e), Ok(f), Ok(g), Ok(h), Ok(i) -> - Ok(constructor(a, b, c, d, e, f, g, h, i)) - a, b, c, d, e, f, g, h, i -> - Error(list.concat([ - all_errors(a), - all_errors(b), - all_errors(c), - all_errors(d), - all_errors(e), - all_errors(f), - all_errors(g), - all_errors(h), - all_errors(i), - ])) - } - } -} - -fn all_errors(result: Result(a, List(DecodeError))) -> List(DecodeError) { - case result { - Ok(_) -> [] - Error(errors) -> errors - } -} diff --git a/build/packages/gleam_stdlib/src/gleam/float.gleam b/build/packages/gleam_stdlib/src/gleam/float.gleam deleted file mode 100644 index c8c6147..0000000 --- a/build/packages/gleam_stdlib/src/gleam/float.gleam +++ /dev/null @@ -1,532 +0,0 @@ -import gleam/order.{Order} - -/// Attempts to parse a string as a `Float`, returning `Error(Nil)` if it was -/// not possible. -/// -/// ## Examples -/// -/// ```gleam -/// > parse("2.3") -/// Ok(2.3) -/// ``` -/// -/// ```gleam -/// > parse("ABC") -/// Error(Nil) -/// ``` -/// -pub fn parse(string: String) -> Result(Float, Nil) { - do_parse(string) -} - -@external(erlang, "gleam_stdlib", "parse_float") -@external(javascript, "../gleam_stdlib.mjs", "parse_float") -fn do_parse(a: String) -> Result(Float, Nil) - -/// Returns the string representation of the provided `Float`. -/// -/// ## Examples -/// -/// ```gleam -/// > to_string(2.3) -/// "2.3" -/// ``` -/// -pub fn to_string(x: Float) -> String { - do_to_string(x) -} - -@external(erlang, "gleam_stdlib", "float_to_string") -@external(javascript, "../gleam_stdlib.mjs", "float_to_string") -fn do_to_string(a: Float) -> String - -/// Restricts a `Float` between a lower and upper bound. -/// -/// ## Examples -/// -/// ```gleam -/// > clamp(1.2, min: 1.4, max: 1.6) -/// 1.4 -/// ``` -/// -pub fn clamp(x: Float, min min_bound: Float, max max_bound: Float) -> Float { - x - |> min(max_bound) - |> max(min_bound) -} - -/// Compares two `Float`s, returning an `Order`: -/// `Lt` for lower than, `Eq` for equals, or `Gt` for greater than. -/// -/// ## Examples -/// -/// ```gleam -/// > compare(2.0, 2.3) -/// Lt -/// ``` -/// -/// To handle -/// [Floating Point Imprecision](https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems) -/// you may use [`loosely_compare`](#loosely_compare) instead. -/// -pub fn compare(a: Float, with b: Float) -> Order { - case a == b { - True -> order.Eq - False -> - case a <. b { - True -> order.Lt - False -> order.Gt - } - } -} - -/// Compares two `Float`s within a tolerance, returning an `Order`: -/// `Lt` for lower than, `Eq` for equals, or `Gt` for greater than. -/// -/// This function allows Float comparison while handling -/// [Floating Point Imprecision](https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems). -/// -/// Notice: For `Float`s the tolerance won't be exact: -/// `5.3 - 5.0` is not exactly `0.3`. -/// -/// ## Examples -/// -/// ```gleam -/// > loosely_compare(5.0, with: 5.3, tolerating: 0.5) -/// Eq -/// ``` -/// -/// If you want to check only for equality you may use -/// [`loosely_equals`](#loosely_equals) instead. -/// -pub fn loosely_compare( - a: Float, - with b: Float, - tolerating tolerance: Float, -) -> Order { - let difference = absolute_value(a -. b) - case difference <=. tolerance { - True -> order.Eq - False -> compare(a, b) - } -} - -/// Checks for equality of two `Float`s within a tolerance, -/// returning an `Bool`. -/// -/// This function allows Float comparison while handling -/// [Floating Point Imprecision](https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems). -/// -/// Notice: For `Float`s the tolerance won't be exact: -/// `5.3 - 5.0` is not exactly `0.3`. -/// -/// ## Examples -/// -/// ```gleam -/// > loosely_equals(5.0, with: 5.3, tolerating: 0.5) -/// True -/// ``` -/// -/// ```gleam -/// > loosely_equals(5.0, with: 5.1, tolerating: 0.1) -/// False -/// ``` -/// -pub fn loosely_equals( - a: Float, - with b: Float, - tolerating tolerance: Float, -) -> Bool { - let difference = absolute_value(a -. b) - difference <=. tolerance -} - -/// Compares two `Float`s, returning the smaller of the two. -/// -/// ## Examples -/// -/// ```gleam -/// > min(2.0, 2.3) -/// 2.0 -/// ``` -/// -pub fn min(a: Float, b: Float) -> Float { - case a <. b { - True -> a - False -> b - } -} - -/// Compares two `Float`s, returning the larger of the two. -/// -/// ## Examples -/// -/// ```gleam -/// > max(2.0, 2.3) -/// 2.3 -/// ``` -/// -pub fn max(a: Float, b: Float) -> Float { - case a >. b { - True -> a - False -> b - } -} - -/// Rounds the value to the next highest whole number as a `Float`. -/// -/// ## Examples -/// -/// ```gleam -/// > ceiling(2.3) -/// 3.0 -/// ``` -/// -pub fn ceiling(x: Float) -> Float { - do_ceiling(x) -} - -@external(erlang, "math", "ceil") -@external(javascript, "../gleam_stdlib.mjs", "ceiling") -fn do_ceiling(a: Float) -> Float - -/// Rounds the value to the next lowest whole number as a `Float`. -/// -/// ## Examples -/// -/// ```gleam -/// > floor(2.3) -/// 2.0 -/// ``` -/// -pub fn floor(x: Float) -> Float { - do_floor(x) -} - -@external(erlang, "math", "floor") -@external(javascript, "../gleam_stdlib.mjs", "floor") -fn do_floor(a: Float) -> Float - -/// Rounds the value to the nearest whole number as an `Int`. -/// -/// ## Examples -/// -/// ```gleam -/// > round(2.3) -/// 2 -/// ``` -/// -/// ```gleam -/// > round(2.5) -/// 3 -/// ``` -/// -pub fn round(x: Float) -> Int { - do_round(x) -} - -@target(erlang) -@external(erlang, "erlang", "round") -fn do_round(a: Float) -> Int - -@target(javascript) -fn do_round(x: Float) -> Int { - case x >=. 0.0 { - True -> js_round(x) - _ -> 0 - js_round(negate(x)) - } -} - -@target(javascript) -@external(javascript, "../gleam_stdlib.mjs", "round") -fn js_round(a: Float) -> Int - -/// Returns the value as an `Int`, truncating all decimal digits. -/// -/// ## Examples -/// -/// ```gleam -/// > truncate(2.4343434847383438) -/// 2 -/// ``` -/// -pub fn truncate(x: Float) -> Int { - do_truncate(x) -} - -@external(erlang, "erlang", "trunc") -@external(javascript, "../gleam_stdlib.mjs", "truncate") -fn do_truncate(a: Float) -> Int - -/// Returns the absolute value of the input as a `Float`. -/// -/// ## Examples -/// -/// ```gleam -/// > absolute_value(-12.5) -/// 12.5 -/// ``` -/// -/// ```gleam -/// > absolute_value(10.2) -/// 10.2 -/// ``` -/// -pub fn absolute_value(x: Float) -> Float { - case x >=. 0.0 { - True -> x - _ -> 0.0 -. x - } -} - -/// Returns the results of the base being raised to the power of the -/// exponent, as a `Float`. -/// -/// ## Examples -/// -/// ```gleam -/// > power(2.0, -1.0) -/// Ok(0.5) -/// ``` -/// -/// ```gleam -/// > power(2.0, 2.0) -/// Ok(4.0) -/// ``` -/// -/// ```gleam -/// > power(8.0, 1.5) -/// Ok(22.627416997969522) -/// ``` -/// -/// ```gleam -/// > 4.0 |> power(of: 2.0) -/// Ok(16.0) -/// ``` -/// -/// ```gleam -/// > power(-1.0, 0.5) -/// Error(Nil) -/// ``` -/// -pub fn power(base: Float, of exponent: Float) -> Result(Float, Nil) { - let fractional: Bool = ceiling(exponent) -. exponent >. 0.0 - // In the following check: - // 1. If the base is negative and the exponent is fractional then - // return an error as it will otherwise be an imaginary number - // 2. If the base is 0 and the exponent is negative then the expression - // is equivalent to the exponent divided by 0 and an error should be - // returned - case base <. 0.0 && fractional || base == 0.0 && exponent <. 0.0 { - True -> Error(Nil) - False -> Ok(do_power(base, exponent)) - } -} - -@external(erlang, "math", "pow") -@external(javascript, "../gleam_stdlib.mjs", "power") -fn do_power(a: Float, b: Float) -> Float - -/// Returns the square root of the input as a `Float`. -/// -/// ## Examples -/// -/// ```gleam -/// > square_root(4.0) -/// Ok(2.0) -/// ``` -/// -/// ```gleam -/// > square_root(-16.0) -/// Error(Nil) -/// ``` -/// -pub fn square_root(x: Float) -> Result(Float, Nil) { - power(x, 0.5) -} - -/// Returns the negative of the value provided. -/// -/// ## Examples -/// -/// ```gleam -/// > negate(1.0) -/// -1.0 -/// ``` -/// -pub fn negate(x: Float) -> Float { - -1.0 *. x -} - -/// Sums a list of `Float`s. -/// -/// ## Example -/// -/// ```gleam -/// > sum([1.0, 2.2, 3.3]) -/// 6.5 -/// ``` -/// -pub fn sum(numbers: List(Float)) -> Float { - numbers - |> do_sum(0.0) -} - -fn do_sum(numbers: List(Float), initial: Float) -> Float { - case numbers { - [] -> initial - [x, ..rest] -> do_sum(rest, x +. initial) - } -} - -/// Multiplies a list of `Float`s and returns the product. -/// -/// ## Example -/// -/// ```gleam -/// > product([2.5, 3.2, 4.2]) -/// 33.6 -/// ``` -/// -pub fn product(numbers: List(Float)) -> Float { - case numbers { - [] -> 1.0 - _ -> do_product(numbers, 1.0) - } -} - -fn do_product(numbers: List(Float), initial: Float) -> Float { - case numbers { - [] -> initial - [x, ..rest] -> do_product(rest, x *. initial) - } -} - -/// Generates a random float between the given minimum and maximum values. -/// -/// -/// ## Examples -/// -/// ```gleam -/// > random(1.0, 5.0) -/// 2.646355926896028 -/// ``` -/// -pub fn random(min: Float, max: Float) -> Float { - do_random_uniform() *. { max -. min } +. min -} - -/// Returns a random float uniformly distributed in the value range -/// 0.0 =< X < 1.0 and updates the state in the process dictionary. -/// See: -/// -@external(erlang, "rand", "uniform") -@external(javascript, "../gleam_stdlib.mjs", "random_uniform") -fn do_random_uniform() -> Float - -/// Returns division of the inputs as a `Result`. -/// -/// ## Examples -/// -/// ```gleam -/// > divide(0.0, 1.0) -/// Ok(1.0) -/// ``` -/// -/// ```gleam -/// > divide(1.0, 0.0) -/// Error(Nil) -/// ``` -/// -pub fn divide(a: Float, by b: Float) -> Result(Float, Nil) { - case b { - 0.0 -> Error(Nil) - b -> Ok(a /. b) - } -} - -/// Adds two floats together. -/// -/// It's the function equivalent of the `+.` operator. -/// This function is useful in higher order functions or pipes. -/// -/// ## Examples -/// -/// ```gleam -/// > add(1.0, 2.0) -/// 3.0 -/// ``` -/// -/// ```gleam -/// > import gleam/list -/// > list.fold([1.0, 2.0, 3.0], 0.0, add) -/// 6.0 -/// ``` -/// -/// ```gleam -/// > 3.0 |> add(2.0) -/// 5.0 -/// ``` -/// -pub fn add(a: Float, b: Float) -> Float { - a +. b -} - -/// Multiplies two floats together. -/// -/// It's the function equivalent of the `*.` operator. -/// This function is useful in higher order functions or pipes. -/// -/// ## Examples -/// -/// ```gleam -/// > multiply(2.0, 4.0) -/// 8.0 -/// ``` -/// -/// ```gleam -/// import gleam/list -/// > list.fold([2.0, 3.0, 4.0], 1.0, multiply) -/// 24.0 -/// ``` -/// -/// ```gleam -/// > 3.0 |> multiply(2.0) -/// 6.0 -/// ``` -/// -pub fn multiply(a: Float, b: Float) -> Float { - a *. b -} - -/// Subtracts one float from another. -/// -/// It's the function equivalent of the `-.` operator. -/// This function is useful in higher order functions or pipes. -/// -/// ## Examples -/// -/// ```gleam -/// > subtract(3.0, 1.0) -/// 2.0 -/// ``` -/// -/// ```gleam -/// > import gleam/list -/// > list.fold([1.0, 2.0, 3.0], 10.0, subtract) -/// 4.0 -/// ``` -/// -/// ```gleam -/// > 3.0 |> subtract(_, 2.0) -/// 1.0 -/// ``` -/// -/// ```gleam -/// > 3.0 |> subtract(2.0, _) -/// -1.0 -/// ``` -/// -pub fn subtract(a: Float, b: Float) -> Float { - a -. b -} diff --git a/build/packages/gleam_stdlib/src/gleam/function.gleam b/build/packages/gleam_stdlib/src/gleam/function.gleam deleted file mode 100644 index daa997d..0000000 --- a/build/packages/gleam_stdlib/src/gleam/function.gleam +++ /dev/null @@ -1,162 +0,0 @@ -/// Takes two functions and chains them together to form one function that -/// takes the input from the first and returns the output of the second. -/// -pub fn compose(fun1: fn(a) -> b, fun2: fn(b) -> c) -> fn(a) -> c { - fn(a) { fun2(fun1(a)) } -} - -/// Takes a function with `2` arguments (an arity of `2`), and returns the -/// curried equivalent. -/// -/// `fn(a, b) -> c` becomes `fn(a) -> fn(b) -> c`. -/// -/// ## Examples -/// -/// *Currying* creates a new function that is identical to the given function -/// except that arguments must now be supplied one by one over several function -/// calls. It thus is the process of taking a function with `n` arguments -/// and producing a sequence of `n` single-argument functions. Given: -/// -/// ```gleam -/// > fn my_fun(i: Int, s: String) -> String { ... } -/// ``` -/// -/// …calling `curry2(my_fun)` would return the curried equivalent, like so: -/// -/// ```gleam -/// > curry2(my_fun) -/// fn(Int) -> fn(String) -> String -/// ``` -/// -/// Currying is useful when you want to partially apply a function with -/// some arguments and then pass it somewhere else, for example: -/// -/// ```gleam -/// > import gleam/list -/// > let multiply = curry2(fn(x, y) { x * y }) -/// > let doubles = list.map([1, 2, 3], multiply(2)) -/// [2, 4, 6] -/// ``` -/// -pub fn curry2(fun: fn(a, b) -> value) { - fn(a) { fn(b) { fun(a, b) } } -} - -/// Takes a function with `3` arguments (an arity of `3`), and returns the -/// curried equivalent. -/// -/// `fn(a, b, c) -> d` becomes `fn(a) -> fn(b) -> fn(c) -> d`. -/// -/// See [`curry2`](#curry2) for a detailed explanation. -/// -pub fn curry3(fun: fn(a, b, c) -> value) { - fn(a) { fn(b) { fn(c) { fun(a, b, c) } } } -} - -/// Takes a function with `4` arguments (an arity of `4`), and returns the -/// curried equivalent. -/// -/// `fn(a, b, c, d) -> e` becomes `fn(a) -> fn(b) -> fn(c) -> fn(d) -> e`. -/// -/// See [`curry2`](#curry2) for a detailed explanation. -/// -pub fn curry4(fun: fn(a, b, c, d) -> value) { - fn(a) { fn(b) { fn(c) { fn(d) { fun(a, b, c, d) } } } } -} - -/// Takes a function with `5` arguments (an arity of `5`), and returns the -/// curried equivalent. -/// -/// `fn(a, b, c, d, e) -> f` becomes -/// `fn(a) -> fn(b) -> fn(c) -> fn(d) -> fn(e) -> f`. -/// -/// See [`curry2`](#curry2) for a detailed explanation. -/// -pub fn curry5(fun: fn(a, b, c, d, e) -> value) { - fn(a) { fn(b) { fn(c) { fn(d) { fn(e) { fun(a, b, c, d, e) } } } } } -} - -/// Takes a function with `6` arguments (an arity of `6`), and returns the -/// curried equivalent. -/// -/// `fn(a, b, c, d, e, f) -> g` becomes -/// `fn(a) -> fn(b) -> fn(c) -> fn(d) -> fn(e) -> fn(f) -> g`. -/// -/// See [`curry2`](#curry2) for a detailed explanation. -/// -pub fn curry6(fun: fn(a, b, c, d, e, f) -> value) { - fn(a) { - fn(b) { fn(c) { fn(d) { fn(e) { fn(f) { fun(a, b, c, d, e, f) } } } } } - } -} - -/// Takes a function that takes two arguments and returns a new function that -/// takes the same two arguments, but in reverse order. -/// -pub fn flip(fun: fn(a, b) -> c) -> fn(b, a) -> c { - fn(b, a) { fun(a, b) } -} - -/// Takes a single argument and always returns its input value. -/// -pub fn identity(x: a) -> a { - x -} - -/// Takes a single argument and returns a new function that -/// ignores its argument and always returns the input value. -/// -pub fn constant(value: a) -> fn(b) -> a { - fn(_) { value } -} - -/// Takes an argument and a single function, -/// calls that function with that argument -/// and returns that argument instead of the function return value. -/// Useful for running synchronous side effects in a pipeline. -/// -pub fn tap(arg: a, effect: fn(a) -> b) -> a { - effect(arg) - arg -} - -/// Takes a function with arity one and an argument, -/// calls that function with the argument and returns the function return value. -/// -/// Useful for concisely calling functions returned as a part of a pipeline. -/// -/// ## Example -/// -/// ```gleam -/// > let doubler = fn() { -/// > fn(x: Int) { x * 2 } -/// > } -/// > -/// > doubler() -/// > |> apply1(2) -/// 4 -/// ``` -/// -pub fn apply1(fun: fn(a) -> value, arg1: a) -> value { - fun(arg1) -} - -/// Takes a function with arity two and two arguments, -/// calls that function with the arguments -/// and returns the function return value. -/// -/// See [`apply1`](#apply1) for more details. -/// -pub fn apply2(fun: fn(a, b) -> value, arg1: a, arg2: b) -> value { - fun(arg1, arg2) -} - -/// Takes a function with arity three and three arguments, -/// calls that function with the arguments -/// and returns the function return value. -/// -/// See [`apply1`](#apply1) for more details. -/// -pub fn apply3(fun: fn(a, b, c) -> value, arg1: a, arg2: b, arg3: c) -> value { - fun(arg1, arg2, arg3) -} diff --git a/build/packages/gleam_stdlib/src/gleam/int.gleam b/build/packages/gleam_stdlib/src/gleam/int.gleam deleted file mode 100644 index e440365..0000000 --- a/build/packages/gleam_stdlib/src/gleam/int.gleam +++ /dev/null @@ -1,862 +0,0 @@ -import gleam/float -import gleam/order.{Order} - -/// Returns the absolute value of the input. -/// -/// ## Examples -/// -/// ```gleam -/// > absolute_value(-12) -/// 12 -/// ``` -/// -/// ```gleam -/// > absolute_value(10) -/// 10 -/// ``` -/// -pub fn absolute_value(x: Int) -> Int { - case x >= 0 { - True -> x - False -> x * -1 - } -} - -/// Returns the results of the base being raised to the power of the -/// exponent, as a `Float`. -/// -/// ## Examples -/// -/// ```gleam -/// > power(2, -1.0) -/// Ok(0.5) -/// ``` -/// -/// ```gleam -/// > power(2, 2.0) -/// Ok(4.0) -/// ``` -/// -/// ```gleam -/// > power(8, 1.5) -/// Ok(22.627416997969522) -/// ``` -/// -/// ```gleam -/// > 4 |> power(of: 2.0) -/// Ok(16.0) -/// ``` -/// -/// ```gleam -/// > power(-1, 0.5) -/// Error(Nil) -/// ``` -/// -pub fn power(base: Int, of exponent: Float) -> Result(Float, Nil) { - base - |> to_float() - |> float.power(exponent) -} - -/// Returns the square root of the input as a `Float`. -/// -/// ## Examples -/// -/// ```gleam -/// > square_root(4) -/// Ok(2.0) -/// ``` -/// -/// ```gleam -/// > square_root(-16) -/// Error(Nil) -/// ``` -/// -pub fn square_root(x: Int) -> Result(Float, Nil) { - x - |> to_float() - |> float.square_root() -} - -/// Parses a given string as an int if possible. -/// -/// ## Examples -/// -/// ```gleam -/// > parse("2") -/// Ok(2) -/// ``` -/// -/// ```gleam -/// > parse("ABC") -/// Error(Nil) -/// ``` -/// -pub fn parse(string: String) -> Result(Int, Nil) { - do_parse(string) -} - -@external(erlang, "gleam_stdlib", "parse_int") -@external(javascript, "../gleam_stdlib.mjs", "parse_int") -fn do_parse(a: String) -> Result(Int, Nil) - -/// Parses a given string as an int in a given base if possible. -/// Supports only bases 2 to 36, for values outside of which this function returns an `Error(Nil)`. -/// -/// ## Examples -/// -/// ```gleam -/// > base_parse("10", 2) -/// Ok(2) -/// -/// > base_parse("30", 16) -/// Ok(48) -/// -/// > base_parse("1C", 36) -/// Ok(48) -/// -/// > base_parse("48", 1) -/// Error(Nil) -/// -/// > base_parse("48", 37) -/// Error(Nil) -/// ``` -/// -pub fn base_parse(string: String, base: Int) -> Result(Int, Nil) { - case base >= 2 && base <= 36 { - True -> do_base_parse(string, base) - False -> Error(Nil) - } -} - -@external(erlang, "gleam_stdlib", "int_from_base_string") -@external(javascript, "../gleam_stdlib.mjs", "int_from_base_string") -fn do_base_parse(a: String, b: Int) -> Result(Int, Nil) - -/// Prints a given int to a string. -/// -/// ## Examples -/// -/// ```gleam -/// > to_string(2) -/// "2" -/// ``` -/// -pub fn to_string(x: Int) { - do_to_string(x) -} - -@external(erlang, "erlang", "integer_to_binary") -@external(javascript, "../gleam_stdlib.mjs", "to_string") -fn do_to_string(a: Int) -> String - -/// Error value when trying to operate with a base out of the allowed range. -/// -pub type InvalidBase { - InvalidBase -} - -/// Prints a given int to a string using the base number provided. -/// Supports only bases 2 to 36, for values outside of which this function returns an `Error(InvalidBase)`. -/// For common bases (2, 8, 16, 36), use the `to_baseN` functions. -/// -/// ## Examples -/// -/// ```gleam -/// > to_base_string(2, 2) -/// Ok("10") -/// ``` -/// -/// ```gleam -/// > to_base_string(48, 16) -/// Ok("30") -/// ``` -/// -/// ```gleam -/// > to_base_string(48, 36) -/// Ok("1C") -/// ``` -/// -/// ```gleam -/// > to_base_string(48, 1) -/// Error(InvalidBase) -/// ``` -/// -/// ```gleam -/// > to_base_string(48, 37) -/// Error(InvalidBase) -/// ``` -/// -pub fn to_base_string(x: Int, base: Int) -> Result(String, InvalidBase) { - case base >= 2 && base <= 36 { - True -> Ok(do_to_base_string(x, base)) - False -> Error(InvalidBase) - } -} - -@external(erlang, "erlang", "integer_to_binary") -@external(javascript, "../gleam_stdlib.mjs", "int_to_base_string") -fn do_to_base_string(a: Int, b: Int) -> String - -/// Prints a given int to a string using base-2. -/// -/// ## Examples -/// -/// ```gleam -/// > to_base2(2) -/// "10" -/// ``` -/// -pub fn to_base2(x: Int) -> String { - do_to_base_string(x, 2) -} - -/// Prints a given int to a string using base-8. -/// -/// ## Examples -/// -/// ```gleam -/// > to_base8(15) -/// "17" -/// ``` -/// -pub fn to_base8(x: Int) -> String { - do_to_base_string(x, 8) -} - -/// Prints a given int to a string using base-16. -/// -/// ## Examples -/// -/// ```gleam -/// > to_base16(48) -/// "30" -/// ``` -/// -pub fn to_base16(x: Int) -> String { - do_to_base_string(x, 16) -} - -/// Prints a given int to a string using base-36. -/// -/// ## Examples -/// -/// ```gleam -/// > to_base36(48) -/// "1C" -/// ``` -/// -pub fn to_base36(x: Int) -> String { - do_to_base_string(x, 36) -} - -/// Takes an int and returns its value as a float. -/// -/// ## Examples -/// -/// ```gleam -/// > to_float(5) -/// 5.0 -/// ``` -/// -/// ```gleam -/// > to_float(0) -/// 0.0 -/// ``` -/// -/// ```gleam -/// > to_float(-3) -/// -3.0 -/// ``` -/// -pub fn to_float(x: Int) -> Float { - do_to_float(x) -} - -@external(erlang, "erlang", "float") -@external(javascript, "../gleam_stdlib.mjs", "identity") -fn do_to_float(a: Int) -> Float - -/// Restricts an int between a lower and upper bound. -/// -/// ## Examples -/// -/// ```gleam -/// > clamp(40, min: 50, max: 60) -/// 50 -/// ``` -/// -pub fn clamp(x: Int, min min_bound: Int, max max_bound: Int) -> Int { - x - |> min(max_bound) - |> max(min_bound) -} - -/// Compares two ints, returning an order. -/// -/// ## Examples -/// -/// ```gleam -/// > compare(2, 3) -/// Lt -/// ``` -/// -/// ```gleam -/// > compare(4, 3) -/// Gt -/// ``` -/// -/// ```gleam -/// > compare(3, 3) -/// Eq -/// ``` -/// -pub fn compare(a: Int, with b: Int) -> Order { - case a == b { - True -> order.Eq - False -> - case a < b { - True -> order.Lt - False -> order.Gt - } - } -} - -/// Compares two ints, returning the smaller of the two. -/// -/// ## Examples -/// -/// ```gleam -/// > min(2, 3) -/// 2 -/// ``` -/// -pub fn min(a: Int, b: Int) -> Int { - case a < b { - True -> a - False -> b - } -} - -/// Compares two ints, returning the larger of the two. -/// -/// ## Examples -/// -/// ```gleam -/// > max(2, 3) -/// 3 -/// ``` -/// -pub fn max(a: Int, b: Int) -> Int { - case a > b { - True -> a - False -> b - } -} - -/// Returns whether the value provided is even. -/// -/// ## Examples -/// -/// ```gleam -/// > is_even(2) -/// True -/// ``` -/// -/// ```gleam -/// > is_even(3) -/// False -/// ``` -/// -pub fn is_even(x: Int) -> Bool { - x % 2 == 0 -} - -/// Returns whether the value provided is odd. -/// -/// ## Examples -/// -/// ```gleam -/// > is_odd(3) -/// True -/// ``` -/// -/// ```gleam -/// > is_odd(2) -/// False -/// ``` -/// -pub fn is_odd(x: Int) -> Bool { - x % 2 != 0 -} - -/// Returns the negative of the value provided. -/// -/// ## Examples -/// -/// ```gleam -/// > negate(1) -/// -1 -/// ``` -/// -pub fn negate(x: Int) -> Int { - -1 * x -} - -/// Sums a list of ints. -/// -/// ## Example -/// -/// ```gleam -/// > sum([1, 2, 3]) -/// 6 -/// ``` -/// -pub fn sum(numbers: List(Int)) -> Int { - numbers - |> do_sum(0) -} - -fn do_sum(numbers: List(Int), initial: Int) -> Int { - case numbers { - [] -> initial - [x, ..rest] -> do_sum(rest, x + initial) - } -} - -/// Multiplies a list of ints and returns the product. -/// -/// ## Example -/// -/// ```gleam -/// > product([2, 3, 4]) -/// 24 -/// ``` -/// -pub fn product(numbers: List(Int)) -> Int { - case numbers { - [] -> 1 - _ -> do_product(numbers, 1) - } -} - -fn do_product(numbers: List(Int), initial: Int) -> Int { - case numbers { - [] -> initial - [x, ..rest] -> do_product(rest, x * initial) - } -} - -/// Splits an integer into its digit representation in the specified base -/// -/// ## Examples -/// -/// ```gleam -/// > digits(234, 10) -/// Ok([2,3,4]) -/// ``` -/// -/// ```gleam -/// > digits(234, 1) -/// Error(InvalidBase) -/// ``` -/// -pub fn digits(x: Int, base: Int) -> Result(List(Int), InvalidBase) { - case base < 2 { - True -> Error(InvalidBase) - False -> Ok(do_digits(x, base, [])) - } -} - -fn do_digits(x: Int, base: Int, acc: List(Int)) -> List(Int) { - case absolute_value(x) < base { - True -> [x, ..acc] - False -> do_digits(x / base, base, [x % base, ..acc]) - } -} - -/// Joins a list of digits into a single value. -/// Returns an error if the base is less than 2 or if the list contains a digit greater than or equal to the specified base. -/// -/// ## Examples -/// -/// ```gleam -/// > undigits([2,3,4], 10) -/// Ok(234) -/// ``` -/// -/// ```gleam -/// > undigits([2,3,4], 1) -/// Error(InvalidBase) -/// ``` -/// -/// ```gleam -/// > undigits([2,3,4], 2) -/// Error(InvalidBase) -/// ``` -/// -pub fn undigits(numbers: List(Int), base: Int) -> Result(Int, InvalidBase) { - case base < 2 { - True -> Error(InvalidBase) - False -> do_undigits(numbers, base, 0) - } -} - -fn do_undigits( - numbers: List(Int), - base: Int, - acc: Int, -) -> Result(Int, InvalidBase) { - case numbers { - [] -> Ok(acc) - [digit, ..] if digit >= base -> Error(InvalidBase) - [digit, ..rest] -> do_undigits(rest, base, acc * base + digit) - } -} - -/// Generates a random int between the given minimum and maximum values. -/// -/// ## Examples -/// -/// ```gleam -/// > random(1, 5) -/// 2 -/// ``` -/// -pub fn random(min: Int, max: Int) -> Int { - float.random(to_float(min), to_float(max)) - |> float.floor() - |> float.round() -} - -/// Performs a truncated integer division. -/// -/// Returns division of the inputs as a `Result`: If the given divisor equals -/// `0`, this function returns an `Error`. -/// -/// ## Examples -/// -/// ```gleam -/// > divide(0, 1) -/// Ok(1) -/// ``` -/// -/// ```gleam -/// > divide(1, 0) -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > divide(5, 2) -/// Ok(2) -/// ``` -/// -/// ```gleam -/// > divide(-99, 2) -/// Ok(-49) -/// ``` -/// -pub fn divide(dividend: Int, by divisor: Int) -> Result(Int, Nil) { - case divisor { - 0 -> Error(Nil) - divisor -> Ok(dividend / divisor) - } -} - -/// Computes the remainder of an integer division of inputs as a `Result`. -/// -/// Returns division of the inputs as a `Result`: If the given divisor equals -/// `0`, this function returns an `Error`. -/// -/// Most the time you will want to use the `%` operator instead of this -/// function. -/// -/// ## Examples -/// -/// ```gleam -/// > remainder(3, 2) -/// Ok(1) -/// ``` -/// -/// ```gleam -/// > remainder(1, 0) -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > remainder(10, -1) -/// Ok(0) -/// ``` -/// -/// ```gleam -/// > remainder(13, by: 3) -/// Ok(1) -/// ``` -/// -/// ```gleam -/// > remainder(-13, by: 3) -/// Ok(-1) -/// ``` -/// -/// ```gleam -/// > remainder(13, by: -3) -/// Ok(1) -/// ``` -/// -/// ```gleam -/// > remainder(-13, by: -3) -/// Ok(-1) -/// ``` -/// -pub fn remainder(dividend: Int, by divisor: Int) -> Result(Int, Nil) { - case divisor { - 0 -> Error(Nil) - divisor -> Ok(dividend % divisor) - } -} - -/// Computes the modulo of an integer division of inputs as a `Result`. -/// -/// Returns division of the inputs as a `Result`: If the given divisor equals -/// `0`, this function returns an `Error`. -/// -/// Most the time you will want to use the `%` operator instead of this -/// function. -/// -/// ## Examples -/// -/// ```gleam -/// > modulo(3, 2) -/// Ok(1) -/// ``` -/// -/// ```gleam -/// > modulo(1, 0) -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > modulo(10, -1) -/// Ok(0) -/// ``` -/// -/// ```gleam -/// > modulo(13, by: 3) -/// Ok(1) -/// ``` -/// -/// ```gleam -/// > modulo(-13, by: 3) -/// Ok(2) -/// ``` -/// -/// ```gleam -/// > modulo(13, by: -3) -/// Ok(-2) -/// ``` -/// -/// ```gleam -/// > modulo(-13, by: -3) -/// Ok(-1) -/// ``` -/// -pub fn modulo(dividend: Int, by divisor: Int) -> Result(Int, Nil) { - case divisor { - 0 -> Error(Nil) - _ -> { - let remainder = dividend % divisor - case remainder * divisor < 0 { - True -> Ok(remainder + divisor) - False -> Ok(remainder) - } - } - } -} - -/// Performs a *floored* integer division, which means that the result will -/// always be rounded towards negative infinity. -/// -/// If you want to perform truncated integer division (rounding towards zero), -/// use `int.divide()` or the `/` operator instead. -/// -/// Returns division of the inputs as a `Result`: If the given divisor equals -/// `0`, this function returns an `Error`. -/// -/// ## Examples -/// -/// ```gleam -/// > floor_divide(1, 0) -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > floor_divide(5, 2) -/// Ok(2) -/// ``` -/// -/// ```gleam -/// > floor_divide(6, -4) -/// Ok(-2) -/// ``` -/// -/// ```gleam -/// > floor_divide(-99, 2) -/// Ok(-50) -/// ``` -/// -pub fn floor_divide(dividend: Int, by divisor: Int) -> Result(Int, Nil) { - case divisor { - 0 -> Error(Nil) - divisor -> - case dividend * divisor < 0 && dividend % divisor != 0 { - True -> Ok(dividend / divisor - 1) - False -> Ok(dividend / divisor) - } - } -} - -/// Adds two integers together. -/// -/// It's the function equivalent of the `+` operator. -/// This function is useful in higher order functions or pipes. -/// -/// ## Examples -/// -/// ```gleam -/// > add(1, 2) -/// 3 -/// ``` -/// -/// ```gleam -/// import gleam/list -/// > list.fold([1, 2, 3], 0, add) -/// 6 -/// ``` -/// -/// ```gleam -/// > 3 |> add(2) -/// 5 -/// ``` -/// -pub fn add(a: Int, b: Int) -> Int { - a + b -} - -/// Multiplies two integers together. -/// -/// It's the function equivalent of the `*` operator. -/// This function is useful in higher order functions or pipes. -/// -/// ## Examples -/// -/// ```gleam -/// > multiply(2, 4) -/// 8 -/// ``` -/// -/// ```gleam -/// import gleam/list -/// > list.fold([2, 3, 4], 1, multiply) -/// 24 -/// ``` -/// -/// ```gleam -/// > 3 |> multiply(2) -/// 6 -/// ``` -/// -pub fn multiply(a: Int, b: Int) -> Int { - a * b -} - -/// Subtracts one int from another. -/// -/// It's the function equivalent of the `-` operator. -/// This function is useful in higher order functions or pipes. -/// -/// ## Examples -/// -/// ```gleam -/// > subtract(3, 1) -/// 2.0 -/// ``` -/// -/// ```gleam -/// import gleam/list -/// > list.fold([1, 2, 3], 10, subtract) -/// 4 -/// ``` -/// -/// ```gleam -/// > 3 |> subtract(2) -/// 1 -/// ``` -/// -/// ```gleam -/// > 3 |> subtract(2, _) -/// -1 -/// ``` -/// -pub fn subtract(a: Int, b: Int) -> Int { - a - b -} - -/// Calculates the bitwise AND of its arguments. -/// -/// The exact behaviour of this function depends on the target platform. -/// On Erlang it is equivalent to bitwise operations on ints, on JavaScript it -/// is equivalent to bitwise operations on big-ints. -/// -@external(erlang, "erlang", "band") -@external(javascript, "../gleam_stdlib.mjs", "bitwise_and") -pub fn bitwise_and(x: Int, y: Int) -> Int - -/// Calculates the bitwise NOT of its argument. -/// -/// The exact behaviour of this function depends on the target platform. -/// On Erlang it is equivalent to bitwise operations on ints, on JavaScript it -/// is equivalent to bitwise operations on big-ints. -/// -@external(erlang, "erlang", "bnot") -@external(javascript, "../gleam_stdlib.mjs", "bitwise_not") -pub fn bitwise_not(x: Int) -> Int - -/// Calculates the bitwise OR of its arguments. -/// -/// The exact behaviour of this function depends on the target platform. -/// On Erlang it is equivalent to bitwise operations on ints, on JavaScript it -/// is equivalent to bitwise operations on big-ints. -/// -@external(erlang, "erlang", "bor") -@external(javascript, "../gleam_stdlib.mjs", "bitwise_or") -pub fn bitwise_or(x: Int, y: Int) -> Int - -/// Calculates the bitwise XOR of its arguments. -/// -/// The exact behaviour of this function depends on the target platform. -/// On Erlang it is equivalent to bitwise operations on ints, on JavaScript it -/// is equivalent to bitwise operations on big-ints. -/// -@external(erlang, "erlang", "bxor") -@external(javascript, "../gleam_stdlib.mjs", "bitwise_exclusive_or") -pub fn bitwise_exclusive_or(x: Int, y: Int) -> Int - -/// Calculates the result of an arithmetic left bitshift. -/// -/// The exact behaviour of this function depends on the target platform. -/// On Erlang it is equivalent to bitwise operations on ints, on JavaScript it -/// is equivalent to bitwise operations on big-ints. -/// -@external(erlang, "erlang", "bsl") -@external(javascript, "../gleam_stdlib.mjs", "bitwise_shift_left") -pub fn bitwise_shift_left(x: Int, y: Int) -> Int - -/// Calculates the result of an arithmetic right bitshift. -/// -/// The exact behaviour of this function depends on the target platform. -/// On Erlang it is equivalent to bitwise operations on ints, on JavaScript it -/// is equivalent to bitwise operations on big-ints. -/// -@external(erlang, "erlang", "bsr") -@external(javascript, "../gleam_stdlib.mjs", "bitwise_shift_right") -pub fn bitwise_shift_right(x: Int, y: Int) -> Int diff --git a/build/packages/gleam_stdlib/src/gleam/io.gleam b/build/packages/gleam_stdlib/src/gleam/io.gleam deleted file mode 100644 index 0c0a3ee..0000000 --- a/build/packages/gleam_stdlib/src/gleam/io.gleam +++ /dev/null @@ -1,117 +0,0 @@ -import gleam/string - -/// Writes a string to standard output. -/// -/// If you want your output to be printed on its own line see `println`. -/// -/// ## Example -/// -/// ```gleam -/// > io.print("Hi mum") -/// // -> Hi mum -/// Nil -/// ``` -/// -pub fn print(string: String) -> Nil { - do_print(string) -} - -@external(erlang, "gleam_stdlib", "print") -@external(javascript, "../gleam_stdlib.mjs", "print") -fn do_print(string string: String) -> Nil - -/// Writes a string to standard error. -/// -/// If you want your output to be printed on its own line see `println_error`. -/// -/// ## Example -/// -/// ``` -/// > io.print_error("Hi pop") -/// // -> Hi pop -/// Nil -/// ``` -/// -pub fn print_error(string: String) -> Nil { - do_print_error(string) -} - -@external(erlang, "gleam_stdlib", "print_error") -@external(javascript, "../gleam_stdlib.mjs", "print_error") -fn do_print_error(string string: String) -> Nil - -/// Writes a string to standard output, appending a newline to the end. -/// -/// ## Example -/// -/// ```gleam -/// > io.println("Hi mum") -/// // -> Hi mum -/// Nil -/// ``` -/// -pub fn println(string: String) -> Nil { - do_println(string) -} - -@external(erlang, "gleam_stdlib", "println") -@external(javascript, "../gleam_stdlib.mjs", "console_log") -fn do_println(string string: String) -> Nil - -/// Writes a string to standard error, appending a newline to the end. -/// -/// ## Example -/// -/// ```gleam -/// > io.println_error("Hi pop") -/// // -> Hi mum -/// Nil -/// ``` -/// -pub fn println_error(string: String) -> Nil { - do_println_error(string) -} - -@external(erlang, "gleam_stdlib", "println_error") -@external(javascript, "../gleam_stdlib.mjs", "console_error") -fn do_println_error(string string: String) -> Nil - -/// Prints a value to standard error (stderr) yielding Gleam syntax. -/// -/// The value is returned after being printed so it can be used in pipelines. -/// -/// ## Example -/// -/// ```gleam -/// > debug("Hi mum") -/// // -> <<"Hi mum">> -/// "Hi mum" -/// ``` -/// -/// ```gleam -/// > debug(Ok(1)) -/// // -> {ok, 1} -/// Ok(1) -/// ``` -/// -/// ```gleam -/// > import list -/// > [1, 2] -/// > |> list.map(fn(x) { x + 1 }) -/// > |> debug -/// > |> list.map(fn(x) { x * 2 }) -/// // -> [2, 3] -/// [4, 6] -/// ``` -/// -pub fn debug(term: anything) -> anything { - term - |> string.inspect - |> do_debug_println - - term -} - -@external(erlang, "gleam_stdlib", "println_error") -@external(javascript, "../gleam_stdlib.mjs", "print_debug") -fn do_debug_println(string string: String) -> Nil diff --git a/build/packages/gleam_stdlib/src/gleam/iterator.gleam b/build/packages/gleam_stdlib/src/gleam/iterator.gleam deleted file mode 100644 index 5865646..0000000 --- a/build/packages/gleam_stdlib/src/gleam/iterator.gleam +++ /dev/null @@ -1,1480 +0,0 @@ -import gleam/result -import gleam/int -import gleam/list -import gleam/map.{Map} -import gleam/option.{None, Option, Some} -import gleam/order - -// Internal private representation of an Iterator -type Action(element) { - // Dedicated to Electric Six - // https://youtu.be/_30t2dzEgiw?t=162 - Stop - Continue(element, fn() -> Action(element)) -} - -/// An iterator is a lazily evaluated sequence of element. -/// -/// Iterators are useful when working with collections that are too large to -/// fit in memory (or those that are infinite in size) as they only require the -/// elements currently being processed to be in memory. -/// -/// As a lazy data structure no work is done when an iterator is filters, -/// mapped, etc, instead a new iterator is returned with these transformations -/// applied to the stream. Once the stream has all the required transformations -/// applied it can be evaluated using functions such as `fold` and `to_list`. -/// -pub opaque type Iterator(element) { - Iterator(continuation: fn() -> Action(element)) -} - -// Public API for iteration -pub type Step(element, accumulator) { - Next(element: element, accumulator: accumulator) - Done -} - -// Shortcut for an empty iterator. -fn stop() -> Action(element) { - Stop -} - -// Creating Iterators -fn do_unfold( - initial: acc, - f: fn(acc) -> Step(element, acc), -) -> fn() -> Action(element) { - fn() { - case f(initial) { - Next(x, acc) -> Continue(x, do_unfold(acc, f)) - Done -> Stop - } - } -} - -/// Creates an iterator from a given function and accumulator. -/// -/// The function is called on the accumulator and returns either `Done`, -/// indicating the iterator has no more elements, or `Next` which contains a -/// new element and accumulator. The element is yielded by the iterator and the -/// new accumulator is used with the function to compute the next element in -/// the sequence. -/// -/// ## Examples -/// -/// ```gleam -/// > unfold(from: 5, with: fn(n) { -/// > case n { -/// > 0 -> Done -/// > n -> Next(element: n, accumulator: n - 1) -/// > } -/// > }) -/// > |> to_list -/// [5, 4, 3, 2, 1] -/// ``` -/// -pub fn unfold( - from initial: acc, - with f: fn(acc) -> Step(element, acc), -) -> Iterator(element) { - initial - |> do_unfold(f) - |> Iterator -} - -// TODO: test -/// Creates an iterator that yields values created by calling a given function -/// repeatedly. -/// -pub fn repeatedly(f: fn() -> element) -> Iterator(element) { - unfold(Nil, fn(_) { Next(f(), Nil) }) -} - -/// Creates an iterator that returns the same value infinitely. -/// -/// ## Examples -/// -/// ```gleam -/// > repeat(10) -/// > |> take(4) -/// > |> to_list -/// [10, 10, 10, 10] -/// ``` -/// -pub fn repeat(x: element) -> Iterator(element) { - repeatedly(fn() { x }) -} - -/// Creates an iterator that yields each element from the given list. -/// -/// ## Examples -/// -/// ```gleam -/// > from_list([1, 2, 3, 4]) -/// > |> to_list -/// [1, 2, 3, 4] -/// ``` -/// -pub fn from_list(list: List(element)) -> Iterator(element) { - let yield = fn(acc) { - case acc { - [] -> Done - [head, ..tail] -> Next(head, tail) - } - } - unfold(list, yield) -} - -// Consuming Iterators -fn do_transform( - continuation: fn() -> Action(a), - state: acc, - f: fn(acc, a) -> Step(b, acc), -) -> fn() -> Action(b) { - fn() { - case continuation() { - Stop -> Stop - Continue(el, next) -> - case f(state, el) { - Done -> Stop - Next(yield, next_state) -> - Continue(yield, do_transform(next, next_state, f)) - } - } - } -} - -/// Creates an iterator from an existing iterator -/// and a stateful function that may short-circuit. -/// -/// `f` takes arguments `acc` for current state and `el` for current element from underlying iterator, -/// and returns either `Next` with yielded element and new state value, or `Done` to halt the iterator. -/// -/// ## Examples -/// -/// Approximate implementation of `index` in terms of `transform`: -/// -/// ```gleam -/// > from_list(["a", "b", "c"]) -/// > |> transform(0, fn(i, el) { Next(#(i, el), i + 1) }) -/// > |> to_list -/// [#(0, "a"), #(1, "b"), #(2, "c")] -/// ``` -pub fn transform( - over iterator: Iterator(a), - from initial: acc, - with f: fn(acc, a) -> Step(b, acc), -) -> Iterator(b) { - do_transform(iterator.continuation, initial, f) - |> Iterator -} - -fn do_fold( - continuation: fn() -> Action(e), - f: fn(acc, e) -> acc, - accumulator: acc, -) -> acc { - case continuation() { - Continue(elem, next) -> do_fold(next, f, f(accumulator, elem)) - Stop -> accumulator - } -} - -/// Reduces an iterator of elements into a single value by calling a given -/// function on each element in turn. -/// -/// If called on an iterator of infinite length then this function will never -/// return. -/// -/// If you do not care about the end value and only wish to evaluate the -/// iterator for side effects consider using the `run` function instead. -/// -/// ## Examples -/// -/// ```gleam -/// > [1, 2, 3, 4] -/// > |> from_list -/// > |> fold(from: 0, with: fn(acc, element) { element + acc }) -/// 10 -/// ``` -/// -pub fn fold( - over iterator: Iterator(e), - from initial: acc, - with f: fn(acc, e) -> acc, -) -> acc { - iterator.continuation - |> do_fold(f, initial) -} - -// TODO: test -/// Evaluates all elements emitted by the given iterator. This function is useful for when -/// you wish to trigger any side effects that would occur when evaluating -/// the iterator. -/// -pub fn run(iterator: Iterator(e)) -> Nil { - fold(iterator, Nil, fn(_, _) { Nil }) -} - -/// Evaluates an iterator and returns all the elements as a list. -/// -/// If called on an iterator of infinite length then this function will never -/// return. -/// -/// ## Examples -/// -/// ```gleam -/// > [1, 2, 3] -/// > |> from_list -/// > |> map(fn(x) { x * 2 }) -/// > |> to_list -/// [2, 4, 6] -/// ``` -/// -pub fn to_list(iterator: Iterator(element)) -> List(element) { - iterator - |> fold([], fn(acc, e) { [e, ..acc] }) - |> list.reverse -} - -/// Eagerly accesses the first value of an iterator, returning a `Next` -/// that contains the first value and the rest of the iterator. -/// -/// If called on an empty iterator, `Done` is returned. -/// -/// ## Examples -/// -/// ```gleam -/// > let assert Next(first, rest) = [1, 2, 3, 4] -/// > |> from_list -/// > |> step -/// > first -/// 1 -/// ``` -/// -/// ```gleam -/// > rest |> to_list -/// [2, 3, 4] -/// ``` -/// -/// ```gleam -/// > empty() |> step -/// Done -/// ``` -/// -pub fn step(iterator: Iterator(e)) -> Step(e, Iterator(e)) { - case iterator.continuation() { - Stop -> Done - Continue(e, a) -> Next(e, Iterator(a)) - } -} - -fn do_take(continuation: fn() -> Action(e), desired: Int) -> fn() -> Action(e) { - fn() { - case desired > 0 { - False -> Stop - True -> - case continuation() { - Stop -> Stop - Continue(e, next) -> Continue(e, do_take(next, desired - 1)) - } - } - } -} - -/// Creates an iterator that only yields the first `desired` elements. -/// -/// If the iterator does not have enough elements all of them are yielded. -/// -/// ## Examples -/// -/// ```gleam -/// > [1, 2, 3, 4, 5] -/// > |> from_list -/// > |> take(up_to: 3) -/// > |> to_list -/// [1, 2, 3] -/// ``` -/// -/// ```gleam -/// > [1, 2] -/// > |> from_list -/// > |> take(up_to: 3) -/// > |> to_list -/// [1, 2] -/// ``` -/// -pub fn take(from iterator: Iterator(e), up_to desired: Int) -> Iterator(e) { - iterator.continuation - |> do_take(desired) - |> Iterator -} - -fn do_drop(continuation: fn() -> Action(e), desired: Int) -> Action(e) { - case continuation() { - Stop -> Stop - Continue(e, next) -> - case desired > 0 { - True -> do_drop(next, desired - 1) - False -> Continue(e, next) - } - } -} - -/// Evaluates and discards the first N elements in an iterator, returning a new -/// iterator. -/// -/// If the iterator does not have enough elements an empty iterator is -/// returned. -/// -/// This function does not evaluate the elements of the iterator, the -/// computation is performed when the iterator is later run. -/// -/// ## Examples -/// -/// ```gleam -/// > [1, 2, 3, 4, 5] -/// > |> from_list -/// > |> drop(up_to: 3) -/// > |> to_list -/// [4, 5] -/// ``` -/// -/// ```gleam -/// > [1, 2] -/// > |> from_list -/// > |> drop(up_to: 3) -/// > |> to_list -/// [] -/// ``` -/// -pub fn drop(from iterator: Iterator(e), up_to desired: Int) -> Iterator(e) { - fn() { do_drop(iterator.continuation, desired) } - |> Iterator -} - -fn do_map(continuation: fn() -> Action(a), f: fn(a) -> b) -> fn() -> Action(b) { - fn() { - case continuation() { - Stop -> Stop - Continue(e, continuation) -> Continue(f(e), do_map(continuation, f)) - } - } -} - -/// Creates an iterator from an existing iterator and a transformation function. -/// -/// Each element in the new iterator will be the result of calling the given -/// function on the elements in the given iterator. -/// -/// This function does not evaluate the elements of the iterator, the -/// computation is performed when the iterator is later run. -/// -/// ## Examples -/// -/// ```gleam -/// > [1, 2, 3] -/// > |> from_list -/// > |> map(fn(x) { x * 2 }) -/// > |> to_list -/// [2, 4, 6] -/// ``` -/// -pub fn map(over iterator: Iterator(a), with f: fn(a) -> b) -> Iterator(b) { - iterator.continuation - |> do_map(f) - |> Iterator -} - -fn do_append(first: fn() -> Action(a), second: fn() -> Action(a)) -> Action(a) { - case first() { - Continue(e, first) -> Continue(e, fn() { do_append(first, second) }) - Stop -> second() - } -} - -/// Appends two iterators, producing a new iterator. -/// -/// This function does not evaluate the elements of the iterators, the -/// computation is performed when the resulting iterator is later run. -/// -/// ## Examples -/// -/// ```gleam -/// > [1, 2] -/// > |> from_list -/// > |> append([3, 4] |> from_list) -/// > |> to_list -/// [1, 2, 3, 4] -/// ``` -/// -pub fn append(to first: Iterator(a), suffix second: Iterator(a)) -> Iterator(a) { - fn() { do_append(first.continuation, second.continuation) } - |> Iterator -} - -fn do_flatten(flattened: fn() -> Action(Iterator(a))) -> Action(a) { - case flattened() { - Stop -> Stop - Continue(it, next_iterator) -> - do_append(it.continuation, fn() { do_flatten(next_iterator) }) - } -} - -/// Flattens an iterator of iterators, creating a new iterator. -/// -/// This function does not evaluate the elements of the iterator, the -/// computation is performed when the iterator is later run. -/// -/// ## Examples -/// -/// ```gleam -/// > from_list([[1, 2], [3, 4]]) -/// > |> map(from_list) -/// > |> flatten -/// > |> to_list -/// [1, 2, 3, 4] -/// ``` -/// -pub fn flatten(iterator: Iterator(Iterator(a))) -> Iterator(a) { - fn() { do_flatten(iterator.continuation) } - |> Iterator -} - -/// Joins a list of iterators into a single iterator. -/// -/// This function does not evaluate the elements of the iterator, the -/// computation is performed when the iterator is later run. -/// -/// ## Examples -/// -/// ```gleam -/// > [[1, 2], [3, 4]] -/// > |> map(from_list) -/// > |> concat -/// > |> to_list -/// [1, 2, 3, 4] -/// ``` -/// -pub fn concat(iterators: List(Iterator(a))) -> Iterator(a) { - flatten(from_list(iterators)) -} - -/// Creates an iterator from an existing iterator and a transformation function. -/// -/// Each element in the new iterator will be the result of calling the given -/// function on the elements in the given iterator and then flattening the -/// results. -/// -/// This function does not evaluate the elements of the iterator, the -/// computation is performed when the iterator is later run. -/// -/// ## Examples -/// -/// ```gleam -/// > [1, 2] -/// > |> from_list -/// > |> flat_map(fn(x) { from_list([x, x + 1]) }) -/// > |> to_list -/// [1, 2, 2, 3] -/// ``` -/// -pub fn flat_map( - over iterator: Iterator(a), - with f: fn(a) -> Iterator(b), -) -> Iterator(b) { - iterator - |> map(f) - |> flatten -} - -fn do_filter( - continuation: fn() -> Action(e), - predicate: fn(e) -> Bool, -) -> Action(e) { - case continuation() { - Stop -> Stop - Continue(e, iterator) -> - case predicate(e) { - True -> Continue(e, fn() { do_filter(iterator, predicate) }) - False -> do_filter(iterator, predicate) - } - } -} - -/// Creates an iterator from an existing iterator and a predicate function. -/// -/// The new iterator will contain elements from the first iterator for which -/// the given function returns `True`. -/// -/// This function does not evaluate the elements of the iterator, the -/// computation is performed when the iterator is later run. -/// -/// ## Examples -/// -/// ```gleam -/// > import gleam/int -/// > [1, 2, 3, 4] -/// > |> from_list -/// > |> filter(int.is_even) -/// > |> to_list -/// [2, 4] -/// ``` -/// -pub fn filter( - iterator: Iterator(a), - for predicate: fn(a) -> Bool, -) -> Iterator(a) { - fn() { do_filter(iterator.continuation, predicate) } - |> Iterator -} - -/// Creates an iterator that repeats a given iterator infinitely. -/// -/// ## Examples -/// -/// ```gleam -/// > [1, 2] -/// > |> from_list -/// > |> cycle -/// > |> take(6) -/// > |> to_list -/// [1, 2, 1, 2, 1, 2] -/// ``` -/// -pub fn cycle(iterator: Iterator(a)) -> Iterator(a) { - repeat(iterator) - |> flatten -} - -/// Creates an iterator of ints, starting at a given start int and stepping by -/// one to a given end int. -/// -/// ## Examples -/// -/// ```gleam -/// > range(from: 1, to: 5) |> to_list -/// [1, 2, 3, 4, 5] -/// ``` -/// -/// ```gleam -/// > range(from: 1, to: -2) |> to_list -/// [1, 0, -1, -2] -/// ``` -/// -/// ```gleam -/// > range(from: 0, to: 0) |> to_list -/// [0] -/// ``` -/// -pub fn range(from start: Int, to stop: Int) -> Iterator(Int) { - case int.compare(start, stop) { - order.Eq -> once(fn() { start }) - order.Gt -> - unfold( - from: start, - with: fn(current) { - case current < stop { - False -> Next(current, current - 1) - True -> Done - } - }, - ) - - order.Lt -> - unfold( - from: start, - with: fn(current) { - case current > stop { - False -> Next(current, current + 1) - True -> Done - } - }, - ) - } -} - -fn do_find(continuation: fn() -> Action(a), f: fn(a) -> Bool) -> Result(a, Nil) { - case continuation() { - Stop -> Error(Nil) - Continue(e, next) -> - case f(e) { - True -> Ok(e) - False -> do_find(next, f) - } - } -} - -/// Finds the first element in a given iterator for which the given function returns -/// `True`. -/// -/// Returns `Error(Nil)` if the function does not return `True` for any of the -/// elements. -/// -/// ## Examples -/// -/// ```gleam -/// > find(from_list([1, 2, 3]), fn(x) { x > 2 }) -/// Ok(3) -/// ``` -/// -/// ```gleam -/// > find(from_list([1, 2, 3]), fn(x) { x > 4 }) -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > find(empty(), fn(_) { True }) -/// Error(Nil) -/// ``` -/// -pub fn find( - in haystack: Iterator(a), - one_that is_desired: fn(a) -> Bool, -) -> Result(a, Nil) { - haystack.continuation - |> do_find(is_desired) -} - -fn do_index( - continuation: fn() -> Action(element), - next: Int, -) -> fn() -> Action(#(Int, element)) { - fn() { - case continuation() { - Stop -> Stop - Continue(e, continuation) -> - Continue(#(next, e), do_index(continuation, next + 1)) - } - } -} - -/// Wraps values yielded from an iterator with indices, starting from 0. -/// -/// ## Examples -/// -/// ```gleam -/// > from_list(["a", "b", "c"]) |> index |> to_list -/// [#(0, "a"), #(1, "b"), #(2, "c")] -/// ``` -/// -pub fn index(over iterator: Iterator(element)) -> Iterator(#(Int, element)) { - iterator.continuation - |> do_index(0) - |> Iterator -} - -/// Creates an iterator that inifinitely applies a function to a value. -/// -/// ## Examples -/// -/// ```gleam -/// > iterate(1, fn(n) { n * 3 }) |> take(5) |> to_list -/// [1, 3, 9, 27, 81] -/// ``` -/// -pub fn iterate( - from initial: element, - with f: fn(element) -> element, -) -> Iterator(element) { - unfold(initial, fn(element) { Next(element, f(element)) }) -} - -fn do_take_while( - continuation: fn() -> Action(element), - predicate: fn(element) -> Bool, -) -> fn() -> Action(element) { - fn() { - case continuation() { - Stop -> Stop - Continue(e, next) -> - case predicate(e) { - False -> Stop - True -> Continue(e, do_take_while(next, predicate)) - } - } - } -} - -/// Creates an iterator that yields elements while the predicate returns `True`. -/// -/// ## Examples -/// -/// ```gleam -/// > from_list([1, 2, 3, 2, 4]) -/// > |> take_while(satisfying: fn(x) { x < 3 }) -/// > |> to_list -/// [1, 2] -/// ``` -/// -pub fn take_while( - in iterator: Iterator(element), - satisfying predicate: fn(element) -> Bool, -) -> Iterator(element) { - iterator.continuation - |> do_take_while(predicate) - |> Iterator -} - -fn do_drop_while( - continuation: fn() -> Action(element), - predicate: fn(element) -> Bool, -) -> Action(element) { - case continuation() { - Stop -> Stop - Continue(e, next) -> - case predicate(e) { - False -> Continue(e, next) - True -> do_drop_while(next, predicate) - } - } -} - -/// Creates an iterator that drops elements while the predicate returns `True`, -/// and then yields the remaining elements. -/// -/// ## Examples -/// -/// ```gleam -/// > from_list([1, 2, 3, 4, 2, 5]) -/// > |> drop_while(satisfying: fn(x) { x < 4 }) -/// > |> to_list -/// [4, 2, 5] -/// ``` -/// -pub fn drop_while( - in iterator: Iterator(element), - satisfying predicate: fn(element) -> Bool, -) -> Iterator(element) { - fn() { do_drop_while(iterator.continuation, predicate) } - |> Iterator -} - -fn do_scan( - continuation: fn() -> Action(element), - f: fn(acc, element) -> acc, - accumulator: acc, -) -> fn() -> Action(acc) { - fn() { - case continuation() { - Stop -> Stop - Continue(el, next) -> { - let accumulated = f(accumulator, el) - Continue(accumulated, do_scan(next, f, accumulated)) - } - } - } -} - -/// Creates an iterator from an existing iterator and a stateful function. -/// -/// Specifically, this behaves like `fold`, but yields intermediate results. -/// -/// ## Examples -/// -/// ```gleam -/// // Generate a sequence of partial sums -/// > from_list([1, 2, 3, 4, 5]) -/// > |> scan(from: 0, with: fn(acc, el) { acc + el }) -/// > |> to_list -/// [1, 3, 6, 10, 15] -/// ``` -/// -pub fn scan( - over iterator: Iterator(element), - from initial: acc, - with f: fn(acc, element) -> acc, -) -> Iterator(acc) { - iterator.continuation - |> do_scan(f, initial) - |> Iterator -} - -fn do_zip( - left: fn() -> Action(a), - right: fn() -> Action(b), -) -> fn() -> Action(#(a, b)) { - fn() { - case left() { - Stop -> Stop - Continue(el_left, next_left) -> - case right() { - Stop -> Stop - Continue(el_right, next_right) -> - Continue(#(el_left, el_right), do_zip(next_left, next_right)) - } - } - } -} - -/// Zips two iterators together, emitting values from both -/// until the shorter one runs out. -/// -/// ## Examples -/// -/// ```gleam -/// > from_list(["a", "b", "c"]) -/// > |> zip(range(20, 30)) -/// > |> to_list -/// [#("a", 20), #("b", 21), #("c", 22)] -/// ``` -/// -pub fn zip(left: Iterator(a), right: Iterator(b)) -> Iterator(#(a, b)) { - do_zip(left.continuation, right.continuation) - |> Iterator -} - -// Result of collecting a single chunk by key -type Chunk(element, key) { - AnotherBy(List(element), key, element, fn() -> Action(element)) - LastBy(List(element)) -} - -fn next_chunk( - continuation: fn() -> Action(element), - f: fn(element) -> key, - previous_key: key, - current_chunk: List(element), -) -> Chunk(element, key) { - case continuation() { - Stop -> LastBy(list.reverse(current_chunk)) - Continue(e, next) -> { - let key = f(e) - case key == previous_key { - True -> next_chunk(next, f, key, [e, ..current_chunk]) - False -> AnotherBy(list.reverse(current_chunk), key, e, next) - } - } - } -} - -fn do_chunk( - continuation: fn() -> Action(element), - f: fn(element) -> key, - previous_key: key, - previous_element: element, -) -> Action(List(element)) { - case next_chunk(continuation, f, previous_key, [previous_element]) { - LastBy(chunk) -> Continue(chunk, stop) - AnotherBy(chunk, key, el, next) -> - Continue(chunk, fn() { do_chunk(next, f, key, el) }) - } -} - -/// Creates an iterator that emits chunks of elements -/// for which `f` returns the same value. -/// -/// ## Examples -/// -/// ```gleam -/// > from_list([1, 2, 2, 3, 4, 4, 6, 7, 7]) -/// > |> chunk(by: fn(n) { n % 2 }) -/// > |> to_list -/// [[1], [2, 2], [3], [4, 4, 6], [7, 7]] -/// ``` -/// -pub fn chunk( - over iterator: Iterator(element), - by f: fn(element) -> key, -) -> Iterator(List(element)) { - fn() { - case iterator.continuation() { - Stop -> Stop - Continue(e, next) -> do_chunk(next, f, f(e), e) - } - } - |> Iterator -} - -// Result of collecting a single sized chunk -type SizedChunk(element) { - Another(List(element), fn() -> Action(element)) - Last(List(element)) - NoMore -} - -fn next_sized_chunk( - continuation: fn() -> Action(element), - left: Int, - current_chunk: List(element), -) -> SizedChunk(element) { - case continuation() { - Stop -> - case current_chunk { - [] -> NoMore - remaining -> Last(list.reverse(remaining)) - } - Continue(e, next) -> { - let chunk = [e, ..current_chunk] - case left > 1 { - False -> Another(list.reverse(chunk), next) - True -> next_sized_chunk(next, left - 1, chunk) - } - } - } -} - -fn do_sized_chunk( - continuation: fn() -> Action(element), - count: Int, -) -> fn() -> Action(List(element)) { - fn() { - case next_sized_chunk(continuation, count, []) { - NoMore -> Stop - Last(chunk) -> Continue(chunk, stop) - Another(chunk, next_element) -> - Continue(chunk, do_sized_chunk(next_element, count)) - } - } -} - -/// Creates an iterator that emits chunks of given size. -/// -/// If the last chunk does not have `count` elements, it is yielded -/// as a partial chunk, with less than `count` elements. -/// -/// For any `count` less than 1 this function behaves as if it was set to 1. -/// -/// ## Examples -/// -/// ```gleam -/// > from_list([1, 2, 3, 4, 5, 6]) -/// > |> sized_chunk(into: 2) -/// > |> to_list -/// [[1, 2], [3, 4], [5, 6]] -/// ``` -/// -/// ```gleam -/// > from_list([1, 2, 3, 4, 5, 6, 7, 8]) -/// > |> sized_chunk(into: 3) -/// > |> to_list -/// [[1, 2, 3], [4, 5, 6], [7, 8]] -/// ``` -/// -pub fn sized_chunk( - over iterator: Iterator(element), - into count: Int, -) -> Iterator(List(element)) { - iterator.continuation - |> do_sized_chunk(count) - |> Iterator -} - -fn do_intersperse( - continuation: fn() -> Action(element), - separator: element, -) -> Action(element) { - case continuation() { - Stop -> Stop - Continue(e, next) -> { - let next_interspersed = fn() { do_intersperse(next, separator) } - Continue(separator, fn() { Continue(e, next_interspersed) }) - } - } -} - -/// Creates an iterator that yields the given `elem` element -/// between elements emitted by the underlying iterator. -/// -/// ## Examples -/// -/// ```gleam -/// > empty() -/// > |> intersperse(with: 0) -/// > |> to_list -/// [] -/// -/// > from_list([1]) -/// > |> intersperse(with: 0) -/// > |> to_list -/// [1] -/// -/// > from_list([1, 2, 3, 4, 5]) -/// > |> intersperse(with: 0) -/// > |> to_list -/// [1, 0, 2, 0, 3, 0, 4, 0, 5] -/// ``` -/// -pub fn intersperse( - over iterator: Iterator(element), - with elem: element, -) -> Iterator(element) { - fn() { - case iterator.continuation() { - Stop -> Stop - Continue(e, next) -> Continue(e, fn() { do_intersperse(next, elem) }) - } - } - |> Iterator -} - -fn do_any( - continuation: fn() -> Action(element), - predicate: fn(element) -> Bool, -) -> Bool { - case continuation() { - Stop -> False - Continue(e, next) -> - case predicate(e) { - True -> True - False -> do_any(next, predicate) - } - } -} - -/// Returns `True` if any element emitted by the iterator satisfies the given predicate, -/// `False` otherwise. -/// -/// This function short-circuits once it finds a satisfying element. -/// -/// An empty iterator results in `False`. -/// -/// ## Examples -/// -/// ```gleam -/// > empty() |> any(fn(n) { n % 2 == 0 }) -/// False -/// ``` -/// -/// ```gleam -/// > from_list([1, 2, 5, 7, 9]) |> any(fn(n) { n % 2 == 0 }) -/// True -/// ``` -/// -/// ```gleam -/// > from_list([1, 3, 5, 7, 9]) |> any(fn(n) { n % 2 == 0 }) -/// False -/// ``` -/// -pub fn any( - in iterator: Iterator(element), - satisfying predicate: fn(element) -> Bool, -) -> Bool { - iterator.continuation - |> do_any(predicate) -} - -fn do_all( - continuation: fn() -> Action(element), - predicate: fn(element) -> Bool, -) -> Bool { - case continuation() { - Stop -> True - Continue(e, next) -> - case predicate(e) { - True -> do_all(next, predicate) - False -> False - } - } -} - -/// Returns `True` if all elements emitted by the iterator satisfy the given predicate, -/// `False` otherwise. -/// -/// This function short-circuits once it finds a non-satisfying element. -/// -/// An empty iterator results in `True`. -/// -/// ## Examples -/// -/// ```gleam -/// > empty() |> all(fn(n) { n % 2 == 0 }) -/// True -/// ``` -/// -/// ```gleam -/// > from_list([2, 4, 6, 8]) |> all(fn(n) { n % 2 == 0 }) -/// True -/// ``` -/// -/// ```gleam -/// > from_list([2, 4, 5, 8]) |> all(fn(n) { n % 2 == 0 }) -/// False -/// ``` -/// -pub fn all( - in iterator: Iterator(element), - satisfying predicate: fn(element) -> Bool, -) -> Bool { - iterator.continuation - |> do_all(predicate) -} - -fn update_group_with(el: element) -> fn(Option(List(element))) -> List(element) { - fn(maybe_group) { - case maybe_group { - Some(group) -> [el, ..group] - None -> [el] - } - } -} - -fn group_updater( - f: fn(element) -> key, -) -> fn(Map(key, List(element)), element) -> Map(key, List(element)) { - fn(groups, elem) { - groups - |> map.update(f(elem), update_group_with(elem)) - } -} - -/// Returns a `Map(k, List(element))` of elements from the given iterator -/// grouped with the given key function. -/// -/// The order within each group is preserved from the iterator. -/// -/// ## Examples -/// -/// ```gleam -/// > from_list([1, 2, 3, 4, 5, 6]) |> group(by: fn(n) { n % 3 }) -/// map.from_list([#(0, [3, 6]), #(1, [1, 4]), #(2, [2, 5])]) -/// ``` -/// -pub fn group( - in iterator: Iterator(element), - by key: fn(element) -> key, -) -> Map(key, List(element)) { - iterator - |> fold(map.new(), group_updater(key)) - |> map.map_values(fn(_, group) { list.reverse(group) }) -} - -/// This function acts similar to fold, but does not take an initial state. -/// Instead, it starts from the first yielded element -/// and combines it with each subsequent element in turn using the given function. -/// The function is called as `f(accumulator, current_element)`. -/// -/// Returns `Ok` to indicate a successful run, and `Error` if called on an empty iterator. -/// -/// ## Examples -/// -/// ```gleam -/// > from_list([]) |> reduce(fn(acc, x) { acc + x }) -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > from_list([1, 2, 3, 4, 5]) |> reduce(fn(acc, x) { acc + x }) -/// Ok(15) -/// ``` -/// -pub fn reduce( - over iterator: Iterator(e), - with f: fn(e, e) -> e, -) -> Result(e, Nil) { - case iterator.continuation() { - Stop -> Error(Nil) - Continue(e, next) -> - do_fold(next, f, e) - |> Ok - } -} - -/// Returns the last element in the given iterator. -/// -/// Returns `Error(Nil)` if the iterator is empty. -/// -/// This function runs in linear time. -/// -/// ## Examples -/// -/// ```gleam -/// > empty() |> last -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > range(1, 10) |> last -/// Ok(9) -/// ``` -/// -pub fn last(iterator: Iterator(element)) -> Result(element, Nil) { - iterator - |> reduce(fn(_, elem) { elem }) -} - -/// Creates an iterator that yields no elements. -/// -/// ## Examples -/// -/// ```gleam -/// > empty() |> to_list -/// [] -/// ``` -/// -pub fn empty() -> Iterator(element) { - Iterator(stop) -} - -/// Creates an iterator that yields exactly one element provided by calling the given function. -/// -/// ## Examples -/// -/// ```gleam -/// > once(fn() { 1 }) |> to_list -/// [1] -/// ``` -/// -pub fn once(f: fn() -> element) -> Iterator(element) { - fn() { Continue(f(), stop) } - |> Iterator -} - -/// Creates an iterator that yields the given element exactly once. -/// -/// ## Examples -/// -/// ```gleam -/// > single(1) |> to_list -/// [1] -/// ``` -/// -pub fn single(elem: element) -> Iterator(element) { - once(fn() { elem }) -} - -fn do_interleave( - current: fn() -> Action(element), - next: fn() -> Action(element), -) -> Action(element) { - case current() { - Stop -> next() - Continue(e, next_other) -> - Continue(e, fn() { do_interleave(next, next_other) }) - } -} - -/// Creates an iterator that alternates between the two given iterators -/// until both have run out. -/// -/// ## Examples -/// -/// ```gleam -/// > from_list([1, 2, 3, 4]) |> interleave(from_list([11, 12, 13, 14])) |> to_list -/// [1, 11, 2, 12, 3, 13, 4, 14] -/// ``` -/// -/// ```gleam -/// > from_list([1, 2, 3, 4]) |> interleave(from_list([100])) |> to_list -/// [1, 100, 2, 3, 4] -/// ``` -/// -pub fn interleave( - left: Iterator(element), - with right: Iterator(element), -) -> Iterator(element) { - fn() { do_interleave(left.continuation, right.continuation) } - |> Iterator -} - -fn do_fold_until( - continuation: fn() -> Action(e), - f: fn(acc, e) -> list.ContinueOrStop(acc), - accumulator: acc, -) -> acc { - case continuation() { - Stop -> accumulator - Continue(elem, next) -> - case f(accumulator, elem) { - list.Continue(accumulator) -> do_fold_until(next, f, accumulator) - list.Stop(accumulator) -> accumulator - } - } -} - -/// Like `fold`, `fold_until` reduces an iterator of elements into a single value by calling a given -/// function on each element in turn, but uses `list.ContinueOrStop` to determine -/// whether or not to keep iterating. -/// -/// If called on an iterator of infinite length then this function will only ever -/// return if the function returns `list.Stop`. -/// -/// ## Examples -/// -/// ```gleam -/// > import gleam/list -/// > let f = fn(acc, e) { -/// > case e { -/// > _ if e < 4 -> list.Continue(e + acc) -/// > _ -> list.Stop(acc) -/// > } -/// > } -/// > -/// > [1, 2, 3, 4] -/// > |> from_list -/// > |> fold_until(from: acc, with: f) -/// 6 -/// ``` -/// -pub fn fold_until( - over iterator: Iterator(e), - from initial: acc, - with f: fn(acc, e) -> list.ContinueOrStop(acc), -) -> acc { - iterator.continuation - |> do_fold_until(f, initial) -} - -fn do_try_fold( - over continuation: fn() -> Action(a), - with f: fn(acc, a) -> Result(acc, err), - from accumulator: acc, -) -> Result(acc, err) { - case continuation() { - Stop -> Ok(accumulator) - Continue(elem, next) -> { - use accumulator <- result.try(f(accumulator, elem)) - do_try_fold(next, f, accumulator) - } - } -} - -/// A variant of fold that might fail. -/// -/// The folding function should return `Result(accumulator, error)`. -/// If the returned value is `Ok(accumulator)` try_fold will try the next value in the iterator. -/// If the returned value is `Error(error)` try_fold will stop and return that error. -/// -/// ## Examples -/// -/// ```gleam -/// > [1, 2, 3, 4] -/// > |> iterator.from_list() -/// > |> try_fold(0, fn(acc, i) { -/// > case i < 3 { -/// > True -> Ok(acc + i) -/// > False -> Error(Nil) -/// > } -/// > }) -/// Error(Nil) -/// ``` -/// -pub fn try_fold( - over iterator: Iterator(e), - from initial: acc, - with f: fn(acc, e) -> Result(acc, err), -) -> Result(acc, err) { - iterator.continuation - |> do_try_fold(f, initial) -} - -/// Returns the first element yielded by the given iterator, if it exists, -/// or `Error(Nil)` otherwise. -/// -/// ## Examples -/// -/// ```gleam -/// > from_list([1, 2, 3]) |> first -/// Ok(1) -/// ``` -/// -/// ```gleam -/// > empty() |> first -/// Error(Nil) -/// ``` -pub fn first(from iterator: Iterator(e)) -> Result(e, Nil) { - case iterator.continuation() { - Stop -> Error(Nil) - Continue(e, _) -> Ok(e) - } -} - -/// Returns nth element yielded by the given iterator, where `0` means the first element. -/// -/// If there are not enough elements in the iterator, `Error(Nil)` is returned. -/// -/// For any `index` less than `0` this function behaves as if it was set to `0`. -/// -/// ## Examples -/// -/// ```gleam -/// > from_list([1, 2, 3, 4]) |> at(2) -/// Ok(3) -/// ``` -/// -/// ```gleam -/// > from_list([1, 2, 3, 4]) |> at(4) -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > empty() |> at(0) -/// Error(Nil) -/// ``` -/// -pub fn at(in iterator: Iterator(e), get index: Int) -> Result(e, Nil) { - iterator - |> drop(index) - |> first -} - -fn do_length(over continuation: fn() -> Action(e), with length: Int) -> Int { - case continuation() { - Stop -> length - Continue(_, next) -> do_length(next, length + 1) - } -} - -/// Counts the number of elements in the given iterator. -/// -/// This function has to traverse the entire iterator to count its elements, -/// so it runs in linear time. -/// -/// ## Examples -/// -/// ```gleam -/// > empty() |> length -/// 0 -/// ``` -/// -/// ```gleam -/// > from_list([1, 2, 3, 4]) |> length -/// 4 -/// ``` -/// -pub fn length(over iterator: Iterator(e)) -> Int { - iterator.continuation - |> do_length(0) -} - -/// Traverse an iterator, calling a function on each element. -/// -/// ## Examples -/// -/// ```gleam -/// > empty() |> each(io.println) -/// Nil -/// ``` -/// -/// ```gleam -/// > from_list(["Tom", "Malory", "Louis"]) |> each(io.println) -/// // -> Tom -/// // -> Malory -/// // -> Louis -/// Nil -/// ``` -/// -pub fn each(over iterator: Iterator(a), with f: fn(a) -> b) -> Nil { - iterator - |> map(f) - |> run -} - -/// Add a new element to the start of an iterator. -/// -/// This function is for use with `use` expressions, to replicate the behaviour -/// of the `yield` keyword found in other languages. -/// -/// ## Examples -/// -/// ```gleam -/// > use <- iterator.yield(1) -/// > use <- iterator.yield(2) -/// > use <- iterator.yield(3) -/// > iterator.empty() -/// iterator.from_list([1, 2, 3]) -/// ``` -/// -pub fn yield(element: a, next: fn() -> Iterator(a)) -> Iterator(a) { - Iterator(fn() { Continue(element, next().continuation) }) -} diff --git a/build/packages/gleam_stdlib/src/gleam/list.gleam b/build/packages/gleam_stdlib/src/gleam/list.gleam deleted file mode 100644 index 4836f92..0000000 --- a/build/packages/gleam_stdlib/src/gleam/list.gleam +++ /dev/null @@ -1,2120 +0,0 @@ -//// Lists are an ordered sequence of elements and are one of the most common -//// data types in Gleam. -//// -//// New elements can be added and removed from the front of a list in -//// constant time, while adding and removing from the end requires traversing -//// the copying the whole list, so keep this in mind when designing your -//// programs. -//// -//// There is a dedicated syntax for prefixing to a list: -//// -//// ```gleam -//// let new_list = [1, 2, ..existing_list] -//// ``` -//// -//// And a matching syntax for getting the first elements of a list: -//// -//// ```gleam -//// case list { -//// [first_element, ..rest] -> first_element -//// _ -> "this pattern matches when the list is empty" -//// } -//// ``` -//// - -import gleam/int -import gleam/float -import gleam/order.{Order} -import gleam/pair -import gleam/map.{Map} - -/// An error value returned by the `strict_zip` function. -/// -pub type LengthMismatch { - LengthMismatch -} - -/// Counts the number of elements in a given list. -/// -/// This function has to traverse the list to determine the number of elements, -/// so it runs in linear time. -/// -/// This function is natively implemented by the virtual machine and is highly -/// optimised. -/// -/// ## Examples -/// -/// ```gleam -/// > length([]) -/// 0 -/// ``` -/// -/// ```gleam -/// > length([1]) -/// 1 -/// ``` -/// -/// ```gleam -/// > length([1, 2]) -/// 2 -/// ``` -/// -pub fn length(of list: List(a)) -> Int { - do_length(list) -} - -@target(erlang) -@external(erlang, "erlang", "length") -fn do_length(a: List(a)) -> Int - -@target(javascript) -fn do_length(list: List(a)) -> Int { - do_length_acc(list, 0) -} - -@target(javascript) -fn do_length_acc(list: List(a), count: Int) -> Int { - case list { - [_, ..list] -> do_length_acc(list, count + 1) - _ -> count - } -} - -/// Creates a new list from a given list containing the same elements but in the -/// opposite order. -/// -/// This function has to traverse the list to create the new reversed list, so -/// it runs in linear time. -/// -/// This function is natively implemented by the virtual machine and is highly -/// optimised. -/// -/// ## Examples -/// -/// ```gleam -/// > reverse([]) -/// [] -/// ``` -/// -/// ```gleam -/// > reverse([1]) -/// [1] -/// ``` -/// -/// ```gleam -/// > reverse([1, 2]) -/// [2, 1] -/// ``` -/// -pub fn reverse(xs: List(a)) -> List(a) { - do_reverse(xs) -} - -@target(erlang) -@external(erlang, "lists", "reverse") -fn do_reverse(a: List(a)) -> List(a) - -@target(javascript) -fn do_reverse(list) { - do_reverse_acc(list, []) -} - -@target(javascript) -fn do_reverse_acc(remaining, accumulator) { - case remaining { - [] -> accumulator - [item, ..rest] -> do_reverse_acc(rest, [item, ..accumulator]) - } -} - -/// Determines whether or not the list is empty. -/// -/// This function runs in constant time. -/// -/// ## Examples -/// -/// ```gleam -/// > is_empty([]) -/// True -/// ``` -/// -/// ```gleam -/// > is_empty([1]) -/// False -/// ``` -/// -/// ```gleam -/// > is_empty([1, 1]) -/// False -/// ``` -/// -pub fn is_empty(list: List(a)) -> Bool { - list == [] -} - -/// Determines whether or not a given element exists within a given list. -/// -/// This function traverses the list to find the element, so it runs in linear -/// time. -/// -/// ## Examples -/// -/// ```gleam -/// > [] |> contains(any: 0) -/// False -/// ``` -/// -/// ```gleam -/// > [0] |> contains(any: 0) -/// True -/// ``` -/// -/// ```gleam -/// > [1] |> contains(any: 0) -/// False -/// ``` -/// -/// ```gleam -/// > [1, 1] |> contains(any: 0) -/// False -/// ``` -/// -/// ```gleam -/// > [1, 0] |> contains(any: 0) -/// True -/// ``` -/// -pub fn contains(list: List(a), any elem: a) -> Bool { - case list { - [] -> False - [first, ..] if first == elem -> True - [_, ..rest] -> contains(rest, elem) - } -} - -/// Gets the first element from the start of the list, if there is one. -/// -/// ## Examples -/// -/// ```gleam -/// > first([]) -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > first([0]) -/// Ok(0) -/// ``` -/// -/// ```gleam -/// > first([1, 2]) -/// Ok(1) -/// ``` -/// -pub fn first(list: List(a)) -> Result(a, Nil) { - case list { - [] -> Error(Nil) - [x, ..] -> Ok(x) - } -} - -/// Returns the list minus the first element. If the list is empty, `Error(Nil)` is -/// returned. -/// -/// This function runs in constant time and does not make a copy of the list. -/// -/// ## Examples -/// -/// ```gleam -/// > rest([]) -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > rest([0]) -/// Ok([]) -/// ``` -/// -/// ```gleam -/// > rest([1, 2]) -/// Ok([2]) -/// ``` -/// -pub fn rest(list: List(a)) -> Result(List(a), Nil) { - case list { - [] -> Error(Nil) - [_, ..xs] -> Ok(xs) - } -} - -fn update_group( - f: fn(element) -> key, -) -> fn(Map(key, List(element)), element) -> Map(key, List(element)) { - fn(groups, elem) { - case map.get(groups, f(elem)) { - Ok(existing) -> map.insert(groups, f(elem), [elem, ..existing]) - Error(_) -> map.insert(groups, f(elem), [elem]) - } - } -} - -/// Takes a list and groups the values by a key -/// which is built from a key function. -/// -/// Does not preserve the initial value order. -/// -/// ## Examples -/// -/// ```gleam -/// > [Ok(3), Error("Wrong"), Ok(200), Ok(73)] -/// |> group(by: fn(i) { -/// case i { -/// Ok(_) -> "Successful" -/// Error(_) -> "Failed" -/// } -/// }) -/// |> map.to_list -/// -/// [ -/// #("Failed", [Error("Wrong")]), -/// #("Successful", [Ok(73), Ok(200), Ok(3)]) -/// ] -/// -/// > group(from: [1,2,3,4,5], with: fn(i) {fn(i) { i - i / 3 * 3 }}) -/// |> map.to_list -/// [#(0, [3]), #(1, [4, 1]), #(2, [5, 2])] -/// ``` -/// -pub fn group(list: List(v), by key: fn(v) -> k) -> Map(k, List(v)) { - fold(list, map.new(), update_group(key)) -} - -fn do_filter(list: List(a), fun: fn(a) -> Bool, acc: List(a)) -> List(a) { - case list { - [] -> reverse(acc) - [x, ..xs] -> { - let new_acc = case fun(x) { - True -> [x, ..acc] - False -> acc - } - do_filter(xs, fun, new_acc) - } - } -} - -/// Returns a new list containing only the elements from the first list for -/// which the given functions returns `True`. -/// -/// ## Examples -/// -/// ```gleam -/// > filter([2, 4, 6, 1], fn(x) { x > 2 }) -/// [4, 6] -/// ``` -/// -/// ```gleam -/// > filter([2, 4, 6, 1], fn(x) { x > 6 }) -/// [] -/// ``` -/// -pub fn filter(list: List(a), for predicate: fn(a) -> Bool) -> List(a) { - do_filter(list, predicate, []) -} - -fn do_filter_map( - list: List(a), - fun: fn(a) -> Result(b, e), - acc: List(b), -) -> List(b) { - case list { - [] -> reverse(acc) - [x, ..xs] -> { - let new_acc = case fun(x) { - Ok(x) -> [x, ..acc] - Error(_) -> acc - } - do_filter_map(xs, fun, new_acc) - } - } -} - -/// Returns a new list containing only the elements from the first list for -/// which the given functions returns `Ok(_)`. -/// -/// ## Examples -/// -/// ```gleam -/// > filter_map([2, 4, 6, 1], Error) -/// [] -/// ``` -/// -/// ```gleam -/// > filter_map([2, 4, 6, 1], fn(x) { Ok(x + 1) }) -/// [3, 5, 7, 2] -/// ``` -/// -pub fn filter_map(list: List(a), with fun: fn(a) -> Result(b, e)) -> List(b) { - do_filter_map(list, fun, []) -} - -fn do_map(list: List(a), fun: fn(a) -> b, acc: List(b)) -> List(b) { - case list { - [] -> reverse(acc) - [x, ..xs] -> do_map(xs, fun, [fun(x), ..acc]) - } -} - -/// Returns a new list containing only the elements of the first list after the -/// function has been applied to each one. -/// -/// ## Examples -/// -/// ```gleam -/// > map([2, 4, 6], fn(x) { x * 2 }) -/// [4, 8, 12] -/// ``` -/// -pub fn map(list: List(a), with fun: fn(a) -> b) -> List(b) { - do_map(list, fun, []) -} - -/// Combines two lists into a single list using the given function. -/// -/// If a list is longer than the other the extra elements are dropped. -/// -/// ## Examples -/// -/// ```gleam -/// > map2([1, 2, 3], [4, 5, 6], fn(x, y) { x + y }) -/// [5, 7, 9] -/// ``` -/// -/// ```gleam -/// > map2([1, 2], ["a", "b", "c"], fn(i, x) { #(i, x) }) -/// [#(1, "a"), #(2, "b")] -/// ``` -/// -pub fn map2(list1: List(a), list2: List(b), with fun: fn(a, b) -> c) -> List(c) { - do_map2(list1, list2, fun, []) -} - -fn do_map2( - list1: List(a), - list2: List(b), - fun: fn(a, b) -> c, - acc: List(c), -) -> List(c) { - case list1, list2 { - [], _ | _, [] -> reverse(acc) - [a, ..as_], [b, ..bs] -> do_map2(as_, bs, fun, [fun(a, b), ..acc]) - } -} - -/// Similar to `map` but also lets you pass around an accumulated value. -/// -/// ## Examples -/// -/// ```gleam -/// > map_fold( -/// over: [1, 2, 3], -/// from: 100, -/// with: fn(memo, i) { #(memo + i, i * 2) } -/// ) -/// #(106, [2, 4, 6]) -/// ``` -/// -pub fn map_fold( - over list: List(a), - from acc: acc, - with fun: fn(acc, a) -> #(acc, b), -) -> #(acc, List(b)) { - fold( - over: list, - from: #(acc, []), - with: fn(acc, item) { - let #(current_acc, items) = acc - let #(next_acc, next_item) = fun(current_acc, item) - #(next_acc, [next_item, ..items]) - }, - ) - |> pair.map_second(reverse) -} - -fn do_index_map( - list: List(a), - fun: fn(Int, a) -> b, - index: Int, - acc: List(b), -) -> List(b) { - case list { - [] -> reverse(acc) - [x, ..xs] -> { - let acc = [fun(index, x), ..acc] - do_index_map(xs, fun, index + 1, acc) - } - } -} - -/// Returns a new list containing only the elements of the first list after the -/// function has been applied to each one and their index. -/// -/// The index starts at 0, so the first element is 0, the second is 1, and so -/// on. -/// -/// ## Examples -/// -/// ```gleam -/// > index_map(["a", "b"], fn(i, x) { #(i, x) }) -/// [#(0, "a"), #(1, "b")] -/// ``` -/// -pub fn index_map(list: List(a), with fun: fn(Int, a) -> b) -> List(b) { - do_index_map(list, fun, 0, []) -} - -fn do_try_map( - list: List(a), - fun: fn(a) -> Result(b, e), - acc: List(b), -) -> Result(List(b), e) { - case list { - [] -> Ok(reverse(acc)) - [x, ..xs] -> - case fun(x) { - Ok(y) -> do_try_map(xs, fun, [y, ..acc]) - Error(error) -> Error(error) - } - } -} - -/// Takes a function that returns a `Result` and applies it to each element in a -/// given list in turn. -/// -/// If the function returns `Ok(new_value)` for all elements in the list then a -/// list of the new values is returned. -/// -/// If the function returns `Error(reason)` for any of the elements then it is -/// returned immediately. None of the elements in the list are processed after -/// one returns an `Error`. -/// -/// ## Examples -/// -/// ```gleam -/// > try_map([1, 2, 3], fn(x) { Ok(x + 2) }) -/// Ok([3, 4, 5]) -/// ``` -/// -/// ```gleam -/// > try_map([1, 2, 3], fn(_) { Error(0) }) -/// Error(0) -/// ``` -/// -/// ```gleam -/// > try_map([[1], [2, 3]], first) -/// Ok([1, 2]) -/// ``` -/// -/// ```gleam -/// > try_map([[1], [], [2]], first) -/// Error(Nil) -/// ``` -/// -pub fn try_map( - over list: List(a), - with fun: fn(a) -> Result(b, e), -) -> Result(List(b), e) { - do_try_map(list, fun, []) -} - -/// Returns a list that is the given list with up to the given number of -/// elements removed from the front of the list. -/// -/// If the element has less than the number of elements an empty list is -/// returned. -/// -/// This function runs in linear time but does not copy the list. -/// -/// ## Examples -/// -/// ```gleam -/// > drop([1, 2, 3, 4], 2) -/// [3, 4] -/// ``` -/// -/// ```gleam -/// > drop([1, 2, 3, 4], 9) -/// [] -/// ``` -/// -pub fn drop(from list: List(a), up_to n: Int) -> List(a) { - case n <= 0 { - True -> list - False -> - case list { - [] -> [] - [_, ..xs] -> drop(xs, n - 1) - } - } -} - -fn do_take(list: List(a), n: Int, acc: List(a)) -> List(a) { - case n <= 0 { - True -> reverse(acc) - False -> - case list { - [] -> reverse(acc) - [x, ..xs] -> do_take(xs, n - 1, [x, ..acc]) - } - } -} - -/// Returns a list containing the first given number of elements from the given -/// list. -/// -/// If the element has less than the number of elements then the full list is -/// returned. -/// -/// This function runs in linear time but does not copy the list. -/// -/// ## Examples -/// -/// ```gleam -/// > take([1, 2, 3, 4], 2) -/// [1, 2] -/// ``` -/// -/// ```gleam -/// > take([1, 2, 3, 4], 9) -/// [1, 2, 3, 4] -/// ``` -/// -pub fn take(from list: List(a), up_to n: Int) -> List(a) { - do_take(list, n, []) -} - -/// Returns a new empty list. -/// -/// ## Examples -/// -/// ```gleam -/// > new() -/// [] -/// ``` -/// -pub fn new() -> List(a) { - [] -} - -/// Joins one list onto the end of another. -/// -/// This function runs in linear time, and it traverses and copies the first -/// list. -/// -/// ## Examples -/// -/// ```gleam -/// > append([1, 2], [3]) -/// [1, 2, 3] -/// ``` -/// -pub fn append(first: List(a), second: List(a)) -> List(a) { - do_append(first, second) -} - -@target(erlang) -@external(erlang, "lists", "append") -fn do_append(a: List(a), b: List(a)) -> List(a) - -@target(javascript) -fn do_append(first: List(a), second: List(a)) -> List(a) { - do_append_acc(reverse(first), second) -} - -@target(javascript) -fn do_append_acc(first: List(a), second: List(a)) -> List(a) { - case first { - [] -> second - [item, ..rest] -> do_append_acc(rest, [item, ..second]) - } -} - -/// Prefixes an item to a list. This can also be done using the dedicated -/// syntax instead -/// -/// ```gleam -/// let new_list = [1, ..existing_list] -/// ``` -/// -pub fn prepend(to list: List(a), this item: a) -> List(a) { - [item, ..list] -} - -// Reverses a list and prepends it to another list -fn reverse_and_prepend(list prefix: List(a), to suffix: List(a)) -> List(a) { - case prefix { - [] -> suffix - [first, ..rest] -> reverse_and_prepend(list: rest, to: [first, ..suffix]) - } -} - -fn do_concat(lists: List(List(a)), acc: List(a)) -> List(a) { - case lists { - [] -> reverse(acc) - [list, ..further_lists] -> - do_concat(further_lists, reverse_and_prepend(list: list, to: acc)) - } -} - -/// Joins a list of lists into a single list. -/// -/// This function traverses all elements twice. -/// -/// ## Examples -/// -/// ```gleam -/// > concat([[1], [2, 3], []]) -/// [1, 2, 3] -/// ``` -/// -pub fn concat(lists: List(List(a))) -> List(a) { - do_concat(lists, []) -} - -/// This is the same as `concat`: it joins a list of lists into a single -/// list. -/// -/// This function traverses all elements twice. -/// -/// ## Examples -/// -/// ```gleam -/// > flatten([[1], [2, 3], []]) -/// [1, 2, 3] -/// ``` -/// -pub fn flatten(lists: List(List(a))) -> List(a) { - do_concat(lists, []) -} - -/// Maps the list with the given function into a list of lists, and then flattens it. -/// -/// ## Examples -/// -/// ```gleam -/// > flat_map([2, 4, 6], fn(x) { [x, x + 1] }) -/// [2, 3, 4, 5, 6, 7] -/// ``` -/// -pub fn flat_map(over list: List(a), with fun: fn(a) -> List(b)) -> List(b) { - map(list, fun) - |> concat -} - -/// Reduces a list of elements into a single value by calling a given function -/// on each element, going from left to right. -/// -/// `fold([1, 2, 3], 0, add)` is the equivalent of -/// `add(add(add(0, 1), 2), 3)`. -/// -/// This function runs in linear time. -/// -pub fn fold( - over list: List(a), - from initial: acc, - with fun: fn(acc, a) -> acc, -) -> acc { - case list { - [] -> initial - [x, ..rest] -> fold(rest, fun(initial, x), fun) - } -} - -/// Reduces a list of elements into a single value by calling a given function -/// on each element, going from right to left. -/// -/// `fold_right([1, 2, 3], 0, add)` is the equivalent of -/// `add(add(add(0, 3), 2), 1)`. -/// -/// This function runs in linear time. -/// -/// Unlike `fold` this function is not tail recursive. Where possible use -/// `fold` instead as it will use less memory. -/// -pub fn fold_right( - over list: List(a), - from initial: acc, - with fun: fn(acc, a) -> acc, -) -> acc { - case list { - [] -> initial - [x, ..rest] -> fun(fold_right(rest, initial, fun), x) - } -} - -fn do_index_fold( - over: List(a), - acc: acc, - with: fn(acc, a, Int) -> acc, - index: Int, -) -> acc { - case over { - [] -> acc - [first, ..rest] -> - do_index_fold(rest, with(acc, first, index), with, index + 1) - } -} - -/// Like fold but the folding function also receives the index of the current element. -/// -/// ## Examples -/// -/// ```gleam -/// ["a", "b", "c"] -/// |> index_fold([], fn(acc, item, index) { ... }) -/// ``` -/// -pub fn index_fold( - over over: List(a), - from initial: acc, - with fun: fn(acc, a, Int) -> acc, -) -> acc { - do_index_fold(over, initial, fun, 0) -} - -/// A variant of fold that might fail. -/// -/// The folding function should return `Result(accumulator, error)`. -/// If the returned value is `Ok(accumulator)` try_fold will try the next value in the list. -/// If the returned value is `Error(error)` try_fold will stop and return that error. -/// -/// ## Examples -/// -/// ```gleam -/// [1, 2, 3, 4] -/// |> try_fold(0, fn(acc, i) { -/// case i < 3 { -/// True -> Ok(acc + i) -/// False -> Error(Nil) -/// } -/// }) -/// ``` -/// -pub fn try_fold( - over collection: List(a), - from accumulator: acc, - with fun: fn(acc, a) -> Result(acc, e), -) -> Result(acc, e) { - case collection { - [] -> Ok(accumulator) - [first, ..rest] -> - case fun(accumulator, first) { - Ok(result) -> try_fold(rest, result, fun) - Error(_) as error -> error - } - } -} - -pub type ContinueOrStop(a) { - Continue(a) - Stop(a) -} - -/// A variant of fold that allows to stop folding earlier. -/// -/// The folding function should return `ContinueOrStop(accumulator)`. -/// If the returned value is `Continue(accumulator)` fold_until will try the next value in the list. -/// If the returned value is `Stop(accumulator)` fold_until will stop and return that accumulator. -/// -/// ## Examples -/// -/// ```gleam -/// [1, 2, 3, 4] -/// |> fold_until(0, fn(acc, i) { -/// case i < 3 { -/// True -> Continue(acc + i) -/// False -> Stop(acc) -/// } -/// }) -/// ``` -/// -pub fn fold_until( - over collection: List(a), - from accumulator: acc, - with fun: fn(acc, a) -> ContinueOrStop(acc), -) -> acc { - case collection { - [] -> accumulator - [first, ..rest] -> - case fun(accumulator, first) { - Continue(next_accumulator) -> fold_until(rest, next_accumulator, fun) - Stop(b) -> b - } - } -} - -/// Finds the first element in a given list for which the given function returns -/// `True`. -/// -/// Returns `Error(Nil)` if no such element is found. -/// -/// ## Examples -/// -/// ```gleam -/// > find([1, 2, 3], fn(x) { x > 2 }) -/// Ok(3) -/// ``` -/// -/// ```gleam -/// > find([1, 2, 3], fn(x) { x > 4 }) -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > find([], fn(_) { True }) -/// Error(Nil) -/// ``` -/// -pub fn find( - in haystack: List(a), - one_that is_desired: fn(a) -> Bool, -) -> Result(a, Nil) { - case haystack { - [] -> Error(Nil) - [x, ..rest] -> - case is_desired(x) { - True -> Ok(x) - _ -> find(in: rest, one_that: is_desired) - } - } -} - -/// Finds the first element in a given list for which the given function returns -/// `Ok(new_value)`, then returns the wrapped `new_value`. -/// -/// Returns `Error(Nil)` if no such element is found. -/// -/// ## Examples -/// -/// ```gleam -/// > find_map([[], [2], [3]], first) -/// Ok(2) -/// ``` -/// -/// ```gleam -/// > find_map([[], []], first) -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > find_map([], first) -/// Error(Nil) -/// ``` -/// -pub fn find_map( - in haystack: List(a), - with fun: fn(a) -> Result(b, c), -) -> Result(b, Nil) { - case haystack { - [] -> Error(Nil) - [x, ..rest] -> - case fun(x) { - Ok(x) -> Ok(x) - _ -> find_map(in: rest, with: fun) - } - } -} - -/// Returns `True` if the given function returns `True` for all the elements in -/// the given list. If the function returns `False` for any of the elements it -/// immediately returns `False` without checking the rest of the list. -/// -/// ## Examples -/// -/// ```gleam -/// > all([], fn(x) { x > 3 }) -/// True -/// ``` -/// -/// ```gleam -/// > all([4, 5], fn(x) { x > 3 }) -/// True -/// ``` -/// -/// ```gleam -/// > all([4, 3], fn(x) { x > 3 }) -/// False -/// ``` -/// -pub fn all(in list: List(a), satisfying predicate: fn(a) -> Bool) -> Bool { - case list { - [] -> True - [first, ..rest] -> - case predicate(first) { - True -> all(rest, predicate) - False -> False - } - } -} - -/// Returns `True` if the given function returns `True` for any the elements in -/// the given list. If the function returns `True` for any of the elements it -/// immediately returns `True` without checking the rest of the list. -/// -/// ## Examples -/// -/// ```gleam -/// > any([], fn(x) { x > 3 }) -/// False -/// ``` -/// -/// ```gleam -/// > any([4, 5], fn(x) { x > 3 }) -/// True -/// ``` -/// -/// ```gleam -/// > any([4, 3], fn(x) { x > 4 }) -/// False -/// ``` -/// -/// ```gleam -/// > any([3, 4], fn(x) { x > 3 }) -/// True -/// ``` -/// -pub fn any(in list: List(a), satisfying predicate: fn(a) -> Bool) -> Bool { - case list { - [] -> False - [first, ..rest] -> - case predicate(first) { - True -> True - False -> any(rest, predicate) - } - } -} - -fn do_zip(xs: List(a), ys: List(b), acc: List(#(a, b))) -> List(#(a, b)) { - case xs, ys { - [x, ..xs], [y, ..ys] -> do_zip(xs, ys, [#(x, y), ..acc]) - _, _ -> reverse(acc) - } -} - -/// Takes two lists and returns a single list of 2-element tuples. -/// -/// If one of the lists is longer than the other, the remaining elements from -/// the longer list are not used. -/// -/// ## Examples -/// -/// ```gleam -/// > zip([], []) -/// [] -/// ``` -/// -/// ```gleam -/// > zip([1, 2], [3]) -/// [#(1, 3)] -/// ``` -/// -/// ```gleam -/// > zip([1], [3, 4]) -/// [#(1, 3)] -/// ``` -/// -/// ```gleam -/// > zip([1, 2], [3, 4]) -/// [#(1, 3), #(2, 4)] -/// ``` -/// -pub fn zip(list: List(a), with other: List(b)) -> List(#(a, b)) { - do_zip(list, other, []) -} - -/// Takes two lists and returns a single list of 2-element tuples. -/// -/// If one of the lists is longer than the other, an `Error` is returned. -/// -/// ## Examples -/// -/// ```gleam -/// > strict_zip([], []) -/// Ok([]) -/// ``` -/// -/// ```gleam -/// > strict_zip([1, 2], [3]) -/// Error(LengthMismatch) -/// ``` -/// -/// ```gleam -/// > strict_zip([1], [3, 4]) -/// Error(LengthMismatch) -/// ``` -/// -/// ```gleam -/// > strict_zip([1, 2], [3, 4]) -/// Ok([#(1, 3), #(2, 4)]) -/// ``` -/// -pub fn strict_zip( - list: List(a), - with other: List(b), -) -> Result(List(#(a, b)), LengthMismatch) { - case length(of: list) == length(of: other) { - True -> Ok(zip(list, other)) - False -> Error(LengthMismatch) - } -} - -fn do_unzip(input, xs, ys) { - case input { - [] -> #(reverse(xs), reverse(ys)) - [#(x, y), ..rest] -> do_unzip(rest, [x, ..xs], [y, ..ys]) - } -} - -/// Takes a single list of 2-element tuples and returns two lists. -/// -/// ## Examples -/// -/// ```gleam -/// > unzip([#(1, 2), #(3, 4)]) -/// #([1, 3], [2, 4]) -/// ``` -/// -/// ```gleam -/// > unzip([]) -/// #([], []) -/// ``` -/// -pub fn unzip(input: List(#(a, b))) -> #(List(a), List(b)) { - do_unzip(input, [], []) -} - -fn do_intersperse(list: List(a), separator: a, acc: List(a)) -> List(a) { - case list { - [] -> reverse(acc) - [x, ..rest] -> do_intersperse(rest, separator, [x, separator, ..acc]) - } -} - -/// Inserts a given value between each existing element in a given list. -/// -/// This function runs in linear time and copies the list. -/// -/// ## Examples -/// -/// ```gleam -/// > intersperse([1, 1, 1], 2) -/// [1, 2, 1, 2, 1] -/// ``` -/// -/// ```gleam -/// > intersperse([], 2) -/// [] -/// ``` -/// -pub fn intersperse(list: List(a), with elem: a) -> List(a) { - case list { - [] | [_] -> list - [x, ..rest] -> do_intersperse(rest, elem, [x]) - } -} - -/// Returns the element in the Nth position in the list, with 0 being the first -/// position. -/// -/// `Error(Nil)` is returned if the list is not long enough for the given index -/// or if the index is less than 0. -/// -/// ## Examples -/// -/// ```gleam -/// > at([1, 2, 3], 1) -/// Ok(2) -/// ``` -/// -/// ```gleam -/// > at([1, 2, 3], 5) -/// Error(Nil) -/// ``` -/// -pub fn at(in list: List(a), get index: Int) -> Result(a, Nil) { - case index >= 0 { - True -> - list - |> drop(index) - |> first - False -> Error(Nil) - } -} - -/// Removes any duplicate elements from a given list. -/// -/// This function returns in loglinear time. -/// -/// ## Examples -/// -/// ```gleam -/// > unique([1, 1, 1, 4, 7, 3, 3, 4]) -/// [1, 4, 7, 3] -/// ``` -/// -pub fn unique(list: List(a)) -> List(a) { - case list { - [] -> [] - [x, ..rest] -> [x, ..unique(filter(rest, fn(y) { y != x }))] - } -} - -/// Merge lists `a` and `b` in ascending order -/// but only up to `na` and `nb` number of items respectively. -/// -fn merge_up( - na: Int, - nb: Int, - a: List(a), - b: List(a), - acc: List(a), - compare: fn(a, a) -> Order, -) { - case na, nb, a, b { - 0, 0, _, _ -> acc - _, 0, [ax, ..ar], _ -> merge_up(na - 1, nb, ar, b, [ax, ..acc], compare) - 0, _, _, [bx, ..br] -> merge_up(na, nb - 1, a, br, [bx, ..acc], compare) - _, _, [ax, ..ar], [bx, ..br] -> - case compare(ax, bx) { - order.Gt -> merge_up(na, nb - 1, a, br, [bx, ..acc], compare) - _ -> merge_up(na - 1, nb, ar, b, [ax, ..acc], compare) - } - } -} - -/// Merge lists `a` and `b` in descending order -/// but only up to `na` and `nb` number of items respectively. -/// -fn merge_down( - na: Int, - nb: Int, - a: List(a), - b: List(a), - acc: List(a), - compare: fn(a, a) -> Order, -) { - case na, nb, a, b { - 0, 0, _, _ -> acc - _, 0, [ax, ..ar], _ -> merge_down(na - 1, nb, ar, b, [ax, ..acc], compare) - 0, _, _, [bx, ..br] -> merge_down(na, nb - 1, a, br, [bx, ..acc], compare) - _, _, [ax, ..ar], [bx, ..br] -> - case compare(bx, ax) { - order.Lt -> merge_down(na - 1, nb, ar, b, [ax, ..acc], compare) - _ -> merge_down(na, nb - 1, a, br, [bx, ..acc], compare) - } - } -} - -/// Merge sort that alternates merging in ascending and descending order -/// because the merge process also reverses the list. -/// -/// Some copying is avoided by merging only a subset of the lists -/// instead of creating and merging new smaller lists. -/// -fn merge_sort( - l: List(a), - ln: Int, - compare: fn(a, a) -> Order, - down: Bool, -) -> List(a) { - let n = ln / 2 - let a = l - let b = drop(l, n) - case ln < 3 { - True -> - case down { - True -> merge_down(n, ln - n, a, b, [], compare) - False -> merge_up(n, ln - n, a, b, [], compare) - } - False -> - case down { - True -> - merge_down( - n, - ln - n, - merge_sort(a, n, compare, False), - merge_sort(b, ln - n, compare, False), - [], - compare, - ) - False -> - merge_up( - n, - ln - n, - merge_sort(a, n, compare, True), - merge_sort(b, ln - n, compare, True), - [], - compare, - ) - } - } -} - -/// Sorts from smallest to largest based upon the ordering specified by a given -/// function. -/// -/// ## Examples -/// -/// ```gleam -/// > import gleam/int -/// > list.sort([4, 3, 6, 5, 4, 1, 2], by: int.compare) -/// [1, 2, 3, 4, 4, 5, 6] -/// ``` -/// -pub fn sort(list: List(a), by compare: fn(a, a) -> Order) -> List(a) { - merge_sort(list, length(list), compare, True) -} - -/// Creates a list of ints ranging from a given start and finish. -/// -/// ## Examples -/// -/// ```gleam -/// > range(0, 0) -/// [0] -/// ``` -/// -/// ```gleam -/// > range(0, 5) -/// [0, 1, 2, 3, 4, 5] -/// ``` -/// -/// ```gleam -/// > range(1, -5) -/// [1, 0, -1, -2, -3, -4, -5] -/// ``` -/// -pub fn range(from start: Int, to stop: Int) -> List(Int) { - tail_recursive_range(start, stop, []) -} - -fn tail_recursive_range(start: Int, stop: Int, acc: List(Int)) -> List(Int) { - case int.compare(start, stop) { - order.Eq -> [stop, ..acc] - order.Gt -> tail_recursive_range(start, stop + 1, [stop, ..acc]) - order.Lt -> tail_recursive_range(start, stop - 1, [stop, ..acc]) - } -} - -fn do_repeat(a: a, times: Int, acc: List(a)) -> List(a) { - case times <= 0 { - True -> acc - False -> do_repeat(a, times - 1, [a, ..acc]) - } -} - -/// Builds a list of a given value a given number of times. -/// -/// ## Examples -/// -/// ```gleam -/// > repeat("a", times: 0) -/// [] -/// ``` -/// -/// ```gleam -/// > repeat("a", times: 5) -/// ["a", "a", "a", "a", "a"] -/// ``` -/// -pub fn repeat(item a: a, times times: Int) -> List(a) { - do_repeat(a, times, []) -} - -fn do_split(list: List(a), n: Int, taken: List(a)) -> #(List(a), List(a)) { - case n <= 0 { - True -> #(reverse(taken), list) - False -> - case list { - [] -> #(reverse(taken), []) - [x, ..xs] -> do_split(xs, n - 1, [x, ..taken]) - } - } -} - -/// Splits a list in two before the given index. -/// -/// If the list is not long enough to have the given index the before list will -/// be the input list, and the after list will be empty. -/// -/// ## Examples -/// -/// ```gleam -/// > split([6, 7, 8, 9], 0) -/// #([], [6, 7, 8, 9]) -/// ``` -/// -/// ```gleam -/// > split([6, 7, 8, 9], 2) -/// #([6, 7], [8, 9]) -/// ``` -/// -/// ```gleam -/// > split([6, 7, 8, 9], 4) -/// #([6, 7, 8, 9], []) -/// ``` -/// -pub fn split(list list: List(a), at index: Int) -> #(List(a), List(a)) { - do_split(list, index, []) -} - -fn do_split_while( - list: List(a), - f: fn(a) -> Bool, - acc: List(a), -) -> #(List(a), List(a)) { - case list { - [] -> #(reverse(acc), []) - [x, ..xs] -> - case f(x) { - False -> #(reverse(acc), list) - _ -> do_split_while(xs, f, [x, ..acc]) - } - } -} - -/// Splits a list in two before the first element that a given function returns -/// `False` for. -/// -/// If the function returns `True` for all elements the first list will be the -/// input list, and the second list will be empty. -/// -/// ## Examples -/// -/// ```gleam -/// > split_while([1, 2, 3, 4, 5], fn(x) { x <= 3 }) -/// #([1, 2, 3], [4, 5]) -/// ``` -/// -/// ```gleam -/// > split_while([1, 2, 3, 4, 5], fn(x) { x <= 5 }) -/// #([1, 2, 3, 4, 5], []) -/// ``` -/// -pub fn split_while( - list list: List(a), - satisfying predicate: fn(a) -> Bool, -) -> #(List(a), List(a)) { - do_split_while(list, predicate, []) -} - -/// Given a list of 2-element tuples, finds the first tuple that has a given -/// key as the first element and returns the second element. -/// -/// If no tuple is found with the given key then `Error(Nil)` is returned. -/// -/// This function may be useful for interacting with Erlang code where lists of -/// tuples are common. -/// -/// ## Examples -/// -/// ```gleam -/// > key_find([#("a", 0), #("b", 1)], "a") -/// Ok(0) -/// ``` -/// -/// ```gleam -/// > key_find([#("a", 0), #("b", 1)], "b") -/// Ok(1) -/// ``` -/// -/// ```gleam -/// > key_find([#("a", 0), #("b", 1)], "c") -/// Error(Nil) -/// ``` -/// -pub fn key_find( - in keyword_list: List(#(k, v)), - find desired_key: k, -) -> Result(v, Nil) { - find_map( - keyword_list, - fn(keyword) { - let #(key, value) = keyword - case key == desired_key { - True -> Ok(value) - False -> Error(Nil) - } - }, - ) -} - -fn do_pop(haystack, predicate, checked) { - case haystack { - [] -> Error(Nil) - [x, ..rest] -> - case predicate(x) { - True -> Ok(#(x, append(reverse(checked), rest))) - False -> do_pop(rest, predicate, [x, ..checked]) - } - } -} - -/// Removes the first element in a given list for which the predicate function returns `True`. -/// -/// Returns `Error(Nil)` if no such element is found. -/// -/// ## Examples -/// -/// ```gleam -/// > pop([1, 2, 3], fn(x) { x > 2 }) -/// Ok(#(3, [1, 2])) -/// ``` -/// -/// ```gleam -/// > pop([1, 2, 3], fn(x) { x > 4 }) -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > pop([], fn(_) { True }) -/// Error(Nil) -/// ``` -/// -pub fn pop( - in haystack: List(a), - one_that is_desired: fn(a) -> Bool, -) -> Result(#(a, List(a)), Nil) { - do_pop(haystack, is_desired, []) -} - -fn do_pop_map(haystack, mapper, checked) { - case haystack { - [] -> Error(Nil) - [x, ..rest] -> - case mapper(x) { - Ok(y) -> Ok(#(y, append(reverse(checked), rest))) - Error(_) -> do_pop_map(rest, mapper, [x, ..checked]) - } - } -} - -/// Removes the first element in a given list for which the given function returns -/// `Ok(new_value)`, then returns the wrapped `new_value` as well as list with the value removed. -/// -/// Returns `Error(Nil)` if no such element is found. -/// -/// ## Examples -/// -/// ```gleam -/// > pop_map([[], [2], [3]], first) -/// Ok(#(2, [[], [3]])) -/// ``` -/// -/// ```gleam -/// > pop_map([[], []], first) -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > pop_map([], first) -/// Error(Nil) -/// ``` -/// -pub fn pop_map( - in haystack: List(a), - one_that is_desired: fn(a) -> Result(b, c), -) -> Result(#(b, List(a)), Nil) { - do_pop_map(haystack, is_desired, []) -} - -/// Given a list of 2-element tuples, finds the first tuple that has a given -/// key as the first element. This function will return the second element -/// of the found tuple and list with tuple removed. -/// -/// If no tuple is found with the given key then `Error(Nil)` is returned. -/// -/// ## Examples -/// -/// ```gleam -/// > key_pop([#("a", 0), #("b", 1)], "a") -/// Ok(#(0, [#("b", 1)])) -/// ``` -/// -/// ```gleam -/// > key_pop([#("a", 0), #("b", 1)], "b") -/// Ok(#(1, [#("a", 0)])) -/// ``` -/// -/// ```gleam -/// > key_pop([#("a", 0), #("b", 1)], "c") -/// Error(Nil) -/// ``` -/// -pub fn key_pop( - haystack: List(#(k, v)), - key: k, -) -> Result(#(v, List(#(k, v))), Nil) { - pop_map( - haystack, - fn(entry) { - let #(k, v) = entry - case k { - k if k == key -> Ok(v) - _ -> Error(Nil) - } - }, - ) -} - -/// Given a list of 2-element tuples, inserts a key and value into the list. -/// -/// If there was already a tuple with the key then it is replaced, otherwise it -/// is added to the end of the list. -/// -/// ## Examples -/// -/// ```gleam -/// > key_set([#(5, 0), #(4, 1)], 4, 100) -/// [#(5, 0), #(4, 100)] -/// ``` -/// -/// ```gleam -/// > key_set([#(5, 0), #(4, 1)], 1, 100) -/// [#(5, 0), #(4, 1), #(1, 100)] -/// ``` -/// -pub fn key_set(list: List(#(a, b)), key: a, value: b) -> List(#(a, b)) { - case list { - [] -> [#(key, value)] - [#(k, _), ..rest] if k == key -> [#(key, value), ..rest] - [first, ..rest] -> [first, ..key_set(rest, key, value)] - } -} - -/// Calls a function for each element in a list, discarding the return value. -/// -/// Useful for calling a side effect for every item of a list. -/// -/// ```gleam -/// > list.each([1, 2, 3], io.println) -/// Nil -/// ``` -/// -pub fn each(list: List(a), f: fn(a) -> b) -> Nil { - case list { - [] -> Nil - [x, ..xs] -> { - f(x) - each(xs, f) - } - } -} - -/// Calls a `Result` returning function for each element in a list, discarding -/// the return value. If the function returns `Error` then the iteration is -/// stopped and the error is returned. -/// -/// Useful for calling a side effect for every item of a list. -/// -/// ## Examples -/// -/// ```gleam -/// > try_each( -/// > over: [1, 2, 3], -/// > with: function_that_might_fail, -/// > ) -/// Ok(Nil) -/// ``` -/// -pub fn try_each( - over list: List(a), - with fun: fn(a) -> Result(b, e), -) -> Result(Nil, e) { - case list { - [] -> Ok(Nil) - [x, ..xs] -> - case fun(x) { - Ok(_) -> try_each(over: xs, with: fun) - Error(e) -> Error(e) - } - } -} - -fn do_partition(list, categorise, trues, falses) { - case list { - [] -> #(reverse(trues), reverse(falses)) - [x, ..xs] -> - case categorise(x) { - True -> do_partition(xs, categorise, [x, ..trues], falses) - False -> do_partition(xs, categorise, trues, [x, ..falses]) - } - } -} - -/// Partitions a list into a tuple/pair of lists -/// by a given categorisation function. -/// -/// ## Examples -/// -/// ```gleam -/// > [1, 2, 3, 4, 5] |> list.partition(int.is_odd) -/// #([1, 3, 5], [2, 4]) -/// ``` -/// -pub fn partition( - list: List(a), - with categorise: fn(a) -> Bool, -) -> #(List(a), List(a)) { - do_partition(list, categorise, [], []) -} - -/// Returns all the permutations of a list. -/// -/// ## Examples -/// -/// ```gleam -/// > permutations([1, 2]) -/// [[1, 2], [2, 1]] -/// ``` -/// -pub fn permutations(l: List(a)) -> List(List(a)) { - case l { - [] -> [[]] - _ -> - l - |> index_map(fn(i_idx, i) { - l - |> index_fold( - [], - fn(acc, j, j_idx) { - case i_idx == j_idx { - True -> acc - False -> [j, ..acc] - } - }, - ) - |> reverse - |> permutations - |> map(fn(permutation) { [i, ..permutation] }) - }) - |> concat - } -} - -fn do_window(acc: List(List(a)), l: List(a), n: Int) -> List(List(a)) { - let window = take(l, n) - - case length(window) == n { - True -> do_window([window, ..acc], drop(l, 1), n) - False -> acc - } -} - -/// Returns a list of sliding windows. -/// -/// ## Examples -/// -/// ```gleam -/// > window([1,2,3,4,5], 3) -/// [[1, 2, 3], [2, 3, 4], [3, 4, 5]] -/// ``` -/// -/// ```gleam -/// > window([1, 2], 4) -/// [] -/// ``` -/// -pub fn window(l: List(a), by n: Int) -> List(List(a)) { - do_window([], l, n) - |> reverse -} - -/// Returns a list of tuples containing two contiguous elements. -/// -/// ## Examples -/// -/// ```gleam -/// > window_by_2([1,2,3,4]) -/// [#(1, 2), #(2, 3), #(3, 4)] -/// ``` -/// -/// ```gleam -/// > window_by_2([1]) -/// [] -/// ``` -/// -pub fn window_by_2(l: List(a)) -> List(#(a, a)) { - zip(l, drop(l, 1)) -} - -/// Drops the first elements in a given list for which the predicate function returns `True`. -/// -/// ## Examples -/// -/// ```gleam -/// > drop_while([1, 2, 3, 4], fn (x) { x < 3 }) -/// [3, 4] -/// ``` -/// -pub fn drop_while( - in list: List(a), - satisfying predicate: fn(a) -> Bool, -) -> List(a) { - case list { - [] -> [] - [x, ..xs] -> - case predicate(x) { - True -> drop_while(xs, predicate) - False -> [x, ..xs] - } - } -} - -fn do_take_while( - list: List(a), - predicate: fn(a) -> Bool, - acc: List(a), -) -> List(a) { - case list { - [] -> reverse(acc) - [first, ..rest] -> - case predicate(first) { - True -> do_take_while(rest, predicate, [first, ..acc]) - False -> reverse(acc) - } - } -} - -/// Takes the first elements in a given list for which the predicate function returns `True`. -/// -/// ## Examples -/// -/// ```gleam -/// > take_while([1, 2, 3, 2, 4], fn (x) { x < 3 }) -/// [1, 2] -/// ``` -/// -pub fn take_while( - in list: List(a), - satisfying predicate: fn(a) -> Bool, -) -> List(a) { - do_take_while(list, predicate, []) -} - -fn do_chunk( - list: List(a), - f: fn(a) -> key, - previous_key: key, - current_chunk: List(a), - acc: List(List(a)), -) -> List(List(a)) { - case list { - [first, ..rest] -> { - let key = f(first) - case key == previous_key { - False -> { - let new_acc = [reverse(current_chunk), ..acc] - do_chunk(rest, f, key, [first], new_acc) - } - _true -> do_chunk(rest, f, key, [first, ..current_chunk], acc) - } - } - _empty -> reverse([reverse(current_chunk), ..acc]) - } -} - -/// Returns a list of chunks in which -/// the return value of calling `f` on each element is the same. -/// -/// ## Examples -/// -/// ```gleam -/// > [1, 2, 2, 3, 4, 4, 6, 7, 7] |> chunk(by: fn(n) { n % 2 }) -/// [[1], [2, 2], [3], [4, 4, 6], [7, 7]] -/// ``` -/// -pub fn chunk(in list: List(a), by f: fn(a) -> key) -> List(List(a)) { - case list { - [] -> [] - [first, ..rest] -> do_chunk(rest, f, f(first), [first], []) - } -} - -fn do_sized_chunk( - list: List(a), - count: Int, - left: Int, - current_chunk: List(a), - acc: List(List(a)), -) -> List(List(a)) { - case list { - [] -> - case current_chunk { - [] -> reverse(acc) - remaining -> reverse([reverse(remaining), ..acc]) - } - [first, ..rest] -> { - let chunk = [first, ..current_chunk] - case left > 1 { - False -> do_sized_chunk(rest, count, count, [], [reverse(chunk), ..acc]) - True -> do_sized_chunk(rest, count, left - 1, chunk, acc) - } - } - } -} - -/// Returns a list of chunks containing `count` elements each. -/// -/// If the last chunk does not have `count` elements, it is instead -/// a partial chunk, with less than `count` elements. -/// -/// For any `count` less than 1 this function behaves as if it was set to 1. -/// -/// ## Examples -/// -/// ```gleam -/// > [1, 2, 3, 4, 5, 6] |> sized_chunk(into: 2) -/// [[1, 2], [3, 4], [5, 6]] -/// ``` -/// -/// ```gleam -/// > [1, 2, 3, 4, 5, 6, 7, 8] |> sized_chunk(into: 3) -/// [[1, 2, 3], [4, 5, 6], [7, 8]] -/// ``` -/// -pub fn sized_chunk(in list: List(a), into count: Int) -> List(List(a)) { - do_sized_chunk(list, count, count, [], []) -} - -/// This function acts similar to fold, but does not take an initial state. -/// Instead, it starts from the first element in the list -/// and combines it with each subsequent element in turn using the given -/// function. The function is called as `fun(accumulator, current_element)`. -/// -/// Returns `Ok` to indicate a successful run, and `Error` if called on an -/// empty list. -/// -/// ## Examples -/// -/// ```gleam -/// > [] |> reduce(fn(acc, x) { acc + x }) -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > [1, 2, 3, 4, 5] |> reduce(fn(acc, x) { acc + x }) -/// Ok(15) -/// ``` -/// -pub fn reduce(over list: List(a), with fun: fn(a, a) -> a) -> Result(a, Nil) { - case list { - [] -> Error(Nil) - [first, ..rest] -> Ok(fold(rest, first, fun)) - } -} - -fn do_scan( - list: List(a), - accumulator: acc, - accumulated: List(acc), - fun: fn(acc, a) -> acc, -) -> List(acc) { - case list { - [] -> reverse(accumulated) - [x, ..xs] -> { - let next = fun(accumulator, x) - do_scan(xs, next, [next, ..accumulated], fun) - } - } -} - -/// Similar to `fold`, but yields the state of the accumulator at each stage. -/// -/// ## Examples -/// -/// ```gleam -/// > scan(over: [1, 2, 3], from: 100, with: fn(acc, i) { acc + i }) -/// [101, 103, 106] -/// ``` -/// -pub fn scan( - over list: List(a), - from initial: acc, - with fun: fn(acc, a) -> acc, -) -> List(acc) { - do_scan(list, initial, [], fun) -} - -/// Returns the last element in the given list. -/// -/// Returns `Error(Nil)` if the list is empty. -/// -/// This function runs in linear time. -/// For a collection oriented around performant access at either end, -/// see `gleam/queue.Queue`. -/// -/// ## Examples -/// -/// ```gleam -/// > last([]) -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > last([1, 2, 3, 4, 5]) -/// Ok(5) -/// ``` -/// -pub fn last(list: List(a)) -> Result(a, Nil) { - list - |> reduce(fn(_, elem) { elem }) -} - -/// Return unique combinations of elements in the list. -/// -/// ## Examples -/// -/// ```gleam -/// > combinations([1, 2, 3], 2) -/// [[1, 2], [1, 3], [2, 3]] -/// ``` -/// -/// ```gleam -/// > combinations([1, 2, 3, 4], 3) -/// [[1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4]] -/// ``` -/// -pub fn combinations(items: List(a), by n: Int) -> List(List(a)) { - case n { - 0 -> [[]] - _ -> - case items { - [] -> [] - [x, ..xs] -> { - let first_combinations = - map(combinations(xs, n - 1), with: fn(com) { [x, ..com] }) - |> reverse - fold( - first_combinations, - combinations(xs, n), - fn(acc, c) { [c, ..acc] }, - ) - } - } - } -} - -fn do_combination_pairs(items: List(a)) -> List(List(#(a, a))) { - case items { - [] -> [] - [x, ..xs] -> { - let first_combinations = map(xs, with: fn(other) { #(x, other) }) - [first_combinations, ..do_combination_pairs(xs)] - } - } -} - -/// Return unique pair combinations of elements in the list -/// -/// ## Examples -/// -/// ```gleam -/// > combination_pairs([1, 2, 3]) -/// [#(1, 2), #(1, 3), #(2, 3)] -/// ``` -/// -pub fn combination_pairs(items: List(a)) -> List(#(a, a)) { - do_combination_pairs(items) - |> concat -} - -/// Make a list alternating the elements from the given lists -/// -/// ## Examples -/// -/// ```gleam -/// > list.interleave([[1, 2], [101, 102], [201, 202]]) -/// [1, 101, 201, 2, 102, 202] -/// ``` -/// -pub fn interleave(list: List(List(a))) -> List(a) { - transpose(list) - |> concat -} - -/// Transpose rows and columns of the list of lists. -/// -/// Notice: This function is not tail recursive, -/// and thus may exceed stack size if called, -/// with large lists (on target JavaScript). -/// -/// ## Examples -/// -/// ```gleam -/// > transpose([[1, 2, 3], [101, 102, 103]]) -/// [[1, 101], [2, 102], [3, 103]] -/// ``` -/// -pub fn transpose(list_of_list: List(List(a))) -> List(List(a)) { - let take_first = fn(list) { - case list { - [] -> [] - [f] -> [f] - [f, ..] -> [f] - } - } - - case list_of_list { - [] -> [] - [[], ..xss] -> transpose(xss) - rows -> { - let firsts = - rows - |> map(take_first) - |> concat - let rest = transpose(map(rows, drop(_, 1))) - [firsts, ..rest] - } - } -} - -fn do_shuffle_pair_unwrap(list: List(#(Float, a)), acc: List(a)) -> List(a) { - case list { - [] -> acc - _ -> { - let [elem_pair, ..enumerable] = list - do_shuffle_pair_unwrap(enumerable, [elem_pair.1, ..acc]) - } - } -} - -fn do_shuffle_by_pair_indexes( - list_of_pairs: List(#(Float, a)), -) -> List(#(Float, a)) { - sort( - list_of_pairs, - fn(a_pair: #(Float, a), b_pair: #(Float, a)) -> Order { - float.compare(a_pair.0, b_pair.0) - }, - ) -} - -/// Takes a list, randomly sorts all items and returns the shuffled list. -/// -/// This function uses Erlang's `:rand` module or Javascript's -/// `Math.random()` to calcuate the index shuffling. -/// -/// ## Example -/// -/// ```gleam -/// > range(1, 10) -/// > |> shuffle() -/// [1, 6, 9, 10, 3, 8, 4, 2, 7, 5] -/// ``` -/// -pub fn shuffle(list: List(a)) -> List(a) { - list - |> fold(from: [], with: fn(acc, a) { [#(float.random(0.0, 1.0), a), ..acc] }) - |> do_shuffle_by_pair_indexes() - |> do_shuffle_pair_unwrap([]) -} diff --git a/build/packages/gleam_stdlib/src/gleam/map.gleam b/build/packages/gleam_stdlib/src/gleam/map.gleam deleted file mode 100644 index 07d9234..0000000 --- a/build/packages/gleam_stdlib/src/gleam/map.gleam +++ /dev/null @@ -1,542 +0,0 @@ -import gleam/option.{Option} - -/// A dictionary of keys and values. -/// -/// Any type can be used for the keys and values of a map, but all the keys -/// must be of the same type and all the values must be of the same type. -/// -/// Each key can only be present in a map once. -/// -/// Maps are not ordered in any way, and any unintentional ordering is not to -/// be relied upon in your code as it may change in future versions of Erlang -/// or Gleam. -/// -/// See [the Erlang map module](https://erlang.org/doc/man/maps.html) for more -/// information. -/// -pub type Map(key, value) - -/// Determines the number of key-value pairs in the map. -/// This function runs in constant time and does not need to iterate the map. -/// -/// ## Examples -/// -/// ```gleam -/// > new() |> size() -/// 0 -/// ``` -/// -/// ```gleam -/// > new() |> insert("key", "value") |> size() -/// 1 -/// ``` -/// -pub fn size(map: Map(k, v)) -> Int { - do_size(map) -} - -@external(erlang, "maps", "size") -@external(javascript, "../gleam_stdlib.mjs", "map_size") -fn do_size(a: Map(k, v)) -> Int - -/// Converts the map to a list of 2-element tuples `#(key, value)`, one for -/// each key-value pair in the map. -/// -/// The tuples in the list have no specific order. -/// -/// ## Examples -/// -/// ```gleam -/// > new() |> to_list() -/// [] -/// ``` -/// -/// ```gleam -/// > new() |> insert("key", 0) |> to_list() -/// [#("key", 0)] -/// ``` -/// -pub fn to_list(map: Map(key, value)) -> List(#(key, value)) { - do_to_list(map) -} - -@external(erlang, "maps", "to_list") -@external(javascript, "../gleam_stdlib.mjs", "map_to_list") -fn do_to_list(a: Map(key, value)) -> List(#(key, value)) - -/// Converts a list of 2-element tuples `#(key, value)` to a map. -/// -/// If two tuples have the same key the last one in the list will be the one -/// that is present in the map. -/// -pub fn from_list(list: List(#(k, v))) -> Map(k, v) { - do_from_list(list) -} - -@target(erlang) -@external(erlang, "maps", "from_list") -fn do_from_list(a: List(#(key, value))) -> Map(key, value) - -@target(javascript) -fn fold_list_of_pair( - over list: List(#(k, v)), - from initial: Map(k, v), -) -> Map(k, v) { - case list { - [] -> initial - [x, ..rest] -> fold_list_of_pair(rest, insert(initial, x.0, x.1)) - } -} - -@target(javascript) -fn do_from_list(list: List(#(k, v))) -> Map(k, v) { - fold_list_of_pair(list, new()) -} - -/// Determines whether or not a value present in the map for a given key. -/// -/// ## Examples -/// -/// ```gleam -/// > new() |> insert("a", 0) |> has_key("a") -/// True -/// ``` -/// -/// ```gleam -/// > new() |> insert("a", 0) |> has_key("b") -/// False -/// ``` -/// -pub fn has_key(map: Map(k, v), key: k) -> Bool { - do_has_key(key, map) -} - -@target(erlang) -@external(erlang, "maps", "is_key") -fn do_has_key(a: key, b: Map(key, v)) -> Bool - -@target(javascript) -fn do_has_key(key: k, map: Map(k, v)) -> Bool { - get(map, key) != Error(Nil) -} - -/// Creates a fresh map that contains no values. -/// -pub fn new() -> Map(key, value) { - do_new() -} - -@external(erlang, "maps", "new") -@external(javascript, "../gleam_stdlib.mjs", "new_map") -fn do_new() -> Map(key, value) - -/// Fetches a value from a map for a given key. -/// -/// The map may not have a value for the key, so the value is wrapped in a -/// `Result`. -/// -/// ## Examples -/// -/// ```gleam -/// > new() |> insert("a", 0) |> get("a") -/// Ok(0) -/// ``` -/// -/// ```gleam -/// > new() |> insert("a", 0) |> get("b") -/// Error(Nil) -/// ``` -/// -pub fn get(from: Map(key, value), get: key) -> Result(value, Nil) { - do_get(from, get) -} - -@external(erlang, "gleam_stdlib", "map_get") -@external(javascript, "../gleam_stdlib.mjs", "map_get") -fn do_get(a: Map(key, value), b: key) -> Result(value, Nil) - -/// Inserts a value into the map with the given key. -/// -/// If the map already has a value for the given key then the value is -/// replaced with the new value. -/// -/// ## Examples -/// -/// ```gleam -/// > new() |> insert("a", 0) |> to_list -/// [#("a", 0)] -/// ``` -/// -/// ```gleam -/// > new() |> insert("a", 0) |> insert("a", 5) |> to_list -/// [#("a", 5)] -/// ``` -/// -pub fn insert(into map: Map(k, v), for key: k, insert value: v) -> Map(k, v) { - do_insert(key, value, map) -} - -@external(erlang, "maps", "put") -@external(javascript, "../gleam_stdlib.mjs", "map_insert") -fn do_insert(a: key, b: value, c: Map(key, value)) -> Map(key, value) - -/// Updates all values in a given map by calling a given function on each key -/// and value. -/// -/// ## Examples -/// -/// ```gleam -/// > [#(3, 3), #(2, 4)] -/// > |> from_list -/// > |> map_values(fn(key, value) { key * value }) -/// [#(3, 9), #(2, 8)] -/// ``` -/// -pub fn map_values(in map: Map(k, v), with fun: fn(k, v) -> w) -> Map(k, w) { - do_map_values(fun, map) -} - -@target(erlang) -@external(erlang, "maps", "map") -fn do_map_values(a: fn(key, value) -> b, b: Map(key, value)) -> Map(key, b) - -@target(javascript) -fn do_map_values(f: fn(key, value) -> b, map: Map(key, value)) -> Map(key, b) { - let f = fn(map, k, v) { insert(map, k, f(k, v)) } - map - |> fold(from: new(), with: f) -} - -/// Gets a list of all keys in a given map. -/// -/// Maps are not ordered so the keys are not returned in any specific order. Do -/// not write code that relies on the order keys are returned by this function -/// as it may change in later versions of Gleam or Erlang. -/// -/// ## Examples -/// -/// ```gleam -/// > keys([#("a", 0), #("b", 1)]) -/// ["a", "b"] -/// ``` -/// -pub fn keys(map: Map(keys, v)) -> List(keys) { - do_keys(map) -} - -@target(erlang) -@external(erlang, "maps", "keys") -fn do_keys(a: Map(keys, v)) -> List(keys) - -@target(javascript) -fn reverse_and_concat(remaining, accumulator) { - case remaining { - [] -> accumulator - [item, ..rest] -> reverse_and_concat(rest, [item, ..accumulator]) - } -} - -@target(javascript) -fn do_keys_acc(list: List(#(k, v)), acc: List(k)) -> List(k) { - case list { - [] -> reverse_and_concat(acc, []) - [x, ..xs] -> do_keys_acc(xs, [x.0, ..acc]) - } -} - -@target(javascript) -fn do_keys(map: Map(k, v)) -> List(k) { - let list_of_pairs = - map - |> to_list - do_keys_acc(list_of_pairs, []) -} - -/// Gets a list of all values in a given map. -/// -/// Maps are not ordered so the values are not returned in any specific order. Do -/// not write code that relies on the order values are returned by this function -/// as it may change in later versions of Gleam or Erlang. -/// -/// ## Examples -/// -/// ```gleam -/// > values(from_list([#("a", 0), #("b", 1)])) -/// [0, 1] -/// ``` -/// -pub fn values(map: Map(k, values)) -> List(values) { - do_values(map) -} - -@target(erlang) -@external(erlang, "maps", "values") -fn do_values(a: Map(k, values)) -> List(values) - -@target(javascript) -fn do_values_acc(list: List(#(k, v)), acc: List(v)) -> List(v) { - case list { - [] -> reverse_and_concat(acc, []) - [x, ..xs] -> do_values_acc(xs, [x.1, ..acc]) - } -} - -@target(javascript) -fn do_values(map: Map(k, v)) -> List(v) { - let list_of_pairs = - map - |> to_list - do_values_acc(list_of_pairs, []) -} - -/// Creates a new map from a given map, minus any entries that a given function -/// returns `False` for. -/// -/// ## Examples -/// -/// ```gleam -/// > from_list([#("a", 0), #("b", 1)]) -/// > |> filter(fn(key, value) { value != 0 }) -/// from_list([#("b", 1)]) -/// ``` -/// -/// ```gleam -/// > from_list([#("a", 0), #("b", 1)]) -/// > |> filter(fn(key, value) { True }) -/// from_list([#("a", 0), #("b", 1)]) -/// ``` -/// -pub fn filter(in map: Map(k, v), for property: fn(k, v) -> Bool) -> Map(k, v) { - do_filter(property, map) -} - -@target(erlang) -@external(erlang, "maps", "filter") -fn do_filter(a: fn(key, value) -> Bool, b: Map(key, value)) -> Map(key, value) - -@target(javascript) -fn do_filter(f: fn(key, value) -> Bool, map: Map(key, value)) -> Map(key, value) { - let insert = fn(map, k, v) { - case f(k, v) { - True -> insert(map, k, v) - _ -> map - } - } - map - |> fold(from: new(), with: insert) -} - -/// Creates a new map from a given map, only including any entries for which the -/// keys are in a given list. -/// -/// ## Examples -/// -/// ```gleam -/// > from_list([#("a", 0), #("b", 1)]) -/// > |> take(["b"]) -/// from_list([#("b", 1)]) -/// ``` -/// -/// ```gleam -/// > from_list([#("a", 0), #("b", 1)]) -/// > |> take(["a", "b", "c"]) -/// from_list([#("a", 0), #("b", 1)]) -/// ``` -/// -pub fn take(from map: Map(k, v), keeping desired_keys: List(k)) -> Map(k, v) { - do_take(desired_keys, map) -} - -@target(erlang) -@external(erlang, "maps", "with") -fn do_take(a: List(k), b: Map(k, v)) -> Map(k, v) - -@target(javascript) -fn insert_taken( - map: Map(k, v), - desired_keys: List(k), - acc: Map(k, v), -) -> Map(k, v) { - let insert = fn(taken, key) { - case get(map, key) { - Ok(value) -> insert(taken, key, value) - _ -> taken - } - } - case desired_keys { - [] -> acc - [x, ..xs] -> insert_taken(map, xs, insert(acc, x)) - } -} - -@target(javascript) -fn do_take(desired_keys: List(k), map: Map(k, v)) -> Map(k, v) { - insert_taken(map, desired_keys, new()) -} - -/// Creates a new map from a pair of given maps by combining their entries. -/// -/// If there are entries with the same keys in both maps the entry from the -/// second map takes precedence. -/// -/// ## Examples -/// -/// ```gleam -/// > let a = from_list([#("a", 0), #("b", 1)]) -/// > let b = from_list([#("b", 2), #("c", 3)]) -/// > merge(a, b) -/// from_list([#("a", 0), #("b", 2), #("c", 3)]) -/// ``` -/// -pub fn merge(into map: Map(k, v), from new_entries: Map(k, v)) -> Map(k, v) { - do_merge(map, new_entries) -} - -@target(erlang) -@external(erlang, "maps", "merge") -fn do_merge(a: Map(k, v), b: Map(k, v)) -> Map(k, v) - -@target(javascript) -fn insert_pair(map: Map(k, v), pair: #(k, v)) -> Map(k, v) { - insert(map, pair.0, pair.1) -} - -@target(javascript) -fn fold_inserts(new_entries: List(#(k, v)), map: Map(k, v)) -> Map(k, v) { - case new_entries { - [] -> map - [x, ..xs] -> fold_inserts(xs, insert_pair(map, x)) - } -} - -@target(javascript) -fn do_merge(map: Map(k, v), new_entries: Map(k, v)) -> Map(k, v) { - new_entries - |> to_list - |> fold_inserts(map) -} - -/// Creates a new map from a given map with all the same entries except for the -/// one with a given key, if it exists. -/// -/// ## Examples -/// -/// ```gleam -/// > delete([#("a", 0), #("b", 1)], "a") -/// from_list([#("b", 1)]) -/// ``` -/// -/// ```gleam -/// > delete([#("a", 0), #("b", 1)], "c") -/// from_list([#("a", 0), #("b", 1)]) -/// ``` -/// -pub fn delete(from map: Map(k, v), delete key: k) -> Map(k, v) { - do_delete(key, map) -} - -@external(erlang, "maps", "remove") -@external(javascript, "../gleam_stdlib.mjs", "map_remove") -fn do_delete(a: k, b: Map(k, v)) -> Map(k, v) - -/// Creates a new map from a given map with all the same entries except any with -/// keys found in a given list. -/// -/// ## Examples -/// -/// ```gleam -/// > drop([#("a", 0), #("b", 1)], ["a"]) -/// from_list([#("b", 2)]) -/// ``` -/// -/// ```gleam -/// > delete([#("a", 0), #("b", 1)], ["c"]) -/// from_list([#("a", 0), #("b", 1)]) -/// ``` -/// -/// ```gleam -/// > drop([#("a", 0), #("b", 1)], ["a", "b", "c"]) -/// from_list([]) -/// ``` -/// -pub fn drop(from map: Map(k, v), drop disallowed_keys: List(k)) -> Map(k, v) { - case disallowed_keys { - [] -> map - [x, ..xs] -> drop(delete(map, x), xs) - } -} - -/// Creates a new map with one entry updated using a given function. -/// -/// If there was not an entry in the map for the given key then the function -/// gets `None` as its argument, otherwise it gets `Some(value)`. -/// -/// ## Example -/// -/// ```gleam -/// > let increment = fn(x) { -/// > case x { -/// > Some(i) -> i + 1 -/// > None -> 0 -/// > } -/// > } -/// > let map = from_list([#("a", 0)]) -/// > -/// > update(map, "a", increment) -/// from_list([#("a", 1)]) -/// ``` -/// -/// ```gleam -/// > update(map, "b", increment) -/// from_list([#("a", 0), #("b", 0)]) -/// ``` -/// -pub fn update( - in map: Map(k, v), - update key: k, - with fun: fn(Option(v)) -> v, -) -> Map(k, v) { - map - |> get(key) - |> option.from_result - |> fun - |> insert(map, key, _) -} - -fn do_fold(list: List(#(k, v)), initial: acc, fun: fn(acc, k, v) -> acc) -> acc { - case list { - [] -> initial - [#(k, v), ..rest] -> do_fold(rest, fun(initial, k, v), fun) - } -} - -/// Combines all entries into a single value by calling a given function on each -/// one. -/// -/// Maps are not ordered so the values are not returned in any specific order. Do -/// not write code that relies on the order entries are used by this function -/// as it may change in later versions of Gleam or Erlang. -/// -/// # Examples -/// -/// ```gleam -/// > let map = from_list([#("a", 1), #("b", 3), #("c", 9)]) -/// > fold(map, 0, fn(accumulator, key, value) { accumulator + value }) -/// 13 -/// ``` -/// -/// ```gleam -/// > import gleam/string.{append} -/// > fold(map, "", fn(accumulator, key, value) { append(accumulator, key) }) -/// "abc" -/// ``` -/// -pub fn fold( - over map: Map(k, v), - from initial: acc, - with fun: fn(acc, k, v) -> acc, -) -> acc { - map - |> to_list - |> do_fold(initial, fun) -} diff --git a/build/packages/gleam_stdlib/src/gleam/option.gleam b/build/packages/gleam_stdlib/src/gleam/option.gleam deleted file mode 100644 index 6015c0f..0000000 --- a/build/packages/gleam_stdlib/src/gleam/option.gleam +++ /dev/null @@ -1,346 +0,0 @@ -/// `Option` represents a value that may be present or not. `Some` means the value is -/// present, `None` means the value is not. -/// -/// This is Gleam's alternative to having a value that could be Null, as is -/// possible in some other languages. -/// -pub type Option(a) { - Some(a) - None -} - -fn do_all(list: List(Option(a)), acc: List(a)) -> Option(List(a)) { - case list { - [] -> Some(acc) - [x, ..rest] -> { - let accumulate = fn(acc, item) { - case acc, item { - Some(values), Some(value) -> Some([value, ..values]) - _, _ -> None - } - } - accumulate(do_all(rest, acc), x) - } - } -} - -/// Combines a list of `Option`s into a single `Option`. -/// If all elements in the list are `Some` then returns a `Some` holding the list of values. -/// If any element is `None` then returns`None`. -/// -/// ## Examples -/// -/// ```gleam -/// > all([Some(1), Some(2)]) -/// Some([1, 2]) -/// ``` -/// -/// ```gleam -/// > all([Some(1), None]) -/// None -/// ``` -/// -pub fn all(list: List(Option(a))) -> Option(List(a)) { - do_all(list, []) -} - -/// Checks whether the `Option` is a `Some` value. -/// -/// ## Examples -/// -/// ```gleam -/// > is_some(Some(1)) -/// True -/// ``` -/// -/// ```gleam -/// > is_some(None) -/// False -/// ``` -/// -pub fn is_some(option: Option(a)) -> Bool { - option != None -} - -/// Checks whether the `Option` is a `None` value. -/// -/// ## Examples -/// -/// ```gleam -/// > is_none(Some(1)) -/// False -/// ``` -/// -/// ```gleam -/// > is_none(None) -/// True -/// ``` -/// -pub fn is_none(option: Option(a)) -> Bool { - option == None -} - -/// Converts an `Option` type to a `Result` type. -/// -/// ## Examples -/// -/// ```gleam -/// > to_result(Some(1), "some_error") -/// Ok(1) -/// ``` -/// -/// ```gleam -/// > to_result(None, "some_error") -/// Error("some_error") -/// ``` -/// -pub fn to_result(option: Option(a), e) -> Result(a, e) { - case option { - Some(a) -> Ok(a) - _ -> Error(e) - } -} - -/// Converts a `Result` type to an `Option` type. -/// -/// ## Examples -/// -/// ```gleam -/// > from_result(Ok(1)) -/// Some(1) -/// ``` -/// -/// ```gleam -/// > from_result(Error("some_error")) -/// None -/// ``` -/// -pub fn from_result(result: Result(a, e)) -> Option(a) { - case result { - Ok(a) -> Some(a) - _ -> None - } -} - -/// Extracts the value from an `Option`, returning a default value if there is none. -/// -/// ## Examples -/// -/// ```gleam -/// > unwrap(Some(1), 0) -/// 1 -/// ``` -/// -/// ```gleam -/// > unwrap(None, 0) -/// 0 -/// ``` -/// -pub fn unwrap(option: Option(a), or default: a) -> a { - case option { - Some(x) -> x - None -> default - } -} - -/// Extracts the value from an `Option`, evaluating the default function if the option is `None`. -/// -/// ## Examples -/// -/// ```gleam -/// > lazy_unwrap(Some(1), fn() { 0 }) -/// 1 -/// ``` -/// -/// ```gleam -/// > lazy_unwrap(None, fn() { 0 }) -/// 0 -/// ``` -/// -pub fn lazy_unwrap(option: Option(a), or default: fn() -> a) -> a { - case option { - Some(x) -> x - None -> default() - } -} - -/// Updates a value held within the `Some` of an `Option` by calling a given function -/// on it. -/// -/// If the `Option` is a `None` rather than `Some`, the function is not called and the -/// `Option` stays the same. -/// -/// ## Examples -/// -/// ```gleam -/// > map(over: Some(1), with: fn(x) { x + 1 }) -/// Some(2) -/// ``` -/// -/// ```gleam -/// > map(over: None, with: fn(x) { x + 1 }) -/// None -/// ``` -/// -pub fn map(over option: Option(a), with fun: fn(a) -> b) -> Option(b) { - case option { - Some(x) -> Some(fun(x)) - None -> None - } -} - -/// Merges a nested `Option` into a single layer. -/// -/// ## Examples -/// -/// ```gleam -/// > flatten(Some(Some(1))) -/// Some(1) -/// ``` -/// -/// ```gleam -/// > flatten(Some(None)) -/// None -/// ``` -/// -/// ```gleam -/// > flatten(None) -/// None -/// ``` -/// -pub fn flatten(option: Option(Option(a))) -> Option(a) { - case option { - Some(x) -> x - None -> None - } -} - -/// Updates a value held within the `Some` of an `Option` by calling a given function -/// on it, where the given function also returns an `Option`. The two options are -/// then merged together into one `Option`. -/// -/// If the `Option` is a `None` rather than `Some` the function is not called and the -/// option stays the same. -/// -/// This function is the equivalent of calling `map` followed by `flatten`, and -/// it is useful for chaining together multiple functions that return `Option`. -/// -/// ## Examples -/// -/// ```gleam -/// > then(Some(1), fn(x) { Some(x + 1) }) -/// Some(2) -/// ``` -/// -/// ```gleam -/// > then(Some(1), fn(x) { Some(#("a", x)) }) -/// Some(#("a", 1)) -/// ``` -/// -/// ```gleam -/// > then(Some(1), fn(_) { None }) -/// None -/// ``` -/// -/// ```gleam -/// > then(None, fn(x) { Some(x + 1) }) -/// None -/// ``` -/// -pub fn then(option: Option(a), apply fun: fn(a) -> Option(b)) -> Option(b) { - case option { - Some(x) -> fun(x) - None -> None - } -} - -/// Returns the first value if it is `Some`, otherwise returns the second value. -/// -/// ## Examples -/// -/// ```gleam -/// > or(Some(1), Some(2)) -/// Some(1) -/// ``` -/// -/// ```gleam -/// > or(Some(1), None) -/// Some(1) -/// ``` -/// -/// ```gleam -/// > or(None, Some(2)) -/// Some(2) -/// ``` -/// -/// ```gleam -/// > or(None, None) -/// None -/// ``` -/// -pub fn or(first: Option(a), second: Option(a)) -> Option(a) { - case first { - Some(_) -> first - None -> second - } -} - -/// Returns the first value if it is `Some`, otherwise evaluates the given function for a fallback value. -/// -/// ## Examples -/// -/// ```gleam -/// > lazy_or(Some(1), fn() { Some(2) }) -/// Some(1) -/// ``` -/// -/// ```gleam -/// > lazy_or(Some(1), fn() { None }) -/// Some(1) -/// ``` -/// -/// ```gleam -/// > lazy_or(None, fn() { Some(2) }) -/// Some(2) -/// ``` -/// -/// ```gleam -/// > lazy_or(None, fn() { None }) -/// None -/// ``` -/// -pub fn lazy_or(first: Option(a), second: fn() -> Option(a)) -> Option(a) { - case first { - Some(_) -> first - None -> second() - } -} - -fn do_values(list: List(Option(a)), acc: List(a)) -> List(a) { - case list { - [] -> acc - [x, ..xs] -> { - let accumulate = fn(acc, item) { - case item { - Some(value) -> [value, ..acc] - None -> acc - } - } - accumulate(do_values(xs, acc), x) - } - } -} - -/// Given a list of `Option`s, -/// returns only the values inside `Some`. -/// -/// ## Examples -/// -/// ```gleam -/// > values([Some(1), None, Some(3)]) -/// [1, 3] -/// ``` -/// -pub fn values(options: List(Option(a))) -> List(a) { - do_values(options, []) -} diff --git a/build/packages/gleam_stdlib/src/gleam/order.gleam b/build/packages/gleam_stdlib/src/gleam/order.gleam deleted file mode 100644 index 12ce011..0000000 --- a/build/packages/gleam_stdlib/src/gleam/order.gleam +++ /dev/null @@ -1,133 +0,0 @@ -/// Represents the result of a single comparison to determine the precise -/// ordering of two values. -/// -pub type Order { - /// Less-than - Lt - - /// Equal - Eq - - /// Greater than - Gt -} - -/// Inverts an order, so less-than becomes greater-than and greater-than -/// becomes less-than. -/// -/// ## Examples -/// -/// ```gleam -/// > negate(Lt) -/// Gt -/// ``` -/// -/// ```gleam -/// > negate(Eq) -/// Eq -/// ``` -/// -/// ```gleam -/// > negate(Lt) -/// Gt -/// ``` -/// -pub fn negate(order: Order) -> Order { - case order { - Lt -> Gt - Eq -> Eq - Gt -> Lt - } -} - -/// Produces a numeric representation of the order. -/// -/// ## Examples -/// -/// ```gleam -/// > to_int(Lt) -/// -1 -/// ``` -/// -/// ```gleam -/// > to_int(Eq) -/// 0 -/// ``` -/// -/// ```gleam -/// > to_int(Gt) -/// 1 -/// ``` -/// -pub fn to_int(order: Order) -> Int { - case order { - Lt -> -1 - Eq -> 0 - Gt -> 1 - } -} - -/// Compares two `Order` values to one another, producing a new `Order`. -/// -/// ## Examples -/// -/// ```gleam -/// > compare(Eq, with: Lt) -/// Gt -/// ``` -/// -pub fn compare(a: Order, with b: Order) -> Order { - case a, b { - x, y if x == y -> Eq - Lt, _ | Eq, Gt -> Lt - _, _ -> Gt - } -} - -/// Returns the largest of two orders given that `Gt > Eq > Lt`. -/// -/// ## Examples -/// -/// ```gleam -/// > max(Eq, Lt) -/// Eq -/// ``` -/// -pub fn max(a: Order, b: Order) -> Order { - case a, b { - Gt, _ -> Gt - Eq, Lt -> Eq - _, _ -> b - } -} - -/// Returns the smallest of two orders given that `Gt > Eq > Lt`. -/// -/// ## Examples -/// -/// ```gleam -/// > min(Eq, Lt) -/// Lt -/// ``` -/// -pub fn min(a: Order, b: Order) -> Order { - case a, b { - Lt, _ -> Lt - Eq, Gt -> Eq - _, _ -> b - } -} - -/// Inverts an ordering function, so less-than becomes greater-than and greater-than -/// becomes less-than. -/// -/// ## Examples -/// -/// ```gleam -/// > list.sort([1, 5, 4], by: reverse(int.compare)) -/// [5, 4, 1] -/// ``` -/// -pub fn reverse(orderer: fn(a, a) -> Order) -> fn(a, a) -> Order { - fn(a, b) { orderer(b, a) } -} diff --git a/build/packages/gleam_stdlib/src/gleam/pair.gleam b/build/packages/gleam_stdlib/src/gleam/pair.gleam deleted file mode 100644 index 894e6a8..0000000 --- a/build/packages/gleam_stdlib/src/gleam/pair.gleam +++ /dev/null @@ -1,85 +0,0 @@ -/// Returns the first element in a pair. -/// -/// ## Examples -/// -/// ```gleam -/// > first(#(1, 2)) -/// 1 -/// ``` -/// -pub fn first(pair: #(a, b)) -> a { - let #(a, _) = pair - a -} - -/// Returns the second element in a pair. -/// -/// ## Examples -/// -/// ```gleam -/// > second(#(1, 2)) -/// 2 -/// ``` -/// -pub fn second(pair: #(a, b)) -> b { - let #(_, a) = pair - a -} - -/// Returns a new pair with the elements swapped. -/// -/// ## Examples -/// -/// ```gleam -/// > swap(#(1, 2)) -/// #(2, 1) -/// ``` -/// -pub fn swap(pair: #(a, b)) -> #(b, a) { - let #(a, b) = pair - #(b, a) -} - -/// Returns a new pair with the first element having had `with` applied to -/// it. -/// -/// ## Examples -/// -/// ```gleam -/// > #(1, 2) |> map_first(fn(n) { n * 2 }) -/// #(2, 2) -/// ``` -/// -pub fn map_first(of pair: #(a, b), with fun: fn(a) -> c) -> #(c, b) { - let #(a, b) = pair - #(fun(a), b) -} - -/// Returns a new pair with the second element having had `with` applied to -/// it. -/// -/// ## Examples -/// -/// ```gleam -/// > #(1, 2) |> map_second(fn(n) { n * 2 }) -/// #(1, 4) -/// ``` -/// -pub fn map_second(of pair: #(a, b), with fun: fn(b) -> c) -> #(a, c) { - let #(a, b) = pair - #(a, fun(b)) -} - -/// Returns a new pair with the given elements. This can also be done using the dedicated -/// syntax instead: `new(1, 2) == #(1, 2)`. -/// -/// ## Examples -/// -/// ```gleam -/// > new(1, 2) -/// #(1, 2) -/// ``` -/// -pub fn new(first: a, second: b) -> #(a, b) { - #(first, second) -} diff --git a/build/packages/gleam_stdlib/src/gleam/queue.gleam b/build/packages/gleam_stdlib/src/gleam/queue.gleam deleted file mode 100644 index 5bf60c8..0000000 --- a/build/packages/gleam_stdlib/src/gleam/queue.gleam +++ /dev/null @@ -1,292 +0,0 @@ -import gleam/list - -/// A queue is an ordered collection of elements. It is similar to a list, but -/// unlike a list elements can be added to or removed from either the front or -/// the back in a performant fashion. -/// -/// The internal representation may be different for two queues with the same -/// elements in the same order if the queues were constructed in different -/// ways. This is the price paid for a queue's fast access at both the front -/// and the back. -/// -/// Because of unpredictable internal representation the equality operator `==` -/// may return surprising results, and the `is_equal` and `is_logically_equal` -/// functions are the recommended way to test queues for equality. -/// -pub opaque type Queue(element) { - Queue(in: List(element), out: List(element)) -} - -/// Creates a fresh queue that contains no values. -/// -pub fn new() -> Queue(a) { - Queue(in: [], out: []) -} - -/// Converts a list of elements into a queue of the same elements in the same -/// order. The first element in the list becomes the front element in the queue. -/// -/// This function runs in constant time. -/// -/// # Examples -/// -/// ```gleam -/// > [1, 2, 3] |> from_list |> length -/// 3 -/// ``` -/// -pub fn from_list(list: List(a)) -> Queue(a) { - Queue(in: [], out: list) -} - -/// Converts a queue of elements into a list of the same elements in the same -/// order. The front element in the queue becomes the first element in the list. -/// -/// This function runs in linear time. -/// -/// # Examples -/// -/// ```gleam -/// > new() |> push_back(1) |> push_back(2) |> to_list -/// [1, 2] -/// ``` -/// -pub fn to_list(queue: Queue(a)) -> List(a) { - queue.out - |> list.append(list.reverse(queue.in)) -} - -/// Determines whether or not the queue is empty. -/// -/// This function runs in constant time. -/// -/// ## Examples -/// -/// ```gleam -/// > [] |> from_list |> is_empty -/// True -/// ``` -/// -/// ```gleam -/// > [1] |> from_list |> is_empty -/// False -/// ``` -/// -/// ```gleam -/// > [1, 2] |> from_list |> is_empty -/// False -/// ``` -/// -pub fn is_empty(queue: Queue(a)) -> Bool { - queue.in == [] && queue.out == [] -} - -/// Counts the number of elements in a given queue. -/// -/// This function has to traverse the queue to determine the number of elements, -/// so it runs in linear time. -/// -/// ## Examples -/// -/// ```gleam -/// > length(from_list([])) -/// 0 -/// ``` -/// -/// ```gleam -/// > length(from_list([1])) -/// 1 -/// ``` -/// -/// ```gleam -/// > length(from_list([1, 2])) -/// 2 -/// ``` -/// -pub fn length(queue: Queue(a)) -> Int { - list.length(queue.in) + list.length(queue.out) -} - -/// Pushes an element onto the back of the queue. -/// -/// # Examples -/// -/// ```gleam -/// > [1, 2] |> from_list |> push_back(3) |> to_list -/// [1, 2, 3] -/// ``` -/// -pub fn push_back(onto queue: Queue(a), this item: a) -> Queue(a) { - Queue(in: [item, ..queue.in], out: queue.out) -} - -/// Pushes an element onto the front of the queue. -/// -/// # Examples -/// -/// ```gleam -/// > [0, 0] |> from_list |> push_front(1) |> to_list -/// [1, 0, 0] -/// ``` -/// -pub fn push_front(onto queue: Queue(a), this item: a) -> Queue(a) { - Queue(in: queue.in, out: [item, ..queue.out]) -} - -/// Gets the last element from the queue, returning the -/// element and a new queue without that element. -/// -/// This function typically runs in constant time, but will occasionally run in -/// linear time. -/// -/// # Examples -/// -/// ```gleam -/// > new() -/// > |> push_back(0) -/// > |> push_back(1) -/// > |> pop_back() -/// Ok(#(1, push_front(new(), 0))) -/// ``` -/// -/// ```gleam -/// > new() -/// > |> push_front(0) -/// > |> pop_back() -/// Ok(#(0, new())) -/// ``` -/// -/// ```gleam -/// > new() -/// > |> pop_back() -/// Error(Nil) -/// ``` -/// -pub fn pop_back(from queue: Queue(a)) -> Result(#(a, Queue(a)), Nil) { - case queue { - Queue(in: [], out: []) -> Error(Nil) - Queue(in: [], out: out) -> pop_back(Queue(in: list.reverse(out), out: [])) - Queue(in: [first, ..rest], out: out) -> { - let queue = Queue(in: rest, out: out) - Ok(#(first, queue)) - } - } -} - -/// Gets the first element from the queue, returning the -/// element and a new queue without that element. -/// -/// This function typically runs in constant time, but will occasionally run in -/// linear time. -/// -/// # Examples -/// -/// ```gleam -/// > queue.new() -/// > |> queue.push_front(1) -/// > |> queue.push_front(0) -/// > |> queue.pop_front() -/// Ok(#(0, queue.push_back(queue.new(), 1))) -/// ``` -/// -/// ```gleam -/// > queue.new() -/// > |> queue.push_back(0) -/// > |> queue.pop_front() -/// Ok(#(0, queue.new())) -/// ``` -/// -/// ```gleam -/// > queue.new() -/// > |> queue.pop_back() -/// Error(Nil) -/// ``` -/// -pub fn pop_front(from queue: Queue(a)) -> Result(#(a, Queue(a)), Nil) { - case queue { - Queue(in: [], out: []) -> Error(Nil) - Queue(in: in, out: []) -> pop_front(Queue(in: [], out: list.reverse(in))) - Queue(in: in, out: [first, ..rest]) -> { - let queue = Queue(in: in, out: rest) - Ok(#(first, queue)) - } - } -} - -/// Creates a new queue from a given queue containing the same elements, but in -/// the opposite order. -/// -/// This function runs in constant time. -/// -/// ## Examples -/// -/// ```gleam -/// > [] |> from_list |> reverse |> to_list -/// [] -/// ``` -/// -/// ```gleam -/// > [1] |> from_list |> reverse |> to_list -/// [1] -/// ``` -/// -/// ```gleam -/// > [1, 2] |> from_list |> reverse |> to_list -/// [2, 1] -/// ``` -/// -pub fn reverse(queue: Queue(a)) -> Queue(a) { - Queue(in: queue.out, out: queue.in) -} - -fn check_equal( - xs: List(t), - x_tail: List(t), - ys: List(t), - y_tail: List(t), - eq: fn(t, t) -> Bool, -) -> Bool { - case xs, x_tail, ys, y_tail { - [], [], [], [] -> True - [x, ..xs], _, [y, ..ys], _ -> - case eq(x, y) { - False -> False - True -> check_equal(xs, x_tail, ys, y_tail, eq) - } - [], [_, ..], _, _ -> check_equal(list.reverse(x_tail), [], ys, y_tail, eq) - _, _, [], [_, ..] -> check_equal(xs, x_tail, list.reverse(y_tail), [], eq) - _, _, _, _ -> False - } -} - -/// Checks whether two queues have equal elements in the same order, where the -/// equality of elements is determined by a given equality checking function. -/// -/// This function is useful as the internal representation may be different for -/// two queues with the same elements in the same order depending on how they -/// were constructed, so the equality operator `==` may return surprising -/// results. -/// -/// This function runs in linear time multiplied by the time taken by the -/// element equality checking function. -/// -pub fn is_logically_equal( - a: Queue(t), - to b: Queue(t), - checking element_is_equal: fn(t, t) -> Bool, -) -> Bool { - check_equal(a.out, a.in, b.out, b.in, element_is_equal) -} - -/// Checks whether two queues have the same elements in the same order. -/// -/// This function is useful as the internal representation may be different for -/// two queues with the same elements in the same order depending on how they -/// were constructed, so the equality operator `==` may return surprising -/// results. -/// -/// This function runs in linear time. -/// -pub fn is_equal(a: Queue(t), to b: Queue(t)) -> Bool { - check_equal(a.out, a.in, b.out, b.in, fn(a, b) { a == b }) -} diff --git a/build/packages/gleam_stdlib/src/gleam/regex.gleam b/build/packages/gleam_stdlib/src/gleam/regex.gleam deleted file mode 100644 index 10b09e2..0000000 --- a/build/packages/gleam_stdlib/src/gleam/regex.gleam +++ /dev/null @@ -1,214 +0,0 @@ -//// This module contains regular expression matching functions for strings. -//// The matching algorithms of the library are based on the PCRE library, but not -//// all of the PCRE library is interfaced and some parts of the library go beyond -//// what PCRE offers. Currently PCRE version 8.40 (release date 2017-01-11) is used. - -import gleam/option.{Option} - -pub type Regex - -/// The details about a particular match: -/// -pub type Match { - Match( - /// The full string of the match. - content: String, - /// A `Regex` can have subpatterns, sup-parts that are in parentheses. - submatches: List(Option(String)), - ) -} - -/// When a regular expression fails to compile: -/// -pub type CompileError { - CompileError( - /// The problem encountered that caused the compilation to fail - error: String, - /// The byte index into the string to where the problem was found - /// This value may not be correct in JavaScript environments. - byte_index: Int, - ) -} - -pub type Options { - Options(case_insensitive: Bool, multi_line: Bool) -} - -/// Creates a `Regex` with some additional options. -/// -/// ## Examples -/// -/// ```gleam -/// > let options = Options(case_insensitive: False, multi_line: True) -/// > let assert Ok(re) = compile("^[0-9]", with: options) -/// > check(re, "abc\n123") -/// True -/// ``` -/// -/// ```gleam -/// > let options = Options(case_insensitive: True, multi_line: False) -/// > let assert Ok(re) = compile("[A-Z]", with: options) -/// > check(re, "abc123") -/// True -/// ``` -/// -pub fn compile( - pattern: String, - with options: Options, -) -> Result(Regex, CompileError) { - do_compile(pattern, options) -} - -@external(erlang, "gleam_stdlib", "compile_regex") -@external(javascript, "../gleam_stdlib.mjs", "compile_regex") -fn do_compile(a: String, with with: Options) -> Result(Regex, CompileError) - -/// Creates a new `Regex`. -/// -/// ## Examples -/// -/// ```gleam -/// > let assert Ok(re) = from_string("[0-9]") -/// > check(re, "abc123") -/// True -/// ``` -/// -/// ```gleam -/// > check(re, "abcxyz") -/// False -/// ``` -/// -/// ```gleam -/// > from_string("[0-9") -/// Error( -/// CompileError( -/// error: "missing terminating ] for character class", -/// byte_index: 4 -/// ) -/// ) -/// ``` -/// -pub fn from_string(pattern: String) -> Result(Regex, CompileError) { - compile(pattern, Options(case_insensitive: False, multi_line: False)) -} - -/// Returns a boolean indicating whether there was a match or not. -/// -/// ## Examples -/// -/// ```gleam -/// > let assert Ok(re) = from_string("^f.o.?") -/// > check(with: re, content: "foo") -/// True -/// ``` -/// -/// ```gleam -/// > check(with: re, content: "boo") -/// False -/// ``` -/// -pub fn check(with regex: Regex, content content: String) -> Bool { - do_check(regex, content) -} - -@external(erlang, "gleam_stdlib", "regex_check") -@external(javascript, "../gleam_stdlib.mjs", "regex_check") -fn do_check(a: Regex, b: String) -> Bool - -/// Splits a string. -/// -/// ## Examples -/// -/// ```gleam -/// > let assert Ok(re) = from_string(" *, *") -/// > split(with: re, content: "foo,32, 4, 9 ,0") -/// ["foo", "32", "4", "9", "0"] -/// ``` -/// -pub fn split(with regex: Regex, content string: String) -> List(String) { - do_split(regex, string) -} - -@target(erlang) -@external(erlang, "gleam_stdlib", "regex_split") -fn do_split(a: Regex, b: String) -> List(String) - -@target(javascript) -fn do_split(regex, string) -> List(String) { - js_split(string, regex) -} - -@target(javascript) -@external(javascript, "../gleam_stdlib.mjs", "split") -fn js_split(a: String, b: Regex) -> List(String) - -/// Collects all matches of the regular expression. -/// -/// ## Examples -/// -/// ```gleam -/// > let assert Ok(re) = from_string("[oi]n a (\\w+)") -/// > scan(with: re, content: "I am on a boat in a lake.") -/// [ -/// Match( -/// content: "on a boat", -/// submatches: [Some("boat")] -/// ), -/// Match( -/// content: "in a lake", -/// submatches: [Some("lake")] -/// ) -/// ] -/// ``` -/// -/// ```gleam -/// > let assert Ok(re) = regex.from_string("([+|\\-])?(\\d+)(\\w+)?") -/// > scan(with: re, content: "-36") -/// [ -/// Match( -/// content: "-36", -/// submatches: [Some("-"), Some("36")] -/// ) -/// ] -/// -/// > scan(with: re, content: "36") -/// [ -/// Match( -/// content: "36", -/// submatches: [None, Some("36")] -/// ) -/// ] -/// ``` -/// -/// ```gleam -/// > let assert Ok(re) = regex.from_string("var\\s*(\\w+)\\s*(int|string)?\\s*=\\s*(.*)") -/// > scan(with: re, content: "var age = 32") -/// [ -/// Match( -/// content: "var age = 32", -/// submatches: [Some("age"), None, Some("32")] -/// ) -/// ] -/// ``` -/// -/// ```gleam -/// > let assert Ok(re) = regex.from_string("let (\\w+) = (\\w+)") -/// > scan(with: re, content: "let age = 32") -/// [ -/// Match( -/// content: "let age = 32", -/// submatches: [Some("age"), Some("32")] -/// ) -/// ] -/// -/// > scan(with: re, content: "const age = 32") -/// [] -/// ``` -/// -pub fn scan(with regex: Regex, content string: String) -> List(Match) { - do_scan(regex, string) -} - -@external(erlang, "gleam_stdlib", "regex_scan") -@external(javascript, "../gleam_stdlib.mjs", "regex_scan") -fn do_scan(a: Regex, b: String) -> List(Match) diff --git a/build/packages/gleam_stdlib/src/gleam/result.gleam b/build/packages/gleam_stdlib/src/gleam/result.gleam deleted file mode 100644 index 5941f0e..0000000 --- a/build/packages/gleam_stdlib/src/gleam/result.gleam +++ /dev/null @@ -1,483 +0,0 @@ -//// Result represents the result of something that may succeed or not. -//// `Ok` means it was successful, `Error` means it was not successful. - -import gleam/list - -/// Checks whether the result is an `Ok` value. -/// -/// ## Examples -/// -/// ```gleam -/// > is_ok(Ok(1)) -/// True -/// ``` -/// -/// ```gleam -/// > is_ok(Error(Nil)) -/// False -/// ``` -/// -pub fn is_ok(result: Result(a, e)) -> Bool { - case result { - Error(_) -> False - Ok(_) -> True - } -} - -/// Checks whether the result is an `Error` value. -/// -/// ## Examples -/// -/// ```gleam -/// > is_error(Ok(1)) -/// False -/// ``` -/// -/// ```gleam -/// > is_error(Error(Nil)) -/// True -/// ``` -/// -pub fn is_error(result: Result(a, e)) -> Bool { - case result { - Ok(_) -> False - Error(_) -> True - } -} - -/// Updates a value held within the `Ok` of a result by calling a given function -/// on it. -/// -/// If the result is an `Error` rather than `Ok` the function is not called and the -/// result stays the same. -/// -/// ## Examples -/// -/// ```gleam -/// > map(over: Ok(1), with: fn(x) { x + 1 }) -/// Ok(2) -/// ``` -/// -/// ```gleam -/// > map(over: Error(1), with: fn(x) { x + 1 }) -/// Error(1) -/// ``` -/// -pub fn map(over result: Result(a, e), with fun: fn(a) -> b) -> Result(b, e) { - case result { - Ok(x) -> Ok(fun(x)) - Error(e) -> Error(e) - } -} - -/// Updates a value held within the `Error` of a result by calling a given function -/// on it. -/// -/// If the result is `Ok` rather than `Error` the function is not called and the -/// result stays the same. -/// -/// ## Examples -/// -/// ```gleam -/// > map_error(over: Error(1), with: fn(x) { x + 1 }) -/// Error(2) -/// ``` -/// -/// ```gleam -/// > map_error(over: Ok(1), with: fn(x) { x + 1 }) -/// Ok(1) -/// ``` -/// -pub fn map_error( - over result: Result(a, e), - with fun: fn(e) -> f, -) -> Result(a, f) { - case result { - Ok(x) -> Ok(x) - Error(error) -> Error(fun(error)) - } -} - -/// Merges a nested `Result` into a single layer. -/// -/// ## Examples -/// -/// ```gleam -/// > flatten(Ok(Ok(1))) -/// Ok(1) -/// ``` -/// -/// ```gleam -/// > flatten(Ok(Error(""))) -/// Error("") -/// ``` -/// -/// ```gleam -/// > flatten(Error(Nil)) -/// Error(Nil) -/// ``` -/// -pub fn flatten(result: Result(Result(a, e), e)) -> Result(a, e) { - case result { - Ok(x) -> x - Error(error) -> Error(error) - } -} - -/// Updates a value held within the `Ok` of a result by calling a given function -/// on it, where the given function also returns a result. The two results are -/// then merged together into one result. -/// -/// If the result is an `Error` rather than `Ok` the function is not called and the -/// result stays the same. -/// -/// This function is the equivalent of calling `map` followed by `flatten`, and -/// it is useful for chaining together multiple functions that may fail. -/// -/// ## Examples -/// -/// ```gleam -/// > try(Ok(1), fn(x) { Ok(x + 1) }) -/// Ok(2) -/// ``` -/// -/// ```gleam -/// > try(Ok(1), fn(x) { Ok(#("a", x)) }) -/// Ok(#("a", 1)) -/// ``` -/// -/// ```gleam -/// > try(Ok(1), fn(_) { Error("Oh no") }) -/// Error("Oh no") -/// ``` -/// -/// ```gleam -/// > try(Error(Nil), fn(x) { Ok(x + 1) }) -/// Error(Nil) -/// ``` -/// -pub fn try( - result: Result(a, e), - apply fun: fn(a) -> Result(b, e), -) -> Result(b, e) { - case result { - Ok(x) -> fun(x) - Error(e) -> Error(e) - } -} - -/// An alias for `try`. See the documentation for that function for more information. -/// -pub fn then( - result: Result(a, e), - apply fun: fn(a) -> Result(b, e), -) -> Result(b, e) { - try(result, fun) -} - -/// Extracts the `Ok` value from a result, returning a default value if the result -/// is an `Error`. -/// -/// ## Examples -/// -/// ```gleam -/// > unwrap(Ok(1), 0) -/// 1 -/// ``` -/// -/// ```gleam -/// > unwrap(Error(""), 0) -/// 0 -/// ``` -/// -pub fn unwrap(result: Result(a, e), or default: a) -> a { - case result { - Ok(v) -> v - Error(_) -> default - } -} - -/// Extracts the `Ok` value from a result, evaluating the default function if the result -/// is an `Error`. -/// -/// ## Examples -/// -/// ```gleam -/// > lazy_unwrap(Ok(1), fn() { 0 }) -/// 1 -/// ``` -/// -/// ```gleam -/// > lazy_unwrap(Error(""), fn() { 0 }) -/// 0 -/// ``` -/// -pub fn lazy_unwrap(result: Result(a, e), or default: fn() -> a) -> a { - case result { - Ok(v) -> v - Error(_) -> default() - } -} - -/// Extracts the `Error` value from a result, returning a default value if the result -/// is an `Ok`. -/// -/// ## Examples -/// -/// ```gleam -/// > unwrap_error(Error(1), 0) -/// 1 -/// ``` -/// -/// ```gleam -/// > unwrap_error(Ok(""), 0) -/// 0 -/// ``` -/// -pub fn unwrap_error(result: Result(a, e), or default: e) -> e { - case result { - Ok(_) -> default - Error(e) -> e - } -} - -/// Extracts the inner value from a result. Both the value and error must be of -/// the same type. -/// -/// ## Examples -/// -/// ```gleam -/// > unwrap_both(Error(1)) -/// 1 -/// ``` -/// -/// ```gleam -/// > unwrap_both(Ok(2)) -/// 2 -/// ``` -/// -pub fn unwrap_both(result: Result(a, a)) -> a { - case result { - Ok(a) -> a - Error(a) -> a - } -} - -/// Transforms any error into `Error(Nil)`. -/// -/// ## Examples -/// -/// ```gleam -/// > nil_error(Error(1)) -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > nil_error(Ok(1)) -/// Ok(1) -/// ``` -/// -pub fn nil_error(result: Result(a, e)) -> Result(a, Nil) { - map_error(result, fn(_) { Nil }) -} - -/// Returns the first value if it is `Ok`, otherwise returns the second value. -/// -/// ## Examples -/// -/// ```gleam -/// > or(Ok(1), Ok(2)) -/// Ok(1) -/// ``` -/// -/// ```gleam -/// > or(Ok(1), Error("Error 2")) -/// Ok(1) -/// ``` -/// -/// ```gleam -/// > or(Error("Error 1"), Ok(2)) -/// Ok(2) -/// ``` -/// -/// ```gleam -/// > or(Error("Error 1"), Error("Error 2")) -/// Error("Error 2") -/// ``` -/// -pub fn or(first: Result(a, e), second: Result(a, e)) -> Result(a, e) { - case first { - Ok(_) -> first - Error(_) -> second - } -} - -/// Returns the first value if it is `Ok`, otherwise evaluates the given function for a fallback value. -/// -/// ## Examples -/// -/// ```gleam -/// > lazy_or(Ok(1), fn() { Ok(2) }) -/// Ok(1) -/// ``` -/// -/// ```gleam -/// > lazy_or(Ok(1), fn() { Error("Error 2") }) -/// Ok(1) -/// ``` -/// -/// ```gleam -/// > lazy_or(Error("Error 1"), fn() { Ok(2) }) -/// Ok(2) -/// ``` -/// -/// ```gleam -/// > lazy_or(Error("Error 1"), fn() { Error("Error 2") }) -/// Error("Error 2") -/// ``` -/// -pub fn lazy_or( - first: Result(a, e), - second: fn() -> Result(a, e), -) -> Result(a, e) { - case first { - Ok(_) -> first - Error(_) -> second() - } -} - -/// Combines a list of results into a single result. -/// If all elements in the list are `Ok` then returns an `Ok` holding the list of values. -/// If any element is `Error` then returns the first error. -/// -/// ## Examples -/// -/// ```gleam -/// > all([Ok(1), Ok(2)]) -/// Ok([1, 2]) -/// ``` -/// -/// ```gleam -/// > all([Ok(1), Error("e")]) -/// Error("e") -/// ``` -/// -pub fn all(results: List(Result(a, e))) -> Result(List(a), e) { - list.try_map(results, fn(x) { x }) -} - -/// Given a list of results, returns a pair where the first element is a list -/// of all the values inside `Ok` and the second element is a list with all the -/// values inside `Error`. The values in both lists appear in reverse order with -/// respect to their position in the original list of results. -/// -/// ## Examples -/// -/// ```gleam -/// > partition([Ok(1), Error("a"), Error("b"), Ok(2)]) -/// #([2, 1], ["b", "a"]) -/// ``` -/// -pub fn partition(results: List(Result(a, e))) -> #(List(a), List(e)) { - do_partition(results, [], []) -} - -fn do_partition(results: List(Result(a, e)), oks: List(a), errors: List(e)) { - case results { - [] -> #(oks, errors) - [Ok(a), ..rest] -> do_partition(rest, [a, ..oks], errors) - [Error(e), ..rest] -> do_partition(rest, oks, [e, ..errors]) - } -} - -/// Replace the value within a result -/// -/// ## Examples -/// -/// ```gleam -/// > replace(Ok(1), Nil) -/// Ok(Nil) -/// ``` -/// -/// ```gleam -/// > replace(Error(1), Nil) -/// Error(1) -/// ``` -/// -pub fn replace(result: Result(a, e), value: b) -> Result(b, e) { - case result { - Ok(_) -> Ok(value) - Error(error) -> Error(error) - } -} - -/// Replace the error within a result -/// -/// ## Examples -/// -/// ```gleam -/// > replace_error(Error(1), Nil) -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > replace_error(Ok(1), Nil) -/// Ok(1) -/// ``` -/// -pub fn replace_error(result: Result(a, e1), error: e2) -> Result(a, e2) { - case result { - Ok(x) -> Ok(x) - Error(_) -> Error(error) - } -} - -/// Given a list of results, returns only the values inside `Ok`. -/// -/// ## Examples -/// -/// ```gleam -/// > values([Ok(1), Error("a"), Ok(3)]) -/// [1, 3] -/// ``` -/// -pub fn values(results: List(Result(a, e))) -> List(a) { - list.filter_map(results, fn(r) { r }) -} - -/// Updates a value held within the `Error` of a result by calling a given function -/// on it, where the given function also returns a result. The two results are -/// then merged together into one result. -/// -/// If the result is an `Ok` rather than `Error` the function is not called and the -/// result stays the same. -/// -/// This function is useful for chaining together computations that may fail -/// and trying to recover from possible errors. -/// -/// ## Examples -/// -/// ```gleam -/// > Ok(1) |> try_recover(with: fn(_) { Error("failed to recover") }) -/// Ok(1) -/// ``` -/// -/// ```gleam -/// > Error(1) |> try_recover(with: fn(error) { Ok(error + 1) }) -/// Ok(2) -/// ``` -/// -/// ```gleam -/// > Error(1) |> try_recover(with: fn(error) { Error("failed to recover") }) -/// Error("failed to recover") -/// ``` -/// -pub fn try_recover( - result: Result(a, e), - with fun: fn(e) -> Result(a, f), -) -> Result(a, f) { - case result { - Ok(value) -> Ok(value) - Error(error) -> fun(error) - } -} diff --git a/build/packages/gleam_stdlib/src/gleam/set.gleam b/build/packages/gleam_stdlib/src/gleam/set.gleam deleted file mode 100644 index 9ca8e44..0000000 --- a/build/packages/gleam_stdlib/src/gleam/set.gleam +++ /dev/null @@ -1,264 +0,0 @@ -import gleam/list -import gleam/map.{Map} -import gleam/result - -// A list is used as the map value as an empty list has the smallest -// representation in Erlang's binary format -@target(erlang) -type Token = - List(Nil) - -@target(erlang) -const token = [] - -@target(javascript) -type Token = - Nil - -@target(javascript) -const token = Nil - -/// A set is a collection of unique members of the same type. -/// -/// It is implemented using the `gleam/map` module, so inserts and lookups have -/// logarithmic time complexity. -/// -pub opaque type Set(member) { - Set(map: Map(member, Token)) -} - -/// Creates a new empty set. -/// -pub fn new() -> Set(member) { - Set(map.new()) -} - -/// Gets the number of members in a set. -/// -/// This function runs in constant time. -/// -/// ## Examples -/// -/// ```gleam -/// > new() -/// > |> insert(1) -/// > |> insert(2) -/// > |> size -/// 2 -/// ``` -/// -pub fn size(set: Set(member)) -> Int { - map.size(set.map) -} - -/// Inserts an member into the set. -/// -/// This function runs in logarithmic time. -/// -/// ## Examples -/// -/// ```gleam -/// > new() -/// > |> insert(1) -/// > |> insert(2) -/// > |> size -/// 2 -/// ``` -/// -pub fn insert(into set: Set(member), this member: member) -> Set(member) { - Set(map: map.insert(set.map, member, token)) -} - -/// Checks whether a set contains a given member. -/// -/// This function runs in logarithmic time. -/// -/// ## Examples -/// -/// ```gleam -/// > new() -/// > |> insert(2) -/// > |> contains(2) -/// True -/// ``` -/// -/// ```gleam -/// > new() -/// > |> insert(2) -/// > |> contains(1) -/// False -/// ``` -/// -pub fn contains(in set: Set(member), this member: member) -> Bool { - set.map - |> map.get(member) - |> result.is_ok -} - -/// Removes a member from a set. If the set does not contain the member then -/// the set is returned unchanged. -/// -/// This function runs in logarithmic time. -/// -/// ## Examples -/// -/// ```gleam -/// > new() -/// > |> insert(2) -/// > |> delete(2) -/// > |> contains(1) -/// False -/// ``` -/// -pub fn delete(from set: Set(member), this member: member) -> Set(member) { - Set(map: map.delete(set.map, member)) -} - -/// Converts the set into a list of the contained members. -/// -/// The list has no specific ordering, any unintentional ordering may change in -/// future versions of Gleam or Erlang. -/// -/// This function runs in linear time. -/// -/// ## Examples -/// -/// ```gleam -/// > new() |> insert(2) |> to_list -/// [2] -/// ``` -/// -pub fn to_list(set: Set(member)) -> List(member) { - map.keys(set.map) -} - -/// Creates a new set of the members in a given list. -/// -/// This function runs in loglinear time. -/// -/// ## Examples -/// -/// ```gleam -/// > import gleam/list -/// > [1, 1, 2, 4, 3, 2] |> from_list |> to_list |> list.sort -/// [1, 3, 3, 4] -/// ``` -/// -pub fn from_list(members: List(member)) -> Set(member) { - let map = - list.fold( - over: members, - from: map.new(), - with: fn(m, k) { map.insert(m, k, token) }, - ) - Set(map) -} - -/// Combines all entries into a single value by calling a given function on each -/// one. -/// -/// Sets are not ordered so the values are not returned in any specific order. -/// Do not write code that relies on the order entries are used by this -/// function as it may change in later versions of Gleam or Erlang. -/// -/// # Examples -/// -/// ```gleam -/// > from_list([1, 3, 9]) -/// > |> fold(0, fn(member, accumulator) { accumulator + member }) -/// 13 -/// ``` -/// -pub fn fold( - over set: Set(member), - from initial: acc, - with reducer: fn(acc, member) -> acc, -) -> acc { - map.fold(over: set.map, from: initial, with: fn(a, k, _) { reducer(a, k) }) -} - -/// Creates a new set from an existing set, minus any members that a given -/// function returns `False` for. -/// -/// This function runs in loglinear time. -/// -/// ## Examples -/// -/// ```gleam -/// > import gleam/int -/// > from_list([1, 4, 6, 3, 675, 44, 67]) -/// > |> filter(for: int.is_even) -/// > |> to_list -/// [4, 6, 44] -/// ``` -/// -pub fn filter( - in set: Set(member), - for property: fn(member) -> Bool, -) -> Set(member) { - Set(map.filter(in: set.map, for: fn(m, _) { property(m) })) -} - -pub fn drop(from set: Set(member), drop disallowed: List(member)) -> Set(member) { - list.fold(over: disallowed, from: set, with: delete) -} - -/// Creates a new map from a given map, only including any members which are in -/// a given list. -/// -/// This function runs in loglinear time. -/// -/// ## Examples -/// -/// ```gleam -/// > from_list([1, 2, 3]) -/// > |> take([1, 3, 5]) -/// > |> to_list -/// [1, 3] -/// ``` -/// -pub fn take(from set: Set(member), keeping desired: List(member)) -> Set(member) { - Set(map.take(from: set.map, keeping: desired)) -} - -fn order(first: Set(member), second: Set(member)) -> #(Set(member), Set(member)) { - case map.size(first.map) > map.size(second.map) { - True -> #(first, second) - False -> #(second, first) - } -} - -/// Creates a new set that contains all members of both given sets. -/// -/// This function runs in loglinear time. -/// -/// ## Examples -/// -/// ```gleam -/// > union(from_list([1, 2]), from_list([2, 3])) |> to_list -/// [1, 2, 3] -/// ``` -/// -pub fn union(of first: Set(member), and second: Set(member)) -> Set(member) { - let #(larger, smaller) = order(first, second) - fold(over: smaller, from: larger, with: insert) -} - -/// Creates a new set that contains members that are present in both given sets. -/// -/// This function runs in loglinear time. -/// -/// ## Examples -/// -/// ```gleam -/// > intersection(from_list([1, 2]), from_list([2, 3])) |> to_list -/// [2] -/// ``` -/// -pub fn intersection( - of first: Set(member), - and second: Set(member), -) -> Set(member) { - let #(larger, smaller) = order(first, second) - take(from: larger, keeping: to_list(smaller)) -} diff --git a/build/packages/gleam_stdlib/src/gleam/string.gleam b/build/packages/gleam_stdlib/src/gleam/string.gleam deleted file mode 100644 index 39a69d3..0000000 --- a/build/packages/gleam_stdlib/src/gleam/string.gleam +++ /dev/null @@ -1,975 +0,0 @@ -//// Strings in Gleam are UTF-8 binaries. They can be written in your code as -//// text surrounded by `"double quotes"`. - -import gleam/iterator.{Iterator} -import gleam/list -import gleam/option.{None, Option, Some} -import gleam/order -import gleam/string_builder.{StringBuilder} -@target(erlang) -import gleam/bit_string -@target(erlang) -import gleam/dynamic.{Dynamic} -@target(erlang) -import gleam/result - -/// Determines if a `String` is empty. -/// -/// ## Examples -/// -/// ```gleam -/// > is_empty("") -/// True -/// ``` -/// -/// ```gleam -/// > is_empty("the world") -/// False -/// ``` -/// -pub fn is_empty(str: String) -> Bool { - str == "" -} - -/// Gets the number of grapheme clusters in a given `String`. -/// -/// This function has to iterate across the whole string to count the number of -/// graphemes, so it runs in linear time. -/// -/// ## Examples -/// -/// ```gleam -/// > length("Gleam") -/// 5 -/// ``` -/// -/// ```gleam -/// > length("ß↑e̊") -/// 3 -/// ``` -/// -/// ```gleam -/// > length("") -/// 0 -/// ``` -/// -pub fn length(string: String) -> Int { - do_length(string) -} - -@external(erlang, "string", "length") -@external(javascript, "../gleam_stdlib.mjs", "string_length") -fn do_length(a: String) -> Int - -/// Reverses a `String`. -/// -/// This function has to iterate across the whole `String` so it runs in linear -/// time. -/// -/// ## Examples -/// -/// ```gleam -/// > reverse("stressed") -/// "desserts" -/// ``` -/// -pub fn reverse(string: String) -> String { - do_reverse(string) -} - -@target(erlang) -fn do_reverse(string: String) -> String { - string - |> string_builder.from_string - |> string_builder.reverse - |> string_builder.to_string -} - -@target(javascript) -fn do_reverse(string: String) -> String { - string - |> to_graphemes - |> list.reverse - |> concat -} - -/// Creates a new `String` by replacing all occurrences of a given substring. -/// -/// ## Examples -/// -/// ```gleam -/// > replace("www.example.com", each: ".", with: "-") -/// "www-example-com" -/// ``` -/// -/// ```gleam -/// > replace("a,b,c,d,e", each: ",", with: "/") -/// "a/b/c/d/e" -/// ``` -/// -pub fn replace( - in string: String, - each pattern: String, - with substitute: String, -) -> String { - string - |> string_builder.from_string - |> string_builder.replace(each: pattern, with: substitute) - |> string_builder.to_string -} - -/// Creates a new `String` with all the graphemes in the input `String` converted to -/// lowercase. -/// -/// Useful for case-insensitive comparisons. -/// -/// ## Examples -/// -/// ```gleam -/// > lowercase("X-FILES") -/// "x-files" -/// ``` -/// -pub fn lowercase(string: String) -> String { - do_lowercase(string) -} - -@external(erlang, "string", "lowercase") -@external(javascript, "../gleam_stdlib.mjs", "lowercase") -fn do_lowercase(a: String) -> String - -/// Creates a new `String` with all the graphemes in the input `String` converted to -/// uppercase. -/// -/// Useful for case-insensitive comparisons and VIRTUAL YELLING. -/// -/// ## Examples -/// -/// ```gleam -/// > uppercase("skinner") -/// "SKINNER" -/// ``` -/// -pub fn uppercase(string: String) -> String { - do_uppercase(string) -} - -@external(erlang, "string", "uppercase") -@external(javascript, "../gleam_stdlib.mjs", "uppercase") -fn do_uppercase(a: String) -> String - -/// Compares two `String`s to see which is "larger" by comparing their graphemes. -/// -/// This does not compare the size or length of the given `String`s. -/// -/// ## Examples -/// -/// ```gleam -/// > compare("Anthony", "Anthony") -/// order.Eq -/// ``` -/// -/// ```gleam -/// > compare("A", "B") -/// order.Lt -/// ``` -/// -pub fn compare(a: String, b: String) -> order.Order { - case a == b { - True -> order.Eq - _ -> - case less_than(a, b) { - True -> order.Lt - _ -> order.Gt - } - } -} - -@external(erlang, "gleam_stdlib", "less_than") -@external(javascript, "../gleam_stdlib.mjs", "less_than") -fn less_than(a: String, b: String) -> Bool - -/// Takes a substring given a start grapheme index and a length. Negative indexes -/// are taken starting from the *end* of the list. -/// -/// ## Examples -/// -/// ```gleam -/// > slice(from: "gleam", at_index: 1, length: 2) -/// "le" -/// ``` -/// -/// ```gleam -/// > slice(from: "gleam", at_index: 1, length: 10) -/// "leam" -/// ``` -/// -/// ```gleam -/// > slice(from: "gleam", at_index: 10, length: 3) -/// "" -/// ``` -/// -/// ```gleam -/// > slice(from: "gleam", at_index: -2, length: 2) -/// "am" -/// ``` -/// -/// ```gleam -/// > slice(from: "gleam", at_index: -12, length: 2) -/// "" -/// ``` -/// -pub fn slice(from string: String, at_index idx: Int, length len: Int) -> String { - case len < 0 { - True -> "" - False -> - case idx < 0 { - True -> { - let translated_idx = length(string) + idx - case translated_idx < 0 { - True -> "" - False -> do_slice(string, translated_idx, len) - } - } - False -> do_slice(string, idx, len) - } - } -} - -@target(erlang) -@external(erlang, "string", "slice") -fn do_slice(a: String, b: Int, c: Int) -> String - -@target(javascript) -fn do_slice(string: String, idx: Int, len: Int) -> String { - string - |> to_graphemes - |> list.drop(idx) - |> list.take(len) - |> concat -} - -/// Drops contents of the first `String` that occur before the second `String`. -/// If the `from` string does not contain the `before` string, `from` is returned unchanged. -/// -/// ## Examples -/// -/// ```gleam -/// > crop(from: "The Lone Gunmen", before: "Lone") -/// "Lone Gunmen" -/// ``` -/// -pub fn crop(from string: String, before substring: String) -> String { - do_crop(string, substring) -} - -@target(erlang) -fn do_crop(string: String, substring: String) -> String { - string - |> erl_contains(substring) - |> dynamic.string() - |> result.unwrap(string) -} - -@target(erlang) -@external(erlang, "string", "find") -fn erl_contains(a: String, b: String) -> Dynamic - -@target(javascript) -@external(javascript, "../gleam_stdlib.mjs", "crop_string") -fn do_crop(a: String, b: String) -> String - -/// Drops *n* graphemes from the left side of a `String`. -/// -/// ## Examples -/// -/// ```gleam -/// > drop_left(from: "The Lone Gunmen", up_to: 2) -/// "e Lone Gunmen" -/// ``` -/// -pub fn drop_left(from string: String, up_to num_graphemes: Int) -> String { - case num_graphemes < 0 { - True -> string - False -> slice(string, num_graphemes, length(string) - num_graphemes) - } -} - -/// Drops *n* graphemes from the right side of a `String`. -/// -/// ## Examples -/// -/// ```gleam -/// > drop_right(from: "Cigarette Smoking Man", up_to: 2) -/// "Cigarette Smoking M" -/// ``` -/// -pub fn drop_right(from string: String, up_to num_graphemes: Int) -> String { - case num_graphemes < 0 { - True -> string - False -> slice(string, 0, length(string) - num_graphemes) - } -} - -/// Checks if the first `String` contains the second. -/// -/// ## Examples -/// -/// ```gleam -/// > contains(does: "theory", contain: "ory") -/// True -/// ``` -/// -/// ```gleam -/// > contains(does: "theory", contain: "the") -/// True -/// ``` -/// -/// ```gleam -/// > contains(does: "theory", contain: "THE") -/// False -/// ``` -/// -pub fn contains(does haystack: String, contain needle: String) -> Bool { - do_contains(haystack, needle) -} - -@target(erlang) -fn do_contains(haystack: String, needle: String) -> Bool { - haystack - |> erl_contains(needle) - |> dynamic.bit_string - |> result.is_ok -} - -@target(javascript) -fn do_contains(haystack: String, needle: String) -> Bool { - index_of(haystack, needle) != -1 -} - -@target(javascript) -@external(javascript, "../gleam_stdlib.mjs", "index_of") -fn index_of(a: String, b: String) -> Int - -/// Checks whether the first `String` starts with the second one. -/// -/// ## Examples -/// -/// ```gleam -/// > starts_with("theory", "ory") -/// False -/// ``` -/// -pub fn starts_with(string: String, prefix: String) -> Bool { - do_starts_with(string, prefix) -} - -@external(erlang, "gleam_stdlib", "string_starts_with") -@external(javascript, "../gleam_stdlib.mjs", "starts_with") -fn do_starts_with(a: String, b: String) -> Bool - -/// Checks whether the first `String` ends with the second one. -/// -/// ## Examples -/// -/// ```gleam -/// > ends_with("theory", "ory") -/// True -/// ``` -/// -pub fn ends_with(string: String, suffix: String) -> Bool { - do_ends_with(string, suffix) -} - -@external(erlang, "gleam_stdlib", "string_ends_with") -@external(javascript, "../gleam_stdlib.mjs", "ends_with") -fn do_ends_with(a: String, b: String) -> Bool - -/// Creates a list of `String`s by splitting a given string on a given substring. -/// -/// ## Examples -/// -/// ```gleam -/// > split("home/gleam/desktop/", on: "/") -/// ["home", "gleam", "desktop", ""] -/// ``` -/// -pub fn split(x: String, on substring: String) -> List(String) { - case substring { - "" -> to_graphemes(x) - _ -> - x - |> string_builder.from_string - |> string_builder.split(on: substring) - |> list.map(with: string_builder.to_string) - } -} - -/// Splits a `String` a single time on the given substring. -/// -/// Returns an `Error` if substring not present. -/// -/// ## Examples -/// -/// ```gleam -/// > split_once("home/gleam/desktop/", on: "/") -/// Ok(#("home", "gleam/desktop/")) -/// ``` -/// -/// ```gleam -/// > split_once("home/gleam/desktop/", on: "?") -/// Error(Nil) -/// ``` -/// -pub fn split_once( - x: String, - on substring: String, -) -> Result(#(String, String), Nil) { - do_split_once(x, substring) -} - -@target(erlang) -@external(erlang, "string", "split") -fn erl_split(a: String, b: String) -> List(String) - -@target(erlang) -fn do_split_once(x: String, substring: String) -> Result(#(String, String), Nil) { - case erl_split(x, substring) { - [first, rest] -> Ok(#(first, rest)) - _ -> Error(Nil) - } -} - -@target(javascript) -@external(javascript, "../gleam_stdlib.mjs", "split_once") -fn do_split_once( - x x: String, - substring substring: String, -) -> Result(#(String, String), Nil) - -/// Creates a new `String` by joining two `String`s together. -/// -/// This function copies both `String`s and runs in linear time. If you find -/// yourself joining `String`s frequently consider using the [`string_builder`](../gleam/string_builder.html) -/// module as it can append `String`s much faster! -/// -/// ## Examples -/// -/// ```gleam -/// > append(to: "butter", suffix: "fly") -/// "butterfly" -/// ``` -/// -pub fn append(to first: String, suffix second: String) -> String { - first - |> string_builder.from_string - |> string_builder.append(second) - |> string_builder.to_string -} - -/// Creates a new `String` by joining many `String`s together. -/// -/// This function copies both `String`s and runs in linear time. If you find -/// yourself joining `String`s frequently consider using the [`string_builder`](../gleam/string_builder.html) -/// module as it can append `String`s much faster! -/// -/// ## Examples -/// -/// ```gleam -/// > concat(["never", "the", "less"]) -/// "nevertheless" -/// ``` -/// -pub fn concat(strings: List(String)) -> String { - strings - |> string_builder.from_strings - |> string_builder.to_string -} - -/// Creates a new `String` by repeating a `String` a given number of times. -/// -/// This function runs in linear time. -/// -/// ## Examples -/// -/// ```gleam -/// > repeat("ha", times: 3) -/// "hahaha" -/// ``` -/// -pub fn repeat(string: String, times times: Int) -> String { - iterator.repeat(string) - |> iterator.take(times) - |> iterator.to_list - |> concat -} - -/// Joins many `String`s together with a given separator. -/// -/// This function runs in linear time. -/// -/// ## Examples -/// -/// ```gleam -/// > join(["home","evan","Desktop"], with: "/") -/// "home/evan/Desktop" -/// ``` -/// -pub fn join(strings: List(String), with separator: String) -> String { - do_join(strings, separator) -} - -@target(erlang) -fn do_join(strings: List(String), separator: String) -> String { - strings - |> list.intersperse(with: separator) - |> concat -} - -@target(javascript) -@external(javascript, "../gleam_stdlib.mjs", "join") -fn do_join(strings strings: List(String), string string: String) -> String - -/// Pads a `String` on the left until it has at least given number of graphemes. -/// -/// ## Examples -/// -/// ```gleam -/// > pad_left("121", to: 5, with: ".") -/// "..121" -/// ``` -/// -/// ```gleam -/// > pad_left("121", to: 3, with: ".") -/// "121" -/// ``` -/// -/// ```gleam -/// > pad_left("121", to: 2, with: ".") -/// "121" -/// ``` -/// -pub fn pad_left(string: String, to desired_length: Int, with pad_string: String) { - let current_length = length(string) - let to_pad_length = desired_length - current_length - padding(to_pad_length, pad_string) - |> iterator.append(iterator.single(string)) - |> iterator.to_list - |> concat -} - -/// Pads a `String` on the right until it has a given length. -/// -/// ## Examples -/// -/// ```gleam -/// > pad_right("123", to: 5, with: ".") -/// "123.." -/// ``` -/// -/// ```gleam -/// > pad_right("123", to: 3, with: ".") -/// "123" -/// ``` -/// -/// ```gleam -/// > pad_right("123", to: 2, with: ".") -/// "123" -/// ``` -/// -pub fn pad_right( - string: String, - to desired_length: Int, - with pad_string: String, -) { - let current_length = length(string) - let to_pad_length = desired_length - current_length - iterator.single(string) - |> iterator.append(padding(to_pad_length, pad_string)) - |> iterator.to_list - |> concat -} - -fn padding(size: Int, pad_string: String) -> Iterator(String) { - let pad_length = length(pad_string) - let num_pads = size / pad_length - let extra = size % pad_length - iterator.repeat(pad_string) - |> iterator.take(num_pads) - |> iterator.append(iterator.single(slice(pad_string, 0, extra))) -} - -/// Removes whitespace on both sides of a `String`. -/// -/// ## Examples -/// -/// ```gleam -/// > trim(" hats \n") -/// "hats" -/// ``` -/// -pub fn trim(string: String) -> String { - do_trim(string) -} - -@target(erlang) -fn do_trim(string: String) -> String { - erl_trim(string, Both) -} - -@target(erlang) -type Direction { - Leading - Trailing - Both -} - -@target(erlang) -@external(erlang, "string", "trim") -fn erl_trim(a: String, b: Direction) -> String - -@target(javascript) -@external(javascript, "../gleam_stdlib.mjs", "trim") -fn do_trim(string string: String) -> String - -/// Removes whitespace on the left of a `String`. -/// -/// ## Examples -/// -/// ```gleam -/// > trim_left(" hats \n") -/// "hats \n" -/// ``` -/// -pub fn trim_left(string: String) -> String { - do_trim_left(string) -} - -@target(erlang) -fn do_trim_left(string: String) -> String { - erl_trim(string, Leading) -} - -@target(javascript) -@external(javascript, "../gleam_stdlib.mjs", "trim_left") -fn do_trim_left(string string: String) -> String - -/// Removes whitespace on the right of a `String`. -/// -/// ## Examples -/// -/// ```gleam -/// > trim_right(" hats \n") -/// " hats" -/// ``` -/// -pub fn trim_right(string: String) -> String { - do_trim_right(string) -} - -@target(erlang) -fn do_trim_right(string: String) -> String { - erl_trim(string, Trailing) -} - -@target(javascript) -@external(javascript, "../gleam_stdlib.mjs", "trim_right") -fn do_trim_right(string string: String) -> String - -/// Splits a non-empty `String` into its first element (head) and rest (tail). -/// This lets you pattern match on `String`s exactly as you would with lists. -/// -/// ## Examples -/// -/// ```gleam -/// > pop_grapheme("gleam") -/// Ok(#("g", "leam")) -/// ``` -/// -/// ```gleam -/// > pop_grapheme("") -/// Error(Nil) -/// ``` -/// -pub fn pop_grapheme(string: String) -> Result(#(String, String), Nil) { - do_pop_grapheme(string) -} - -@external(erlang, "gleam_stdlib", "string_pop_grapheme") -@external(javascript, "../gleam_stdlib.mjs", "pop_grapheme") -fn do_pop_grapheme(string string: String) -> Result(#(String, String), Nil) - -/// Converts a `String` to a list of -/// [graphemes](https://en.wikipedia.org/wiki/Grapheme). -/// -/// ```gleam -/// > to_graphemes("abc") -/// ["a", "b", "c"] -/// ``` -/// -pub fn to_graphemes(string: String) -> List(String) { - do_to_graphemes(string, []) - |> list.reverse -} - -fn do_to_graphemes(string: String, acc: List(String)) -> List(String) { - case pop_grapheme(string) { - Ok(#(grapheme, rest)) -> do_to_graphemes(rest, [grapheme, ..acc]) - _ -> acc - } -} - -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "codepoint") -fn unsafe_int_to_utf_codepoint(a: Int) -> UtfCodepoint - -/// Converts a `String` to a `List` of `UtfCodepoint`. -/// -/// See and -/// for an -/// explanation on code points. -/// -/// ## Examples -/// -/// ```gleam -/// > "a" |> to_utf_codepoints -/// [UtfCodepoint(97)] -/// ``` -/// -/// ```gleam -/// // Semantically the same as: -/// // ["🏳", "️", "‍", "🌈"] or: -/// // [waving_white_flag, variant_selector_16, zero_width_joiner, rainbow] -/// > "🏳️‍🌈" |> to_utf_codepoints -/// [UtfCodepoint(127987), UtfCodepoint(65039), UtfCodepoint(8205), UtfCodepoint(127752)] -/// ``` -/// -pub fn to_utf_codepoints(string: String) -> List(UtfCodepoint) { - do_to_utf_codepoints(string) -} - -@target(erlang) -fn do_to_utf_codepoints(string: String) -> List(UtfCodepoint) { - do_to_utf_codepoints_impl(bit_string.from_string(string), []) - |> list.reverse -} - -@target(erlang) -fn do_to_utf_codepoints_impl( - bit_string: BitString, - acc: List(UtfCodepoint), -) -> List(UtfCodepoint) { - case bit_string { - <> -> - do_to_utf_codepoints_impl(rest, [first, ..acc]) - <<>> -> acc - } -} - -@target(javascript) -fn do_to_utf_codepoints(string: String) -> List(UtfCodepoint) { - string - |> string_to_codepoint_integer_list - |> list.map(unsafe_int_to_utf_codepoint) -} - -@target(javascript) -@external(javascript, "../gleam_stdlib.mjs", "string_to_codepoint_integer_list") -fn string_to_codepoint_integer_list(a: String) -> List(Int) - -/// Converts a `List` of `UtfCodepoint`s to a `String`. -/// -/// See and -/// for an -/// explanation on code points. -/// -/// ## Examples -/// -/// ```gleam -/// > { -/// > let assert #(Ok(a), Ok(b), Ok(c)) = #( -/// > utf_codepoint(97), -/// > utf_codepoint(98), -/// > utf_codepoint(99), -/// > ) -/// > [a, b, c] -/// > } -/// > |> from_utf_codepoints -/// "abc" -/// ``` -/// -pub fn from_utf_codepoints(utf_codepoints: List(UtfCodepoint)) -> String { - do_from_utf_codepoints(utf_codepoints) -} - -@target(erlang) -fn do_from_utf_codepoints(utf_codepoints: List(UtfCodepoint)) -> String { - let assert Ok(string) = - do_from_utf_codepoints_impl(utf_codepoints, bit_string.from_string("")) - |> bit_string.to_string - string -} - -@target(erlang) -fn do_from_utf_codepoints_impl( - utf_codepoints: List(UtfCodepoint), - acc: BitString, -) -> BitString { - case utf_codepoints { - [first, ..rest] -> - do_from_utf_codepoints_impl( - rest, - <>, - ) - [] -> acc - } -} - -@target(javascript) -fn do_from_utf_codepoints(utf_codepoints: List(UtfCodepoint)) -> String { - utf_codepoint_list_to_string(utf_codepoints) -} - -@target(javascript) -@external(javascript, "../gleam_stdlib.mjs", "utf_codepoint_list_to_string") -fn utf_codepoint_list_to_string(a: List(UtfCodepoint)) -> String - -/// Converts an integer to a `UtfCodepoint`. -/// -/// Returns an `Error` if the integer does not represent a valid UTF codepoint. -/// -pub fn utf_codepoint(value: Int) -> Result(UtfCodepoint, Nil) { - case value { - i if i > 1_114_111 -> Error(Nil) - 65_534 | 65_535 -> Error(Nil) - i if i >= 55_296 && i <= 57_343 -> Error(Nil) - i -> Ok(unsafe_int_to_utf_codepoint(i)) - } -} - -/// Converts an UtfCodepoint to its ordinal code point value. -/// -/// ## Examples -/// -/// ```gleam -/// > utf_codepoint_to_int(128013) |> to_utf_codepoint_int -/// 128013 -/// ``` -/// -pub fn utf_codepoint_to_int(cp: UtfCodepoint) -> Int { - do_utf_codepoint_to_int(cp) -} - -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "utf_codepoint_to_int") -fn do_utf_codepoint_to_int(cp cp: UtfCodepoint) -> Int - -/// Converts a `String` into `Option(String)` where an empty `String` becomes -/// `None`. -/// -/// ## Examples -/// -/// ```gleam -/// > to_option("") -/// None -/// ``` -/// -/// ```gleam -/// > to_option("hats") -/// Some("hats") -/// ``` -/// -pub fn to_option(s: String) -> Option(String) { - case s { - "" -> None - _ -> Some(s) - } -} - -/// Returns the first grapheme cluster in a given `String` and wraps it in a -/// `Result(String, Nil)`. If the `String` is empty, it returns `Error(Nil)`. -/// Otherwise, it returns `Ok(String)`. -/// -/// ## Examples -/// -/// ```gleam -/// > first("") -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > first("icecream") -/// Ok("i") -/// ``` -/// -pub fn first(s: String) -> Result(String, Nil) { - case pop_grapheme(s) { - Ok(#(first, _)) -> Ok(first) - Error(e) -> Error(e) - } -} - -/// Returns the last grapheme cluster in a given `String` and wraps it in a -/// `Result(String, Nil)`. If the `String` is empty, it returns `Error(Nil)`. -/// Otherwise, it returns `Ok(String)`. -/// -/// ## Examples -/// -/// ```gleam -/// > last("") -/// Error(Nil) -/// ``` -/// -/// ```gleam -/// > last("icecream") -/// Ok("m") -/// ``` -/// -pub fn last(s: String) -> Result(String, Nil) { - case pop_grapheme(s) { - Ok(#(first, "")) -> Ok(first) - Ok(#(_, rest)) -> Ok(slice(rest, -1, 1)) - Error(e) -> Error(e) - } -} - -/// Creates a new `String` with the first grapheme in the input `String` -/// converted to uppercase and the remaining graphemes to lowercase. -/// -/// ## Examples -/// -/// ```gleam -/// > capitalise("mamouna") -/// "Mamouna" -/// ``` -/// -pub fn capitalise(s: String) -> String { - case pop_grapheme(s) { - Ok(#(first, rest)) -> append(to: uppercase(first), suffix: lowercase(rest)) - _ -> "" - } -} - -/// Returns a `String` representation of a term in Gleam syntax. -/// -pub fn inspect(term: anything) -> String { - do_inspect(term) - |> string_builder.to_string -} - -@external(erlang, "gleam_stdlib", "inspect") -@external(javascript, "../gleam.mjs", "inspect") -fn do_inspect(term term: anything) -> StringBuilder - -/// Returns the number of bytes in a `String`. -/// -/// This function runs in constant time on Erlang and in linear time on -/// JavaScript. -/// -pub fn byte_size(string: String) -> Int { - do_byte_size(string) -} - -@external(erlang, "erlang", "byte_size") -@external(javascript, "../gleam_stdlib.mjs", "byte_size") -fn do_byte_size(a: String) -> Int diff --git a/build/packages/gleam_stdlib/src/gleam/string_builder.gleam b/build/packages/gleam_stdlib/src/gleam/string_builder.gleam deleted file mode 100644 index 5792ca8..0000000 --- a/build/packages/gleam_stdlib/src/gleam/string_builder.gleam +++ /dev/null @@ -1,298 +0,0 @@ -import gleam/list - -/// `StringBuilder` is a type used for efficiently building strings. -/// -/// When we append one string to another the strings must be copied to a -/// new location in memory so that they can sit together. This behaviour -/// enables efficient reading of the string but copying can be expensive, -/// especially if we want to join many strings together. -/// -/// `StringBuilder` is different in that it can be joined together in constant time -/// using minimal memory, and then can be efficiently converted to a string -/// using the `to_string` function. -/// -/// On Erlang this type is compatible with Erlang's iodata. On JavaScript this -/// type is compatible with normal strings. -/// -pub type StringBuilder - -/// Create an empty `StringBuilder`. Useful as the start of a pipe chaining many -/// builders together. -/// -pub fn new() -> StringBuilder { - do_from_strings([]) -} - -/// Prepends a `String` onto the start of some `StringBuilder`. -/// -/// Runs in constant time. -/// -pub fn prepend( - to builder: StringBuilder, - prefix prefix: String, -) -> StringBuilder { - append_builder(from_string(prefix), builder) -} - -/// Appends a `String` onto the end of some `StringBuilder`. -/// -/// Runs in constant time. -/// -pub fn append(to builder: StringBuilder, suffix second: String) -> StringBuilder { - append_builder(builder, from_string(second)) -} - -/// Prepends some `StringBuilder` onto the start of another. -/// -/// Runs in constant time. -/// -pub fn prepend_builder( - to builder: StringBuilder, - prefix prefix: StringBuilder, -) -> StringBuilder { - do_append(prefix, builder) -} - -/// Appends some `StringBuilder` onto the end of another. -/// -/// Runs in constant time. -/// -pub fn append_builder( - to builder: StringBuilder, - suffix suffix: StringBuilder, -) -> StringBuilder { - do_append(builder, suffix) -} - -@external(erlang, "gleam_stdlib", "iodata_append") -@external(javascript, "../gleam_stdlib.mjs", "add") -fn do_append(a: StringBuilder, b: StringBuilder) -> StringBuilder - -/// Converts a list of strings into a builder. -/// -/// Runs in constant time. -/// -pub fn from_strings(strings: List(String)) -> StringBuilder { - do_from_strings(strings) -} - -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "concat") -fn do_from_strings(a: List(String)) -> StringBuilder - -/// Joins a list of builders into a single builder. -/// -/// Runs in constant time. -/// -pub fn concat(builders: List(StringBuilder)) -> StringBuilder { - do_concat(builders) -} - -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "concat") -fn do_concat(a: List(StringBuilder)) -> StringBuilder - -/// Converts a string into a builder. -/// -/// Runs in constant time. -/// -pub fn from_string(string: String) -> StringBuilder { - do_from_string(string) -} - -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "identity") -fn do_from_string(a: String) -> StringBuilder - -/// Turns an `StringBuilder` into a `String` -/// -/// This function is implemented natively by the virtual machine and is highly -/// optimised. -/// -pub fn to_string(builder: StringBuilder) -> String { - do_to_string(builder) -} - -@external(erlang, "unicode", "characters_to_binary") -@external(javascript, "../gleam_stdlib.mjs", "identity") -fn do_to_string(a: StringBuilder) -> String - -/// Returns the size of the `StringBuilder` in bytes. -/// -pub fn byte_size(builder: StringBuilder) -> Int { - do_byte_size(builder) -} - -@external(erlang, "erlang", "iolist_size") -@external(javascript, "../gleam_stdlib.mjs", "length") -fn do_byte_size(a: StringBuilder) -> Int - -/// Joins the given builders into a new builder separated with the given string -/// -pub fn join(builders: List(StringBuilder), with sep: String) -> StringBuilder { - builders - |> list.intersperse(from_string(sep)) - |> concat -} - -/// Converts a builder to a new builder where the contents have been -/// lowercased. -/// -pub fn lowercase(builder: StringBuilder) -> StringBuilder { - do_lowercase(builder) -} - -@external(erlang, "string", "lowercase") -@external(javascript, "../gleam_stdlib.mjs", "lowercase") -fn do_lowercase(a: StringBuilder) -> StringBuilder - -/// Converts a builder to a new builder where the contents have been -/// uppercased. -/// -pub fn uppercase(builder: StringBuilder) -> StringBuilder { - do_uppercase(builder) -} - -@external(erlang, "string", "uppercase") -@external(javascript, "../gleam_stdlib.mjs", "uppercase") -fn do_uppercase(a: StringBuilder) -> StringBuilder - -/// Converts a builder to a new builder with the contents reversed. -/// -pub fn reverse(builder: StringBuilder) -> StringBuilder { - do_reverse(builder) -} - -@target(erlang) -@external(erlang, "string", "reverse") -fn do_reverse(a: StringBuilder) -> StringBuilder - -@target(javascript) -fn do_reverse(builder: StringBuilder) -> StringBuilder { - builder - |> to_string - |> do_to_graphemes - |> list.reverse - |> from_strings -} - -@target(javascript) -@external(javascript, "../gleam_stdlib.mjs", "graphemes") -fn do_to_graphemes(string string: String) -> List(String) - -/// Splits a builder on a given pattern into a list of builders. -/// -pub fn split(iodata: StringBuilder, on pattern: String) -> List(StringBuilder) { - do_split(iodata, pattern) -} - -@target(erlang) -type Direction { - All -} - -@target(erlang) -@external(erlang, "string", "split") -fn erl_split(a: StringBuilder, b: String, c: Direction) -> List(StringBuilder) - -@target(erlang) -fn do_split(iodata: StringBuilder, pattern: String) -> List(StringBuilder) { - erl_split(iodata, pattern, All) -} - -@target(javascript) -@external(javascript, "../gleam_stdlib.mjs", "split") -fn do_split( - builder builder: StringBuilder, - pattern pattern: String, -) -> List(StringBuilder) - -/// Replaces all instances of a pattern with a given string substitute. -/// -pub fn replace( - in builder: StringBuilder, - each pattern: String, - with substitute: String, -) -> StringBuilder { - do_replace(builder, pattern, substitute) -} - -@target(erlang) -fn do_replace( - iodata: StringBuilder, - pattern: String, - substitute: String, -) -> StringBuilder { - erl_replace(iodata, pattern, substitute, All) -} - -@target(erlang) -@external(erlang, "string", "replace") -fn erl_replace( - a: StringBuilder, - b: String, - c: String, - d: Direction, -) -> StringBuilder - -@target(javascript) -@external(javascript, "../gleam_stdlib.mjs", "string_replace") -fn do_replace(a: StringBuilder, b: String, c: String) -> StringBuilder - -/// Compares two builders to determine if they have the same textual content. -/// -/// Comparing two iodata using the `==` operator may return `False` even if they -/// have the same content as they may have been build in different ways, so -/// using this function is often preferred. -/// -/// ## Examples -/// -/// ```gleam -/// > from_strings(["a", "b"]) == from_string("ab") -/// False -/// ``` -/// -/// ```gleam -/// > is_equal(from_strings(["a", "b"]), from_string("ab")) -/// True -/// ``` -/// -pub fn is_equal(a: StringBuilder, b: StringBuilder) -> Bool { - do_is_equal(a, b) -} - -@external(erlang, "string", "equal") -@external(javascript, "../gleam_stdlib.mjs", "equal") -fn do_is_equal(a: StringBuilder, b: StringBuilder) -> Bool - -/// Inspects a builder to determine if it is equivalent to an empty string. -/// -/// ## Examples -/// -/// ```gleam -/// > from_string("ok") |> is_empty -/// False -/// ``` -/// -/// ```gleam -/// > from_string("") |> is_empty -/// True -/// ``` -/// -/// ```gleam -/// > from_strings([]) |> is_empty -/// True -/// ``` -/// -pub fn is_empty(builder: StringBuilder) -> Bool { - do_is_empty(builder) -} - -@target(erlang) -@external(erlang, "string", "is_empty") -fn do_is_empty(a: StringBuilder) -> Bool - -@target(javascript) -fn do_is_empty(builder: StringBuilder) -> Bool { - from_string("") == builder -} diff --git a/build/packages/gleam_stdlib/src/gleam/uri.gleam b/build/packages/gleam_stdlib/src/gleam/uri.gleam deleted file mode 100644 index 2565771..0000000 --- a/build/packages/gleam_stdlib/src/gleam/uri.gleam +++ /dev/null @@ -1,462 +0,0 @@ -//// Utilities for working with URIs -//// -//// This module provides functions for working with URIs (for example, parsing -//// URIs or encoding query strings). The functions in this module are implemented -//// according to [RFC 3986](https://tools.ietf.org/html/rfc3986). -//// -//// Query encoding (Form encoding) is defined in the -//// [W3C specification](https://www.w3.org/TR/html52/sec-forms.html#urlencoded-form-data). - -import gleam/int -import gleam/list -import gleam/option.{None, Option, Some} -import gleam/string -import gleam/string_builder.{StringBuilder} -@target(javascript) -import gleam/pair -@target(javascript) -import gleam/regex -@target(javascript) -import gleam/result - -/// Type representing holding the parsed components of an URI. -/// All components of a URI are optional, except the path. -/// -pub type Uri { - Uri( - scheme: Option(String), - userinfo: Option(String), - host: Option(String), - port: Option(Int), - path: String, - query: Option(String), - fragment: Option(String), - ) -} - -/// Parses a compliant URI string into the `Uri` Type. -/// If the string is not a valid URI string then an error is returned. -/// -/// The opposite operation is `uri.to_string`. -/// -/// ## Examples -/// -/// ```gleam -/// > parse("https://example.com:1234/a/b?query=true#fragment") -/// Ok( -/// Uri( -/// scheme: Some("https"), -/// userinfo: None, -/// host: Some("example.com"), -/// port: Some(1234), -/// path: "/a/b", -/// query: Some("query=true"), -/// fragment: Some("fragment") -/// ) -/// ) -/// ``` -/// -pub fn parse(uri_string: String) -> Result(Uri, Nil) { - do_parse(uri_string) -} - -@target(erlang) -@external(erlang, "gleam_stdlib", "uri_parse") -fn do_parse(a: String) -> Result(Uri, Nil) - -@target(javascript) -fn do_parse(uri_string: String) -> Result(Uri, Nil) { - // From https://tools.ietf.org/html/rfc3986#appendix-B - let pattern = - // 12 3 4 5 6 7 8 - "^(([a-z][a-z0-9\\+\\-\\.]*):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#.*)?" - let matches = - pattern - |> regex_submatches(uri_string) - |> pad_list(8) - - let #(scheme, authority, path, query, fragment) = case matches { - [ - _scheme_with_colon, - scheme, - authority_with_slashes, - _authority, - path, - query_with_question_mark, - _query, - fragment, - ] -> #( - scheme, - authority_with_slashes, - path, - query_with_question_mark, - fragment, - ) - _ -> #(None, None, None, None, None) - } - - let scheme = noneify_empty_string(scheme) - let path = option.unwrap(path, "") - let query = noneify_query(query) - let #(userinfo, host, port) = split_authority(authority) - let fragment = - fragment - |> option.to_result(Nil) - |> result.try(string.pop_grapheme) - |> result.map(pair.second) - |> option.from_result - let scheme = - scheme - |> noneify_empty_string - |> option.map(string.lowercase) - Ok(Uri( - scheme: scheme, - userinfo: userinfo, - host: host, - port: port, - path: path, - query: query, - fragment: fragment, - )) -} - -@target(javascript) -fn regex_submatches(pattern: String, string: String) -> List(Option(String)) { - pattern - |> regex.compile(regex.Options(case_insensitive: True, multi_line: False)) - |> result.nil_error - |> result.map(regex.scan(_, string)) - |> result.try(list.first) - |> result.map(fn(m: regex.Match) { m.submatches }) - |> result.unwrap([]) -} - -@target(javascript) -fn noneify_query(x: Option(String)) -> Option(String) { - case x { - None -> None - Some(x) -> - case string.pop_grapheme(x) { - Ok(#("?", query)) -> Some(query) - _ -> None - } - } -} - -@target(javascript) -fn noneify_empty_string(x: Option(String)) -> Option(String) { - case x { - Some("") | None -> None - Some(_) -> x - } -} - -// Split an authority into its userinfo, host and port parts. -@target(javascript) -fn split_authority( - authority: Option(String), -) -> #(Option(String), Option(String), Option(Int)) { - case option.unwrap(authority, "") { - "" -> #(None, None, None) - "//" -> #(None, Some(""), None) - authority -> { - let matches = - "^(//)?((.*)@)?(\\[[a-zA-Z0-9:.]*\\]|[^:]*)(:(\\d*))?" - |> regex_submatches(authority) - |> pad_list(6) - case matches { - [_, _, userinfo, host, _, port] -> { - let userinfo = noneify_empty_string(userinfo) - let host = noneify_empty_string(host) - let port = - port - |> option.unwrap("") - |> int.parse - |> option.from_result - #(userinfo, host, port) - } - _ -> #(None, None, None) - } - } - } -} - -@target(javascript) -fn pad_list(list: List(Option(a)), size: Int) -> List(Option(a)) { - list - |> list.append(list.repeat(None, extra_required(list, size))) -} - -@target(javascript) -fn extra_required(list: List(a), remaining: Int) -> Int { - case list { - _ if remaining == 0 -> 0 - [] -> remaining - [_, ..xs] -> extra_required(xs, remaining - 1) - } -} - -/// Parses an urlencoded query string into a list of key value pairs. -/// Returns an error for invalid encoding. -/// -/// The opposite operation is `uri.query_to_string`. -/// -/// ## Examples -/// -/// ```gleam -/// > parse_query("a=1&b=2") -/// Ok([#("a", "1"), #("b", "2")]) -/// ``` -/// -pub fn parse_query(query: String) -> Result(List(#(String, String)), Nil) { - do_parse_query(query) -} - -@external(erlang, "gleam_stdlib", "parse_query") -@external(javascript, "../gleam_stdlib.mjs", "parse_query") -fn do_parse_query(a: String) -> Result(List(#(String, String)), Nil) - -/// Encodes a list of key value pairs as a URI query string. -/// -/// The opposite operation is `uri.parse_query`. -/// -/// ## Examples -/// -/// ```gleam -/// > query_to_string([#("a", "1"), #("b", "2")]) -/// "a=1&b=2" -/// ``` -/// -pub fn query_to_string(query: List(#(String, String))) -> String { - query - |> list.map(query_pair) - |> list.intersperse(string_builder.from_string("&")) - |> string_builder.concat - |> string_builder.to_string -} - -fn query_pair(pair: #(String, String)) -> StringBuilder { - string_builder.from_strings([ - percent_encode(pair.0), - "=", - percent_encode(pair.1), - ]) -} - -/// Encodes a string into a percent encoded representation. -/// -/// ## Examples -/// -/// ```gleam -/// > percent_encode("100% great") -/// "100%25%20great" -/// ``` -/// -pub fn percent_encode(value: String) -> String { - do_percent_encode(value) -} - -@external(erlang, "gleam_stdlib", "percent_encode") -@external(javascript, "../gleam_stdlib.mjs", "percent_encode") -fn do_percent_encode(a: String) -> String - -/// Decodes a percent encoded string. -/// -/// ## Examples -/// -/// ```gleam -/// > percent_decode("100%25+great") -/// Ok("100% great") -/// ``` -/// -pub fn percent_decode(value: String) -> Result(String, Nil) { - do_percent_decode(value) -} - -@external(erlang, "gleam_stdlib", "percent_decode") -@external(javascript, "../gleam_stdlib.mjs", "percent_decode") -fn do_percent_decode(a: String) -> Result(String, Nil) - -fn do_remove_dot_segments( - input: List(String), - accumulator: List(String), -) -> List(String) { - case input { - [] -> list.reverse(accumulator) - [segment, ..rest] -> { - let accumulator = case segment, accumulator { - "", accumulator -> accumulator - ".", accumulator -> accumulator - "..", [] -> [] - "..", [_, ..accumulator] -> accumulator - segment, accumulator -> [segment, ..accumulator] - } - do_remove_dot_segments(rest, accumulator) - } - } -} - -fn remove_dot_segments(input: List(String)) -> List(String) { - do_remove_dot_segments(input, []) -} - -/// Splits the path section of a URI into it's constituent segments. -/// -/// Removes empty segments and resolves dot-segments as specified in -/// [section 5.2](https://www.ietf.org/rfc/rfc3986.html#section-5.2) of the RFC. -/// -/// ## Examples -/// -/// ```gleam -/// > path_segments("/users/1") -/// ["users" ,"1"] -/// ``` -/// -pub fn path_segments(path: String) -> List(String) { - remove_dot_segments(string.split(path, "/")) -} - -/// Encodes a `Uri` value as a URI string. -/// -/// The opposite operation is `uri.parse`. -/// -/// ## Examples -/// -/// ```gleam -/// > let uri = Uri(Some("http"), None, Some("example.com"), ...) -/// > to_string(uri) -/// "http://example.com" -/// ``` -/// -pub fn to_string(uri: Uri) -> String { - let parts = case uri.fragment { - Some(fragment) -> ["#", fragment] - _ -> [] - } - let parts = case uri.query { - Some(query) -> ["?", query, ..parts] - _ -> parts - } - let parts = [uri.path, ..parts] - let parts = case uri.host, string.starts_with(uri.path, "/") { - Some(host), False if host != "" -> ["/", ..parts] - _, _ -> parts - } - let parts = case uri.host, uri.port { - Some(_), Some(port) -> [":", int.to_string(port), ..parts] - _, _ -> parts - } - let parts = case uri.scheme, uri.userinfo, uri.host { - Some(s), Some(u), Some(h) -> [s, "://", u, "@", h, ..parts] - Some(s), None, Some(h) -> [s, "://", h, ..parts] - Some(s), Some(_), None | Some(s), None, None -> [s, ":", ..parts] - None, None, Some(h) -> ["//", h, ..parts] - None, Some(_), None | None, None, None -> parts - } - string.concat(parts) -} - -/// Fetches the origin of a URI. -/// -/// Returns the origin of a uri as defined in -/// [RFC 6454](https://tools.ietf.org/html/rfc6454) -/// -/// The supported URI schemes are `http` and `https`. -/// URLs without a scheme will return `Error`. -/// -/// ## Examples -/// -/// ```gleam -/// > let assert Ok(uri) = parse("http://example.com/path?foo#bar") -/// > origin(uri) -/// Ok("http://example.com") -/// ``` -/// -pub fn origin(uri: Uri) -> Result(String, Nil) { - let Uri(scheme: scheme, host: host, port: port, ..) = uri - case scheme { - Some("https") if port == Some(443) -> { - let origin = Uri(scheme, None, host, None, "", None, None) - Ok(to_string(origin)) - } - Some("http") if port == Some(80) -> { - let origin = Uri(scheme, None, host, None, "", None, None) - Ok(to_string(origin)) - } - Some(s) if s == "http" || s == "https" -> { - let origin = Uri(scheme, None, host, port, "", None, None) - Ok(to_string(origin)) - } - _ -> Error(Nil) - } -} - -fn drop_last(elements: List(a)) -> List(a) { - list.take(from: elements, up_to: list.length(elements) - 1) -} - -fn join_segments(segments: List(String)) -> String { - string.join(["", ..segments], "/") -} - -/// Resolves a URI with respect to the given base URI. -/// -/// The base URI must be an absolute URI or this function will return an error. -/// The algorithm for merging uris is described in -/// [RFC 3986](https://tools.ietf.org/html/rfc3986#section-5.2). -/// -pub fn merge(base: Uri, relative: Uri) -> Result(Uri, Nil) { - case base { - Uri(scheme: Some(_), host: Some(_), ..) -> - case relative { - Uri(host: Some(_), ..) -> { - let path = - string.split(relative.path, "/") - |> remove_dot_segments() - |> join_segments() - let resolved = - Uri( - option.or(relative.scheme, base.scheme), - None, - relative.host, - option.or(relative.port, base.port), - path, - relative.query, - relative.fragment, - ) - Ok(resolved) - } - Uri(scheme: None, host: None, ..) -> { - let #(new_path, new_query) = case relative.path { - "" -> #(base.path, option.or(relative.query, base.query)) - _ -> { - let path_segments = case string.starts_with(relative.path, "/") { - True -> string.split(relative.path, "/") - False -> - string.split(base.path, "/") - |> drop_last() - |> list.append(string.split(relative.path, "/")) - } - let path = - path_segments - |> remove_dot_segments() - |> join_segments() - #(path, relative.query) - } - } - let resolved = - Uri( - base.scheme, - None, - base.host, - base.port, - new_path, - new_query, - relative.fragment, - ) - Ok(resolved) - } - } - _ -> Error(Nil) - } -} diff --git a/build/packages/gleam_stdlib/src/gleam@base.erl b/build/packages/gleam_stdlib/src/gleam@base.erl deleted file mode 100644 index 1ebe7c7..0000000 --- a/build/packages/gleam_stdlib/src/gleam@base.erl +++ /dev/null @@ -1,45 +0,0 @@ --module(gleam@base). --compile([no_auto_import, nowarn_unused_vars]). - --export([encode64/2, decode64/1, url_encode64/2, url_decode64/1]). - --spec encode64(bitstring(), boolean()) -> binary(). -encode64(Input, Padding) -> - Encoded = base64:encode(Input), - case Padding of - true -> - Encoded; - - false -> - gleam@string:replace(Encoded, <<"="/utf8>>, <<""/utf8>>) - end. - --spec decode64(binary()) -> {ok, bitstring()} | {error, nil}. -decode64(Encoded) -> - Padded = case gleam@bit_string:byte_size( - gleam@bit_string:from_string(Encoded) - ) - rem 4 of - 0 -> - Encoded; - - N -> - gleam@string:append( - Encoded, - gleam@string:repeat(<<"="/utf8>>, 4 - N) - ) - end, - gleam_stdlib:base_decode64(Padded). - --spec url_encode64(bitstring(), boolean()) -> binary(). -url_encode64(Input, Padding) -> - _pipe = encode64(Input, Padding), - _pipe@1 = gleam@string:replace(_pipe, <<"+"/utf8>>, <<"-"/utf8>>), - gleam@string:replace(_pipe@1, <<"/"/utf8>>, <<"_"/utf8>>). - --spec url_decode64(binary()) -> {ok, bitstring()} | {error, nil}. -url_decode64(Encoded) -> - _pipe = Encoded, - _pipe@1 = gleam@string:replace(_pipe, <<"-"/utf8>>, <<"+"/utf8>>), - _pipe@2 = gleam@string:replace(_pipe@1, <<"_"/utf8>>, <<"/"/utf8>>), - decode64(_pipe@2). diff --git a/build/packages/gleam_stdlib/src/gleam@bit_builder.erl b/build/packages/gleam_stdlib/src/gleam@bit_builder.erl deleted file mode 100644 index 8cc9d32..0000000 --- a/build/packages/gleam_stdlib/src/gleam@bit_builder.erl +++ /dev/null @@ -1,63 +0,0 @@ --module(gleam@bit_builder). --compile([no_auto_import, nowarn_unused_vars]). - --export([append_builder/2, prepend_builder/2, new/0, concat/1, concat_bit_strings/1, from_string/1, prepend_string/2, append_string/2, from_string_builder/1, from_bit_string/1, prepend/2, append/2, to_bit_string/1, byte_size/1]). --export_type([bit_builder/0]). - --type bit_builder() :: any(). - --spec append_builder(bit_builder(), bit_builder()) -> bit_builder(). -append_builder(First, Second) -> - gleam_stdlib:iodata_append(First, Second). - --spec prepend_builder(bit_builder(), bit_builder()) -> bit_builder(). -prepend_builder(To, Prefix) -> - append_builder(Prefix, To). - --spec new() -> bit_builder(). -new() -> - gleam_stdlib:identity([]). - --spec concat(list(bit_builder())) -> bit_builder(). -concat(Builders) -> - gleam_stdlib:identity(Builders). - --spec concat_bit_strings(list(bitstring())) -> bit_builder(). -concat_bit_strings(Bits) -> - gleam_stdlib:identity(Bits). - --spec from_string(binary()) -> bit_builder(). -from_string(String) -> - gleam_stdlib:wrap_list(String). - --spec prepend_string(bit_builder(), binary()) -> bit_builder(). -prepend_string(To, Prefix) -> - append_builder(from_string(Prefix), To). - --spec append_string(bit_builder(), binary()) -> bit_builder(). -append_string(To, Suffix) -> - append_builder(To, from_string(Suffix)). - --spec from_string_builder(gleam@string_builder:string_builder()) -> bit_builder(). -from_string_builder(Builder) -> - gleam_stdlib:wrap_list(Builder). - --spec from_bit_string(bitstring()) -> bit_builder(). -from_bit_string(Bits) -> - gleam_stdlib:wrap_list(Bits). - --spec prepend(bit_builder(), bitstring()) -> bit_builder(). -prepend(To, Prefix) -> - append_builder(from_bit_string(Prefix), To). - --spec append(bit_builder(), bitstring()) -> bit_builder(). -append(To, Suffix) -> - append_builder(To, from_bit_string(Suffix)). - --spec to_bit_string(bit_builder()) -> bitstring(). -to_bit_string(Builder) -> - erlang:list_to_bitstring(Builder). - --spec byte_size(bit_builder()) -> integer(). -byte_size(Builder) -> - erlang:iolist_size(Builder). diff --git a/build/packages/gleam_stdlib/src/gleam@bit_string.erl b/build/packages/gleam_stdlib/src/gleam@bit_string.erl deleted file mode 100644 index f3ce77a..0000000 --- a/build/packages/gleam_stdlib/src/gleam@bit_string.erl +++ /dev/null @@ -1,56 +0,0 @@ --module(gleam@bit_string). --compile([no_auto_import, nowarn_unused_vars]). - --export([from_string/1, byte_size/1, slice/3, is_utf8/1, to_string/1, concat/1, append/2]). - --spec from_string(binary()) -> bitstring(). -from_string(X) -> - gleam_stdlib:identity(X). - --spec byte_size(bitstring()) -> integer(). -byte_size(X) -> - erlang:byte_size(X). - --spec slice(bitstring(), integer(), integer()) -> {ok, bitstring()} | - {error, nil}. -slice(String, Position, Length) -> - gleam_stdlib:bit_string_slice(String, Position, Length). - --spec do_is_utf8(bitstring()) -> boolean(). -do_is_utf8(Bits) -> - case Bits of - <<>> -> - true; - - <<_/utf8, Rest/binary>> -> - do_is_utf8(Rest); - - _ -> - false - end. - --spec is_utf8(bitstring()) -> boolean(). -is_utf8(Bits) -> - do_is_utf8(Bits). - --spec do_to_string(bitstring()) -> {ok, binary()} | {error, nil}. -do_to_string(Bits) -> - case is_utf8(Bits) of - true -> - {ok, gleam_stdlib:identity(Bits)}; - - false -> - {error, nil} - end. - --spec to_string(bitstring()) -> {ok, binary()} | {error, nil}. -to_string(Bits) -> - do_to_string(Bits). - --spec concat(list(bitstring())) -> bitstring(). -concat(Bit_strings) -> - gleam_stdlib:bit_string_concat(Bit_strings). - --spec append(bitstring(), bitstring()) -> bitstring(). -append(First, Second) -> - concat([First, Second]). diff --git a/build/packages/gleam_stdlib/src/gleam@bool.erl b/build/packages/gleam_stdlib/src/gleam@bool.erl deleted file mode 100644 index c3e94a7..0000000 --- a/build/packages/gleam_stdlib/src/gleam@bool.erl +++ /dev/null @@ -1,152 +0,0 @@ --module(gleam@bool). --compile([no_auto_import, nowarn_unused_vars]). - --export(['and'/2, 'or'/2, negate/1, nor/2, nand/2, exclusive_or/2, exclusive_nor/2, compare/2, max/2, min/2, to_int/1, to_string/1, guard/3]). - --spec 'and'(boolean(), boolean()) -> boolean(). -'and'(A, B) -> - A andalso B. - --spec 'or'(boolean(), boolean()) -> boolean(). -'or'(A, B) -> - A orelse B. - --spec negate(boolean()) -> boolean(). -negate(Bool) -> - case Bool of - true -> - false; - - false -> - true - end. - --spec nor(boolean(), boolean()) -> boolean(). -nor(A, B) -> - case {A, B} of - {false, false} -> - true; - - {false, true} -> - false; - - {true, false} -> - false; - - {true, true} -> - false - end. - --spec nand(boolean(), boolean()) -> boolean(). -nand(A, B) -> - case {A, B} of - {false, false} -> - true; - - {false, true} -> - true; - - {true, false} -> - true; - - {true, true} -> - false - end. - --spec exclusive_or(boolean(), boolean()) -> boolean(). -exclusive_or(A, B) -> - case {A, B} of - {false, false} -> - false; - - {false, true} -> - true; - - {true, false} -> - true; - - {true, true} -> - false - end. - --spec exclusive_nor(boolean(), boolean()) -> boolean(). -exclusive_nor(A, B) -> - case {A, B} of - {false, false} -> - true; - - {false, true} -> - false; - - {true, false} -> - false; - - {true, true} -> - true - end. - --spec compare(boolean(), boolean()) -> gleam@order:order(). -compare(A, B) -> - case {A, B} of - {true, true} -> - eq; - - {true, false} -> - gt; - - {false, false} -> - eq; - - {false, true} -> - lt - end. - --spec max(boolean(), boolean()) -> boolean(). -max(A, B) -> - case A of - true -> - true; - - false -> - B - end. - --spec min(boolean(), boolean()) -> boolean(). -min(A, B) -> - case A of - false -> - false; - - true -> - B - end. - --spec to_int(boolean()) -> integer(). -to_int(Bool) -> - case Bool of - false -> - 0; - - true -> - 1 - end. - --spec to_string(boolean()) -> binary(). -to_string(Bool) -> - case Bool of - false -> - <<"False"/utf8>>; - - true -> - <<"True"/utf8>> - end. - --spec guard(boolean(), ETF, fun(() -> ETF)) -> ETF. -guard(Requirement, Consequence, Alternative) -> - case Requirement of - true -> - Consequence; - - false -> - Alternative() - end. diff --git a/build/packages/gleam_stdlib/src/gleam@dynamic.erl b/build/packages/gleam_stdlib/src/gleam@dynamic.erl deleted file mode 100644 index 0576be4..0000000 --- a/build/packages/gleam_stdlib/src/gleam@dynamic.erl +++ /dev/null @@ -1,796 +0,0 @@ --module(gleam@dynamic). --compile([no_auto_import, nowarn_unused_vars]). - --export([from/1, unsafe_coerce/1, dynamic/1, bit_string/1, classify/1, int/1, float/1, bool/1, shallow_list/1, optional/1, any/1, decode1/2, result/2, list/1, string/1, field/2, optional_field/2, element/2, tuple2/2, tuple3/3, tuple4/4, tuple5/5, tuple6/6, map/2, decode2/3, decode3/4, decode4/5, decode5/6, decode6/7, decode7/8, decode8/9, decode9/10]). --export_type([dynamic_/0, decode_error/0, unknown_tuple/0]). - --type dynamic_() :: any(). - --type decode_error() :: {decode_error, binary(), binary(), list(binary())}. - --type unknown_tuple() :: any(). - --spec from(any()) -> dynamic_(). -from(A) -> - gleam_stdlib:identity(A). - --spec unsafe_coerce(dynamic_()) -> any(). -unsafe_coerce(A) -> - gleam_stdlib:identity(A). - --spec dynamic(dynamic_()) -> {ok, dynamic_()} | {error, list(decode_error())}. -dynamic(Value) -> - {ok, Value}. - --spec bit_string(dynamic_()) -> {ok, bitstring()} | - {error, list(decode_error())}. -bit_string(Data) -> - gleam_stdlib:decode_bit_string(Data). - --spec put_expected(decode_error(), binary()) -> decode_error(). -put_expected(Error, Expected) -> - erlang:setelement(2, Error, Expected). - --spec classify(dynamic_()) -> binary(). -classify(Data) -> - gleam_stdlib:classify_dynamic(Data). - --spec int(dynamic_()) -> {ok, integer()} | {error, list(decode_error())}. -int(Data) -> - gleam_stdlib:decode_int(Data). - --spec float(dynamic_()) -> {ok, float()} | {error, list(decode_error())}. -float(Data) -> - gleam_stdlib:decode_float(Data). - --spec bool(dynamic_()) -> {ok, boolean()} | {error, list(decode_error())}. -bool(Data) -> - gleam_stdlib:decode_bool(Data). - --spec shallow_list(dynamic_()) -> {ok, list(dynamic_())} | - {error, list(decode_error())}. -shallow_list(Value) -> - gleam_stdlib:decode_list(Value). - --spec optional(fun((dynamic_()) -> {ok, CUI} | {error, list(decode_error())})) -> fun((dynamic_()) -> {ok, - gleam@option:option(CUI)} | - {error, list(decode_error())}). -optional(Decode) -> - fun(Value) -> gleam_stdlib:decode_option(Value, Decode) end. - --spec at_least_decode_tuple_error(integer(), dynamic_()) -> {ok, any()} | - {error, list(decode_error())}. -at_least_decode_tuple_error(Size, Data) -> - S = case Size of - 1 -> - <<""/utf8>>; - - _ -> - <<"s"/utf8>> - end, - Error = begin - _pipe = [<<"Tuple of at least "/utf8>>, - gleam@int:to_string(Size), - <<" element"/utf8>>, - S], - _pipe@1 = gleam@string_builder:from_strings(_pipe), - _pipe@2 = gleam@string_builder:to_string(_pipe@1), - {decode_error, _pipe@2, classify(Data), []} - end, - {error, [Error]}. - --spec any(list(fun((dynamic_()) -> {ok, CYI} | {error, list(decode_error())}))) -> fun((dynamic_()) -> {ok, - CYI} | - {error, list(decode_error())}). -any(Decoders) -> - fun(Data) -> case Decoders of - [] -> - {error, - [{decode_error, <<"another type"/utf8>>, classify(Data), []}]}; - - [Decoder | Decoders@1] -> - case Decoder(Data) of - {ok, Decoded} -> - {ok, Decoded}; - - {error, _} -> - (any(Decoders@1))(Data) - end - end end. - --spec all_errors({ok, any()} | {error, list(decode_error())}) -> list(decode_error()). -all_errors(Result) -> - case Result of - {ok, _} -> - []; - - {error, Errors} -> - Errors - end. - --spec decode1( - fun((CYM) -> CYN), - fun((dynamic_()) -> {ok, CYM} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, CYN} | {error, list(decode_error())}). -decode1(Constructor, T1) -> - fun(Value) -> case T1(Value) of - {ok, A} -> - {ok, Constructor(A)}; - - A@1 -> - {error, all_errors(A@1)} - end end. - --spec push_path(decode_error(), any()) -> decode_error(). -push_path(Error, Name) -> - Name@1 = from(Name), - Decoder = any( - [fun string/1, - fun(X) -> gleam@result:map(int(X), fun gleam@int:to_string/1) end] - ), - Name@3 = case Decoder(Name@1) of - {ok, Name@2} -> - Name@2; - - {error, _} -> - _pipe = [<<"<"/utf8>>, classify(Name@1), <<">"/utf8>>], - _pipe@1 = gleam@string_builder:from_strings(_pipe), - gleam@string_builder:to_string(_pipe@1) - end, - erlang:setelement(4, Error, [Name@3 | erlang:element(4, Error)]). - --spec result( - fun((dynamic_()) -> {ok, CTW} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CTY} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, {ok, CTW} | {error, CTY}} | - {error, list(decode_error())}). -result(Decode_ok, Decode_error) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_result(Value), - fun(Inner_result) -> case Inner_result of - {ok, Raw} -> - gleam@result:'try'( - begin - _pipe = Decode_ok(Raw), - map_errors( - _pipe, - fun(_capture) -> - push_path(_capture, <<"ok"/utf8>>) - end - ) - end, - fun(Value@1) -> {ok, {ok, Value@1}} end - ); - - {error, Raw@1} -> - gleam@result:'try'( - begin - _pipe@1 = Decode_error(Raw@1), - map_errors( - _pipe@1, - fun(_capture@1) -> - push_path(_capture@1, <<"error"/utf8>>) - end - ) - end, - fun(Value@2) -> {ok, {error, Value@2}} end - ) - end end - ) - end. - --spec list(fun((dynamic_()) -> {ok, CUD} | {error, list(decode_error())})) -> fun((dynamic_()) -> {ok, - list(CUD)} | - {error, list(decode_error())}). -list(Decoder_type) -> - fun(Dynamic) -> - gleam@result:'try'(shallow_list(Dynamic), fun(List) -> _pipe = List, - _pipe@1 = gleam@list:try_map(_pipe, Decoder_type), - map_errors( - _pipe@1, - fun(_capture) -> push_path(_capture, <<"*"/utf8>>) end - ) end) - end. - --spec map_errors( - {ok, CSR} | {error, list(decode_error())}, - fun((decode_error()) -> decode_error()) -) -> {ok, CSR} | {error, list(decode_error())}. -map_errors(Result, F) -> - gleam@result:map_error( - Result, - fun(_capture) -> gleam@list:map(_capture, F) end - ). - --spec decode_string(dynamic_()) -> {ok, binary()} | - {error, list(decode_error())}. -decode_string(Data) -> - _pipe = bit_string(Data), - _pipe@1 = map_errors( - _pipe, - fun(_capture) -> put_expected(_capture, <<"String"/utf8>>) end - ), - gleam@result:'try'( - _pipe@1, - fun(Raw) -> case gleam@bit_string:to_string(Raw) of - {ok, String} -> - {ok, String}; - - {error, nil} -> - {error, - [{decode_error, - <<"String"/utf8>>, - <<"BitString"/utf8>>, - []}]} - end end - ). - --spec string(dynamic_()) -> {ok, binary()} | {error, list(decode_error())}. -string(Data) -> - decode_string(Data). - --spec field( - any(), - fun((dynamic_()) -> {ok, CUS} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, CUS} | {error, list(decode_error())}). -field(Name, Inner_type) -> - fun(Value) -> - Missing_field_error = {decode_error, - <<"field"/utf8>>, - <<"nothing"/utf8>>, - []}, - gleam@result:'try'( - gleam_stdlib:decode_field(Value, Name), - fun(Maybe_inner) -> _pipe = Maybe_inner, - _pipe@1 = gleam@option:to_result(_pipe, [Missing_field_error]), - _pipe@2 = gleam@result:'try'(_pipe@1, Inner_type), - map_errors( - _pipe@2, - fun(_capture) -> push_path(_capture, Name) end - ) end - ) - end. - --spec optional_field( - any(), - fun((dynamic_()) -> {ok, CUW} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, gleam@option:option(CUW)} | - {error, list(decode_error())}). -optional_field(Name, Inner_type) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_field(Value, Name), - fun(Maybe_inner) -> case Maybe_inner of - none -> - {ok, none}; - - {some, Dynamic_inner} -> - _pipe = Dynamic_inner, - _pipe@1 = gleam_stdlib:decode_option(_pipe, Inner_type), - map_errors( - _pipe@1, - fun(_capture) -> push_path(_capture, Name) end - ) - end end - ) - end. - --spec element( - integer(), - fun((dynamic_()) -> {ok, CVE} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, CVE} | {error, list(decode_error())}). -element(Index, Inner_type) -> - fun(Data) -> - gleam@result:'try'( - gleam_stdlib:decode_tuple(Data), - fun(Tuple) -> - Size = gleam_stdlib:size_of_tuple(Tuple), - gleam@result:'try'(case Index >= 0 of - true -> - case Index < Size of - true -> - gleam_stdlib:tuple_get(Tuple, Index); - - false -> - at_least_decode_tuple_error(Index + 1, Data) - end; - - false -> - case gleam@int:absolute_value(Index) =< Size of - true -> - gleam_stdlib:tuple_get(Tuple, Size + Index); - - false -> - at_least_decode_tuple_error( - gleam@int:absolute_value(Index), - Data - ) - end - end, fun(Data@1) -> _pipe = Inner_type(Data@1), - map_errors( - _pipe, - fun(_capture) -> push_path(_capture, Index) end - ) end) - end - ) - end. - --spec tuple_errors({ok, any()} | {error, list(decode_error())}, binary()) -> list(decode_error()). -tuple_errors(Result, Name) -> - case Result of - {ok, _} -> - []; - - {error, Errors} -> - gleam@list:map( - Errors, - fun(_capture) -> push_path(_capture, Name) end - ) - end. - --spec tuple2( - fun((dynamic_()) -> {ok, CWE} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CWG} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, {CWE, CWG}} | {error, list(decode_error())}). -tuple2(Decode1, Decode2) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_tuple2(Value), - fun(_use0) -> - {A, B} = _use0, - case {Decode1(A), Decode2(B)} of - {{ok, A@1}, {ok, B@1}} -> - {ok, {A@1, B@1}}; - - {A@2, B@2} -> - _pipe = tuple_errors(A@2, <<"0"/utf8>>), - _pipe@1 = gleam@list:append( - _pipe, - tuple_errors(B@2, <<"1"/utf8>>) - ), - {error, _pipe@1} - end - end - ) - end. - --spec tuple3( - fun((dynamic_()) -> {ok, CWJ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CWL} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CWN} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, {CWJ, CWL, CWN}} | {error, list(decode_error())}). -tuple3(Decode1, Decode2, Decode3) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_tuple3(Value), - fun(_use0) -> - {A, B, C} = _use0, - case {Decode1(A), Decode2(B), Decode3(C)} of - {{ok, A@1}, {ok, B@1}, {ok, C@1}} -> - {ok, {A@1, B@1, C@1}}; - - {A@2, B@2, C@2} -> - _pipe = tuple_errors(A@2, <<"0"/utf8>>), - _pipe@1 = gleam@list:append( - _pipe, - tuple_errors(B@2, <<"1"/utf8>>) - ), - _pipe@2 = gleam@list:append( - _pipe@1, - tuple_errors(C@2, <<"2"/utf8>>) - ), - {error, _pipe@2} - end - end - ) - end. - --spec tuple4( - fun((dynamic_()) -> {ok, CWQ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CWS} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CWU} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CWW} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, {CWQ, CWS, CWU, CWW}} | - {error, list(decode_error())}). -tuple4(Decode1, Decode2, Decode3, Decode4) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_tuple4(Value), - fun(_use0) -> - {A, B, C, D} = _use0, - case {Decode1(A), Decode2(B), Decode3(C), Decode4(D)} of - {{ok, A@1}, {ok, B@1}, {ok, C@1}, {ok, D@1}} -> - {ok, {A@1, B@1, C@1, D@1}}; - - {A@2, B@2, C@2, D@2} -> - _pipe = tuple_errors(A@2, <<"0"/utf8>>), - _pipe@1 = gleam@list:append( - _pipe, - tuple_errors(B@2, <<"1"/utf8>>) - ), - _pipe@2 = gleam@list:append( - _pipe@1, - tuple_errors(C@2, <<"2"/utf8>>) - ), - _pipe@3 = gleam@list:append( - _pipe@2, - tuple_errors(D@2, <<"3"/utf8>>) - ), - {error, _pipe@3} - end - end - ) - end. - --spec tuple5( - fun((dynamic_()) -> {ok, CWZ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXB} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXD} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXF} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXH} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, {CWZ, CXB, CXD, CXF, CXH}} | - {error, list(decode_error())}). -tuple5(Decode1, Decode2, Decode3, Decode4, Decode5) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_tuple5(Value), - fun(_use0) -> - {A, B, C, D, E} = _use0, - case {Decode1(A), - Decode2(B), - Decode3(C), - Decode4(D), - Decode5(E)} of - {{ok, A@1}, {ok, B@1}, {ok, C@1}, {ok, D@1}, {ok, E@1}} -> - {ok, {A@1, B@1, C@1, D@1, E@1}}; - - {A@2, B@2, C@2, D@2, E@2} -> - _pipe = tuple_errors(A@2, <<"0"/utf8>>), - _pipe@1 = gleam@list:append( - _pipe, - tuple_errors(B@2, <<"1"/utf8>>) - ), - _pipe@2 = gleam@list:append( - _pipe@1, - tuple_errors(C@2, <<"2"/utf8>>) - ), - _pipe@3 = gleam@list:append( - _pipe@2, - tuple_errors(D@2, <<"3"/utf8>>) - ), - _pipe@4 = gleam@list:append( - _pipe@3, - tuple_errors(E@2, <<"4"/utf8>>) - ), - {error, _pipe@4} - end - end - ) - end. - --spec tuple6( - fun((dynamic_()) -> {ok, CXK} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXM} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXO} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXQ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXS} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXU} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, {CXK, CXM, CXO, CXQ, CXS, CXU}} | - {error, list(decode_error())}). -tuple6(Decode1, Decode2, Decode3, Decode4, Decode5, Decode6) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_tuple6(Value), - fun(_use0) -> - {A, B, C, D, E, F} = _use0, - case {Decode1(A), - Decode2(B), - Decode3(C), - Decode4(D), - Decode5(E), - Decode6(F)} of - {{ok, A@1}, - {ok, B@1}, - {ok, C@1}, - {ok, D@1}, - {ok, E@1}, - {ok, F@1}} -> - {ok, {A@1, B@1, C@1, D@1, E@1, F@1}}; - - {A@2, B@2, C@2, D@2, E@2, F@2} -> - _pipe = tuple_errors(A@2, <<"0"/utf8>>), - _pipe@1 = gleam@list:append( - _pipe, - tuple_errors(B@2, <<"1"/utf8>>) - ), - _pipe@2 = gleam@list:append( - _pipe@1, - tuple_errors(C@2, <<"2"/utf8>>) - ), - _pipe@3 = gleam@list:append( - _pipe@2, - tuple_errors(D@2, <<"3"/utf8>>) - ), - _pipe@4 = gleam@list:append( - _pipe@3, - tuple_errors(E@2, <<"4"/utf8>>) - ), - _pipe@5 = gleam@list:append( - _pipe@4, - tuple_errors(F@2, <<"5"/utf8>>) - ), - {error, _pipe@5} - end - end - ) - end. - --spec map( - fun((dynamic_()) -> {ok, CXX} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CXZ} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, gleam@map:map_(CXX, CXZ)} | - {error, list(decode_error())}). -map(Key_type, Value_type) -> - fun(Value) -> - gleam@result:'try'( - gleam_stdlib:decode_map(Value), - fun(Map) -> - gleam@result:'try'( - begin - _pipe = Map, - _pipe@1 = gleam@map:to_list(_pipe), - gleam@list:try_map( - _pipe@1, - fun(Pair) -> - {K, V} = Pair, - gleam@result:'try'( - begin - _pipe@2 = Key_type(K), - map_errors( - _pipe@2, - fun(_capture) -> - push_path( - _capture, - <<"keys"/utf8>> - ) - end - ) - end, - fun(K@1) -> - gleam@result:'try'( - begin - _pipe@3 = Value_type(V), - map_errors( - _pipe@3, - fun(_capture@1) -> - push_path( - _capture@1, - <<"values"/utf8>> - ) - end - ) - end, - fun(V@1) -> {ok, {K@1, V@1}} end - ) - end - ) - end - ) - end, - fun(Pairs) -> {ok, gleam@map:from_list(Pairs)} end - ) - end - ) - end. - --spec decode2( - fun((CYQ, CYR) -> CYS), - fun((dynamic_()) -> {ok, CYQ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CYR} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, CYS} | {error, list(decode_error())}). -decode2(Constructor, T1, T2) -> - fun(Value) -> case {T1(Value), T2(Value)} of - {{ok, A}, {ok, B}} -> - {ok, Constructor(A, B)}; - - {A@1, B@1} -> - {error, gleam@list:concat([all_errors(A@1), all_errors(B@1)])} - end end. - --spec decode3( - fun((CYW, CYX, CYY) -> CYZ), - fun((dynamic_()) -> {ok, CYW} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CYX} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CYY} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, CYZ} | {error, list(decode_error())}). -decode3(Constructor, T1, T2, T3) -> - fun(Value) -> case {T1(Value), T2(Value), T3(Value)} of - {{ok, A}, {ok, B}, {ok, C}} -> - {ok, Constructor(A, B, C)}; - - {A@1, B@1, C@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), all_errors(B@1), all_errors(C@1)] - )} - end end. - --spec decode4( - fun((CZE, CZF, CZG, CZH) -> CZI), - fun((dynamic_()) -> {ok, CZE} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CZF} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CZG} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CZH} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, CZI} | {error, list(decode_error())}). -decode4(Constructor, T1, T2, T3, T4) -> - fun(X) -> case {T1(X), T2(X), T3(X), T4(X)} of - {{ok, A}, {ok, B}, {ok, C}, {ok, D}} -> - {ok, Constructor(A, B, C, D)}; - - {A@1, B@1, C@1, D@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), - all_errors(B@1), - all_errors(C@1), - all_errors(D@1)] - )} - end end. - --spec decode5( - fun((CZO, CZP, CZQ, CZR, CZS) -> CZT), - fun((dynamic_()) -> {ok, CZO} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CZP} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CZQ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CZR} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, CZS} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, CZT} | {error, list(decode_error())}). -decode5(Constructor, T1, T2, T3, T4, T5) -> - fun(X) -> case {T1(X), T2(X), T3(X), T4(X), T5(X)} of - {{ok, A}, {ok, B}, {ok, C}, {ok, D}, {ok, E}} -> - {ok, Constructor(A, B, C, D, E)}; - - {A@1, B@1, C@1, D@1, E@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), - all_errors(B@1), - all_errors(C@1), - all_errors(D@1), - all_errors(E@1)] - )} - end end. - --spec decode6( - fun((DAA, DAB, DAC, DAD, DAE, DAF) -> DAG), - fun((dynamic_()) -> {ok, DAA} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAB} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAC} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAD} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAE} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAF} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DAG} | {error, list(decode_error())}). -decode6(Constructor, T1, T2, T3, T4, T5, T6) -> - fun(X) -> case {T1(X), T2(X), T3(X), T4(X), T5(X), T6(X)} of - {{ok, A}, {ok, B}, {ok, C}, {ok, D}, {ok, E}, {ok, F}} -> - {ok, Constructor(A, B, C, D, E, F)}; - - {A@1, B@1, C@1, D@1, E@1, F@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), - all_errors(B@1), - all_errors(C@1), - all_errors(D@1), - all_errors(E@1), - all_errors(F@1)] - )} - end end. - --spec decode7( - fun((DAO, DAP, DAQ, DAR, DAS, DAT, DAU) -> DAV), - fun((dynamic_()) -> {ok, DAO} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAP} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAQ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAR} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAS} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAT} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DAU} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DAV} | {error, list(decode_error())}). -decode7(Constructor, T1, T2, T3, T4, T5, T6, T7) -> - fun(X) -> case {T1(X), T2(X), T3(X), T4(X), T5(X), T6(X), T7(X)} of - {{ok, A}, {ok, B}, {ok, C}, {ok, D}, {ok, E}, {ok, F}, {ok, G}} -> - {ok, Constructor(A, B, C, D, E, F, G)}; - - {A@1, B@1, C@1, D@1, E@1, F@1, G@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), - all_errors(B@1), - all_errors(C@1), - all_errors(D@1), - all_errors(E@1), - all_errors(F@1), - all_errors(G@1)] - )} - end end. - --spec decode8( - fun((DBE, DBF, DBG, DBH, DBI, DBJ, DBK, DBL) -> DBM), - fun((dynamic_()) -> {ok, DBE} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBF} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBG} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBH} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBI} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBJ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBK} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBL} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DBM} | {error, list(decode_error())}). -decode8(Constructor, T1, T2, T3, T4, T5, T6, T7, T8) -> - fun(X) -> case {T1(X), T2(X), T3(X), T4(X), T5(X), T6(X), T7(X), T8(X)} of - {{ok, A}, - {ok, B}, - {ok, C}, - {ok, D}, - {ok, E}, - {ok, F}, - {ok, G}, - {ok, H}} -> - {ok, Constructor(A, B, C, D, E, F, G, H)}; - - {A@1, B@1, C@1, D@1, E@1, F@1, G@1, H@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), - all_errors(B@1), - all_errors(C@1), - all_errors(D@1), - all_errors(E@1), - all_errors(F@1), - all_errors(G@1), - all_errors(H@1)] - )} - end end. - --spec decode9( - fun((DBW, DBX, DBY, DBZ, DCA, DCB, DCC, DCD, DCE) -> DCF), - fun((dynamic_()) -> {ok, DBW} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBX} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBY} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DBZ} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DCA} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DCB} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DCC} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DCD} | {error, list(decode_error())}), - fun((dynamic_()) -> {ok, DCE} | {error, list(decode_error())}) -) -> fun((dynamic_()) -> {ok, DCF} | {error, list(decode_error())}). -decode9(Constructor, T1, T2, T3, T4, T5, T6, T7, T8, T9) -> - fun(X) -> - case {T1(X), T2(X), T3(X), T4(X), T5(X), T6(X), T7(X), T8(X), T9(X)} of - {{ok, A}, - {ok, B}, - {ok, C}, - {ok, D}, - {ok, E}, - {ok, F}, - {ok, G}, - {ok, H}, - {ok, I}} -> - {ok, Constructor(A, B, C, D, E, F, G, H, I)}; - - {A@1, B@1, C@1, D@1, E@1, F@1, G@1, H@1, I@1} -> - {error, - gleam@list:concat( - [all_errors(A@1), - all_errors(B@1), - all_errors(C@1), - all_errors(D@1), - all_errors(E@1), - all_errors(F@1), - all_errors(G@1), - all_errors(H@1), - all_errors(I@1)] - )} - end - end. diff --git a/build/packages/gleam_stdlib/src/gleam@float.erl b/build/packages/gleam_stdlib/src/gleam@float.erl deleted file mode 100644 index 5f6c0ab..0000000 --- a/build/packages/gleam_stdlib/src/gleam@float.erl +++ /dev/null @@ -1,180 +0,0 @@ --module(gleam@float). --compile([no_auto_import, nowarn_unused_vars]). - --export([parse/1, to_string/1, compare/2, min/2, max/2, clamp/3, ceiling/1, floor/1, round/1, truncate/1, absolute_value/1, loosely_compare/3, loosely_equals/3, power/2, square_root/1, negate/1, sum/1, product/1, random/2, divide/2, add/2, multiply/2, subtract/2]). - --spec parse(binary()) -> {ok, float()} | {error, nil}. -parse(String) -> - gleam_stdlib:parse_float(String). - --spec to_string(float()) -> binary(). -to_string(X) -> - gleam_stdlib:float_to_string(X). - --spec compare(float(), float()) -> gleam@order:order(). -compare(A, B) -> - case A =:= B of - true -> - eq; - - false -> - case A < B of - true -> - lt; - - false -> - gt - end - end. - --spec min(float(), float()) -> float(). -min(A, B) -> - case A < B of - true -> - A; - - false -> - B - end. - --spec max(float(), float()) -> float(). -max(A, B) -> - case A > B of - true -> - A; - - false -> - B - end. - --spec clamp(float(), float(), float()) -> float(). -clamp(X, Min_bound, Max_bound) -> - _pipe = X, - _pipe@1 = min(_pipe, Max_bound), - max(_pipe@1, Min_bound). - --spec ceiling(float()) -> float(). -ceiling(X) -> - math:ceil(X). - --spec floor(float()) -> float(). -floor(X) -> - math:floor(X). - --spec round(float()) -> integer(). -round(X) -> - erlang:round(X). - --spec truncate(float()) -> integer(). -truncate(X) -> - erlang:trunc(X). - --spec absolute_value(float()) -> float(). -absolute_value(X) -> - case X >= 0.0 of - true -> - X; - - _ -> - 0.0 - X - end. - --spec loosely_compare(float(), float(), float()) -> gleam@order:order(). -loosely_compare(A, B, Tolerance) -> - Difference = absolute_value(A - B), - case Difference =< Tolerance of - true -> - eq; - - false -> - compare(A, B) - end. - --spec loosely_equals(float(), float(), float()) -> boolean(). -loosely_equals(A, B, Tolerance) -> - Difference = absolute_value(A - B), - Difference =< Tolerance. - --spec power(float(), float()) -> {ok, float()} | {error, nil}. -power(Base, Exponent) -> - Fractional = (ceiling(Exponent) - Exponent) > 0.0, - case ((Base < 0.0) andalso Fractional) orelse ((Base =:= 0.0) andalso (Exponent - < 0.0)) of - true -> - {error, nil}; - - false -> - {ok, math:pow(Base, Exponent)} - end. - --spec square_root(float()) -> {ok, float()} | {error, nil}. -square_root(X) -> - power(X, 0.5). - --spec negate(float()) -> float(). -negate(X) -> - -1.0 * X. - --spec do_sum(list(float()), float()) -> float(). -do_sum(Numbers, Initial) -> - case Numbers of - [] -> - Initial; - - [X | Rest] -> - do_sum(Rest, X + Initial) - end. - --spec sum(list(float())) -> float(). -sum(Numbers) -> - _pipe = Numbers, - do_sum(_pipe, 0.0). - --spec do_product(list(float()), float()) -> float(). -do_product(Numbers, Initial) -> - case Numbers of - [] -> - Initial; - - [X | Rest] -> - do_product(Rest, X * Initial) - end. - --spec product(list(float())) -> float(). -product(Numbers) -> - case Numbers of - [] -> - 1.0; - - _ -> - do_product(Numbers, 1.0) - end. - --spec random(float(), float()) -> float(). -random(Min, Max) -> - (rand:uniform() * (Max - Min)) + Min. - --spec divide(float(), float()) -> {ok, float()} | {error, nil}. -divide(A, B) -> - case B of - 0.0 -> - {error, nil}; - - B@1 -> - {ok, case B@1 of - 0.0 -> 0.0; - Gleam@denominator -> A / Gleam@denominator - end} - end. - --spec add(float(), float()) -> float(). -add(A, B) -> - A + B. - --spec multiply(float(), float()) -> float(). -multiply(A, B) -> - A * B. - --spec subtract(float(), float()) -> float(). -subtract(A, B) -> - A - B. diff --git a/build/packages/gleam_stdlib/src/gleam@function.erl b/build/packages/gleam_stdlib/src/gleam@function.erl deleted file mode 100644 index b3fcc5c..0000000 --- a/build/packages/gleam_stdlib/src/gleam@function.erl +++ /dev/null @@ -1,67 +0,0 @@ --module(gleam@function). --compile([no_auto_import, nowarn_unused_vars]). - --export([compose/2, curry2/1, curry3/1, curry4/1, curry5/1, curry6/1, flip/1, identity/1, constant/1, tap/2, apply1/2, apply2/3, apply3/4]). - --spec compose(fun((EUC) -> EUD), fun((EUD) -> EUE)) -> fun((EUC) -> EUE). -compose(Fun1, Fun2) -> - fun(A) -> Fun2(Fun1(A)) end. - --spec curry2(fun((EUF, EUG) -> EUH)) -> fun((EUF) -> fun((EUG) -> EUH)). -curry2(Fun) -> - fun(A) -> fun(B) -> Fun(A, B) end end. - --spec curry3(fun((EUJ, EUK, EUL) -> EUM)) -> fun((EUJ) -> fun((EUK) -> fun((EUL) -> EUM))). -curry3(Fun) -> - fun(A) -> fun(B) -> fun(C) -> Fun(A, B, C) end end end. - --spec curry4(fun((EUO, EUP, EUQ, EUR) -> EUS)) -> fun((EUO) -> fun((EUP) -> fun((EUQ) -> fun((EUR) -> EUS)))). -curry4(Fun) -> - fun(A) -> fun(B) -> fun(C) -> fun(D) -> Fun(A, B, C, D) end end end end. - --spec curry5(fun((EUU, EUV, EUW, EUX, EUY) -> EUZ)) -> fun((EUU) -> fun((EUV) -> fun((EUW) -> fun((EUX) -> fun((EUY) -> EUZ))))). -curry5(Fun) -> - fun(A) -> - fun(B) -> - fun(C) -> fun(D) -> fun(E) -> Fun(A, B, C, D, E) end end end - end - end. - --spec curry6(fun((EVB, EVC, EVD, EVE, EVF, EVG) -> EVH)) -> fun((EVB) -> fun((EVC) -> fun((EVD) -> fun((EVE) -> fun((EVF) -> fun((EVG) -> EVH)))))). -curry6(Fun) -> - fun(A) -> - fun(B) -> - fun(C) -> - fun(D) -> fun(E) -> fun(F) -> Fun(A, B, C, D, E, F) end end end - end - end - end. - --spec flip(fun((EVJ, EVK) -> EVL)) -> fun((EVK, EVJ) -> EVL). -flip(Fun) -> - fun(B, A) -> Fun(A, B) end. - --spec identity(EVM) -> EVM. -identity(X) -> - X. - --spec constant(EVN) -> fun((any()) -> EVN). -constant(Value) -> - fun(_) -> Value end. - --spec tap(EVP, fun((EVP) -> any())) -> EVP. -tap(Arg, Effect) -> - Effect(Arg), - Arg. - --spec apply1(fun((EVR) -> EVS), EVR) -> EVS. -apply1(Fun, Arg1) -> - Fun(Arg1). - --spec apply2(fun((EVT, EVU) -> EVV), EVT, EVU) -> EVV. -apply2(Fun, Arg1, Arg2) -> - Fun(Arg1, Arg2). - --spec apply3(fun((EVW, EVX, EVY) -> EVZ), EVW, EVX, EVY) -> EVZ. -apply3(Fun, Arg1, Arg2, Arg3) -> - Fun(Arg1, Arg2, Arg3). diff --git a/build/packages/gleam_stdlib/src/gleam@int.erl b/build/packages/gleam_stdlib/src/gleam@int.erl deleted file mode 100644 index 3d0bdd8..0000000 --- a/build/packages/gleam_stdlib/src/gleam@int.erl +++ /dev/null @@ -1,332 +0,0 @@ --module(gleam@int). --compile([no_auto_import, nowarn_unused_vars]). - --export([absolute_value/1, parse/1, base_parse/2, to_string/1, to_base_string/2, to_base2/1, to_base8/1, to_base16/1, to_base36/1, to_float/1, power/2, square_root/1, compare/2, min/2, max/2, clamp/3, is_even/1, is_odd/1, negate/1, sum/1, product/1, digits/2, undigits/2, random/2, divide/2, remainder/2, modulo/2, floor_divide/2, add/2, multiply/2, subtract/2, bitwise_and/2, bitwise_not/1, bitwise_or/2, bitwise_exclusive_or/2, bitwise_shift_left/2, bitwise_shift_right/2]). --export_type([invalid_base/0]). - --type invalid_base() :: invalid_base. - --spec absolute_value(integer()) -> integer(). -absolute_value(X) -> - case X >= 0 of - true -> - X; - - false -> - X * -1 - end. - --spec parse(binary()) -> {ok, integer()} | {error, nil}. -parse(String) -> - gleam_stdlib:parse_int(String). - --spec base_parse(binary(), integer()) -> {ok, integer()} | {error, nil}. -base_parse(String, Base) -> - case (Base >= 2) andalso (Base =< 36) of - true -> - gleam_stdlib:int_from_base_string(String, Base); - - false -> - {error, nil} - end. - --spec to_string(integer()) -> binary(). -to_string(X) -> - erlang:integer_to_binary(X). - --spec to_base_string(integer(), integer()) -> {ok, binary()} | - {error, invalid_base()}. -to_base_string(X, Base) -> - case (Base >= 2) andalso (Base =< 36) of - true -> - {ok, erlang:integer_to_binary(X, Base)}; - - false -> - {error, invalid_base} - end. - --spec to_base2(integer()) -> binary(). -to_base2(X) -> - erlang:integer_to_binary(X, 2). - --spec to_base8(integer()) -> binary(). -to_base8(X) -> - erlang:integer_to_binary(X, 8). - --spec to_base16(integer()) -> binary(). -to_base16(X) -> - erlang:integer_to_binary(X, 16). - --spec to_base36(integer()) -> binary(). -to_base36(X) -> - erlang:integer_to_binary(X, 36). - --spec to_float(integer()) -> float(). -to_float(X) -> - erlang:float(X). - --spec power(integer(), float()) -> {ok, float()} | {error, nil}. -power(Base, Exponent) -> - _pipe = Base, - _pipe@1 = to_float(_pipe), - gleam@float:power(_pipe@1, Exponent). - --spec square_root(integer()) -> {ok, float()} | {error, nil}. -square_root(X) -> - _pipe = X, - _pipe@1 = to_float(_pipe), - gleam@float:square_root(_pipe@1). - --spec compare(integer(), integer()) -> gleam@order:order(). -compare(A, B) -> - case A =:= B of - true -> - eq; - - false -> - case A < B of - true -> - lt; - - false -> - gt - end - end. - --spec min(integer(), integer()) -> integer(). -min(A, B) -> - case A < B of - true -> - A; - - false -> - B - end. - --spec max(integer(), integer()) -> integer(). -max(A, B) -> - case A > B of - true -> - A; - - false -> - B - end. - --spec clamp(integer(), integer(), integer()) -> integer(). -clamp(X, Min_bound, Max_bound) -> - _pipe = X, - _pipe@1 = min(_pipe, Max_bound), - max(_pipe@1, Min_bound). - --spec is_even(integer()) -> boolean(). -is_even(X) -> - (X rem 2) =:= 0. - --spec is_odd(integer()) -> boolean(). -is_odd(X) -> - (X rem 2) /= 0. - --spec negate(integer()) -> integer(). -negate(X) -> - -1 * X. - --spec do_sum(list(integer()), integer()) -> integer(). -do_sum(Numbers, Initial) -> - case Numbers of - [] -> - Initial; - - [X | Rest] -> - do_sum(Rest, X + Initial) - end. - --spec sum(list(integer())) -> integer(). -sum(Numbers) -> - _pipe = Numbers, - do_sum(_pipe, 0). - --spec do_product(list(integer()), integer()) -> integer(). -do_product(Numbers, Initial) -> - case Numbers of - [] -> - Initial; - - [X | Rest] -> - do_product(Rest, X * Initial) - end. - --spec product(list(integer())) -> integer(). -product(Numbers) -> - case Numbers of - [] -> - 1; - - _ -> - do_product(Numbers, 1) - end. - --spec do_digits(integer(), integer(), list(integer())) -> list(integer()). -do_digits(X, Base, Acc) -> - case absolute_value(X) < Base of - true -> - [X | Acc]; - - false -> - do_digits(case Base of - 0 -> 0; - Gleam@denominator -> X div Gleam@denominator - end, Base, [case Base of - 0 -> 0; - Gleam@denominator@1 -> X rem Gleam@denominator@1 - end | Acc]) - end. - --spec digits(integer(), integer()) -> {ok, list(integer())} | - {error, invalid_base()}. -digits(X, Base) -> - case Base < 2 of - true -> - {error, invalid_base}; - - false -> - {ok, do_digits(X, Base, [])} - end. - --spec do_undigits(list(integer()), integer(), integer()) -> {ok, integer()} | - {error, invalid_base()}. -do_undigits(Numbers, Base, Acc) -> - case Numbers of - [] -> - {ok, Acc}; - - [Digit | _] when Digit >= Base -> - {error, invalid_base}; - - [Digit@1 | Rest] -> - do_undigits(Rest, Base, (Acc * Base) + Digit@1) - end. - --spec undigits(list(integer()), integer()) -> {ok, integer()} | - {error, invalid_base()}. -undigits(Numbers, Base) -> - case Base < 2 of - true -> - {error, invalid_base}; - - false -> - do_undigits(Numbers, Base, 0) - end. - --spec random(integer(), integer()) -> integer(). -random(Min, Max) -> - _pipe = gleam@float:random(to_float(Min), to_float(Max)), - _pipe@1 = gleam@float:floor(_pipe), - gleam@float:round(_pipe@1). - --spec divide(integer(), integer()) -> {ok, integer()} | {error, nil}. -divide(Dividend, Divisor) -> - case Divisor of - 0 -> - {error, nil}; - - Divisor@1 -> - {ok, case Divisor@1 of - 0 -> 0; - Gleam@denominator -> Dividend div Gleam@denominator - end} - end. - --spec remainder(integer(), integer()) -> {ok, integer()} | {error, nil}. -remainder(Dividend, Divisor) -> - case Divisor of - 0 -> - {error, nil}; - - Divisor@1 -> - {ok, case Divisor@1 of - 0 -> 0; - Gleam@denominator -> Dividend rem Gleam@denominator - end} - end. - --spec modulo(integer(), integer()) -> {ok, integer()} | {error, nil}. -modulo(Dividend, Divisor) -> - case Divisor of - 0 -> - {error, nil}; - - _ -> - Remainder = case Divisor of - 0 -> 0; - Gleam@denominator -> Dividend rem Gleam@denominator - end, - case (Remainder * Divisor) < 0 of - true -> - {ok, Remainder + Divisor}; - - false -> - {ok, Remainder} - end - end. - --spec floor_divide(integer(), integer()) -> {ok, integer()} | {error, nil}. -floor_divide(Dividend, Divisor) -> - case Divisor of - 0 -> - {error, nil}; - - Divisor@1 -> - case ((Dividend * Divisor@1) < 0) andalso ((case Divisor@1 of - 0 -> 0; - Gleam@denominator -> Dividend rem Gleam@denominator - end) /= 0) of - true -> - {ok, (case Divisor@1 of - 0 -> 0; - Gleam@denominator@1 -> Dividend div Gleam@denominator@1 - end) - 1}; - - false -> - {ok, case Divisor@1 of - 0 -> 0; - Gleam@denominator@2 -> Dividend div Gleam@denominator@2 - end} - end - end. - --spec add(integer(), integer()) -> integer(). -add(A, B) -> - A + B. - --spec multiply(integer(), integer()) -> integer(). -multiply(A, B) -> - A * B. - --spec subtract(integer(), integer()) -> integer(). -subtract(A, B) -> - A - B. - --spec bitwise_and(integer(), integer()) -> integer(). -bitwise_and(X, Y) -> - erlang:'band'(X, Y). - --spec bitwise_not(integer()) -> integer(). -bitwise_not(X) -> - erlang:'bnot'(X). - --spec bitwise_or(integer(), integer()) -> integer(). -bitwise_or(X, Y) -> - erlang:'bor'(X, Y). - --spec bitwise_exclusive_or(integer(), integer()) -> integer(). -bitwise_exclusive_or(X, Y) -> - erlang:'bxor'(X, Y). - --spec bitwise_shift_left(integer(), integer()) -> integer(). -bitwise_shift_left(X, Y) -> - erlang:'bsl'(X, Y). - --spec bitwise_shift_right(integer(), integer()) -> integer(). -bitwise_shift_right(X, Y) -> - erlang:'bsr'(X, Y). diff --git a/build/packages/gleam_stdlib/src/gleam@io.erl b/build/packages/gleam_stdlib/src/gleam@io.erl deleted file mode 100644 index f8c8b7f..0000000 --- a/build/packages/gleam_stdlib/src/gleam@io.erl +++ /dev/null @@ -1,27 +0,0 @@ --module(gleam@io). --compile([no_auto_import, nowarn_unused_vars]). - --export([print/1, print_error/1, println/1, println_error/1, debug/1]). - --spec print(binary()) -> nil. -print(String) -> - gleam_stdlib:print(String). - --spec print_error(binary()) -> nil. -print_error(String) -> - gleam_stdlib:print_error(String). - --spec println(binary()) -> nil. -println(String) -> - gleam_stdlib:println(String). - --spec println_error(binary()) -> nil. -println_error(String) -> - gleam_stdlib:println_error(String). - --spec debug(ETS) -> ETS. -debug(Term) -> - _pipe = Term, - _pipe@1 = gleam@string:inspect(_pipe), - gleam_stdlib:println_error(_pipe@1), - Term. diff --git a/build/packages/gleam_stdlib/src/gleam@iterator.erl b/build/packages/gleam_stdlib/src/gleam@iterator.erl deleted file mode 100644 index 2f2ee29..0000000 --- a/build/packages/gleam_stdlib/src/gleam@iterator.erl +++ /dev/null @@ -1,715 +0,0 @@ --module(gleam@iterator). --compile([no_auto_import, nowarn_unused_vars]). - --export([unfold/2, repeatedly/1, repeat/1, from_list/1, transform/3, fold/3, run/1, to_list/1, step/1, take/2, drop/2, map/2, append/2, flatten/1, concat/1, flat_map/2, filter/2, cycle/1, find/2, index/1, iterate/2, take_while/2, drop_while/2, scan/3, zip/2, chunk/2, sized_chunk/2, intersperse/2, any/2, all/2, group/2, reduce/2, last/1, empty/0, once/1, range/2, single/1, interleave/2, fold_until/3, try_fold/3, first/1, at/2, length/1, each/2, yield/2]). --export_type([action/1, iterator/1, step/2, chunk/2, sized_chunk/1]). - --type action(BPX) :: stop | {continue, BPX, fun(() -> action(BPX))}. - --opaque iterator(BPY) :: {iterator, fun(() -> action(BPY))}. - --type step(BPZ, BQA) :: {next, BPZ, BQA} | done. - --type chunk(BQB, BQC) :: {another_by, - list(BQB), - BQC, - BQB, - fun(() -> action(BQB))} | - {last_by, list(BQB)}. - --type sized_chunk(BQD) :: {another, list(BQD), fun(() -> action(BQD))} | - {last, list(BQD)} | - no_more. - --spec stop() -> action(any()). -stop() -> - stop. - --spec do_unfold(BQG, fun((BQG) -> step(BQH, BQG))) -> fun(() -> action(BQH)). -do_unfold(Initial, F) -> - fun() -> case F(Initial) of - {next, X, Acc} -> - {continue, X, do_unfold(Acc, F)}; - - done -> - stop - end end. - --spec unfold(BQL, fun((BQL) -> step(BQM, BQL))) -> iterator(BQM). -unfold(Initial, F) -> - _pipe = Initial, - _pipe@1 = do_unfold(_pipe, F), - {iterator, _pipe@1}. - --spec repeatedly(fun(() -> BQQ)) -> iterator(BQQ). -repeatedly(F) -> - unfold(nil, fun(_) -> {next, F(), nil} end). - --spec repeat(BQS) -> iterator(BQS). -repeat(X) -> - repeatedly(fun() -> X end). - --spec from_list(list(BQU)) -> iterator(BQU). -from_list(List) -> - Yield = fun(Acc) -> case Acc of - [] -> - done; - - [Head | Tail] -> - {next, Head, Tail} - end end, - unfold(List, Yield). - --spec do_transform( - fun(() -> action(BQX)), - BQZ, - fun((BQZ, BQX) -> step(BRA, BQZ)) -) -> fun(() -> action(BRA)). -do_transform(Continuation, State, F) -> - fun() -> case Continuation() of - stop -> - stop; - - {continue, El, Next} -> - case F(State, El) of - done -> - stop; - - {next, Yield, Next_state} -> - {continue, Yield, do_transform(Next, Next_state, F)} - end - end end. - --spec transform(iterator(BRE), BRG, fun((BRG, BRE) -> step(BRH, BRG))) -> iterator(BRH). -transform(Iterator, Initial, F) -> - _pipe = do_transform(erlang:element(2, Iterator), Initial, F), - {iterator, _pipe}. - --spec do_fold(fun(() -> action(BRL)), fun((BRN, BRL) -> BRN), BRN) -> BRN. -do_fold(Continuation, F, Accumulator) -> - case Continuation() of - {continue, Elem, Next} -> - do_fold(Next, F, F(Accumulator, Elem)); - - stop -> - Accumulator - end. - --spec fold(iterator(BRO), BRQ, fun((BRQ, BRO) -> BRQ)) -> BRQ. -fold(Iterator, Initial, F) -> - _pipe = erlang:element(2, Iterator), - do_fold(_pipe, F, Initial). - --spec run(iterator(any())) -> nil. -run(Iterator) -> - fold(Iterator, nil, fun(_, _) -> nil end). - --spec to_list(iterator(BRT)) -> list(BRT). -to_list(Iterator) -> - _pipe = Iterator, - _pipe@1 = fold(_pipe, [], fun(Acc, E) -> [E | Acc] end), - gleam@list:reverse(_pipe@1). - --spec step(iterator(BRW)) -> step(BRW, iterator(BRW)). -step(Iterator) -> - case (erlang:element(2, Iterator))() of - stop -> - done; - - {continue, E, A} -> - {next, E, {iterator, A}} - end. - --spec do_take(fun(() -> action(BSB)), integer()) -> fun(() -> action(BSB)). -do_take(Continuation, Desired) -> - fun() -> case Desired > 0 of - false -> - stop; - - true -> - case Continuation() of - stop -> - stop; - - {continue, E, Next} -> - {continue, E, do_take(Next, Desired - 1)} - end - end end. - --spec take(iterator(BSE), integer()) -> iterator(BSE). -take(Iterator, Desired) -> - _pipe = erlang:element(2, Iterator), - _pipe@1 = do_take(_pipe, Desired), - {iterator, _pipe@1}. - --spec do_drop(fun(() -> action(BSH)), integer()) -> action(BSH). -do_drop(Continuation, Desired) -> - case Continuation() of - stop -> - stop; - - {continue, E, Next} -> - case Desired > 0 of - true -> - do_drop(Next, Desired - 1); - - false -> - {continue, E, Next} - end - end. - --spec drop(iterator(BSK), integer()) -> iterator(BSK). -drop(Iterator, Desired) -> - _pipe = fun() -> do_drop(erlang:element(2, Iterator), Desired) end, - {iterator, _pipe}. - --spec do_map(fun(() -> action(BSN)), fun((BSN) -> BSP)) -> fun(() -> action(BSP)). -do_map(Continuation, F) -> - fun() -> case Continuation() of - stop -> - stop; - - {continue, E, Continuation@1} -> - {continue, F(E), do_map(Continuation@1, F)} - end end. - --spec map(iterator(BSR), fun((BSR) -> BST)) -> iterator(BST). -map(Iterator, F) -> - _pipe = erlang:element(2, Iterator), - _pipe@1 = do_map(_pipe, F), - {iterator, _pipe@1}. - --spec do_append(fun(() -> action(BSV)), fun(() -> action(BSV))) -> action(BSV). -do_append(First, Second) -> - case First() of - {continue, E, First@1} -> - {continue, E, fun() -> do_append(First@1, Second) end}; - - stop -> - Second() - end. - --spec append(iterator(BSZ), iterator(BSZ)) -> iterator(BSZ). -append(First, Second) -> - _pipe = fun() -> - do_append(erlang:element(2, First), erlang:element(2, Second)) - end, - {iterator, _pipe}. - --spec do_flatten(fun(() -> action(iterator(BTD)))) -> action(BTD). -do_flatten(Flattened) -> - case Flattened() of - stop -> - stop; - - {continue, It, Next_iterator} -> - do_append( - erlang:element(2, It), - fun() -> do_flatten(Next_iterator) end - ) - end. - --spec flatten(iterator(iterator(BTH))) -> iterator(BTH). -flatten(Iterator) -> - _pipe = fun() -> do_flatten(erlang:element(2, Iterator)) end, - {iterator, _pipe}. - --spec concat(list(iterator(BTL))) -> iterator(BTL). -concat(Iterators) -> - flatten(from_list(Iterators)). - --spec flat_map(iterator(BTP), fun((BTP) -> iterator(BTR))) -> iterator(BTR). -flat_map(Iterator, F) -> - _pipe = Iterator, - _pipe@1 = map(_pipe, F), - flatten(_pipe@1). - --spec do_filter(fun(() -> action(BTU)), fun((BTU) -> boolean())) -> action(BTU). -do_filter(Continuation, Predicate) -> - case Continuation() of - stop -> - stop; - - {continue, E, Iterator} -> - case Predicate(E) of - true -> - {continue, E, fun() -> do_filter(Iterator, Predicate) end}; - - false -> - do_filter(Iterator, Predicate) - end - end. - --spec filter(iterator(BTX), fun((BTX) -> boolean())) -> iterator(BTX). -filter(Iterator, Predicate) -> - _pipe = fun() -> do_filter(erlang:element(2, Iterator), Predicate) end, - {iterator, _pipe}. - --spec cycle(iterator(BUA)) -> iterator(BUA). -cycle(Iterator) -> - _pipe = repeat(Iterator), - flatten(_pipe). - --spec do_find(fun(() -> action(BUE)), fun((BUE) -> boolean())) -> {ok, BUE} | - {error, nil}. -do_find(Continuation, F) -> - case Continuation() of - stop -> - {error, nil}; - - {continue, E, Next} -> - case F(E) of - true -> - {ok, E}; - - false -> - do_find(Next, F) - end - end. - --spec find(iterator(BUI), fun((BUI) -> boolean())) -> {ok, BUI} | {error, nil}. -find(Haystack, Is_desired) -> - _pipe = erlang:element(2, Haystack), - do_find(_pipe, Is_desired). - --spec do_index(fun(() -> action(BUM)), integer()) -> fun(() -> action({integer(), - BUM})). -do_index(Continuation, Next) -> - fun() -> case Continuation() of - stop -> - stop; - - {continue, E, Continuation@1} -> - {continue, {Next, E}, do_index(Continuation@1, Next + 1)} - end end. - --spec index(iterator(BUP)) -> iterator({integer(), BUP}). -index(Iterator) -> - _pipe = erlang:element(2, Iterator), - _pipe@1 = do_index(_pipe, 0), - {iterator, _pipe@1}. - --spec iterate(BUS, fun((BUS) -> BUS)) -> iterator(BUS). -iterate(Initial, F) -> - unfold(Initial, fun(Element) -> {next, Element, F(Element)} end). - --spec do_take_while(fun(() -> action(BUU)), fun((BUU) -> boolean())) -> fun(() -> action(BUU)). -do_take_while(Continuation, Predicate) -> - fun() -> case Continuation() of - stop -> - stop; - - {continue, E, Next} -> - case Predicate(E) of - false -> - stop; - - true -> - {continue, E, do_take_while(Next, Predicate)} - end - end end. - --spec take_while(iterator(BUX), fun((BUX) -> boolean())) -> iterator(BUX). -take_while(Iterator, Predicate) -> - _pipe = erlang:element(2, Iterator), - _pipe@1 = do_take_while(_pipe, Predicate), - {iterator, _pipe@1}. - --spec do_drop_while(fun(() -> action(BVA)), fun((BVA) -> boolean())) -> action(BVA). -do_drop_while(Continuation, Predicate) -> - case Continuation() of - stop -> - stop; - - {continue, E, Next} -> - case Predicate(E) of - false -> - {continue, E, Next}; - - true -> - do_drop_while(Next, Predicate) - end - end. - --spec drop_while(iterator(BVD), fun((BVD) -> boolean())) -> iterator(BVD). -drop_while(Iterator, Predicate) -> - _pipe = fun() -> do_drop_while(erlang:element(2, Iterator), Predicate) end, - {iterator, _pipe}. - --spec do_scan(fun(() -> action(BVG)), fun((BVI, BVG) -> BVI), BVI) -> fun(() -> action(BVI)). -do_scan(Continuation, F, Accumulator) -> - fun() -> case Continuation() of - stop -> - stop; - - {continue, El, Next} -> - Accumulated = F(Accumulator, El), - {continue, Accumulated, do_scan(Next, F, Accumulated)} - end end. - --spec scan(iterator(BVK), BVM, fun((BVM, BVK) -> BVM)) -> iterator(BVM). -scan(Iterator, Initial, F) -> - _pipe = erlang:element(2, Iterator), - _pipe@1 = do_scan(_pipe, F, Initial), - {iterator, _pipe@1}. - --spec do_zip(fun(() -> action(BVO)), fun(() -> action(BVQ))) -> fun(() -> action({BVO, - BVQ})). -do_zip(Left, Right) -> - fun() -> case Left() of - stop -> - stop; - - {continue, El_left, Next_left} -> - case Right() of - stop -> - stop; - - {continue, El_right, Next_right} -> - {continue, - {El_left, El_right}, - do_zip(Next_left, Next_right)} - end - end end. - --spec zip(iterator(BVT), iterator(BVV)) -> iterator({BVT, BVV}). -zip(Left, Right) -> - _pipe = do_zip(erlang:element(2, Left), erlang:element(2, Right)), - {iterator, _pipe}. - --spec next_chunk(fun(() -> action(BVY)), fun((BVY) -> BWA), BWA, list(BVY)) -> chunk(BVY, BWA). -next_chunk(Continuation, F, Previous_key, Current_chunk) -> - case Continuation() of - stop -> - {last_by, gleam@list:reverse(Current_chunk)}; - - {continue, E, Next} -> - Key = F(E), - case Key =:= Previous_key of - true -> - next_chunk(Next, F, Key, [E | Current_chunk]); - - false -> - {another_by, - gleam@list:reverse(Current_chunk), - Key, - E, - Next} - end - end. - --spec do_chunk(fun(() -> action(BWE)), fun((BWE) -> BWG), BWG, BWE) -> action(list(BWE)). -do_chunk(Continuation, F, Previous_key, Previous_element) -> - case next_chunk(Continuation, F, Previous_key, [Previous_element]) of - {last_by, Chunk} -> - {continue, Chunk, fun stop/0}; - - {another_by, Chunk@1, Key, El, Next} -> - {continue, Chunk@1, fun() -> do_chunk(Next, F, Key, El) end} - end. - --spec chunk(iterator(BWJ), fun((BWJ) -> any())) -> iterator(list(BWJ)). -chunk(Iterator, F) -> - _pipe = fun() -> case (erlang:element(2, Iterator))() of - stop -> - stop; - - {continue, E, Next} -> - do_chunk(Next, F, F(E), E) - end end, - {iterator, _pipe}. - --spec next_sized_chunk(fun(() -> action(BWO)), integer(), list(BWO)) -> sized_chunk(BWO). -next_sized_chunk(Continuation, Left, Current_chunk) -> - case Continuation() of - stop -> - case Current_chunk of - [] -> - no_more; - - Remaining -> - {last, gleam@list:reverse(Remaining)} - end; - - {continue, E, Next} -> - Chunk = [E | Current_chunk], - case Left > 1 of - false -> - {another, gleam@list:reverse(Chunk), Next}; - - true -> - next_sized_chunk(Next, Left - 1, Chunk) - end - end. - --spec do_sized_chunk(fun(() -> action(BWS)), integer()) -> fun(() -> action(list(BWS))). -do_sized_chunk(Continuation, Count) -> - fun() -> case next_sized_chunk(Continuation, Count, []) of - no_more -> - stop; - - {last, Chunk} -> - {continue, Chunk, fun stop/0}; - - {another, Chunk@1, Next_element} -> - {continue, Chunk@1, do_sized_chunk(Next_element, Count)} - end end. - --spec sized_chunk(iterator(BWW), integer()) -> iterator(list(BWW)). -sized_chunk(Iterator, Count) -> - _pipe = erlang:element(2, Iterator), - _pipe@1 = do_sized_chunk(_pipe, Count), - {iterator, _pipe@1}. - --spec do_intersperse(fun(() -> action(BXA)), BXA) -> action(BXA). -do_intersperse(Continuation, Separator) -> - case Continuation() of - stop -> - stop; - - {continue, E, Next} -> - Next_interspersed = fun() -> do_intersperse(Next, Separator) end, - {continue, Separator, fun() -> {continue, E, Next_interspersed} end} - end. - --spec intersperse(iterator(BXD), BXD) -> iterator(BXD). -intersperse(Iterator, Elem) -> - _pipe = fun() -> case (erlang:element(2, Iterator))() of - stop -> - stop; - - {continue, E, Next} -> - {continue, E, fun() -> do_intersperse(Next, Elem) end} - end end, - {iterator, _pipe}. - --spec do_any(fun(() -> action(BXG)), fun((BXG) -> boolean())) -> boolean(). -do_any(Continuation, Predicate) -> - case Continuation() of - stop -> - false; - - {continue, E, Next} -> - case Predicate(E) of - true -> - true; - - false -> - do_any(Next, Predicate) - end - end. - --spec any(iterator(BXI), fun((BXI) -> boolean())) -> boolean(). -any(Iterator, Predicate) -> - _pipe = erlang:element(2, Iterator), - do_any(_pipe, Predicate). - --spec do_all(fun(() -> action(BXK)), fun((BXK) -> boolean())) -> boolean(). -do_all(Continuation, Predicate) -> - case Continuation() of - stop -> - true; - - {continue, E, Next} -> - case Predicate(E) of - true -> - do_all(Next, Predicate); - - false -> - false - end - end. - --spec all(iterator(BXM), fun((BXM) -> boolean())) -> boolean(). -all(Iterator, Predicate) -> - _pipe = erlang:element(2, Iterator), - do_all(_pipe, Predicate). - --spec update_group_with(BXO) -> fun((gleam@option:option(list(BXO))) -> list(BXO)). -update_group_with(El) -> - fun(Maybe_group) -> case Maybe_group of - {some, Group} -> - [El | Group]; - - none -> - [El] - end end. - --spec group_updater(fun((BXS) -> BXT)) -> fun((gleam@map:map_(BXT, list(BXS)), BXS) -> gleam@map:map_(BXT, list(BXS))). -group_updater(F) -> - fun(Groups, Elem) -> _pipe = Groups, - gleam@map:update(_pipe, F(Elem), update_group_with(Elem)) end. - --spec group(iterator(BYA), fun((BYA) -> BYC)) -> gleam@map:map_(BYC, list(BYA)). -group(Iterator, Key) -> - _pipe = Iterator, - _pipe@1 = fold(_pipe, gleam@map:new(), group_updater(Key)), - gleam@map:map_values( - _pipe@1, - fun(_, Group) -> gleam@list:reverse(Group) end - ). - --spec reduce(iterator(BYG), fun((BYG, BYG) -> BYG)) -> {ok, BYG} | {error, nil}. -reduce(Iterator, F) -> - case (erlang:element(2, Iterator))() of - stop -> - {error, nil}; - - {continue, E, Next} -> - _pipe = do_fold(Next, F, E), - {ok, _pipe} - end. - --spec last(iterator(BYK)) -> {ok, BYK} | {error, nil}. -last(Iterator) -> - _pipe = Iterator, - reduce(_pipe, fun(_, Elem) -> Elem end). - --spec empty() -> iterator(any()). -empty() -> - {iterator, fun stop/0}. - --spec once(fun(() -> BYQ)) -> iterator(BYQ). -once(F) -> - _pipe = fun() -> {continue, F(), fun stop/0} end, - {iterator, _pipe}. - --spec range(integer(), integer()) -> iterator(integer()). -range(Start, Stop) -> - case gleam@int:compare(Start, Stop) of - eq -> - once(fun() -> Start end); - - gt -> - unfold(Start, fun(Current) -> case Current < Stop of - false -> - {next, Current, Current - 1}; - - true -> - done - end end); - - lt -> - unfold(Start, fun(Current@1) -> case Current@1 > Stop of - false -> - {next, Current@1, Current@1 + 1}; - - true -> - done - end end) - end. - --spec single(BYS) -> iterator(BYS). -single(Elem) -> - once(fun() -> Elem end). - --spec do_interleave(fun(() -> action(BYU)), fun(() -> action(BYU))) -> action(BYU). -do_interleave(Current, Next) -> - case Current() of - stop -> - Next(); - - {continue, E, Next_other} -> - {continue, E, fun() -> do_interleave(Next, Next_other) end} - end. - --spec interleave(iterator(BYY), iterator(BYY)) -> iterator(BYY). -interleave(Left, Right) -> - _pipe = fun() -> - do_interleave(erlang:element(2, Left), erlang:element(2, Right)) - end, - {iterator, _pipe}. - --spec do_fold_until( - fun(() -> action(BZC)), - fun((BZE, BZC) -> gleam@list:continue_or_stop(BZE)), - BZE -) -> BZE. -do_fold_until(Continuation, F, Accumulator) -> - case Continuation() of - stop -> - Accumulator; - - {continue, Elem, Next} -> - case F(Accumulator, Elem) of - {continue, Accumulator@1} -> - do_fold_until(Next, F, Accumulator@1); - - {stop, Accumulator@2} -> - Accumulator@2 - end - end. - --spec fold_until( - iterator(BZG), - BZI, - fun((BZI, BZG) -> gleam@list:continue_or_stop(BZI)) -) -> BZI. -fold_until(Iterator, Initial, F) -> - _pipe = erlang:element(2, Iterator), - do_fold_until(_pipe, F, Initial). - --spec do_try_fold( - fun(() -> action(BZK)), - fun((BZM, BZK) -> {ok, BZM} | {error, BZN}), - BZM -) -> {ok, BZM} | {error, BZN}. -do_try_fold(Continuation, F, Accumulator) -> - case Continuation() of - stop -> - {ok, Accumulator}; - - {continue, Elem, Next} -> - gleam@result:'try'( - F(Accumulator, Elem), - fun(Accumulator@1) -> do_try_fold(Next, F, Accumulator@1) end - ) - end. - --spec try_fold(iterator(BZS), BZU, fun((BZU, BZS) -> {ok, BZU} | {error, BZV})) -> {ok, - BZU} | - {error, BZV}. -try_fold(Iterator, Initial, F) -> - _pipe = erlang:element(2, Iterator), - do_try_fold(_pipe, F, Initial). - --spec first(iterator(CAA)) -> {ok, CAA} | {error, nil}. -first(Iterator) -> - case (erlang:element(2, Iterator))() of - stop -> - {error, nil}; - - {continue, E, _} -> - {ok, E} - end. - --spec at(iterator(CAE), integer()) -> {ok, CAE} | {error, nil}. -at(Iterator, Index) -> - _pipe = Iterator, - _pipe@1 = drop(_pipe, Index), - first(_pipe@1). - --spec do_length(fun(() -> action(any())), integer()) -> integer(). -do_length(Continuation, Length) -> - case Continuation() of - stop -> - Length; - - {continue, _, Next} -> - do_length(Next, Length + 1) - end. - --spec length(iterator(any())) -> integer(). -length(Iterator) -> - _pipe = erlang:element(2, Iterator), - do_length(_pipe, 0). - --spec each(iterator(CAM), fun((CAM) -> any())) -> nil. -each(Iterator, F) -> - _pipe = Iterator, - _pipe@1 = map(_pipe, F), - run(_pipe@1). - --spec yield(CAP, fun(() -> iterator(CAP))) -> iterator(CAP). -yield(Element, Next) -> - {iterator, fun() -> {continue, Element, erlang:element(2, Next())} end}. diff --git a/build/packages/gleam_stdlib/src/gleam@list.erl b/build/packages/gleam_stdlib/src/gleam@list.erl deleted file mode 100644 index 6425964..0000000 --- a/build/packages/gleam_stdlib/src/gleam@list.erl +++ /dev/null @@ -1,1109 +0,0 @@ --module(gleam@list). --compile([no_auto_import, nowarn_unused_vars]). - --export([length/1, reverse/1, is_empty/1, contains/2, first/1, rest/1, filter/2, filter_map/2, map/2, map2/3, index_map/2, try_map/2, drop/2, take/2, new/0, append/2, prepend/2, concat/1, flatten/1, flat_map/2, fold/3, group/2, map_fold/3, fold_right/3, index_fold/3, try_fold/3, fold_until/3, find/2, find_map/2, all/2, any/2, zip/2, strict_zip/2, unzip/1, intersperse/2, at/2, unique/1, sort/2, range/2, repeat/2, split/2, split_while/2, key_find/2, pop/2, pop_map/2, key_pop/2, key_set/3, each/2, try_each/2, partition/2, permutations/1, window/2, window_by_2/1, drop_while/2, take_while/2, chunk/2, sized_chunk/2, reduce/2, scan/3, last/1, combinations/2, combination_pairs/1, transpose/1, interleave/1, shuffle/1]). --export_type([length_mismatch/0, continue_or_stop/1]). - --type length_mismatch() :: length_mismatch. - --type continue_or_stop(VA) :: {continue, VA} | {stop, VA}. - --spec length(list(any())) -> integer(). -length(List) -> - erlang:length(List). - --spec reverse(list(VF)) -> list(VF). -reverse(Xs) -> - lists:reverse(Xs). - --spec is_empty(list(any())) -> boolean(). -is_empty(List) -> - List =:= []. - --spec contains(list(VN), VN) -> boolean(). -contains(List, Elem) -> - case List of - [] -> - false; - - [First | _] when First =:= Elem -> - true; - - [_ | Rest] -> - contains(Rest, Elem) - end. - --spec first(list(VP)) -> {ok, VP} | {error, nil}. -first(List) -> - case List of - [] -> - {error, nil}; - - [X | _] -> - {ok, X} - end. - --spec rest(list(VT)) -> {ok, list(VT)} | {error, nil}. -rest(List) -> - case List of - [] -> - {error, nil}; - - [_ | Xs] -> - {ok, Xs} - end. - --spec do_filter(list(WM), fun((WM) -> boolean()), list(WM)) -> list(WM). -do_filter(List, Fun, Acc) -> - case List of - [] -> - reverse(Acc); - - [X | Xs] -> - New_acc = case Fun(X) of - true -> - [X | Acc]; - - false -> - Acc - end, - do_filter(Xs, Fun, New_acc) - end. - --spec filter(list(WQ), fun((WQ) -> boolean())) -> list(WQ). -filter(List, Predicate) -> - do_filter(List, Predicate, []). - --spec do_filter_map(list(WT), fun((WT) -> {ok, WV} | {error, any()}), list(WV)) -> list(WV). -do_filter_map(List, Fun, Acc) -> - case List of - [] -> - reverse(Acc); - - [X | Xs] -> - New_acc = case Fun(X) of - {ok, X@1} -> - [X@1 | Acc]; - - {error, _} -> - Acc - end, - do_filter_map(Xs, Fun, New_acc) - end. - --spec filter_map(list(XB), fun((XB) -> {ok, XD} | {error, any()})) -> list(XD). -filter_map(List, Fun) -> - do_filter_map(List, Fun, []). - --spec do_map(list(XI), fun((XI) -> XK), list(XK)) -> list(XK). -do_map(List, Fun, Acc) -> - case List of - [] -> - reverse(Acc); - - [X | Xs] -> - do_map(Xs, Fun, [Fun(X) | Acc]) - end. - --spec map(list(XN), fun((XN) -> XP)) -> list(XP). -map(List, Fun) -> - do_map(List, Fun, []). - --spec update_group(fun((VY) -> VZ)) -> fun((gleam@map:map_(VZ, list(VY)), VY) -> gleam@map:map_(VZ, list(VY))). -update_group(F) -> - fun(Groups, Elem) -> case gleam@map:get(Groups, F(Elem)) of - {ok, Existing} -> - gleam@map:insert(Groups, F(Elem), [Elem | Existing]); - - {error, _} -> - gleam@map:insert(Groups, F(Elem), [Elem]) - end end. - --spec do_map2(list(XX), list(XZ), fun((XX, XZ) -> YB), list(YB)) -> list(YB). -do_map2(List1, List2, Fun, Acc) -> - case {List1, List2} of - {[], _} -> - reverse(Acc); - - {_, []} -> - reverse(Acc); - - {[A | As_], [B | Bs]} -> - do_map2(As_, Bs, Fun, [Fun(A, B) | Acc]) - end. - --spec map2(list(XR), list(XT), fun((XR, XT) -> XV)) -> list(XV). -map2(List1, List2, Fun) -> - do_map2(List1, List2, Fun, []). - --spec do_index_map(list(YJ), fun((integer(), YJ) -> YL), integer(), list(YL)) -> list(YL). -do_index_map(List, Fun, Index, Acc) -> - case List of - [] -> - reverse(Acc); - - [X | Xs] -> - Acc@1 = [Fun(Index, X) | Acc], - do_index_map(Xs, Fun, Index + 1, Acc@1) - end. - --spec index_map(list(YO), fun((integer(), YO) -> YQ)) -> list(YQ). -index_map(List, Fun) -> - do_index_map(List, Fun, 0, []). - --spec do_try_map(list(YS), fun((YS) -> {ok, YU} | {error, YV}), list(YU)) -> {ok, - list(YU)} | - {error, YV}. -do_try_map(List, Fun, Acc) -> - case List of - [] -> - {ok, reverse(Acc)}; - - [X | Xs] -> - case Fun(X) of - {ok, Y} -> - do_try_map(Xs, Fun, [Y | Acc]); - - {error, Error} -> - {error, Error} - end - end. - --spec try_map(list(AAC), fun((AAC) -> {ok, AAE} | {error, AAF})) -> {ok, - list(AAE)} | - {error, AAF}. -try_map(List, Fun) -> - do_try_map(List, Fun, []). - --spec drop(list(AAL), integer()) -> list(AAL). -drop(List, N) -> - case N =< 0 of - true -> - List; - - false -> - case List of - [] -> - []; - - [_ | Xs] -> - drop(Xs, N - 1) - end - end. - --spec do_take(list(AAO), integer(), list(AAO)) -> list(AAO). -do_take(List, N, Acc) -> - case N =< 0 of - true -> - reverse(Acc); - - false -> - case List of - [] -> - reverse(Acc); - - [X | Xs] -> - do_take(Xs, N - 1, [X | Acc]) - end - end. - --spec take(list(AAS), integer()) -> list(AAS). -take(List, N) -> - do_take(List, N, []). - --spec new() -> list(any()). -new() -> - []. - --spec append(list(AAX), list(AAX)) -> list(AAX). -append(First, Second) -> - lists:append(First, Second). - --spec prepend(list(ABF), ABF) -> list(ABF). -prepend(List, Item) -> - [Item | List]. - --spec reverse_and_prepend(list(ABI), list(ABI)) -> list(ABI). -reverse_and_prepend(Prefix, Suffix) -> - case Prefix of - [] -> - Suffix; - - [First | Rest] -> - reverse_and_prepend(Rest, [First | Suffix]) - end. - --spec do_concat(list(list(ABM)), list(ABM)) -> list(ABM). -do_concat(Lists, Acc) -> - case Lists of - [] -> - reverse(Acc); - - [List | Further_lists] -> - do_concat(Further_lists, reverse_and_prepend(List, Acc)) - end. - --spec concat(list(list(ABR))) -> list(ABR). -concat(Lists) -> - do_concat(Lists, []). - --spec flatten(list(list(ABV))) -> list(ABV). -flatten(Lists) -> - do_concat(Lists, []). - --spec flat_map(list(ABZ), fun((ABZ) -> list(ACB))) -> list(ACB). -flat_map(List, Fun) -> - _pipe = map(List, Fun), - concat(_pipe). - --spec fold(list(ACE), ACG, fun((ACG, ACE) -> ACG)) -> ACG. -fold(List, Initial, Fun) -> - case List of - [] -> - Initial; - - [X | Rest] -> - fold(Rest, Fun(Initial, X), Fun) - end. - --spec group(list(WG), fun((WG) -> WI)) -> gleam@map:map_(WI, list(WG)). -group(List, Key) -> - fold(List, gleam@map:new(), update_group(Key)). - --spec map_fold(list(YE), YG, fun((YG, YE) -> {YG, YH})) -> {YG, list(YH)}. -map_fold(List, Acc, Fun) -> - _pipe = fold( - List, - {Acc, []}, - fun(Acc@1, Item) -> - {Current_acc, Items} = Acc@1, - {Next_acc, Next_item} = Fun(Current_acc, Item), - {Next_acc, [Next_item | Items]} - end - ), - gleam@pair:map_second(_pipe, fun reverse/1). - --spec fold_right(list(ACH), ACJ, fun((ACJ, ACH) -> ACJ)) -> ACJ. -fold_right(List, Initial, Fun) -> - case List of - [] -> - Initial; - - [X | Rest] -> - Fun(fold_right(Rest, Initial, Fun), X) - end. - --spec do_index_fold( - list(ACK), - ACM, - fun((ACM, ACK, integer()) -> ACM), - integer() -) -> ACM. -do_index_fold(Over, Acc, With, Index) -> - case Over of - [] -> - Acc; - - [First | Rest] -> - do_index_fold(Rest, With(Acc, First, Index), With, Index + 1) - end. - --spec index_fold(list(ACN), ACP, fun((ACP, ACN, integer()) -> ACP)) -> ACP. -index_fold(Over, Initial, Fun) -> - do_index_fold(Over, Initial, Fun, 0). - --spec try_fold(list(ACQ), ACS, fun((ACS, ACQ) -> {ok, ACS} | {error, ACT})) -> {ok, - ACS} | - {error, ACT}. -try_fold(Collection, Accumulator, Fun) -> - case Collection of - [] -> - {ok, Accumulator}; - - [First | Rest] -> - case Fun(Accumulator, First) of - {ok, Result} -> - try_fold(Rest, Result, Fun); - - {error, _} = Error -> - Error - end - end. - --spec fold_until(list(ACY), ADA, fun((ADA, ACY) -> continue_or_stop(ADA))) -> ADA. -fold_until(Collection, Accumulator, Fun) -> - case Collection of - [] -> - Accumulator; - - [First | Rest] -> - case Fun(Accumulator, First) of - {continue, Next_accumulator} -> - fold_until(Rest, Next_accumulator, Fun); - - {stop, B} -> - B - end - end. - --spec find(list(ADC), fun((ADC) -> boolean())) -> {ok, ADC} | {error, nil}. -find(Haystack, Is_desired) -> - case Haystack of - [] -> - {error, nil}; - - [X | Rest] -> - case Is_desired(X) of - true -> - {ok, X}; - - _ -> - find(Rest, Is_desired) - end - end. - --spec find_map(list(ADG), fun((ADG) -> {ok, ADI} | {error, any()})) -> {ok, ADI} | - {error, nil}. -find_map(Haystack, Fun) -> - case Haystack of - [] -> - {error, nil}; - - [X | Rest] -> - case Fun(X) of - {ok, X@1} -> - {ok, X@1}; - - _ -> - find_map(Rest, Fun) - end - end. - --spec all(list(ADO), fun((ADO) -> boolean())) -> boolean(). -all(List, Predicate) -> - case List of - [] -> - true; - - [First | Rest] -> - case Predicate(First) of - true -> - all(Rest, Predicate); - - false -> - false - end - end. - --spec any(list(ADQ), fun((ADQ) -> boolean())) -> boolean(). -any(List, Predicate) -> - case List of - [] -> - false; - - [First | Rest] -> - case Predicate(First) of - true -> - true; - - false -> - any(Rest, Predicate) - end - end. - --spec do_zip(list(ADS), list(ADU), list({ADS, ADU})) -> list({ADS, ADU}). -do_zip(Xs, Ys, Acc) -> - case {Xs, Ys} of - {[X | Xs@1], [Y | Ys@1]} -> - do_zip(Xs@1, Ys@1, [{X, Y} | Acc]); - - {_, _} -> - reverse(Acc) - end. - --spec zip(list(ADY), list(AEA)) -> list({ADY, AEA}). -zip(List, Other) -> - do_zip(List, Other, []). - --spec strict_zip(list(AED), list(AEF)) -> {ok, list({AED, AEF})} | - {error, length_mismatch()}. -strict_zip(List, Other) -> - case length(List) =:= length(Other) of - true -> - {ok, zip(List, Other)}; - - false -> - {error, length_mismatch} - end. - --spec do_unzip(list({AUB, AUC}), list(AUB), list(AUC)) -> {list(AUB), list(AUC)}. -do_unzip(Input, Xs, Ys) -> - case Input of - [] -> - {reverse(Xs), reverse(Ys)}; - - [{X, Y} | Rest] -> - do_unzip(Rest, [X | Xs], [Y | Ys]) - end. - --spec unzip(list({AEO, AEP})) -> {list(AEO), list(AEP)}. -unzip(Input) -> - do_unzip(Input, [], []). - --spec do_intersperse(list(AET), AET, list(AET)) -> list(AET). -do_intersperse(List, Separator, Acc) -> - case List of - [] -> - reverse(Acc); - - [X | Rest] -> - do_intersperse(Rest, Separator, [X, Separator | Acc]) - end. - --spec intersperse(list(AEX), AEX) -> list(AEX). -intersperse(List, Elem) -> - case List of - [] -> - List; - - [_] -> - List; - - [X | Rest] -> - do_intersperse(Rest, Elem, [X]) - end. - --spec at(list(AFA), integer()) -> {ok, AFA} | {error, nil}. -at(List, Index) -> - case Index >= 0 of - true -> - _pipe = List, - _pipe@1 = drop(_pipe, Index), - first(_pipe@1); - - false -> - {error, nil} - end. - --spec unique(list(AFE)) -> list(AFE). -unique(List) -> - case List of - [] -> - []; - - [X | Rest] -> - [X | unique(filter(Rest, fun(Y) -> Y /= X end))] - end. - --spec merge_up( - integer(), - integer(), - list(AFH), - list(AFH), - list(AFH), - fun((AFH, AFH) -> gleam@order:order()) -) -> list(AFH). -merge_up(Na, Nb, A, B, Acc, Compare) -> - case {Na, Nb, A, B} of - {0, 0, _, _} -> - Acc; - - {_, 0, [Ax | Ar], _} -> - merge_up(Na - 1, Nb, Ar, B, [Ax | Acc], Compare); - - {0, _, _, [Bx | Br]} -> - merge_up(Na, Nb - 1, A, Br, [Bx | Acc], Compare); - - {_, _, [Ax@1 | Ar@1], [Bx@1 | Br@1]} -> - case Compare(Ax@1, Bx@1) of - gt -> - merge_up(Na, Nb - 1, A, Br@1, [Bx@1 | Acc], Compare); - - _ -> - merge_up(Na - 1, Nb, Ar@1, B, [Ax@1 | Acc], Compare) - end - end. - --spec merge_down( - integer(), - integer(), - list(AFM), - list(AFM), - list(AFM), - fun((AFM, AFM) -> gleam@order:order()) -) -> list(AFM). -merge_down(Na, Nb, A, B, Acc, Compare) -> - case {Na, Nb, A, B} of - {0, 0, _, _} -> - Acc; - - {_, 0, [Ax | Ar], _} -> - merge_down(Na - 1, Nb, Ar, B, [Ax | Acc], Compare); - - {0, _, _, [Bx | Br]} -> - merge_down(Na, Nb - 1, A, Br, [Bx | Acc], Compare); - - {_, _, [Ax@1 | Ar@1], [Bx@1 | Br@1]} -> - case Compare(Bx@1, Ax@1) of - lt -> - merge_down(Na - 1, Nb, Ar@1, B, [Ax@1 | Acc], Compare); - - _ -> - merge_down(Na, Nb - 1, A, Br@1, [Bx@1 | Acc], Compare) - end - end. - --spec merge_sort( - list(AFR), - integer(), - fun((AFR, AFR) -> gleam@order:order()), - boolean() -) -> list(AFR). -merge_sort(L, Ln, Compare, Down) -> - N = Ln div 2, - A = L, - B = drop(L, N), - case Ln < 3 of - true -> - case Down of - true -> - merge_down(N, Ln - N, A, B, [], Compare); - - false -> - merge_up(N, Ln - N, A, B, [], Compare) - end; - - false -> - case Down of - true -> - merge_down( - N, - Ln - N, - merge_sort(A, N, Compare, false), - merge_sort(B, Ln - N, Compare, false), - [], - Compare - ); - - false -> - merge_up( - N, - Ln - N, - merge_sort(A, N, Compare, true), - merge_sort(B, Ln - N, Compare, true), - [], - Compare - ) - end - end. - --spec sort(list(AFU), fun((AFU, AFU) -> gleam@order:order())) -> list(AFU). -sort(List, Compare) -> - merge_sort(List, length(List), Compare, true). - --spec tail_recursive_range(integer(), integer(), list(integer())) -> list(integer()). -tail_recursive_range(Start, Stop, Acc) -> - case gleam@int:compare(Start, Stop) of - eq -> - [Stop | Acc]; - - gt -> - tail_recursive_range(Start, Stop + 1, [Stop | Acc]); - - lt -> - tail_recursive_range(Start, Stop - 1, [Stop | Acc]) - end. - --spec range(integer(), integer()) -> list(integer()). -range(Start, Stop) -> - tail_recursive_range(Start, Stop, []). - --spec do_repeat(AGA, integer(), list(AGA)) -> list(AGA). -do_repeat(A, Times, Acc) -> - case Times =< 0 of - true -> - Acc; - - false -> - do_repeat(A, Times - 1, [A | Acc]) - end. - --spec repeat(AGD, integer()) -> list(AGD). -repeat(A, Times) -> - do_repeat(A, Times, []). - --spec do_split(list(AGF), integer(), list(AGF)) -> {list(AGF), list(AGF)}. -do_split(List, N, Taken) -> - case N =< 0 of - true -> - {reverse(Taken), List}; - - false -> - case List of - [] -> - {reverse(Taken), []}; - - [X | Xs] -> - do_split(Xs, N - 1, [X | Taken]) - end - end. - --spec split(list(AGK), integer()) -> {list(AGK), list(AGK)}. -split(List, Index) -> - do_split(List, Index, []). - --spec do_split_while(list(AGO), fun((AGO) -> boolean()), list(AGO)) -> {list(AGO), - list(AGO)}. -do_split_while(List, F, Acc) -> - case List of - [] -> - {reverse(Acc), []}; - - [X | Xs] -> - case F(X) of - false -> - {reverse(Acc), List}; - - _ -> - do_split_while(Xs, F, [X | Acc]) - end - end. - --spec split_while(list(AGT), fun((AGT) -> boolean())) -> {list(AGT), list(AGT)}. -split_while(List, Predicate) -> - do_split_while(List, Predicate, []). - --spec key_find(list({AGX, AGY}), AGX) -> {ok, AGY} | {error, nil}. -key_find(Keyword_list, Desired_key) -> - find_map( - Keyword_list, - fun(Keyword) -> - {Key, Value} = Keyword, - case Key =:= Desired_key of - true -> - {ok, Value}; - - false -> - {error, nil} - end - end - ). - --spec do_pop(list(AXL), fun((AXL) -> boolean()), list(AXL)) -> {ok, - {AXL, list(AXL)}} | - {error, nil}. -do_pop(Haystack, Predicate, Checked) -> - case Haystack of - [] -> - {error, nil}; - - [X | Rest] -> - case Predicate(X) of - true -> - {ok, {X, append(reverse(Checked), Rest)}}; - - false -> - do_pop(Rest, Predicate, [X | Checked]) - end - end. - --spec pop(list(AHG), fun((AHG) -> boolean())) -> {ok, {AHG, list(AHG)}} | - {error, nil}. -pop(Haystack, Is_desired) -> - do_pop(Haystack, Is_desired, []). - --spec do_pop_map(list(AXZ), fun((AXZ) -> {ok, AYM} | {error, any()}), list(AXZ)) -> {ok, - {AYM, list(AXZ)}} | - {error, nil}. -do_pop_map(Haystack, Mapper, Checked) -> - case Haystack of - [] -> - {error, nil}; - - [X | Rest] -> - case Mapper(X) of - {ok, Y} -> - {ok, {Y, append(reverse(Checked), Rest)}}; - - {error, _} -> - do_pop_map(Rest, Mapper, [X | Checked]) - end - end. - --spec pop_map(list(AHP), fun((AHP) -> {ok, AHR} | {error, any()})) -> {ok, - {AHR, list(AHP)}} | - {error, nil}. -pop_map(Haystack, Is_desired) -> - do_pop_map(Haystack, Is_desired, []). - --spec key_pop(list({AHY, AHZ}), AHY) -> {ok, {AHZ, list({AHY, AHZ})}} | - {error, nil}. -key_pop(Haystack, Key) -> - pop_map( - Haystack, - fun(Entry) -> - {K, V} = Entry, - case K of - K@1 when K@1 =:= Key -> - {ok, V}; - - _ -> - {error, nil} - end - end - ). - --spec key_set(list({AIE, AIF}), AIE, AIF) -> list({AIE, AIF}). -key_set(List, Key, Value) -> - case List of - [] -> - [{Key, Value}]; - - [{K, _} | Rest] when K =:= Key -> - [{Key, Value} | Rest]; - - [First | Rest@1] -> - [First | key_set(Rest@1, Key, Value)] - end. - --spec each(list(AII), fun((AII) -> any())) -> nil. -each(List, F) -> - case List of - [] -> - nil; - - [X | Xs] -> - F(X), - each(Xs, F) - end. - --spec try_each(list(AIL), fun((AIL) -> {ok, any()} | {error, AIO})) -> {ok, nil} | - {error, AIO}. -try_each(List, Fun) -> - case List of - [] -> - {ok, nil}; - - [X | Xs] -> - case Fun(X) of - {ok, _} -> - try_each(Xs, Fun); - - {error, E} -> - {error, E} - end - end. - --spec do_partition(list(AZT), fun((AZT) -> boolean()), list(AZT), list(AZT)) -> {list(AZT), - list(AZT)}. -do_partition(List, Categorise, Trues, Falses) -> - case List of - [] -> - {reverse(Trues), reverse(Falses)}; - - [X | Xs] -> - case Categorise(X) of - true -> - do_partition(Xs, Categorise, [X | Trues], Falses); - - false -> - do_partition(Xs, Categorise, Trues, [X | Falses]) - end - end. - --spec partition(list(AIY), fun((AIY) -> boolean())) -> {list(AIY), list(AIY)}. -partition(List, Categorise) -> - do_partition(List, Categorise, [], []). - --spec permutations(list(AJC)) -> list(list(AJC)). -permutations(L) -> - case L of - [] -> - [[]]; - - _ -> - _pipe = L, - _pipe@5 = index_map(_pipe, fun(I_idx, I) -> _pipe@1 = L, - _pipe@2 = index_fold( - _pipe@1, - [], - fun(Acc, J, J_idx) -> case I_idx =:= J_idx of - true -> - Acc; - - false -> - [J | Acc] - end end - ), - _pipe@3 = reverse(_pipe@2), - _pipe@4 = permutations(_pipe@3), - map(_pipe@4, fun(Permutation) -> [I | Permutation] end) end), - concat(_pipe@5) - end. - --spec do_window(list(list(AJG)), list(AJG), integer()) -> list(list(AJG)). -do_window(Acc, L, N) -> - Window = take(L, N), - case length(Window) =:= N of - true -> - do_window([Window | Acc], drop(L, 1), N); - - false -> - Acc - end. - --spec window(list(AJM), integer()) -> list(list(AJM)). -window(L, N) -> - _pipe = do_window([], L, N), - reverse(_pipe). - --spec window_by_2(list(AJQ)) -> list({AJQ, AJQ}). -window_by_2(L) -> - zip(L, drop(L, 1)). - --spec drop_while(list(AJT), fun((AJT) -> boolean())) -> list(AJT). -drop_while(List, Predicate) -> - case List of - [] -> - []; - - [X | Xs] -> - case Predicate(X) of - true -> - drop_while(Xs, Predicate); - - false -> - [X | Xs] - end - end. - --spec do_take_while(list(AJW), fun((AJW) -> boolean()), list(AJW)) -> list(AJW). -do_take_while(List, Predicate, Acc) -> - case List of - [] -> - reverse(Acc); - - [First | Rest] -> - case Predicate(First) of - true -> - do_take_while(Rest, Predicate, [First | Acc]); - - false -> - reverse(Acc) - end - end. - --spec take_while(list(AKA), fun((AKA) -> boolean())) -> list(AKA). -take_while(List, Predicate) -> - do_take_while(List, Predicate, []). - --spec do_chunk(list(AKD), fun((AKD) -> AKF), AKF, list(AKD), list(list(AKD))) -> list(list(AKD)). -do_chunk(List, F, Previous_key, Current_chunk, Acc) -> - case List of - [First | Rest] -> - Key = F(First), - case Key =:= Previous_key of - false -> - New_acc = [reverse(Current_chunk) | Acc], - do_chunk(Rest, F, Key, [First], New_acc); - - _ -> - do_chunk(Rest, F, Key, [First | Current_chunk], Acc) - end; - - _ -> - reverse([reverse(Current_chunk) | Acc]) - end. - --spec chunk(list(AKL), fun((AKL) -> any())) -> list(list(AKL)). -chunk(List, F) -> - case List of - [] -> - []; - - [First | Rest] -> - do_chunk(Rest, F, F(First), [First], []) - end. - --spec do_sized_chunk( - list(AKQ), - integer(), - integer(), - list(AKQ), - list(list(AKQ)) -) -> list(list(AKQ)). -do_sized_chunk(List, Count, Left, Current_chunk, Acc) -> - case List of - [] -> - case Current_chunk of - [] -> - reverse(Acc); - - Remaining -> - reverse([reverse(Remaining) | Acc]) - end; - - [First | Rest] -> - Chunk = [First | Current_chunk], - case Left > 1 of - false -> - do_sized_chunk( - Rest, - Count, - Count, - [], - [reverse(Chunk) | Acc] - ); - - true -> - do_sized_chunk(Rest, Count, Left - 1, Chunk, Acc) - end - end. - --spec sized_chunk(list(AKX), integer()) -> list(list(AKX)). -sized_chunk(List, Count) -> - do_sized_chunk(List, Count, Count, [], []). - --spec reduce(list(ALB), fun((ALB, ALB) -> ALB)) -> {ok, ALB} | {error, nil}. -reduce(List, Fun) -> - case List of - [] -> - {error, nil}; - - [First | Rest] -> - {ok, fold(Rest, First, Fun)} - end. - --spec do_scan(list(ALF), ALH, list(ALH), fun((ALH, ALF) -> ALH)) -> list(ALH). -do_scan(List, Accumulator, Accumulated, Fun) -> - case List of - [] -> - reverse(Accumulated); - - [X | Xs] -> - Next = Fun(Accumulator, X), - do_scan(Xs, Next, [Next | Accumulated], Fun) - end. - --spec scan(list(ALK), ALM, fun((ALM, ALK) -> ALM)) -> list(ALM). -scan(List, Initial, Fun) -> - do_scan(List, Initial, [], Fun). - --spec last(list(ALO)) -> {ok, ALO} | {error, nil}. -last(List) -> - _pipe = List, - reduce(_pipe, fun(_, Elem) -> Elem end). - --spec combinations(list(ALS), integer()) -> list(list(ALS)). -combinations(Items, N) -> - case N of - 0 -> - [[]]; - - _ -> - case Items of - [] -> - []; - - [X | Xs] -> - First_combinations = begin - _pipe = map( - combinations(Xs, N - 1), - fun(Com) -> [X | Com] end - ), - reverse(_pipe) - end, - fold( - First_combinations, - combinations(Xs, N), - fun(Acc, C) -> [C | Acc] end - ) - end - end. - --spec do_combination_pairs(list(ALW)) -> list(list({ALW, ALW})). -do_combination_pairs(Items) -> - case Items of - [] -> - []; - - [X | Xs] -> - First_combinations = map(Xs, fun(Other) -> {X, Other} end), - [First_combinations | do_combination_pairs(Xs)] - end. - --spec combination_pairs(list(AMA)) -> list({AMA, AMA}). -combination_pairs(Items) -> - _pipe = do_combination_pairs(Items), - concat(_pipe). - --spec transpose(list(list(AMH))) -> list(list(AMH)). -transpose(List_of_list) -> - Take_first = fun(List) -> case List of - [] -> - []; - - [F] -> - [F]; - - [F@1 | _] -> - [F@1] - end end, - case List_of_list of - [] -> - []; - - [[] | Xss] -> - transpose(Xss); - - Rows -> - Firsts = begin - _pipe = Rows, - _pipe@1 = map(_pipe, Take_first), - concat(_pipe@1) - end, - Rest = transpose(map(Rows, fun(_capture) -> drop(_capture, 1) end)), - [Firsts | Rest] - end. - --spec interleave(list(list(AMD))) -> list(AMD). -interleave(List) -> - _pipe = transpose(List), - concat(_pipe). - --spec do_shuffle_pair_unwrap(list({float(), AMM}), list(AMM)) -> list(AMM). -do_shuffle_pair_unwrap(List, Acc) -> - case List of - [] -> - Acc; - - _ -> - [Elem_pair | Enumerable] = List, - do_shuffle_pair_unwrap( - Enumerable, - [erlang:element(2, Elem_pair) | Acc] - ) - end. - --spec do_shuffle_by_pair_indexes(list({float(), AMQ})) -> list({float(), AMQ}). -do_shuffle_by_pair_indexes(List_of_pairs) -> - sort( - List_of_pairs, - fun(A_pair, B_pair) -> - gleam@float:compare( - erlang:element(1, A_pair), - erlang:element(1, B_pair) - ) - end - ). - --spec shuffle(list(AMT)) -> list(AMT). -shuffle(List) -> - _pipe = List, - _pipe@1 = fold( - _pipe, - [], - fun(Acc, A) -> [{gleam@float:random(0.0, 1.0), A} | Acc] end - ), - _pipe@2 = do_shuffle_by_pair_indexes(_pipe@1), - do_shuffle_pair_unwrap(_pipe@2, []). diff --git a/build/packages/gleam_stdlib/src/gleam@map.erl b/build/packages/gleam_stdlib/src/gleam@map.erl deleted file mode 100644 index 2eeed8c..0000000 --- a/build/packages/gleam_stdlib/src/gleam@map.erl +++ /dev/null @@ -1,97 +0,0 @@ --module(gleam@map). --compile([no_auto_import, nowarn_unused_vars]). - --export([size/1, to_list/1, from_list/1, has_key/2, new/0, get/2, insert/3, map_values/2, keys/1, values/1, filter/2, take/2, merge/2, delete/2, drop/2, update/3, fold/3]). --export_type([map_/2]). - --type map_(LP, LQ) :: any() | {gleam_phantom, LP, LQ}. - --spec size(map_(any(), any())) -> integer(). -size(Map) -> - maps:size(Map). - --spec to_list(map_(LZ, MA)) -> list({LZ, MA}). -to_list(Map) -> - maps:to_list(Map). - --spec from_list(list({MJ, MK})) -> map_(MJ, MK). -from_list(List) -> - maps:from_list(List). - --spec has_key(map_(MT, any()), MT) -> boolean(). -has_key(Map, Key) -> - maps:is_key(Key, Map). - --spec new() -> map_(any(), any()). -new() -> - maps:new(). - --spec get(map_(NJ, NK), NJ) -> {ok, NK} | {error, nil}. -get(From, Get) -> - gleam_stdlib:map_get(From, Get). - --spec insert(map_(NV, NW), NV, NW) -> map_(NV, NW). -insert(Map, Key, Value) -> - maps:put(Key, Value, Map). - --spec map_values(map_(OH, OI), fun((OH, OI) -> OL)) -> map_(OH, OL). -map_values(Map, Fun) -> - maps:map(Fun, Map). - --spec keys(map_(OV, any())) -> list(OV). -keys(Map) -> - maps:keys(Map). - --spec values(map_(any(), PG)) -> list(PG). -values(Map) -> - maps:values(Map). - --spec filter(map_(PP, PQ), fun((PP, PQ) -> boolean())) -> map_(PP, PQ). -filter(Map, Property) -> - maps:filter(Property, Map). - --spec take(map_(QB, QC), list(QB)) -> map_(QB, QC). -take(Map, Desired_keys) -> - maps:with(Desired_keys, Map). - --spec merge(map_(QP, QQ), map_(QP, QQ)) -> map_(QP, QQ). -merge(Map, New_entries) -> - maps:merge(Map, New_entries). - --spec delete(map_(RF, RG), RF) -> map_(RF, RG). -delete(Map, Key) -> - maps:remove(Key, Map). - --spec drop(map_(RR, RS), list(RR)) -> map_(RR, RS). -drop(Map, Disallowed_keys) -> - case Disallowed_keys of - [] -> - Map; - - [X | Xs] -> - drop(delete(Map, X), Xs) - end. - --spec update(map_(RY, RZ), RY, fun((gleam@option:option(RZ)) -> RZ)) -> map_(RY, RZ). -update(Map, Key, Fun) -> - _pipe = Map, - _pipe@1 = get(_pipe, Key), - _pipe@2 = gleam@option:from_result(_pipe@1), - _pipe@3 = Fun(_pipe@2), - insert(Map, Key, _pipe@3). - --spec do_fold(list({SF, SG}), SI, fun((SI, SF, SG) -> SI)) -> SI. -do_fold(List, Initial, Fun) -> - case List of - [] -> - Initial; - - [{K, V} | Rest] -> - do_fold(Rest, Fun(Initial, K, V), Fun) - end. - --spec fold(map_(SJ, SK), SN, fun((SN, SJ, SK) -> SN)) -> SN. -fold(Map, Initial, Fun) -> - _pipe = Map, - _pipe@1 = to_list(_pipe), - do_fold(_pipe@1, Initial, Fun). diff --git a/build/packages/gleam_stdlib/src/gleam@option.erl b/build/packages/gleam_stdlib/src/gleam@option.erl deleted file mode 100644 index 80f6bed..0000000 --- a/build/packages/gleam_stdlib/src/gleam@option.erl +++ /dev/null @@ -1,147 +0,0 @@ --module(gleam@option). --compile([no_auto_import, nowarn_unused_vars]). - --export([all/1, is_some/1, is_none/1, to_result/2, from_result/1, unwrap/2, lazy_unwrap/2, map/2, flatten/1, then/2, 'or'/2, lazy_or/2, values/1]). --export_type([option/1]). - --type option(GY) :: {some, GY} | none. - --spec do_all(list(option(GZ)), list(GZ)) -> option(list(GZ)). -do_all(List, Acc) -> - case List of - [] -> - {some, Acc}; - - [X | Rest] -> - Accumulate = fun(Acc@1, Item) -> case {Acc@1, Item} of - {{some, Values}, {some, Value}} -> - {some, [Value | Values]}; - - {_, _} -> - none - end end, - Accumulate(do_all(Rest, Acc), X) - end. - --spec all(list(option(HF))) -> option(list(HF)). -all(List) -> - do_all(List, []). - --spec is_some(option(any())) -> boolean(). -is_some(Option) -> - Option /= none. - --spec is_none(option(any())) -> boolean(). -is_none(Option) -> - Option =:= none. - --spec to_result(option(HO), HR) -> {ok, HO} | {error, HR}. -to_result(Option, E) -> - case Option of - {some, A} -> - {ok, A}; - - _ -> - {error, E} - end. - --spec from_result({ok, HU} | {error, any()}) -> option(HU). -from_result(Result) -> - case Result of - {ok, A} -> - {some, A}; - - _ -> - none - end. - --spec unwrap(option(HZ), HZ) -> HZ. -unwrap(Option, Default) -> - case Option of - {some, X} -> - X; - - none -> - Default - end. - --spec lazy_unwrap(option(IB), fun(() -> IB)) -> IB. -lazy_unwrap(Option, Default) -> - case Option of - {some, X} -> - X; - - none -> - Default() - end. - --spec map(option(ID), fun((ID) -> IF)) -> option(IF). -map(Option, Fun) -> - case Option of - {some, X} -> - {some, Fun(X)}; - - none -> - none - end. - --spec flatten(option(option(IH))) -> option(IH). -flatten(Option) -> - case Option of - {some, X} -> - X; - - none -> - none - end. - --spec then(option(IL), fun((IL) -> option(IN))) -> option(IN). -then(Option, Fun) -> - case Option of - {some, X} -> - Fun(X); - - none -> - none - end. - --spec 'or'(option(IQ), option(IQ)) -> option(IQ). -'or'(First, Second) -> - case First of - {some, _} -> - First; - - none -> - Second - end. - --spec lazy_or(option(IU), fun(() -> option(IU))) -> option(IU). -lazy_or(First, Second) -> - case First of - {some, _} -> - First; - - none -> - Second() - end. - --spec do_values(list(option(IY)), list(IY)) -> list(IY). -do_values(List, Acc) -> - case List of - [] -> - Acc; - - [X | Xs] -> - Accumulate = fun(Acc@1, Item) -> case Item of - {some, Value} -> - [Value | Acc@1]; - - none -> - Acc@1 - end end, - Accumulate(do_values(Xs, Acc), X) - end. - --spec values(list(option(JD))) -> list(JD). -values(Options) -> - do_values(Options, []). diff --git a/build/packages/gleam_stdlib/src/gleam@order.erl b/build/packages/gleam_stdlib/src/gleam@order.erl deleted file mode 100644 index c6c2124..0000000 --- a/build/packages/gleam_stdlib/src/gleam@order.erl +++ /dev/null @@ -1,79 +0,0 @@ --module(gleam@order). --compile([no_auto_import, nowarn_unused_vars]). - --export([negate/1, to_int/1, compare/2, max/2, min/2, reverse/1]). --export_type([order/0]). - --type order() :: lt | eq | gt. - --spec negate(order()) -> order(). -negate(Order) -> - case Order of - lt -> - gt; - - eq -> - eq; - - gt -> - lt - end. - --spec to_int(order()) -> integer(). -to_int(Order) -> - case Order of - lt -> - -1; - - eq -> - 0; - - gt -> - 1 - end. - --spec compare(order(), order()) -> order(). -compare(A, B) -> - case {A, B} of - {X, Y} when X =:= Y -> - eq; - - {lt, _} -> - lt; - - {eq, gt} -> - lt; - - {_, _} -> - gt - end. - --spec max(order(), order()) -> order(). -max(A, B) -> - case {A, B} of - {gt, _} -> - gt; - - {eq, lt} -> - eq; - - {_, _} -> - B - end. - --spec min(order(), order()) -> order(). -min(A, B) -> - case {A, B} of - {lt, _} -> - lt; - - {eq, gt} -> - eq; - - {_, _} -> - B - end. - --spec reverse(fun((I, I) -> order())) -> fun((I, I) -> order()). -reverse(Orderer) -> - fun(A, B) -> Orderer(B, A) end. diff --git a/build/packages/gleam_stdlib/src/gleam@pair.erl b/build/packages/gleam_stdlib/src/gleam@pair.erl deleted file mode 100644 index 97f31b5..0000000 --- a/build/packages/gleam_stdlib/src/gleam@pair.erl +++ /dev/null @@ -1,33 +0,0 @@ --module(gleam@pair). --compile([no_auto_import, nowarn_unused_vars]). - --export([first/1, second/1, swap/1, map_first/2, map_second/2, new/2]). - --spec first({GJ, any()}) -> GJ. -first(Pair) -> - {A, _} = Pair, - A. - --spec second({any(), GM}) -> GM. -second(Pair) -> - {_, A} = Pair, - A. - --spec swap({GN, GO}) -> {GO, GN}. -swap(Pair) -> - {A, B} = Pair, - {B, A}. - --spec map_first({GP, GQ}, fun((GP) -> GR)) -> {GR, GQ}. -map_first(Pair, Fun) -> - {A, B} = Pair, - {Fun(A), B}. - --spec map_second({GS, GT}, fun((GT) -> GU)) -> {GS, GU}. -map_second(Pair, Fun) -> - {A, B} = Pair, - {A, Fun(B)}. - --spec new(GV, GW) -> {GV, GW}. -new(First, Second) -> - {First, Second}. diff --git a/build/packages/gleam_stdlib/src/gleam@queue.erl b/build/packages/gleam_stdlib/src/gleam@queue.erl deleted file mode 100644 index 3e45e4d..0000000 --- a/build/packages/gleam_stdlib/src/gleam@queue.erl +++ /dev/null @@ -1,121 +0,0 @@ --module(gleam@queue). --compile([no_auto_import, nowarn_unused_vars]). - --export([new/0, from_list/1, to_list/1, is_empty/1, length/1, push_back/2, push_front/2, pop_back/1, pop_front/1, reverse/1, is_logically_equal/3, is_equal/2]). --export_type([queue/1]). - --opaque queue(EIY) :: {queue, list(EIY), list(EIY)}. - --spec new() -> queue(any()). -new() -> - {queue, [], []}. - --spec from_list(list(EJB)) -> queue(EJB). -from_list(List) -> - {queue, [], List}. - --spec to_list(queue(EJE)) -> list(EJE). -to_list(Queue) -> - _pipe = erlang:element(3, Queue), - gleam@list:append(_pipe, gleam@list:reverse(erlang:element(2, Queue))). - --spec is_empty(queue(any())) -> boolean(). -is_empty(Queue) -> - (erlang:element(2, Queue) =:= []) andalso (erlang:element(3, Queue) =:= []). - --spec length(queue(any())) -> integer(). -length(Queue) -> - gleam@list:length(erlang:element(2, Queue)) + gleam@list:length( - erlang:element(3, Queue) - ). - --spec push_back(queue(EJL), EJL) -> queue(EJL). -push_back(Queue, Item) -> - {queue, [Item | erlang:element(2, Queue)], erlang:element(3, Queue)}. - --spec push_front(queue(EJO), EJO) -> queue(EJO). -push_front(Queue, Item) -> - {queue, erlang:element(2, Queue), [Item | erlang:element(3, Queue)]}. - --spec pop_back(queue(EJR)) -> {ok, {EJR, queue(EJR)}} | {error, nil}. -pop_back(Queue) -> - case Queue of - {queue, [], []} -> - {error, nil}; - - {queue, [], Out} -> - pop_back({queue, gleam@list:reverse(Out), []}); - - {queue, [First | Rest], Out@1} -> - Queue@1 = {queue, Rest, Out@1}, - {ok, {First, Queue@1}} - end. - --spec pop_front(queue(EJW)) -> {ok, {EJW, queue(EJW)}} | {error, nil}. -pop_front(Queue) -> - case Queue of - {queue, [], []} -> - {error, nil}; - - {queue, In, []} -> - pop_front({queue, [], gleam@list:reverse(In)}); - - {queue, In@1, [First | Rest]} -> - Queue@1 = {queue, In@1, Rest}, - {ok, {First, Queue@1}} - end. - --spec reverse(queue(EKB)) -> queue(EKB). -reverse(Queue) -> - {queue, erlang:element(3, Queue), erlang:element(2, Queue)}. - --spec check_equal( - list(EKE), - list(EKE), - list(EKE), - list(EKE), - fun((EKE, EKE) -> boolean()) -) -> boolean(). -check_equal(Xs, X_tail, Ys, Y_tail, Eq) -> - case {Xs, X_tail, Ys, Y_tail} of - {[], [], [], []} -> - true; - - {[X | Xs@1], _, [Y | Ys@1], _} -> - case Eq(X, Y) of - false -> - false; - - true -> - check_equal(Xs@1, X_tail, Ys@1, Y_tail, Eq) - end; - - {[], [_ | _], _, _} -> - check_equal(gleam@list:reverse(X_tail), [], Ys, Y_tail, Eq); - - {_, _, [], [_ | _]} -> - check_equal(Xs, X_tail, gleam@list:reverse(Y_tail), [], Eq); - - {_, _, _, _} -> - false - end. - --spec is_logically_equal(queue(EKJ), queue(EKJ), fun((EKJ, EKJ) -> boolean())) -> boolean(). -is_logically_equal(A, B, Element_is_equal) -> - check_equal( - erlang:element(3, A), - erlang:element(2, A), - erlang:element(3, B), - erlang:element(2, B), - Element_is_equal - ). - --spec is_equal(queue(EKM), queue(EKM)) -> boolean(). -is_equal(A, B) -> - check_equal( - erlang:element(3, A), - erlang:element(2, A), - erlang:element(3, B), - erlang:element(2, B), - fun(A@1, B@1) -> A@1 =:= B@1 end - ). diff --git a/build/packages/gleam_stdlib/src/gleam@regex.erl b/build/packages/gleam_stdlib/src/gleam@regex.erl deleted file mode 100644 index 03063c9..0000000 --- a/build/packages/gleam_stdlib/src/gleam@regex.erl +++ /dev/null @@ -1,33 +0,0 @@ --module(gleam@regex). --compile([no_auto_import, nowarn_unused_vars]). - --export([compile/2, from_string/1, check/2, split/2, scan/2]). --export_type([regex/0, match/0, compile_error/0, options/0]). - --type regex() :: any(). - --type match() :: {match, binary(), list(gleam@option:option(binary()))}. - --type compile_error() :: {compile_error, binary(), integer()}. - --type options() :: {options, boolean(), boolean()}. - --spec compile(binary(), options()) -> {ok, regex()} | {error, compile_error()}. -compile(Pattern, Options) -> - gleam_stdlib:compile_regex(Pattern, Options). - --spec from_string(binary()) -> {ok, regex()} | {error, compile_error()}. -from_string(Pattern) -> - compile(Pattern, {options, false, false}). - --spec check(regex(), binary()) -> boolean(). -check(Regex, Content) -> - gleam_stdlib:regex_check(Regex, Content). - --spec split(regex(), binary()) -> list(binary()). -split(Regex, String) -> - gleam_stdlib:regex_split(Regex, String). - --spec scan(regex(), binary()) -> list(match()). -scan(Regex, String) -> - gleam_stdlib:regex_scan(Regex, String). diff --git a/build/packages/gleam_stdlib/src/gleam@result.erl b/build/packages/gleam_stdlib/src/gleam@result.erl deleted file mode 100644 index 9826d99..0000000 --- a/build/packages/gleam_stdlib/src/gleam@result.erl +++ /dev/null @@ -1,201 +0,0 @@ --module(gleam@result). --compile([no_auto_import, nowarn_unused_vars]). - --export([is_ok/1, is_error/1, map/2, map_error/2, flatten/1, 'try'/2, then/2, unwrap/2, lazy_unwrap/2, unwrap_error/2, unwrap_both/1, nil_error/1, 'or'/2, lazy_or/2, all/1, partition/1, replace/2, replace_error/2, values/1, try_recover/2]). - --spec is_ok({ok, any()} | {error, any()}) -> boolean(). -is_ok(Result) -> - case Result of - {error, _} -> - false; - - {ok, _} -> - true - end. - --spec is_error({ok, any()} | {error, any()}) -> boolean(). -is_error(Result) -> - case Result of - {ok, _} -> - false; - - {error, _} -> - true - end. - --spec map({ok, BGE} | {error, BGF}, fun((BGE) -> BGI)) -> {ok, BGI} | - {error, BGF}. -map(Result, Fun) -> - case Result of - {ok, X} -> - {ok, Fun(X)}; - - {error, E} -> - {error, E} - end. - --spec map_error({ok, BGL} | {error, BGM}, fun((BGM) -> BGP)) -> {ok, BGL} | - {error, BGP}. -map_error(Result, Fun) -> - case Result of - {ok, X} -> - {ok, X}; - - {error, Error} -> - {error, Fun(Error)} - end. - --spec flatten({ok, {ok, BGS} | {error, BGT}} | {error, BGT}) -> {ok, BGS} | - {error, BGT}. -flatten(Result) -> - case Result of - {ok, X} -> - X; - - {error, Error} -> - {error, Error} - end. - --spec 'try'({ok, BHA} | {error, BHB}, fun((BHA) -> {ok, BHE} | {error, BHB})) -> {ok, - BHE} | - {error, BHB}. -'try'(Result, Fun) -> - case Result of - {ok, X} -> - Fun(X); - - {error, E} -> - {error, E} - end. - --spec then({ok, BHJ} | {error, BHK}, fun((BHJ) -> {ok, BHN} | {error, BHK})) -> {ok, - BHN} | - {error, BHK}. -then(Result, Fun) -> - 'try'(Result, Fun). - --spec unwrap({ok, BHS} | {error, any()}, BHS) -> BHS. -unwrap(Result, Default) -> - case Result of - {ok, V} -> - V; - - {error, _} -> - Default - end. - --spec lazy_unwrap({ok, BHW} | {error, any()}, fun(() -> BHW)) -> BHW. -lazy_unwrap(Result, Default) -> - case Result of - {ok, V} -> - V; - - {error, _} -> - Default() - end. - --spec unwrap_error({ok, any()} | {error, BIB}, BIB) -> BIB. -unwrap_error(Result, Default) -> - case Result of - {ok, _} -> - Default; - - {error, E} -> - E - end. - --spec unwrap_both({ok, BIE} | {error, BIE}) -> BIE. -unwrap_both(Result) -> - case Result of - {ok, A} -> - A; - - {error, A@1} -> - A@1 - end. - --spec nil_error({ok, BIH} | {error, any()}) -> {ok, BIH} | {error, nil}. -nil_error(Result) -> - map_error(Result, fun(_) -> nil end). - --spec 'or'({ok, BIN} | {error, BIO}, {ok, BIN} | {error, BIO}) -> {ok, BIN} | - {error, BIO}. -'or'(First, Second) -> - case First of - {ok, _} -> - First; - - {error, _} -> - Second - end. - --spec lazy_or({ok, BIV} | {error, BIW}, fun(() -> {ok, BIV} | {error, BIW})) -> {ok, - BIV} | - {error, BIW}. -lazy_or(First, Second) -> - case First of - {ok, _} -> - First; - - {error, _} -> - Second() - end. - --spec all(list({ok, BJD} | {error, BJE})) -> {ok, list(BJD)} | {error, BJE}. -all(Results) -> - gleam@list:try_map(Results, fun(X) -> X end). - --spec do_partition(list({ok, BJS} | {error, BJT}), list(BJS), list(BJT)) -> {list(BJS), - list(BJT)}. -do_partition(Results, Oks, Errors) -> - case Results of - [] -> - {Oks, Errors}; - - [{ok, A} | Rest] -> - do_partition(Rest, [A | Oks], Errors); - - [{error, E} | Rest@1] -> - do_partition(Rest@1, Oks, [E | Errors]) - end. - --spec partition(list({ok, BJL} | {error, BJM})) -> {list(BJL), list(BJM)}. -partition(Results) -> - do_partition(Results, [], []). - --spec replace({ok, any()} | {error, BKB}, BKE) -> {ok, BKE} | {error, BKB}. -replace(Result, Value) -> - case Result of - {ok, _} -> - {ok, Value}; - - {error, Error} -> - {error, Error} - end. - --spec replace_error({ok, BKH} | {error, any()}, BKL) -> {ok, BKH} | {error, BKL}. -replace_error(Result, Error) -> - case Result of - {ok, X} -> - {ok, X}; - - {error, _} -> - {error, Error} - end. - --spec values(list({ok, BKO} | {error, any()})) -> list(BKO). -values(Results) -> - gleam@list:filter_map(Results, fun(R) -> R end). - --spec try_recover( - {ok, BKU} | {error, BKV}, - fun((BKV) -> {ok, BKU} | {error, BKY}) -) -> {ok, BKU} | {error, BKY}. -try_recover(Result, Fun) -> - case Result of - {ok, Value} -> - {ok, Value}; - - {error, Error} -> - Fun(Error) - end. diff --git a/build/packages/gleam_stdlib/src/gleam@set.erl b/build/packages/gleam_stdlib/src/gleam@set.erl deleted file mode 100644 index b07cea7..0000000 --- a/build/packages/gleam_stdlib/src/gleam@set.erl +++ /dev/null @@ -1,85 +0,0 @@ --module(gleam@set). --compile([no_auto_import, nowarn_unused_vars]). - --export([new/0, size/1, insert/2, contains/2, delete/2, to_list/1, from_list/1, fold/3, filter/2, drop/2, take/2, union/2, intersection/2]). --export_type([set/1]). - --opaque set(EWZ) :: {set, gleam@map:map_(EWZ, list(nil))}. - --spec new() -> set(any()). -new() -> - {set, gleam@map:new()}. - --spec size(set(any())) -> integer(). -size(Set) -> - gleam@map:size(erlang:element(2, Set)). - --spec insert(set(EXF), EXF) -> set(EXF). -insert(Set, Member) -> - {set, gleam@map:insert(erlang:element(2, Set), Member, [])}. - --spec contains(set(EXI), EXI) -> boolean(). -contains(Set, Member) -> - _pipe = erlang:element(2, Set), - _pipe@1 = gleam@map:get(_pipe, Member), - gleam@result:is_ok(_pipe@1). - --spec delete(set(EXK), EXK) -> set(EXK). -delete(Set, Member) -> - {set, gleam@map:delete(erlang:element(2, Set), Member)}. - --spec to_list(set(EXN)) -> list(EXN). -to_list(Set) -> - gleam@map:keys(erlang:element(2, Set)). - --spec from_list(list(EXQ)) -> set(EXQ). -from_list(Members) -> - Map = gleam@list:fold( - Members, - gleam@map:new(), - fun(M, K) -> gleam@map:insert(M, K, []) end - ), - {set, Map}. - --spec fold(set(EXT), EXV, fun((EXV, EXT) -> EXV)) -> EXV. -fold(Set, Initial, Reducer) -> - gleam@map:fold( - erlang:element(2, Set), - Initial, - fun(A, K, _) -> Reducer(A, K) end - ). - --spec filter(set(EXW), fun((EXW) -> boolean())) -> set(EXW). -filter(Set, Property) -> - {set, - gleam@map:filter(erlang:element(2, Set), fun(M, _) -> Property(M) end)}. - --spec drop(set(EXZ), list(EXZ)) -> set(EXZ). -drop(Set, Disallowed) -> - gleam@list:fold(Disallowed, Set, fun delete/2). - --spec take(set(EYD), list(EYD)) -> set(EYD). -take(Set, Desired) -> - {set, gleam@map:take(erlang:element(2, Set), Desired)}. - --spec order(set(EYH), set(EYH)) -> {set(EYH), set(EYH)}. -order(First, Second) -> - case gleam@map:size(erlang:element(2, First)) > gleam@map:size( - erlang:element(2, Second) - ) of - true -> - {First, Second}; - - false -> - {Second, First} - end. - --spec union(set(EYM), set(EYM)) -> set(EYM). -union(First, Second) -> - {Larger, Smaller} = order(First, Second), - fold(Smaller, Larger, fun insert/2). - --spec intersection(set(EYQ), set(EYQ)) -> set(EYQ). -intersection(First, Second) -> - {Larger, Smaller} = order(First, Second), - take(Larger, to_list(Smaller)). diff --git a/build/packages/gleam_stdlib/src/gleam@string.erl b/build/packages/gleam_stdlib/src/gleam@string.erl deleted file mode 100644 index f3dcc69..0000000 --- a/build/packages/gleam_stdlib/src/gleam@string.erl +++ /dev/null @@ -1,397 +0,0 @@ --module(gleam@string). --compile([no_auto_import, nowarn_unused_vars]). - --export([is_empty/1, length/1, reverse/1, replace/3, lowercase/1, uppercase/1, compare/2, slice/3, crop/2, drop_left/2, drop_right/2, contains/2, starts_with/2, ends_with/2, split_once/2, append/2, concat/1, repeat/2, join/2, pad_left/3, pad_right/3, trim/1, trim_left/1, trim_right/1, pop_grapheme/1, to_graphemes/1, split/2, to_utf_codepoints/1, from_utf_codepoints/1, utf_codepoint/1, utf_codepoint_to_int/1, to_option/1, first/1, last/1, capitalise/1, inspect/1, byte_size/1]). --export_type([direction/0]). - --type direction() :: leading | trailing | both. - --spec is_empty(binary()) -> boolean(). -is_empty(Str) -> - Str =:= <<""/utf8>>. - --spec length(binary()) -> integer(). -length(String) -> - string:length(String). - --spec do_reverse(binary()) -> binary(). -do_reverse(String) -> - _pipe = String, - _pipe@1 = gleam@string_builder:from_string(_pipe), - _pipe@2 = gleam@string_builder:reverse(_pipe@1), - gleam@string_builder:to_string(_pipe@2). - --spec reverse(binary()) -> binary(). -reverse(String) -> - do_reverse(String). - --spec replace(binary(), binary(), binary()) -> binary(). -replace(String, Pattern, Substitute) -> - _pipe = String, - _pipe@1 = gleam@string_builder:from_string(_pipe), - _pipe@2 = gleam@string_builder:replace(_pipe@1, Pattern, Substitute), - gleam@string_builder:to_string(_pipe@2). - --spec lowercase(binary()) -> binary(). -lowercase(String) -> - string:lowercase(String). - --spec uppercase(binary()) -> binary(). -uppercase(String) -> - string:uppercase(String). - --spec compare(binary(), binary()) -> gleam@order:order(). -compare(A, B) -> - case A =:= B of - true -> - eq; - - _ -> - case gleam_stdlib:less_than(A, B) of - true -> - lt; - - _ -> - gt - end - end. - --spec slice(binary(), integer(), integer()) -> binary(). -slice(String, Idx, Len) -> - case Len < 0 of - true -> - <<""/utf8>>; - - false -> - case Idx < 0 of - true -> - Translated_idx = length(String) + Idx, - case Translated_idx < 0 of - true -> - <<""/utf8>>; - - false -> - string:slice(String, Translated_idx, Len) - end; - - false -> - string:slice(String, Idx, Len) - end - end. - --spec do_crop(binary(), binary()) -> binary(). -do_crop(String, Substring) -> - _pipe = String, - _pipe@1 = string:find(_pipe, Substring), - _pipe@2 = gleam@dynamic:string(_pipe@1), - gleam@result:unwrap(_pipe@2, String). - --spec crop(binary(), binary()) -> binary(). -crop(String, Substring) -> - do_crop(String, Substring). - --spec drop_left(binary(), integer()) -> binary(). -drop_left(String, Num_graphemes) -> - case Num_graphemes < 0 of - true -> - String; - - false -> - slice(String, Num_graphemes, length(String) - Num_graphemes) - end. - --spec drop_right(binary(), integer()) -> binary(). -drop_right(String, Num_graphemes) -> - case Num_graphemes < 0 of - true -> - String; - - false -> - slice(String, 0, length(String) - Num_graphemes) - end. - --spec do_contains(binary(), binary()) -> boolean(). -do_contains(Haystack, Needle) -> - _pipe = Haystack, - _pipe@1 = string:find(_pipe, Needle), - _pipe@2 = gleam@dynamic:bit_string(_pipe@1), - gleam@result:is_ok(_pipe@2). - --spec contains(binary(), binary()) -> boolean(). -contains(Haystack, Needle) -> - do_contains(Haystack, Needle). - --spec starts_with(binary(), binary()) -> boolean(). -starts_with(String, Prefix) -> - gleam_stdlib:string_starts_with(String, Prefix). - --spec ends_with(binary(), binary()) -> boolean(). -ends_with(String, Suffix) -> - gleam_stdlib:string_ends_with(String, Suffix). - --spec do_split_once(binary(), binary()) -> {ok, {binary(), binary()}} | - {error, nil}. -do_split_once(X, Substring) -> - case string:split(X, Substring) of - [First, Rest] -> - {ok, {First, Rest}}; - - _ -> - {error, nil} - end. - --spec split_once(binary(), binary()) -> {ok, {binary(), binary()}} | - {error, nil}. -split_once(X, Substring) -> - do_split_once(X, Substring). - --spec append(binary(), binary()) -> binary(). -append(First, Second) -> - _pipe = First, - _pipe@1 = gleam@string_builder:from_string(_pipe), - _pipe@2 = gleam@string_builder:append(_pipe@1, Second), - gleam@string_builder:to_string(_pipe@2). - --spec concat(list(binary())) -> binary(). -concat(Strings) -> - _pipe = Strings, - _pipe@1 = gleam@string_builder:from_strings(_pipe), - gleam@string_builder:to_string(_pipe@1). - --spec repeat(binary(), integer()) -> binary(). -repeat(String, Times) -> - _pipe = gleam@iterator:repeat(String), - _pipe@1 = gleam@iterator:take(_pipe, Times), - _pipe@2 = gleam@iterator:to_list(_pipe@1), - concat(_pipe@2). - --spec do_join(list(binary()), binary()) -> binary(). -do_join(Strings, Separator) -> - _pipe = Strings, - _pipe@1 = gleam@list:intersperse(_pipe, Separator), - concat(_pipe@1). - --spec join(list(binary()), binary()) -> binary(). -join(Strings, Separator) -> - do_join(Strings, Separator). - --spec padding(integer(), binary()) -> gleam@iterator:iterator(binary()). -padding(Size, Pad_string) -> - Pad_length = length(Pad_string), - Num_pads = case Pad_length of - 0 -> 0; - Gleam@denominator -> Size div Gleam@denominator - end, - Extra = case Pad_length of - 0 -> 0; - Gleam@denominator@1 -> Size rem Gleam@denominator@1 - end, - _pipe = gleam@iterator:repeat(Pad_string), - _pipe@1 = gleam@iterator:take(_pipe, Num_pads), - gleam@iterator:append( - _pipe@1, - gleam@iterator:single(slice(Pad_string, 0, Extra)) - ). - --spec pad_left(binary(), integer(), binary()) -> binary(). -pad_left(String, Desired_length, Pad_string) -> - Current_length = length(String), - To_pad_length = Desired_length - Current_length, - _pipe = padding(To_pad_length, Pad_string), - _pipe@1 = gleam@iterator:append(_pipe, gleam@iterator:single(String)), - _pipe@2 = gleam@iterator:to_list(_pipe@1), - concat(_pipe@2). - --spec pad_right(binary(), integer(), binary()) -> binary(). -pad_right(String, Desired_length, Pad_string) -> - Current_length = length(String), - To_pad_length = Desired_length - Current_length, - _pipe = gleam@iterator:single(String), - _pipe@1 = gleam@iterator:append(_pipe, padding(To_pad_length, Pad_string)), - _pipe@2 = gleam@iterator:to_list(_pipe@1), - concat(_pipe@2). - --spec do_trim(binary()) -> binary(). -do_trim(String) -> - string:trim(String, both). - --spec trim(binary()) -> binary(). -trim(String) -> - do_trim(String). - --spec do_trim_left(binary()) -> binary(). -do_trim_left(String) -> - string:trim(String, leading). - --spec trim_left(binary()) -> binary(). -trim_left(String) -> - do_trim_left(String). - --spec do_trim_right(binary()) -> binary(). -do_trim_right(String) -> - string:trim(String, trailing). - --spec trim_right(binary()) -> binary(). -trim_right(String) -> - do_trim_right(String). - --spec pop_grapheme(binary()) -> {ok, {binary(), binary()}} | {error, nil}. -pop_grapheme(String) -> - gleam_stdlib:string_pop_grapheme(String). - --spec do_to_graphemes(binary(), list(binary())) -> list(binary()). -do_to_graphemes(String, Acc) -> - case pop_grapheme(String) of - {ok, {Grapheme, Rest}} -> - do_to_graphemes(Rest, [Grapheme | Acc]); - - _ -> - Acc - end. - --spec to_graphemes(binary()) -> list(binary()). -to_graphemes(String) -> - _pipe = do_to_graphemes(String, []), - gleam@list:reverse(_pipe). - --spec split(binary(), binary()) -> list(binary()). -split(X, Substring) -> - case Substring of - <<""/utf8>> -> - to_graphemes(X); - - _ -> - _pipe = X, - _pipe@1 = gleam@string_builder:from_string(_pipe), - _pipe@2 = gleam@string_builder:split(_pipe@1, Substring), - gleam@list:map(_pipe@2, fun gleam@string_builder:to_string/1) - end. - --spec do_to_utf_codepoints_impl(bitstring(), list(integer())) -> list(integer()). -do_to_utf_codepoints_impl(Bit_string, Acc) -> - case Bit_string of - <> -> - do_to_utf_codepoints_impl(Rest, [First | Acc]); - - <<>> -> - Acc - end. - --spec do_to_utf_codepoints(binary()) -> list(integer()). -do_to_utf_codepoints(String) -> - _pipe = do_to_utf_codepoints_impl(gleam@bit_string:from_string(String), []), - gleam@list:reverse(_pipe). - --spec to_utf_codepoints(binary()) -> list(integer()). -to_utf_codepoints(String) -> - do_to_utf_codepoints(String). - --spec do_from_utf_codepoints_impl(list(integer()), bitstring()) -> bitstring(). -do_from_utf_codepoints_impl(Utf_codepoints, Acc) -> - case Utf_codepoints of - [First | Rest] -> - do_from_utf_codepoints_impl(Rest, <>); - - [] -> - Acc - end. - --spec do_from_utf_codepoints(list(integer())) -> binary(). -do_from_utf_codepoints(Utf_codepoints) -> - _assert_subject = begin - _pipe = do_from_utf_codepoints_impl( - Utf_codepoints, - gleam@bit_string:from_string(<<""/utf8>>) - ), - gleam@bit_string:to_string(_pipe) - end, - {ok, String} = case _assert_subject of - {ok, _} -> _assert_subject; - _assert_fail -> - erlang:error(#{gleam_error => let_assert, - message => <<"Assertion pattern match failed"/utf8>>, - value => _assert_fail, - module => <<"gleam/string"/utf8>>, - function => <<"do_from_utf_codepoints"/utf8>>, - line => 807}) - end, - String. - --spec from_utf_codepoints(list(integer())) -> binary(). -from_utf_codepoints(Utf_codepoints) -> - do_from_utf_codepoints(Utf_codepoints). - --spec utf_codepoint(integer()) -> {ok, integer()} | {error, nil}. -utf_codepoint(Value) -> - case Value of - I when I > 1114111 -> - {error, nil}; - - 65534 -> - {error, nil}; - - 65535 -> - {error, nil}; - - I@1 when (I@1 >= 55296) andalso (I@1 =< 57343) -> - {error, nil}; - - I@2 -> - {ok, gleam_stdlib:identity(I@2)} - end. - --spec utf_codepoint_to_int(integer()) -> integer(). -utf_codepoint_to_int(Cp) -> - gleam_stdlib:identity(Cp). - --spec to_option(binary()) -> gleam@option:option(binary()). -to_option(S) -> - case S of - <<""/utf8>> -> - none; - - _ -> - {some, S} - end. - --spec first(binary()) -> {ok, binary()} | {error, nil}. -first(S) -> - case pop_grapheme(S) of - {ok, {First, _}} -> - {ok, First}; - - {error, E} -> - {error, E} - end. - --spec last(binary()) -> {ok, binary()} | {error, nil}. -last(S) -> - case pop_grapheme(S) of - {ok, {First, <<""/utf8>>}} -> - {ok, First}; - - {ok, {_, Rest}} -> - {ok, slice(Rest, -1, 1)}; - - {error, E} -> - {error, E} - end. - --spec capitalise(binary()) -> binary(). -capitalise(S) -> - case pop_grapheme(S) of - {ok, {First, Rest}} -> - append(uppercase(First), lowercase(Rest)); - - _ -> - <<""/utf8>> - end. - --spec inspect(any()) -> binary(). -inspect(Term) -> - _pipe = gleam_stdlib:inspect(Term), - gleam@string_builder:to_string(_pipe). - --spec byte_size(binary()) -> integer(). -byte_size(String) -> - erlang:byte_size(String). diff --git a/build/packages/gleam_stdlib/src/gleam@string_builder.erl b/build/packages/gleam_stdlib/src/gleam@string_builder.erl deleted file mode 100644 index c2ace3b..0000000 --- a/build/packages/gleam_stdlib/src/gleam@string_builder.erl +++ /dev/null @@ -1,91 +0,0 @@ --module(gleam@string_builder). --compile([no_auto_import, nowarn_unused_vars]). - --export([prepend_builder/2, append_builder/2, new/0, from_strings/1, concat/1, from_string/1, prepend/2, append/2, to_string/1, byte_size/1, join/2, lowercase/1, uppercase/1, reverse/1, split/2, replace/3, is_equal/2, is_empty/1]). --export_type([string_builder/0, direction/0]). - --type string_builder() :: any(). - --type direction() :: all. - --spec prepend_builder(string_builder(), string_builder()) -> string_builder(). -prepend_builder(Builder, Prefix) -> - gleam_stdlib:iodata_append(Prefix, Builder). - --spec append_builder(string_builder(), string_builder()) -> string_builder(). -append_builder(Builder, Suffix) -> - gleam_stdlib:iodata_append(Builder, Suffix). - --spec new() -> string_builder(). -new() -> - gleam_stdlib:identity([]). - --spec from_strings(list(binary())) -> string_builder(). -from_strings(Strings) -> - gleam_stdlib:identity(Strings). - --spec concat(list(string_builder())) -> string_builder(). -concat(Builders) -> - gleam_stdlib:identity(Builders). - --spec from_string(binary()) -> string_builder(). -from_string(String) -> - gleam_stdlib:identity(String). - --spec prepend(string_builder(), binary()) -> string_builder(). -prepend(Builder, Prefix) -> - append_builder(from_string(Prefix), Builder). - --spec append(string_builder(), binary()) -> string_builder(). -append(Builder, Second) -> - append_builder(Builder, from_string(Second)). - --spec to_string(string_builder()) -> binary(). -to_string(Builder) -> - unicode:characters_to_binary(Builder). - --spec byte_size(string_builder()) -> integer(). -byte_size(Builder) -> - erlang:iolist_size(Builder). - --spec join(list(string_builder()), binary()) -> string_builder(). -join(Builders, Sep) -> - _pipe = Builders, - _pipe@1 = gleam@list:intersperse(_pipe, from_string(Sep)), - concat(_pipe@1). - --spec lowercase(string_builder()) -> string_builder(). -lowercase(Builder) -> - string:lowercase(Builder). - --spec uppercase(string_builder()) -> string_builder(). -uppercase(Builder) -> - string:uppercase(Builder). - --spec reverse(string_builder()) -> string_builder(). -reverse(Builder) -> - string:reverse(Builder). - --spec do_split(string_builder(), binary()) -> list(string_builder()). -do_split(Iodata, Pattern) -> - string:split(Iodata, Pattern, all). - --spec split(string_builder(), binary()) -> list(string_builder()). -split(Iodata, Pattern) -> - do_split(Iodata, Pattern). - --spec do_replace(string_builder(), binary(), binary()) -> string_builder(). -do_replace(Iodata, Pattern, Substitute) -> - string:replace(Iodata, Pattern, Substitute, all). - --spec replace(string_builder(), binary(), binary()) -> string_builder(). -replace(Builder, Pattern, Substitute) -> - do_replace(Builder, Pattern, Substitute). - --spec is_equal(string_builder(), string_builder()) -> boolean(). -is_equal(A, B) -> - string:equal(A, B). - --spec is_empty(string_builder()) -> boolean(). -is_empty(Builder) -> - string:is_empty(Builder). diff --git a/build/packages/gleam_stdlib/src/gleam@uri.erl b/build/packages/gleam_stdlib/src/gleam@uri.erl deleted file mode 100644 index ee6ba74..0000000 --- a/build/packages/gleam_stdlib/src/gleam@uri.erl +++ /dev/null @@ -1,255 +0,0 @@ --module(gleam@uri). --compile([no_auto_import, nowarn_unused_vars]). - --export([parse/1, parse_query/1, percent_encode/1, query_to_string/1, percent_decode/1, path_segments/1, to_string/1, origin/1, merge/2]). --export_type([uri/0]). - --type uri() :: {uri, - gleam@option:option(binary()), - gleam@option:option(binary()), - gleam@option:option(binary()), - gleam@option:option(integer()), - binary(), - gleam@option:option(binary()), - gleam@option:option(binary())}. - --spec parse(binary()) -> {ok, uri()} | {error, nil}. -parse(Uri_string) -> - gleam_stdlib:uri_parse(Uri_string). - --spec parse_query(binary()) -> {ok, list({binary(), binary()})} | {error, nil}. -parse_query(Query) -> - gleam_stdlib:parse_query(Query). - --spec percent_encode(binary()) -> binary(). -percent_encode(Value) -> - gleam_stdlib:percent_encode(Value). - --spec query_pair({binary(), binary()}) -> gleam@string_builder:string_builder(). -query_pair(Pair) -> - gleam@string_builder:from_strings( - [percent_encode(erlang:element(1, Pair)), - <<"="/utf8>>, - percent_encode(erlang:element(2, Pair))] - ). - --spec query_to_string(list({binary(), binary()})) -> binary(). -query_to_string(Query) -> - _pipe = Query, - _pipe@1 = gleam@list:map(_pipe, fun query_pair/1), - _pipe@2 = gleam@list:intersperse( - _pipe@1, - gleam@string_builder:from_string(<<"&"/utf8>>) - ), - _pipe@3 = gleam@string_builder:concat(_pipe@2), - gleam@string_builder:to_string(_pipe@3). - --spec percent_decode(binary()) -> {ok, binary()} | {error, nil}. -percent_decode(Value) -> - gleam_stdlib:percent_decode(Value). - --spec do_remove_dot_segments(list(binary()), list(binary())) -> list(binary()). -do_remove_dot_segments(Input, Accumulator) -> - case Input of - [] -> - gleam@list:reverse(Accumulator); - - [Segment | Rest] -> - Accumulator@5 = case {Segment, Accumulator} of - {<<""/utf8>>, Accumulator@1} -> - Accumulator@1; - - {<<"."/utf8>>, Accumulator@2} -> - Accumulator@2; - - {<<".."/utf8>>, []} -> - []; - - {<<".."/utf8>>, [_ | Accumulator@3]} -> - Accumulator@3; - - {Segment@1, Accumulator@4} -> - [Segment@1 | Accumulator@4] - end, - do_remove_dot_segments(Rest, Accumulator@5) - end. - --spec remove_dot_segments(list(binary())) -> list(binary()). -remove_dot_segments(Input) -> - do_remove_dot_segments(Input, []). - --spec path_segments(binary()) -> list(binary()). -path_segments(Path) -> - remove_dot_segments(gleam@string:split(Path, <<"/"/utf8>>)). - --spec to_string(uri()) -> binary(). -to_string(Uri) -> - Parts = case erlang:element(8, Uri) of - {some, Fragment} -> - [<<"#"/utf8>>, Fragment]; - - _ -> - [] - end, - Parts@1 = case erlang:element(7, Uri) of - {some, Query} -> - [<<"?"/utf8>>, Query | Parts]; - - _ -> - Parts - end, - Parts@2 = [erlang:element(6, Uri) | Parts@1], - Parts@3 = case {erlang:element(4, Uri), - gleam@string:starts_with(erlang:element(6, Uri), <<"/"/utf8>>)} of - {{some, Host}, false} when Host =/= <<""/utf8>> -> - [<<"/"/utf8>> | Parts@2]; - - {_, _} -> - Parts@2 - end, - Parts@4 = case {erlang:element(4, Uri), erlang:element(5, Uri)} of - {{some, _}, {some, Port}} -> - [<<":"/utf8>>, gleam@int:to_string(Port) | Parts@3]; - - {_, _} -> - Parts@3 - end, - Parts@5 = case {erlang:element(2, Uri), - erlang:element(3, Uri), - erlang:element(4, Uri)} of - {{some, S}, {some, U}, {some, H}} -> - [S, <<"://"/utf8>>, U, <<"@"/utf8>>, H | Parts@4]; - - {{some, S@1}, none, {some, H@1}} -> - [S@1, <<"://"/utf8>>, H@1 | Parts@4]; - - {{some, S@2}, {some, _}, none} -> - [S@2, <<":"/utf8>> | Parts@4]; - - {{some, S@2}, none, none} -> - [S@2, <<":"/utf8>> | Parts@4]; - - {none, none, {some, H@2}} -> - [<<"//"/utf8>>, H@2 | Parts@4]; - - {none, {some, _}, none} -> - Parts@4; - - {none, none, none} -> - Parts@4 - end, - gleam@string:concat(Parts@5). - --spec origin(uri()) -> {ok, binary()} | {error, nil}. -origin(Uri) -> - {uri, Scheme, _, Host, Port, _, _, _} = Uri, - case Scheme of - {some, <<"https"/utf8>>} when Port =:= {some, 443} -> - Origin = {uri, Scheme, none, Host, none, <<""/utf8>>, none, none}, - {ok, to_string(Origin)}; - - {some, <<"http"/utf8>>} when Port =:= {some, 80} -> - Origin@1 = {uri, Scheme, none, Host, none, <<""/utf8>>, none, none}, - {ok, to_string(Origin@1)}; - - {some, S} when (S =:= <<"http"/utf8>>) orelse (S =:= <<"https"/utf8>>) -> - Origin@2 = {uri, Scheme, none, Host, Port, <<""/utf8>>, none, none}, - {ok, to_string(Origin@2)}; - - _ -> - {error, nil} - end. - --spec drop_last(list(EOJ)) -> list(EOJ). -drop_last(Elements) -> - gleam@list:take(Elements, gleam@list:length(Elements) - 1). - --spec join_segments(list(binary())) -> binary(). -join_segments(Segments) -> - gleam@string:join([<<""/utf8>> | Segments], <<"/"/utf8>>). - --spec merge(uri(), uri()) -> {ok, uri()} | {error, nil}. -merge(Base, Relative) -> - case Base of - {uri, {some, _}, _, {some, _}, _, _, _, _} -> - case Relative of - {uri, _, _, {some, _}, _, _, _, _} -> - Path = begin - _pipe = gleam@string:split( - erlang:element(6, Relative), - <<"/"/utf8>> - ), - _pipe@1 = remove_dot_segments(_pipe), - join_segments(_pipe@1) - end, - Resolved = {uri, - gleam@option:'or'( - erlang:element(2, Relative), - erlang:element(2, Base) - ), - none, - erlang:element(4, Relative), - gleam@option:'or'( - erlang:element(5, Relative), - erlang:element(5, Base) - ), - Path, - erlang:element(7, Relative), - erlang:element(8, Relative)}, - {ok, Resolved}; - - {uri, none, _, none, _, _, _, _} -> - {New_path, New_query} = case erlang:element(6, Relative) of - <<""/utf8>> -> - {erlang:element(6, Base), - gleam@option:'or'( - erlang:element(7, Relative), - erlang:element(7, Base) - )}; - - _ -> - Path_segments = case gleam@string:starts_with( - erlang:element(6, Relative), - <<"/"/utf8>> - ) of - true -> - gleam@string:split( - erlang:element(6, Relative), - <<"/"/utf8>> - ); - - false -> - _pipe@2 = gleam@string:split( - erlang:element(6, Base), - <<"/"/utf8>> - ), - _pipe@3 = drop_last(_pipe@2), - gleam@list:append( - _pipe@3, - gleam@string:split( - erlang:element(6, Relative), - <<"/"/utf8>> - ) - ) - end, - Path@1 = begin - _pipe@4 = Path_segments, - _pipe@5 = remove_dot_segments(_pipe@4), - join_segments(_pipe@5) - end, - {Path@1, erlang:element(7, Relative)} - end, - Resolved@1 = {uri, - erlang:element(2, Base), - none, - erlang:element(4, Base), - erlang:element(5, Base), - New_path, - New_query, - erlang:element(8, Relative)}, - {ok, Resolved@1} - end; - - _ -> - {error, nil} - end. diff --git a/build/packages/gleam_stdlib/src/gleam_stdlib.app.src b/build/packages/gleam_stdlib/src/gleam_stdlib.app.src deleted file mode 100644 index 86ee666..0000000 --- a/build/packages/gleam_stdlib/src/gleam_stdlib.app.src +++ /dev/null @@ -1,28 +0,0 @@ -{application, gleam_stdlib, [ - {vsn, "0.31.0"}, - {applications, []}, - {description, "A standard library for the Gleam programming language"}, - {modules, [gleam@base, - gleam@bit_builder, - gleam@bit_string, - gleam@bool, - gleam@dynamic, - gleam@float, - gleam@function, - gleam@int, - gleam@io, - gleam@iterator, - gleam@list, - gleam@map, - gleam@option, - gleam@order, - gleam@pair, - gleam@queue, - gleam@regex, - gleam@result, - gleam@set, - gleam@string, - gleam@string_builder, - gleam@uri]}, - {registered, []} -]}. diff --git a/build/packages/gleam_stdlib/src/gleam_stdlib.erl b/build/packages/gleam_stdlib/src/gleam_stdlib.erl deleted file mode 100644 index 9f3bd02..0000000 --- a/build/packages/gleam_stdlib/src/gleam_stdlib.erl +++ /dev/null @@ -1,475 +0,0 @@ --module(gleam_stdlib). - --export([map_get/2, iodata_append/2, identity/1, decode_int/1, decode_bool/1, - decode_float/1, decode_list/1, decode_option/2, - decode_field/2, parse_int/1, parse_float/1, less_than/2, - string_pop_grapheme/1, string_starts_with/2, wrap_list/1, - string_ends_with/2, string_pad/4, decode_map/1, uri_parse/1, - bit_string_int_to_u32/1, bit_string_int_from_u32/1, decode_result/1, - bit_string_slice/3, decode_bit_string/1, compile_regex/2, regex_scan/2, - percent_encode/1, percent_decode/1, regex_check/2, regex_split/2, - base_decode64/1, parse_query/1, bit_string_concat/1, size_of_tuple/1, - decode_tuple/1, decode_tuple2/1, decode_tuple3/1, decode_tuple4/1, - decode_tuple5/1, decode_tuple6/1, tuple_get/2, classify_dynamic/1, - print/1, println/1, print_error/1, println_error/1, inspect/1, - float_to_string/1, int_from_base_string/2]). - -%% Taken from OTP's uri_string module --define(DEC2HEX(X), - if ((X) >= 0) andalso ((X) =< 9) -> (X) + $0; - ((X) >= 10) andalso ((X) =< 15) -> (X) + $A - 10 - end). - -%% Taken from OTP's uri_string module --define(HEX2DEC(X), - if ((X) >= $0) andalso ((X) =< $9) -> (X) - $0; - ((X) >= $A) andalso ((X) =< $F) -> (X) - $A + 10; - ((X) >= $a) andalso ((X) =< $f) -> (X) - $a + 10 - end). - --define(is_lowercase_char(X), (X > 96 andalso X < 123)). --define(is_underscore_char(X), (X == 95)). --define(is_digit_char(X), (X > 47 andalso X < 58)). - -uppercase(X) -> X - 32. - -map_get(Map, Key) -> - case maps:find(Key, Map) of - error -> {error, nil}; - OkFound -> OkFound - end. - -iodata_append(Iodata, String) -> [Iodata, String]. - -identity(X) -> X. - -decode_error_msg(Expected, Data) when is_binary(Expected) -> - decode_error(Expected, classify_dynamic(Data)). -decode_error(Expected, Got) when is_binary(Expected) andalso is_binary(Got) -> - {error, [{decode_error, Expected, Got, []}]}. - -classify_dynamic(nil) -> <<"Nil">>; -classify_dynamic(X) when is_atom(X) -> <<"Atom">>; -classify_dynamic(X) when is_binary(X) -> <<"String">>; -classify_dynamic(X) when is_bitstring(X) -> <<"BitString">>; -classify_dynamic(X) when is_integer(X) -> <<"Int">>; -classify_dynamic(X) when is_float(X) -> <<"Float">>; -classify_dynamic(X) when is_list(X) -> <<"List">>; -classify_dynamic(X) when is_boolean(X) -> <<"Bool">>; -classify_dynamic(X) when is_map(X) -> <<"Map">>; -classify_dynamic(X) when is_tuple(X) -> - iolist_to_binary(["Tuple of ", integer_to_list(tuple_size(X)), " elements"]); -classify_dynamic(X) when - is_function(X, 0) orelse is_function(X, 1) orelse is_function(X, 2) orelse - is_function(X, 3) orelse is_function(X, 4) orelse is_function(X, 5) orelse - is_function(X, 6) orelse is_function(X, 7) orelse is_function(X, 8) orelse - is_function(X, 9) orelse is_function(X, 10) orelse is_function(X, 11) orelse - is_function(X, 12) -> <<"Function">>; -classify_dynamic(_) -> <<"Some other type">>. - -decode_map(Data) when is_map(Data) -> {ok, Data}; -decode_map(Data) -> decode_error_msg(<<"Map">>, Data). - -decode_bit_string(Data) when is_bitstring(Data) -> {ok, Data}; -decode_bit_string(Data) -> decode_error_msg(<<"BitString">>, Data). - -decode_int(Data) when is_integer(Data) -> {ok, Data}; -decode_int(Data) -> decode_error_msg(<<"Int">>, Data). - -decode_float(Data) when is_float(Data) -> {ok, Data}; -decode_float(Data) -> decode_error_msg(<<"Float">>, Data). - -decode_bool(Data) when is_boolean(Data) -> {ok, Data}; -decode_bool(Data) -> decode_error_msg(<<"Bool">>, Data). - -decode_list(Data) when is_list(Data) -> {ok, Data}; -decode_list(Data) -> decode_error_msg(<<"List">>, Data). - -decode_field(Data, Key) when is_map(Data) -> - case Data of - #{Key := Value} -> {ok, {some, Value}}; - _ -> - {ok, none} - end; -decode_field(Data, _) -> - decode_error_msg(<<"Map">>, Data). - -size_of_tuple(Data) -> tuple_size(Data). - -tuple_get(_tup, Index) when Index < 0 -> {error, nil}; -tuple_get(Data, Index) when Index >= tuple_size(Data) -> {error, nil}; -tuple_get(Data, Index) -> {ok, element(Index + 1, Data)}. - -decode_tuple(Data) when is_tuple(Data) -> {ok, Data}; -decode_tuple(Data) -> decode_error_msg(<<"Tuple">>, Data). - -decode_tuple2({_,_} = A) -> {ok, A}; -decode_tuple2([A,B]) -> {ok, {A,B}}; -decode_tuple2(Data) -> decode_error_msg(<<"Tuple of 2 elements">>, Data). - -decode_tuple3({_,_,_} = A) -> {ok, A}; -decode_tuple3([A,B,C]) -> {ok, {A,B,C}}; -decode_tuple3(Data) -> decode_error_msg(<<"Tuple of 3 elements">>, Data). - -decode_tuple4({_,_,_,_} = A) -> {ok, A}; -decode_tuple4([A,B,C,D]) -> {ok, {A,B,C,D}}; -decode_tuple4(Data) -> decode_error_msg(<<"Tuple of 4 elements">>, Data). - -decode_tuple5({_,_,_,_,_} = A) -> {ok, A}; -decode_tuple5([A,B,C,D,E]) -> {ok, {A,B,C,D,E}}; -decode_tuple5(Data) -> decode_error_msg(<<"Tuple of 5 elements">>, Data). - -decode_tuple6({_,_,_,_,_,_} = A) -> {ok, A}; -decode_tuple6([A,B,C,D,E,F]) -> {ok, {A,B,C,D,E,F}}; -decode_tuple6(Data) -> decode_error_msg(<<"Tuple of 6 elements">>, Data). - -decode_option(Term, F) -> - Decode = fun(Inner) -> - case F(Inner) of - {ok, Decoded} -> {ok, {some, Decoded}}; - Error -> Error - end - end, - case Term of - undefined -> {ok, none}; - error -> {ok, none}; - null -> {ok, none}; - none -> {ok, none}; - nil -> {ok, none}; - {some, Inner} -> Decode(Inner); - _ -> Decode(Term) - end. - -decode_result(Term) -> - case Term of - {ok, Inner} -> {ok, {ok, Inner}}; - ok -> {ok, {ok, nil}}; - {error, Inner} -> {ok, {error, Inner}}; - error -> {ok, {error, nil}}; - _ -> decode_error_msg(<<"Result">>, Term) - end. - -int_from_base_string(String, Base) -> - case catch binary_to_integer(String, Base) of - Int when is_integer(Int) -> {ok, Int}; - _ -> {error, nil} - end. - -parse_int(String) -> - case catch binary_to_integer(String) of - Int when is_integer(Int) -> {ok, Int}; - _ -> {error, nil} - end. - -parse_float(String) -> - case catch binary_to_float(String) of - Float when is_float(Float) -> {ok, Float}; - _ -> {error, nil} - end. - -less_than(Lhs, Rhs) -> - Lhs < Rhs. - -string_starts_with(_, <<>>) -> true; -string_starts_with(String, Prefix) when byte_size(Prefix) > byte_size(String) -> false; -string_starts_with(String, Prefix) -> - PrefixSize = byte_size(Prefix), - Prefix == binary_part(String, 0, PrefixSize). - -string_ends_with(_, <<>>) -> true; -string_ends_with(String, Suffix) when byte_size(Suffix) > byte_size(String) -> false; -string_ends_with(String, Suffix) -> - SuffixSize = byte_size(Suffix), - Suffix == binary_part(String, byte_size(String) - SuffixSize, SuffixSize). - -string_pad(String, Length, Dir, PadString) -> - Chars = string:pad(String, Length, Dir, binary_to_list(PadString)), - case unicode:characters_to_binary(Chars) of - Bin when is_binary(Bin) -> Bin; - Error -> erlang:error({gleam_error, {string_invalid_utf8, Error}}) - end. - -string_pop_grapheme(String) -> - case string:next_grapheme(String) of - [ Next | Rest ] -> - {ok, {unicode:characters_to_binary([Next]), unicode:characters_to_binary(Rest)}}; - _ -> {error, nil} - end. - -bit_string_concat(BitStrings) -> - list_to_bitstring(BitStrings). - -bit_string_slice(Bin, Pos, Len) -> - try {ok, binary:part(Bin, Pos, Len)} - catch error:badarg -> {error, nil} - end. - -bit_string_int_to_u32(I) when 0 =< I, I < 4294967296 -> - {ok, <>}; -bit_string_int_to_u32(_) -> - {error, nil}. - -bit_string_int_from_u32(<>) -> - {ok, I}; -bit_string_int_from_u32(_) -> - {error, nil}. - -compile_regex(String, Options) -> - {options, Caseless, Multiline} = Options, - OptionsList = [ - unicode, - ucp, - Caseless andalso caseless, - Multiline andalso multiline - ], - FilteredOptions = [Option || Option <- OptionsList, Option /= false], - case re:compile(String, FilteredOptions) of - {ok, MP} -> {ok, MP}; - {error, {Str, Pos}} -> - {error, {compile_error, unicode:characters_to_binary(Str), Pos}} - end. - -regex_check(Regex, String) -> - re:run(String, Regex) /= nomatch. - -regex_split(Regex, String) -> - re:split(String, Regex). - -regex_submatches(_, {-1, 0}) -> none; -regex_submatches(String, {Start, Length}) -> - BinarySlice = binary:part(String, {Start, Length}), - case string:is_empty(binary_to_list(BinarySlice)) of - true -> none; - false -> {some, BinarySlice} - end. - -regex_matches(String, [{Start, Length} | Submatches]) -> - Submatches1 = lists:map(fun(X) -> regex_submatches(String, X) end, Submatches), - {match, binary:part(String, Start, Length), Submatches1}. - -regex_scan(Regex, String) -> - case re:run(String, Regex, [global]) of - {match, Captured} -> lists:map(fun(X) -> regex_matches(String, X) end, Captured); - nomatch -> [] - end. - -base_decode64(S) -> - try {ok, base64:decode(S)} - catch error:_ -> {error, nil} - end. - -wrap_list(X) when is_list(X) -> X; -wrap_list(X) -> [X]. - -parse_query(Query) -> - case uri_string:dissect_query(Query) of - {error, _, _} -> {error, nil}; - Pairs -> - Pairs1 = lists:map(fun - ({K, true}) -> {K, <<"">>}; - (Pair) -> Pair - end, Pairs), - {ok, Pairs1} - end. - -percent_encode(B) -> percent_encode(B, <<>>). -percent_encode(<<>>, Acc) -> - Acc; -percent_encode(<>, Acc) -> - case percent_ok(H) of - true -> - percent_encode(T, <>); - false -> - <> = <>, - percent_encode(T, <>) - end. - -percent_decode(Cs) -> percent_decode(Cs, <<>>). -percent_decode(<<$%, C0, C1, Cs/binary>>, Acc) -> - case is_hex_digit(C0) andalso is_hex_digit(C1) of - true -> - B = ?HEX2DEC(C0)*16+?HEX2DEC(C1), - percent_decode(Cs, <>); - false -> - {error, nil} - end; -percent_decode(<>, Acc) -> - percent_decode(Cs, <>); -percent_decode(<<>>, Acc) -> - check_utf8(Acc). - -percent_ok($!) -> true; -percent_ok($$) -> true; -percent_ok($') -> true; -percent_ok($() -> true; -percent_ok($)) -> true; -percent_ok($*) -> true; -percent_ok($+) -> true; -percent_ok($-) -> true; -percent_ok($.) -> true; -percent_ok($_) -> true; -percent_ok($~) -> true; -percent_ok(C) when $0 =< C, C =< $9 -> true; -percent_ok(C) when $A =< C, C =< $Z -> true; -percent_ok(C) when $a =< C, C =< $z -> true; -percent_ok(_) -> false. - -is_hex_digit(C) -> - ($0 =< C andalso C =< $9) orelse ($a =< C andalso C =< $f) orelse ($A =< C andalso C =< $F). - -check_utf8(Cs) -> - case unicode:characters_to_list(Cs) of - {incomplete, _, _} -> {error, nil}; - {error, _, _} -> {error, nil}; - _ -> {ok, Cs} - end. - -uri_parse(String) -> - case uri_string:parse(String) of - {error, _, _} -> {error, nil}; - Uri -> - {ok, {uri, - maps_get_optional(Uri, scheme), - maps_get_optional(Uri, userinfo), - maps_get_optional(Uri, host), - maps_get_optional(Uri, port), - maps_get_or(Uri, path, <<>>), - maps_get_optional(Uri, query), - maps_get_optional(Uri, fragment) - }} - end. - -maps_get_optional(Map, Key) -> - try {some, maps:get(Key, Map)} - catch _:_ -> none - end. - -maps_get_or(Map, Key, Default) -> - try maps:get(Key, Map) - catch _:_ -> Default - end. - -print(String) -> - io:put_chars(String), - nil. - -println(String) -> - io:put_chars([String, $\n]), - nil. - -print_error(String) -> - io:put_chars(standard_error, String), - nil. - -println_error(String) -> - io:put_chars(standard_error, [String, $\n]), - nil. - -inspect(true) -> - "True"; -inspect(false) -> - "False"; -inspect(nil) -> - "Nil"; -inspect(Atom) when is_atom(Atom) -> - Binary = erlang:atom_to_binary(Atom), - case inspect_maybe_gleam_atom(Binary, none, <<>>) of - {ok, Inspected} -> Inspected; - {error, _} -> ["atom.create_from_string(\"", Binary, "\")"] - end; -inspect(Any) when is_integer(Any) -> - erlang:integer_to_list(Any); -inspect(Any) when is_float(Any) -> - io_lib_format:fwrite_g(Any); -inspect(Binary) when is_binary(Binary) -> - case inspect_maybe_utf8_string(Binary, <<>>) of - {ok, InspectedUtf8String} -> InspectedUtf8String; - {error, not_a_utf8_string} -> - Segments = [erlang:integer_to_list(X) || <> <= Binary], - ["<<", lists:join(", ", Segments), ">>"] - end; -inspect(List) when is_list(List) -> - case inspect_list(List) of - {proper, Elements} -> ["[", Elements, "]"]; - {improper, Elements} -> ["//erl([", Elements, "])"] - end; -inspect(Any) when is_tuple(Any) % Record constructors - andalso is_atom(element(1, Any)) - andalso element(1, Any) =/= false - andalso element(1, Any) =/= true - andalso element(1, Any) =/= nil --> - [Atom | ArgsList] = erlang:tuple_to_list(Any), - Args = lists:join(<<", ">>, - lists:map(fun inspect/1, ArgsList) - ), - [inspect(Atom), "(", Args, ")"]; -inspect(Tuple) when is_tuple(Tuple) -> - Elements = lists:map(fun inspect/1, erlang:tuple_to_list(Tuple)), - ["#(", lists:join(", ", Elements), ")"]; -inspect(Any) when is_function(Any) -> - {arity, Arity} = erlang:fun_info(Any, arity), - ArgsAsciiCodes = lists:seq($a, $a + Arity - 1), - Args = lists:join(<<", ">>, - lists:map(fun(Arg) -> <> end, ArgsAsciiCodes) - ), - ["//fn(", Args, ") { ... }"]; -inspect(Any) -> - ["//erl(", io_lib:format("~p", [Any]), ")"]. - - -inspect_maybe_gleam_atom(<<>>, none, _) -> - {error, nil}; -inspect_maybe_gleam_atom(<>, none, _) when ?is_digit_char(First) -> - {error, nil}; -inspect_maybe_gleam_atom(<<"_", _Rest/binary>>, none, _) -> - {error, nil}; -inspect_maybe_gleam_atom(<<"_">>, _PrevChar, _Acc) -> - {error, nil}; -inspect_maybe_gleam_atom(<<"_", _Rest/binary>>, $_, _Acc) -> - {error, nil}; -inspect_maybe_gleam_atom(<>, _PrevChar, _Acc) - when not (?is_lowercase_char(First) orelse ?is_underscore_char(First) orelse ?is_digit_char(First)) -> - {error, nil}; -inspect_maybe_gleam_atom(<>, none, Acc) -> - inspect_maybe_gleam_atom(Rest, First, <>); -inspect_maybe_gleam_atom(<<"_", Rest/binary>>, _PrevChar, Acc) -> - inspect_maybe_gleam_atom(Rest, $_, Acc); -inspect_maybe_gleam_atom(<>, $_, Acc) -> - inspect_maybe_gleam_atom(Rest, First, <>); -inspect_maybe_gleam_atom(<>, _PrevChar, Acc) -> - inspect_maybe_gleam_atom(Rest, First, <>); -inspect_maybe_gleam_atom(<<>>, _PrevChar, Acc) -> - {ok, Acc}; -inspect_maybe_gleam_atom(A, B, C) -> - erlang:display({A, B, C}), - throw({gleam_error, A, B, C}). - -inspect_list([]) -> - {proper, []}; -inspect_list([First]) -> - {proper, [inspect(First)]}; -inspect_list([First | Rest]) when is_list(Rest) -> - {Kind, Inspected} = inspect_list(Rest), - {Kind, [inspect(First), <<", ">> | Inspected]}; -inspect_list([First | ImproperTail]) -> - {improper, [inspect(First), <<" | ">>, inspect(ImproperTail)]}. - -inspect_maybe_utf8_string(Binary, Acc) -> - case Binary of - <<>> -> {ok, <<$", Acc/binary, $">>}; - <> -> - Escaped = case First of - $" -> <<$\\, $">>; - $\\ -> <<$\\, $\\>>; - $\r -> <<$\\, $r>>; - $\n -> <<$\\, $n>>; - $\t -> <<$\\, $t>>; - Other -> <> - end, - inspect_maybe_utf8_string(Rest, <>); - _ -> {error, not_a_utf8_string} - end. - -float_to_string(Float) when is_float(Float) -> - erlang:iolist_to_binary(io_lib_format:fwrite_g(Float)). diff --git a/build/packages/gleam_stdlib/src/gleam_stdlib.mjs b/build/packages/gleam_stdlib/src/gleam_stdlib.mjs deleted file mode 100644 index fb255d9..0000000 --- a/build/packages/gleam_stdlib/src/gleam_stdlib.mjs +++ /dev/null @@ -1,783 +0,0 @@ -import { - BitString, - Error, - List, - Ok, - Result, - UtfCodepoint, - inspect, - stringBits, - toBitString, -} from "./gleam.mjs"; -import { - CompileError as RegexCompileError, - Match as RegexMatch, -} from "./gleam/regex.mjs"; -import { DecodeError } from "./gleam/dynamic.mjs"; -import { Some, None } from "./gleam/option.mjs"; -import PMap from "./persistent-hash-map.mjs"; - -const Nil = undefined; -const NOT_FOUND = {}; - -export function identity(x) { - return x; -} - -export function parse_int(value) { - if (/^[-+]?(\d+)$/.test(value)) { - return new Ok(parseInt(value)); - } else { - return new Error(Nil); - } -} - -export function parse_float(value) { - if (/^[-+]?(\d+)\.(\d+)$/.test(value)) { - return new Ok(parseFloat(value)); - } else { - return new Error(Nil); - } -} - -export function to_string(term) { - return term.toString(); -} - -export function float_to_string(float) { - const string = float.toString(); - if (string.indexOf(".") >= 0) { - return string; - } else { - return string + ".0"; - } -} - -export function int_to_base_string(int, base) { - return int.toString(base).toUpperCase(); -} - -const int_base_patterns = { - 2: /[^0-1]/, - 3: /[^0-2]/, - 4: /[^0-3]/, - 5: /[^0-4]/, - 6: /[^0-5]/, - 7: /[^0-6]/, - 8: /[^0-7]/, - 9: /[^0-8]/, - 10: /[^0-9]/, - 11: /[^0-9a]/, - 12: /[^0-9a-b]/, - 13: /[^0-9a-c]/, - 14: /[^0-9a-d]/, - 15: /[^0-9a-e]/, - 16: /[^0-9a-f]/, - 17: /[^0-9a-g]/, - 18: /[^0-9a-h]/, - 19: /[^0-9a-i]/, - 20: /[^0-9a-j]/, - 21: /[^0-9a-k]/, - 22: /[^0-9a-l]/, - 23: /[^0-9a-m]/, - 24: /[^0-9a-n]/, - 25: /[^0-9a-o]/, - 26: /[^0-9a-p]/, - 27: /[^0-9a-q]/, - 28: /[^0-9a-r]/, - 29: /[^0-9a-s]/, - 30: /[^0-9a-t]/, - 31: /[^0-9a-u]/, - 32: /[^0-9a-v]/, - 33: /[^0-9a-w]/, - 34: /[^0-9a-x]/, - 35: /[^0-9a-y]/, - 36: /[^0-9a-z]/, -}; - -export function int_from_base_string(string, base) { - if (int_base_patterns[base].test(string.replace(/^-/, "").toLowerCase())) { - return new Error(Nil); - } - - const result = parseInt(string, base); - - if (isNaN(result)) { - return new Error(Nil); - } - - return new Ok(result); -} - -export function string_replace(string, target, substitute) { - if (typeof string.replaceAll !== "undefined") { - return string.replaceAll(target, substitute); - } - // Fallback for older Node.js versions: - // 1. - // 2. - // TODO: This fallback could be remove once Node.js 14 is EOL - // aka on or after 2024-04-30 - return string.replace( - // $& means the whole matched string - new RegExp(target.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), - substitute - ); -} - -export function string_reverse(string) { - return [...string].reverse().join(""); -} - -export function string_length(string) { - if (string === "") { - return 0; - } - const iterator = graphemes_iterator(string); - if (iterator) { - let i = 0; - for (const _ of iterator) { - i++; - } - return i; - } else { - return string.match(/./gsu).length; - } -} - -export function graphemes(string) { - return List.fromArray( - Array.from(graphemes_iterator(string)).map((item) => item.segment) - ); -} - -function graphemes_iterator(string) { - if (Intl && Intl.Segmenter) { - return new Intl.Segmenter().segment(string)[Symbol.iterator](); - } -} - -export function pop_grapheme(string) { - let first; - const iterator = graphemes_iterator(string); - if (iterator) { - first = iterator.next().value?.segment; - } else { - first = string.match(/./su)?.[0]; - } - if (first) { - return new Ok([first, string.slice(first.length)]); - } else { - return new Error(Nil); - } -} - -export function lowercase(string) { - return string.toLowerCase(); -} - -export function uppercase(string) { - return string.toUpperCase(); -} - -export function less_than(a, b) { - return a < b; -} - -export function add(a, b) { - return a + b; -} - -export function equal(a, b) { - return a === b; -} - -export function split(xs, pattern) { - return List.fromArray(xs.split(pattern)); -} - -export function join(xs, separator) { - const iterator = xs[Symbol.iterator](); - let result = iterator.next().value || ""; - let current = iterator.next(); - while (!current.done) { - result = result + separator + current.value; - current = iterator.next(); - } - return result; -} - -export function concat(xs) { - let result = ""; - for (const x of xs) { - result = result + x; - } - return result; -} - -export function length(data) { - return data.length; -} - -export function crop_string(string, substring) { - return string.substring(string.indexOf(substring)); -} - -export function index_of(haystack, needle) { - return haystack.indexOf(needle) | 0; -} - -export function starts_with(haystack, needle) { - return haystack.startsWith(needle); -} - -export function ends_with(haystack, needle) { - return haystack.endsWith(needle); -} - -export function split_once(haystack, needle) { - const index = haystack.indexOf(needle); - if (index >= 0) { - const before = haystack.slice(0, index); - const after = haystack.slice(index + needle.length); - return new Ok([before, after]); - } else { - return new Error(Nil); - } -} - -export function trim(string) { - return string.trim(); -} - -export function trim_left(string) { - return string.trimLeft(); -} - -export function trim_right(string) { - return string.trimRight(); -} - -export function bit_string_from_string(string) { - return toBitString([stringBits(string)]); -} - -export function bit_string_concat(bit_strings) { - return toBitString(bit_strings.toArray().map((b) => b.buffer)); -} - -export function console_log(term) { - console.log(term); -} - -export function console_error(term) { - console.error(term); -} - -export function crash(message) { - throw new globalThis.Error(message); -} - -export function bit_string_to_string(bit_string) { - try { - const decoder = new TextDecoder("utf-8", { fatal: true }); - return new Ok(decoder.decode(bit_string.buffer)); - } catch (_error) { - return new Error(Nil); - } -} - -export function print(string) { - if (typeof process === "object") { - process.stdout.write(string); // We can write without a trailing newline - } else if (typeof Deno === "object") { - Deno.stdout.writeSync(new TextEncoder().encode(string)); // We can write without a trailing newline - } else { - console.log(string); // We're in a browser. Newlines are mandated - } -} - -export function print_error(string) { - if (typeof process === "object" && process.stderr?.write) { - process.stderr.write(string); // We can write without a trailing newline - } else if (typeof Deno === "object") { - Deno.stderr.writeSync(new TextEncoder().encode(string)); // We can write without a trailing newline - } else { - console.error(string); // We're in a browser. Newlines are mandated - } -} - -export function print_debug(string) { - if (typeof process === "object" && process.stderr?.write) { - process.stderr.write(string + "\n"); // If we're in Node.js, use `stderr` - } else if (typeof Deno === "object") { - Deno.stderr.writeSync(new TextEncoder().encode(string + "\n")); // If we're in Deno, use `stderr` - } else { - console.log(string); // Otherwise, use `console.log` (so that it doesn't look like an error) - } -} - -export function ceiling(float) { - return Math.ceil(float); -} - -export function floor(float) { - return Math.floor(float); -} - -export function round(float) { - return Math.round(float); -} - -export function truncate(float) { - return Math.trunc(float); -} - -export function power(base, exponent) { - // It is checked in Gleam that: - // - The base is non-negative and that the exponent is not fractional. - // - The base is non-zero and the exponent is non-negative (otherwise - // the result will essentially be division by zero). - // It can thus be assumed that valid input is passed to the Math.pow - // function and a NaN or Infinity value will not be produced. - return Math.pow(base, exponent); -} - -export function random_uniform() { - const random_uniform_result = Math.random(); - // With round-to-nearest-even behavior, the ranges claimed for the functions below - // (excluding the one for Math.random() itself) aren't exact. - // If extremely large bounds are chosen (2^53 or higher), - // it's possible in extremely rare cases to calculate the usually-excluded upper bound. - // Note that as numbers in JavaScript are IEEE 754 floating point numbers - // See: - // Because of this, we just loop 'until' we get a valid result where 0.0 <= x < 1.0: - if (random_uniform_result === 1.0) { - return random_uniform(); - } - return random_uniform_result; -} - -export function bit_string_slice(bits, position, length) { - const start = Math.min(position, position + length); - const end = Math.max(position, position + length); - if (start < 0 || end > bits.length) return new Error(Nil); - const buffer = new Uint8Array(bits.buffer.buffer, start, Math.abs(length)); - return new Ok(new BitString(buffer)); -} - -export function codepoint(int) { - return new UtfCodepoint(int); -} - -export function string_to_codepoint_integer_list(string) { - return List.fromArray(Array.from(string).map((item) => item.codePointAt(0))); -} - -export function utf_codepoint_list_to_string(utf_codepoint_integer_list) { - return utf_codepoint_integer_list - .toArray() - .map((x) => String.fromCodePoint(x.value)) - .join(""); -} - -export function utf_codepoint_to_int(utf_codepoint) { - return utf_codepoint.value; -} - -export function regex_check(regex, string) { - regex.lastIndex = 0; - return regex.test(string); -} - -export function compile_regex(pattern, options) { - try { - let flags = "gu"; - if (options.case_insensitive) flags += "i"; - if (options.multi_line) flags += "m"; - return new Ok(new RegExp(pattern, flags)); - } catch (error) { - const number = (error.columnNumber || 0) | 0; - return new Error(new RegexCompileError(error.message, number)); - } -} - -export function regex_scan(regex, string) { - const matches = Array.from(string.matchAll(regex)).map((match) => { - const content = match[0]; - const submatches = []; - for (let n = match.length - 1; n > 0; n--) { - if (match[n]) { - submatches[n - 1] = new Some(match[n]); - continue; - } - if (submatches.length > 0) { - submatches[n - 1] = new None(); - } - } - return new RegexMatch(content, List.fromArray(submatches)); - }); - return List.fromArray(matches); -} - -export function new_map() { - return PMap.new(); -} - -export function map_size(map) { - return map.size; -} - -export function map_to_list(map) { - return List.fromArray(map.entries()); -} - -export function map_remove(key, map) { - return map.delete(key); -} - -export function map_get(map, key) { - const value = map.get(key, NOT_FOUND); - if (value === NOT_FOUND) { - return new Error(Nil); - } - return new Ok(value); -} - -export function map_insert(key, value, map) { - return map.set(key, value); -} - -function unsafe_percent_decode(string) { - return decodeURIComponent((string || "").replace("+", " ")); -} - -export function percent_decode(string) { - try { - return new Ok(unsafe_percent_decode(string)); - } catch (_error) { - return new Error(Nil); - } -} - -export function percent_encode(string) { - return encodeURIComponent(string); -} - -export function parse_query(query) { - try { - const pairs = []; - for (const section of query.split("&")) { - const [key, value] = section.split("="); - if (!key) continue; - pairs.push([unsafe_percent_decode(key), unsafe_percent_decode(value)]); - } - return new Ok(List.fromArray(pairs)); - } catch (_error) { - return new Error(Nil); - } -} - -// From https://developer.mozilla.org/en-US/docs/Glossary/Base64#Solution_2_%E2%80%93_rewrite_the_DOMs_atob()_and_btoa()_using_JavaScript's_TypedArrays_and_UTF-8 -export function encode64(bit_string) { - const aBytes = bit_string.buffer; - let nMod3 = 2; - let sB64Enc = ""; - - for (let nLen = aBytes.length, nUint24 = 0, nIdx = 0; nIdx < nLen; nIdx++) { - nMod3 = nIdx % 3; - if (nIdx > 0 && ((nIdx * 4) / 3) % 76 === 0) { - sB64Enc += "\r\n"; - } - nUint24 |= aBytes[nIdx] << ((16 >>> nMod3) & 24); - if (nMod3 === 2 || aBytes.length - nIdx === 1) { - sB64Enc += String.fromCharCode( - uint6ToB64((nUint24 >>> 18) & 63), - uint6ToB64((nUint24 >>> 12) & 63), - uint6ToB64((nUint24 >>> 6) & 63), - uint6ToB64(nUint24 & 63) - ); - nUint24 = 0; - } - } - - return ( - sB64Enc.substr(0, sB64Enc.length - 2 + nMod3) + - (nMod3 === 2 ? "" : nMod3 === 1 ? "=" : "==") - ); -} - -// From https://developer.mozilla.org/en-US/docs/Glossary/Base64#Solution_2_%E2%80%93_rewrite_the_DOMs_atob()_and_btoa()_using_JavaScript's_TypedArrays_and_UTF-8 -function uint6ToB64(nUint6) { - return nUint6 < 26 - ? nUint6 + 65 - : nUint6 < 52 - ? nUint6 + 71 - : nUint6 < 62 - ? nUint6 - 4 - : nUint6 === 62 - ? 43 - : nUint6 === 63 - ? 47 - : 65; -} - -// From https://developer.mozilla.org/en-US/docs/Glossary/Base64#Solution_2_%E2%80%93_rewrite_the_DOMs_atob()_and_btoa()_using_JavaScript's_TypedArrays_and_UTF-8 -function b64ToUint6(nChr) { - return nChr > 64 && nChr < 91 - ? nChr - 65 - : nChr > 96 && nChr < 123 - ? nChr - 71 - : nChr > 47 && nChr < 58 - ? nChr + 4 - : nChr === 43 - ? 62 - : nChr === 47 - ? 63 - : 0; -} - -// From https://developer.mozilla.org/en-US/docs/Glossary/Base64#Solution_2_%E2%80%93_rewrite_the_DOMs_atob()_and_btoa()_using_JavaScript's_TypedArrays_and_UTF-8 -export function decode64(sBase64) { - if (sBase64.match(/[^A-Za-z0-9\+\/=]/g)) return new Error(Nil); - const sB64Enc = sBase64.replace(/=/g, ""); - const nInLen = sB64Enc.length; - const nOutLen = (nInLen * 3 + 1) >> 2; - const taBytes = new Uint8Array(nOutLen); - - for ( - let nMod3, nMod4, nUint24 = 0, nOutIdx = 0, nInIdx = 0; - nInIdx < nInLen; - nInIdx++ - ) { - nMod4 = nInIdx & 3; - nUint24 |= b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << (6 * (3 - nMod4)); - if (nMod4 === 3 || nInLen - nInIdx === 1) { - for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) { - taBytes[nOutIdx] = (nUint24 >>> ((16 >>> nMod3) & 24)) & 255; - } - nUint24 = 0; - } - } - - return new Ok(new BitString(taBytes)); -} - -export function classify_dynamic(data) { - if (typeof data === "string") { - return "String"; - } else if (Result.isResult(data)) { - return "Result"; - } else if (List.isList(data)) { - return "List"; - } else if (Number.isInteger(data)) { - return "Int"; - } else if (Array.isArray(data)) { - return `Tuple of ${data.length} elements`; - } else if (BitString.isBitString(data)) { - return "BitString"; - } else if (data instanceof PMap) { - return "Map"; - } else if (typeof data === "number") { - return "Float"; - } else if (data === null) { - return "Null"; - } else if (data === undefined) { - return "Nil"; - } else { - const type = typeof data; - return type.charAt(0).toUpperCase() + type.slice(1); - } -} - -function decoder_error(expected, got) { - return decoder_error_no_classify(expected, classify_dynamic(got)); -} - -function decoder_error_no_classify(expected, got) { - return new Error( - List.fromArray([new DecodeError(expected, got, List.fromArray([]))]) - ); -} - -export function decode_string(data) { - return typeof data === "string" - ? new Ok(data) - : decoder_error("String", data); -} - -export function decode_int(data) { - return Number.isInteger(data) ? new Ok(data) : decoder_error("Int", data); -} - -export function decode_float(data) { - return typeof data === "number" ? new Ok(data) : decoder_error("Float", data); -} - -export function decode_bool(data) { - return typeof data === "boolean" ? new Ok(data) : decoder_error("Bool", data); -} - -export function decode_bit_string(data) { - if (BitString.isBitString(data)) { - return new Ok(data); - } - if (data instanceof Uint8Array) { - return new Ok(new BitString(data)); - } - return decoder_error("BitString", data); -} - -export function decode_tuple(data) { - return Array.isArray(data) ? new Ok(data) : decoder_error("Tuple", data); -} - -export function decode_tuple2(data) { - return decode_tupleN(data, 2); -} - -export function decode_tuple3(data) { - return decode_tupleN(data, 3); -} - -export function decode_tuple4(data) { - return decode_tupleN(data, 4); -} - -export function decode_tuple5(data) { - return decode_tupleN(data, 5); -} - -export function decode_tuple6(data) { - return decode_tupleN(data, 6); -} - -function decode_tupleN(data, n) { - if (Array.isArray(data) && data.length == n) { - return new Ok(data); - } - - const list = decode_exact_length_list(data, n); - if (list) return new Ok(list); - - return decoder_error(`Tuple of ${n} elements`, data); -} - -function decode_exact_length_list(data, n) { - if (!List.isList(data)) return; - - const elements = []; - let current = data; - - for (let i = 0; i < n; i++) { - if (current.isEmpty()) break; - elements.push(current.head); - current = current.tail; - } - - if (elements.length === n && current.isEmpty()) return elements; -} - -export function tuple_get(data, index) { - return index >= 0 && data.length > index - ? new Ok(data[index]) - : new Error(Nil); -} - -export function decode_list(data) { - if (Array.isArray(data)) { - return new Ok(List.fromArray(data)); - } - return List.isList(data) ? new Ok(data) : decoder_error("List", data); -} - -export function decode_result(data) { - return Result.isResult(data) ? new Ok(data) : decoder_error("Result", data); -} - -export function decode_map(data) { - if (data instanceof PMap) { - return new Ok(PMap.fromMap(data)); - } - if (data == null) { - return decoder_error("Map", data); - } - if (typeof data !== "object") { - return decoder_error("Map", data); - } - const proto = Object.getPrototypeOf(data); - if (proto === Object.prototype || proto === null) { - return new Ok(PMap.fromObject(data)); - } - return decoder_error("Map", data); -} - -export function decode_option(data, decoder) { - if (data === null || data === undefined || data instanceof None) - return new Ok(new None()); - if (data instanceof Some) data = data[0]; - const result = decoder(data); - if (result.isOk()) { - return new Ok(new Some(result[0])); - } else { - return result; - } -} - -export function decode_field(value, name) { - const not_a_map_error = () => decoder_error("Map", value); - - if ( - value instanceof PMap || - value instanceof WeakMap || - value instanceof Map - ) { - const entry = map_get(value, name); - return new Ok(entry.isOk() ? new Some(entry[0]) : new None()); - } else if (Object.getPrototypeOf(value) == Object.prototype) { - return try_get_field(value, name, () => new Ok(new None())); - } else { - return try_get_field(value, name, not_a_map_error); - } -} - -function try_get_field(value, field, or_else) { - try { - return field in value ? new Ok(new Some(value[field])) : or_else(); - } catch { - return or_else(); - } -} - -export function byte_size(string) { - return new TextEncoder().encode(string).length; -} - -// In Javascript bitwise operations convert numbers to a sequence of 32 bits -// while Erlang uses arbitrary precision. -// To get around this problem and get consistent results use BigInt and then -// downcast the value back to a Number value. - -export function bitwise_and(x, y) { - return Number(BigInt(x) & BigInt(y)); -} - -export function bitwise_not(x) { - return Number(~BigInt(x)); -} - -export function bitwise_or(x, y) { - return Number(BigInt(x) | BigInt(y)); -} - -export function bitwise_exclusive_or(x, y) { - return Number(BigInt(x) ^ BigInt(y)); -} - -export function bitwise_shift_left(x, y) { - return Number(BigInt(x) << BigInt(y)); -} - -export function bitwise_shift_right(x, y) { - return Number(BigInt(x) >> BigInt(y)); -} diff --git a/build/packages/gleam_stdlib/src/persistent-hash-map.mjs b/build/packages/gleam_stdlib/src/persistent-hash-map.mjs deleted file mode 100644 index ff849d8..0000000 --- a/build/packages/gleam_stdlib/src/persistent-hash-map.mjs +++ /dev/null @@ -1,957 +0,0 @@ -/** - * This file uses jsdoc to annotate types. - * These types can be checked using the typescript compiler with "checkjs" option. - */ - -import { isEqual } from "./gleam.mjs"; - -const referenceMap = new WeakMap(); -const tempDataView = new DataView(new ArrayBuffer(8)); -let referenceUID = 0; -/** - * hash the object by reference using a weak map and incrementing uid - * @param {any} o - * @returns {number} - */ -function hashByReference(o) { - const known = referenceMap.get(o); - if (known !== undefined) { - return known; - } - const hash = referenceUID++; - if (referenceUID === 0x7fffffff) { - referenceUID = 0; - } - referenceMap.set(o, hash); - return hash; -} -/** - * merge two hashes in an order sensitive way - * @param {number} a - * @param {number} b - * @returns {number} - */ -function hashMerge(a, b) { - return (a ^ (b + 0x9e3779b9 + (a << 6) + (a >> 2))) | 0; -} -/** - * standard string hash popularised by java - * @param {string} s - * @returns {number} - */ -function hashString(s) { - let hash = 0; - const len = s.length; - for (let i = 0; i < len; i++) { - hash = (Math.imul(31, hash) + s.charCodeAt(i)) | 0; - } - return hash; -} -/** - * hash a number by converting to two integers and do some jumbling - * @param {number} n - * @returns {number} - */ -function hashNumber(n) { - tempDataView.setFloat64(0, n); - const i = tempDataView.getInt32(0); - const j = tempDataView.getInt32(4); - return Math.imul(0x45d9f3b, (i >> 16) ^ i) ^ j; -} -/** - * hash a BigInt by converting it to a string and hashing that - * @param {BigInt} n - * @returns {number} - */ -function hashBigInt(n) { - return hashString(n.toString()); -} -/** - * hash any js object - * @param {any} o - * @returns {number} - */ -function hashObject(o) { - const proto = Object.getPrototypeOf(o); - if (proto !== null && typeof proto.hashCode === "function") { - try { - const code = o.hashCode(o); - if (typeof code === "number") { - return code; - } - } catch {} - } - if (o instanceof Promise || o instanceof WeakSet || o instanceof WeakMap) { - return hashByReference(o); - } - if (o instanceof Date) { - return hashNumber(o.getTime()); - } - let h = 0; - if (o instanceof ArrayBuffer) { - o = new Uint8Array(o); - } - if (Array.isArray(o) || o instanceof Uint8Array) { - for (let i = 0; i < o.length; i++) { - h = (Math.imul(31, h) + getHash(o[i])) | 0; - } - } else if (o instanceof Set) { - o.forEach((v) => { - h = (h + getHash(v)) | 0; - }); - } else if (o instanceof Map) { - o.forEach((v, k) => { - h = (h + hashMerge(getHash(v), getHash(k))) | 0; - }); - } else { - const keys = Object.keys(o); - for (let i = 0; i < keys.length; i++) { - const k = keys[i]; - const v = o[k]; - h = (h + hashMerge(getHash(v), hashString(k))) | 0; - } - } - return h; -} -/** - * hash any js value - * @param {any} u - * @returns {number} - */ -export function getHash(u) { - if (u === null) return 0x42108422; - if (u === undefined) return 0x42108423; - if (u === true) return 0x42108421; - if (u === false) return 0x42108420; - switch (typeof u) { - case "number": - return hashNumber(u); - case "string": - return hashString(u); - case "bigint": - return hashBigInt(u); - case "object": - return hashObject(u); - case "symbol": - return hashByReference(u); - case "function": - return hashByReference(u); - default: - return 0; // should be unreachable - } -} -/** - * @template K,V - * @typedef {ArrayNode | IndexNode | CollisionNode} Node - */ -/** - * @template K,V - * @typedef {{ type: typeof ENTRY, k: K, v: V }} Entry - */ -/** - * @template K,V - * @typedef {{ type: typeof ARRAY_NODE, size: number, array: (undefined | Entry | Node)[] }} ArrayNode - */ -/** - * @template K,V - * @typedef {{ type: typeof INDEX_NODE, bitmap: number, array: (Entry | Node)[] }} IndexNode - */ -/** - * @template K,V - * @typedef {{ type: typeof COLLISION_NODE, hash: number, array: Entry[] }} CollisionNode - */ -/** - * @typedef {{ val: boolean }} Flag - */ -const SHIFT = 5; // number of bits you need to shift by to get the next bucket -const BUCKET_SIZE = Math.pow(2, SHIFT); -const MASK = BUCKET_SIZE - 1; // used to zero out all bits not in the bucket -const MAX_INDEX_NODE = BUCKET_SIZE / 2; // when does index node grow into array node -const MIN_ARRAY_NODE = BUCKET_SIZE / 4; // when does array node shrink to index node -const ENTRY = 0; -const ARRAY_NODE = 1; -const INDEX_NODE = 2; -const COLLISION_NODE = 3; -/** @type {IndexNode} */ -const EMPTY = { - type: INDEX_NODE, - bitmap: 0, - array: [], -}; -/** - * Mask the hash to get only the bucket corresponding to shift - * @param {number} hash - * @param {number} shift - * @returns {number} - */ -function mask(hash, shift) { - return (hash >>> shift) & MASK; -} -/** - * Set only the Nth bit where N is the masked hash - * @param {number} hash - * @param {number} shift - * @returns {number} - */ -function bitpos(hash, shift) { - return 1 << mask(hash, shift); -} -/** - * Count the number of 1 bits in a number - * @param {number} x - * @returns {number} - */ -function bitcount(x) { - x -= (x >> 1) & 0x55555555; - x = (x & 0x33333333) + ((x >> 2) & 0x33333333); - x = (x + (x >> 4)) & 0x0f0f0f0f; - x += x >> 8; - x += x >> 16; - return x & 0x7f; -} -/** - * Calculate the array index of an item in a bitmap index node - * @param {number} bitmap - * @param {number} bit - * @returns {number} - */ -function index(bitmap, bit) { - return bitcount(bitmap & (bit - 1)); -} -/** - * Efficiently copy an array and set one value at an index - * @template T - * @param {T[]} arr - * @param {number} at - * @param {T} val - * @returns {T[]} - */ -function cloneAndSet(arr, at, val) { - const len = arr.length; - const out = new Array(len); - for (let i = 0; i < len; ++i) { - out[i] = arr[i]; - } - out[at] = val; - return out; -} -/** - * Efficiently copy an array and insert one value at an index - * @template T - * @param {T[]} arr - * @param {number} at - * @param {T} val - * @returns {T[]} - */ -function spliceIn(arr, at, val) { - const len = arr.length; - const out = new Array(len + 1); - let i = 0; - let g = 0; - while (i < at) { - out[g++] = arr[i++]; - } - out[g++] = val; - while (i < len) { - out[g++] = arr[i++]; - } - return out; -} -/** - * Efficiently copy an array and remove one value at an index - * @template T - * @param {T[]} arr - * @param {number} at - * @returns {T[]} - */ -function spliceOut(arr, at) { - const len = arr.length; - const out = new Array(len - 1); - let i = 0; - let g = 0; - while (i < at) { - out[g++] = arr[i++]; - } - ++i; - while (i < len) { - out[g++] = arr[i++]; - } - return out; -} -/** - * Create a new node containing two entries - * @template K,V - * @param {number} shift - * @param {K} key1 - * @param {V} val1 - * @param {number} key2hash - * @param {K} key2 - * @param {V} val2 - * @returns {Node} - */ -function createNode(shift, key1, val1, key2hash, key2, val2) { - const key1hash = getHash(key1); - if (key1hash === key2hash) { - return { - type: COLLISION_NODE, - hash: key1hash, - array: [ - { type: ENTRY, k: key1, v: val1 }, - { type: ENTRY, k: key2, v: val2 }, - ], - }; - } - const addedLeaf = { val: false }; - return assoc( - assocIndex(EMPTY, shift, key1hash, key1, val1, addedLeaf), - shift, - key2hash, - key2, - val2, - addedLeaf - ); -} -/** - * @template T,K,V - * @callback AssocFunction - * @param {T} root - * @param {number} shift - * @param {number} hash - * @param {K} key - * @param {V} val - * @param {Flag} addedLeaf - * @returns {Node} - */ -/** - * Associate a node with a new entry, creating a new node - * @template T,K,V - * @type {AssocFunction,K,V>} - */ -function assoc(root, shift, hash, key, val, addedLeaf) { - switch (root.type) { - case ARRAY_NODE: - return assocArray(root, shift, hash, key, val, addedLeaf); - case INDEX_NODE: - return assocIndex(root, shift, hash, key, val, addedLeaf); - case COLLISION_NODE: - return assocCollision(root, shift, hash, key, val, addedLeaf); - } -} -/** - * @template T,K,V - * @type {AssocFunction,K,V>} - */ -function assocArray(root, shift, hash, key, val, addedLeaf) { - const idx = mask(hash, shift); - const node = root.array[idx]; - // if the corresponding index is empty set the index to a newly created node - if (node === undefined) { - addedLeaf.val = true; - return { - type: ARRAY_NODE, - size: root.size + 1, - array: cloneAndSet(root.array, idx, { type: ENTRY, k: key, v: val }), - }; - } - if (node.type === ENTRY) { - // if keys are equal replace the entry - if (isEqual(key, node.k)) { - if (val === node.v) { - return root; - } - return { - type: ARRAY_NODE, - size: root.size, - array: cloneAndSet(root.array, idx, { - type: ENTRY, - k: key, - v: val, - }), - }; - } - // otherwise upgrade the entry to a node and insert - addedLeaf.val = true; - return { - type: ARRAY_NODE, - size: root.size, - array: cloneAndSet( - root.array, - idx, - createNode(shift + SHIFT, node.k, node.v, hash, key, val) - ), - }; - } - // otherwise call assoc on the child node - const n = assoc(node, shift + SHIFT, hash, key, val, addedLeaf); - // if the child node hasn't changed just return the old root - if (n === node) { - return root; - } - // otherwise set the index to the new node - return { - type: ARRAY_NODE, - size: root.size, - array: cloneAndSet(root.array, idx, n), - }; -} -/** - * @template T,K,V - * @type {AssocFunction,K,V>} - */ -function assocIndex(root, shift, hash, key, val, addedLeaf) { - const bit = bitpos(hash, shift); - const idx = index(root.bitmap, bit); - // if there is already a item at this hash index.. - if ((root.bitmap & bit) !== 0) { - // if there is a node at the index (not an entry), call assoc on the child node - const node = root.array[idx]; - if (node.type !== ENTRY) { - const n = assoc(node, shift + SHIFT, hash, key, val, addedLeaf); - if (n === node) { - return root; - } - return { - type: INDEX_NODE, - bitmap: root.bitmap, - array: cloneAndSet(root.array, idx, n), - }; - } - // otherwise there is an entry at the index - // if the keys are equal replace the entry with the updated value - const nodeKey = node.k; - if (isEqual(key, nodeKey)) { - if (val === node.v) { - return root; - } - return { - type: INDEX_NODE, - bitmap: root.bitmap, - array: cloneAndSet(root.array, idx, { - type: ENTRY, - k: key, - v: val, - }), - }; - } - // if the keys are not equal, replace the entry with a new child node - addedLeaf.val = true; - return { - type: INDEX_NODE, - bitmap: root.bitmap, - array: cloneAndSet( - root.array, - idx, - createNode(shift + SHIFT, nodeKey, node.v, hash, key, val) - ), - }; - } else { - // else there is currently no item at the hash index - const n = root.array.length; - // if the number of nodes is at the maximum, expand this node into an array node - if (n >= MAX_INDEX_NODE) { - // create a 32 length array for the new array node (one for each bit in the hash) - const nodes = new Array(32); - // create and insert a node for the new entry - const jdx = mask(hash, shift); - nodes[jdx] = assocIndex(EMPTY, shift + SHIFT, hash, key, val, addedLeaf); - let j = 0; - let bitmap = root.bitmap; - // place each item in the index node into the correct spot in the array node - // loop through all 32 bits / array positions - for (let i = 0; i < 32; i++) { - if ((bitmap & 1) !== 0) { - const node = root.array[j++]; - nodes[i] = node; - } - // shift the bitmap to process the next bit - bitmap = bitmap >>> 1; - } - return { - type: ARRAY_NODE, - size: n + 1, - array: nodes, - }; - } else { - // else there is still space in this index node - // simply insert a new entry at the hash index - const newArray = spliceIn(root.array, idx, { - type: ENTRY, - k: key, - v: val, - }); - addedLeaf.val = true; - return { - type: INDEX_NODE, - bitmap: root.bitmap | bit, - array: newArray, - }; - } - } -} -/** - * @template T,K,V - * @type {AssocFunction,K,V>} - */ -function assocCollision(root, shift, hash, key, val, addedLeaf) { - // if there is a hash collision - if (hash === root.hash) { - const idx = collisionIndexOf(root, key); - // if this key already exists replace the entry with the new value - if (idx !== -1) { - const entry = root.array[idx]; - if (entry.v === val) { - return root; - } - return { - type: COLLISION_NODE, - hash: hash, - array: cloneAndSet(root.array, idx, { type: ENTRY, k: key, v: val }), - }; - } - // otherwise insert the entry at the end of the array - const size = root.array.length; - addedLeaf.val = true; - return { - type: COLLISION_NODE, - hash: hash, - array: cloneAndSet(root.array, size, { type: ENTRY, k: key, v: val }), - }; - } - // if there is no hash collision, upgrade to an index node - return assoc( - { - type: INDEX_NODE, - bitmap: bitpos(root.hash, shift), - array: [root], - }, - shift, - hash, - key, - val, - addedLeaf - ); -} -/** - * Find the index of a key in the collision node's array - * @template K,V - * @param {CollisionNode} root - * @param {K} key - * @returns {number} - */ -function collisionIndexOf(root, key) { - const size = root.array.length; - for (let i = 0; i < size; i++) { - if (isEqual(key, root.array[i].k)) { - return i; - } - } - return -1; -} -/** - * @template T,K,V - * @callback FindFunction - * @param {T} root - * @param {number} shift - * @param {number} hash - * @param {K} key - * @returns {undefined | Entry} - */ -/** - * Return the found entry or undefined if not present in the root - * @template K,V - * @type {FindFunction,K,V>} - */ -function find(root, shift, hash, key) { - switch (root.type) { - case ARRAY_NODE: - return findArray(root, shift, hash, key); - case INDEX_NODE: - return findIndex(root, shift, hash, key); - case COLLISION_NODE: - return findCollision(root, key); - } -} -/** - * @template K,V - * @type {FindFunction,K,V>} - */ -function findArray(root, shift, hash, key) { - const idx = mask(hash, shift); - const node = root.array[idx]; - if (node === undefined) { - return undefined; - } - if (node.type !== ENTRY) { - return find(node, shift + SHIFT, hash, key); - } - if (isEqual(key, node.k)) { - return node; - } - return undefined; -} -/** - * @template K,V - * @type {FindFunction,K,V>} - */ -function findIndex(root, shift, hash, key) { - const bit = bitpos(hash, shift); - if ((root.bitmap & bit) === 0) { - return undefined; - } - const idx = index(root.bitmap, bit); - const node = root.array[idx]; - if (node.type !== ENTRY) { - return find(node, shift + SHIFT, hash, key); - } - if (isEqual(key, node.k)) { - return node; - } - return undefined; -} -/** - * @template K,V - * @param {CollisionNode} root - * @param {K} key - * @returns {undefined | Entry} - */ -function findCollision(root, key) { - const idx = collisionIndexOf(root, key); - if (idx < 0) { - return undefined; - } - return root.array[idx]; -} -/** - * @template T,K,V - * @callback WithoutFunction - * @param {T} root - * @param {number} shift - * @param {number} hash - * @param {K} key - * @returns {undefined | Node} - */ -/** - * Remove an entry from the root, returning the updated root. - * Returns undefined if the node should be removed from the parent. - * @template K,V - * @type {WithoutFunction,K,V>} - * */ -function without(root, shift, hash, key) { - switch (root.type) { - case ARRAY_NODE: - return withoutArray(root, shift, hash, key); - case INDEX_NODE: - return withoutIndex(root, shift, hash, key); - case COLLISION_NODE: - return withoutCollision(root, key); - } -} -/** - * @template K,V - * @type {WithoutFunction,K,V>} - */ -function withoutArray(root, shift, hash, key) { - const idx = mask(hash, shift); - const node = root.array[idx]; - if (node === undefined) { - return root; // already empty - } - let n = undefined; - // if node is an entry and the keys are not equal there is nothing to remove - // if node is not an entry do a recursive call - if (node.type === ENTRY) { - if (!isEqual(node.k, key)) { - return root; // no changes - } - } else { - n = without(node, shift + SHIFT, hash, key); - if (n === node) { - return root; // no changes - } - } - // if the recursive call returned undefined the node should be removed - if (n === undefined) { - // if the number of child nodes is at the minimum, pack into an index node - if (root.size <= MIN_ARRAY_NODE) { - const arr = root.array; - const out = new Array(root.size - 1); - let i = 0; - let j = 0; - let bitmap = 0; - while (i < idx) { - const nv = arr[i]; - if (nv !== undefined) { - out[j] = nv; - bitmap |= 1 << i; - ++j; - } - ++i; - } - ++i; // skip copying the removed node - while (i < arr.length) { - const nv = arr[i]; - if (nv !== undefined) { - out[j] = nv; - bitmap |= 1 << i; - ++j; - } - ++i; - } - return { - type: INDEX_NODE, - bitmap: bitmap, - array: out, - }; - } - return { - type: ARRAY_NODE, - size: root.size - 1, - array: cloneAndSet(root.array, idx, n), - }; - } - return { - type: ARRAY_NODE, - size: root.size, - array: cloneAndSet(root.array, idx, n), - }; -} -/** - * @template K,V - * @type {WithoutFunction,K,V>} - */ -function withoutIndex(root, shift, hash, key) { - const bit = bitpos(hash, shift); - if ((root.bitmap & bit) === 0) { - return root; // already empty - } - const idx = index(root.bitmap, bit); - const node = root.array[idx]; - // if the item is not an entry - if (node.type !== ENTRY) { - const n = without(node, shift + SHIFT, hash, key); - if (n === node) { - return root; // no changes - } - // if not undefined, the child node still has items, so update it - if (n !== undefined) { - return { - type: INDEX_NODE, - bitmap: root.bitmap, - array: cloneAndSet(root.array, idx, n), - }; - } - // otherwise the child node should be removed - // if it was the only child node, remove this node from the parent - if (root.bitmap === bit) { - return undefined; - } - // otherwise just remove the child node - return { - type: INDEX_NODE, - bitmap: root.bitmap ^ bit, - array: spliceOut(root.array, idx), - }; - } - // otherwise the item is an entry, remove it if the key matches - if (isEqual(key, node.k)) { - if (root.bitmap === bit) { - return undefined; - } - return { - type: INDEX_NODE, - bitmap: root.bitmap ^ bit, - array: spliceOut(root.array, idx), - }; - } - return root; -} -/** - * @template K,V - * @param {CollisionNode} root - * @param {K} key - * @returns {undefined | Node} - */ -function withoutCollision(root, key) { - const idx = collisionIndexOf(root, key); - // if the key not found, no changes - if (idx < 0) { - return root; - } - // otherwise the entry was found, remove it - // if it was the only entry in this node, remove the whole node - if (root.array.length === 1) { - return undefined; - } - // otherwise just remove the entry - return { - type: COLLISION_NODE, - hash: root.hash, - array: spliceOut(root.array, idx), - }; -} -/** - * @template K,V - * @param {undefined | Node} root - * @param {(value:V,key:K)=>void} fn - * @returns {void} - */ -function forEach(root, fn) { - if (root === undefined) { - return; - } - const items = root.array; - const size = items.length; - for (let i = 0; i < size; i++) { - const item = items[i]; - if (item === undefined) { - continue; - } - if (item.type === ENTRY) { - fn(item.v, item.k); - continue; - } - forEach(item, fn); - } -} -/** - * Extra wrapper to keep track of map size and clean up the API - * @template K,V - */ -export default class PMap { - /** - * @template V - * @param {Record} o - * @returns {PMap} - */ - static fromObject(o) { - const keys = Object.keys(o); - /** @type PMap */ - let m = PMap.new(); - for (let i = 0; i < keys.length; i++) { - const k = keys[i]; - m = m.set(k, o[k]); - } - return m; - } - /** - * @template K,V - * @param {Map} o - * @returns {PMap} - */ - static fromMap(o) { - /** @type PMap */ - let m = PMap.new(); - o.forEach((v, k) => { - m = m.set(k, v); - }); - return m; - } - static new() { - return new PMap(undefined, 0); - } - /** - * @param {undefined | Node} root - * @param {number} size - */ - constructor(root, size) { - this.root = root; - this.size = size; - } - /** - * @template NotFound - * @param {K} key - * @param {NotFound} notFound - * @returns {NotFound | V} - */ - get(key, notFound) { - if (this.root === undefined) { - return notFound; - } - const found = find(this.root, 0, getHash(key), key); - if (found === undefined) { - return notFound; - } - return found.v; - } - /** - * @param {K} key - * @param {V} val - * @returns {PMap} - */ - set(key, val) { - const addedLeaf = { val: false }; - const root = this.root === undefined ? EMPTY : this.root; - const newRoot = assoc(root, 0, getHash(key), key, val, addedLeaf); - if (newRoot === this.root) { - return this; - } - return new PMap(newRoot, addedLeaf.val ? this.size + 1 : this.size); - } - /** - * @param {K} key - * @returns {PMap} - */ - delete(key) { - if (this.root === undefined) { - return this; - } - const newRoot = without(this.root, 0, getHash(key), key); - if (newRoot === this.root) { - return this; - } - if (newRoot === undefined) { - return PMap.new(); - } - return new PMap(newRoot, this.size - 1); - } - /** - * @param {K} key - * @returns {boolean} - */ - has(key) { - if (this.root === undefined) { - return false; - } - return find(this.root, 0, getHash(key), key) !== undefined; - } - /** - * @returns {[K,V][]} - */ - entries() { - if (this.root === undefined) { - return []; - } - /** @type [K,V][] */ - const result = []; - this.forEach((v, k) => result.push([k, v])); - return result; - } - /** - * - * @param {(val:V,key:K)=>void} fn - */ - forEach(fn) { - forEach(this.root, fn); - } - hashCode() { - let h = 0; - this.forEach((v, k) => { - h = (h + hashMerge(getHash(v), getHash(k))) | 0; - }); - return h; - } - /** - * @param {unknown} o - * @returns {boolean} - */ - equals(o) { - if (!(o instanceof PMap)) { - return false; - } - let equal = true; - this.forEach((v, k) => { - equal = equal && isEqual(o.get(k, !v), v); - }); - return equal; - } -} diff --git a/build/packages/gleeunit/LICENCE b/build/packages/gleeunit/LICENCE deleted file mode 100644 index c7967c3..0000000 --- a/build/packages/gleeunit/LICENCE +++ /dev/null @@ -1,191 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2021, Louis Pilfold . - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/build/packages/gleeunit/README.md b/build/packages/gleeunit/README.md deleted file mode 100644 index 3ca1c63..0000000 --- a/build/packages/gleeunit/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# gleeunit - -Gleam bindings to the Erlang EUnit test framework. - -A custom test runner is included for when compiled to JavaScript running on -either NodeJS or Deno. - -Documentation is available on [HexDocs](https://hexdocs.pm/gleeunit/index.html). - -## Usage - -Add this package to your Gleam project. - -```sh -gleam add gleeunit --dev -``` - -And then call the `gleeunit.main` function from your test main function. - -```gleam -// In test/yourapp_test.gleam -import gleeunit - -pub fn main() { - gleeunit.main() -} -``` - -Now any public function with a name ending in `_test` in the `test` directory -will be found and run as a test. - -```gleam -pub fn the_universe_test() { - let assert 1 = 1 -} -``` - -Run the tests by entering `gleam test` in the command line. - -### Deno - -If using the Deno JavaScript runtime, you will need to add the following to your -`gleam.toml`. - -```toml -[javascript.deno] -allow_read = [ - "gleam.toml", - "test", - "build", -] -``` diff --git a/build/packages/gleeunit/gleam.toml b/build/packages/gleeunit/gleam.toml deleted file mode 100644 index 74b7e20..0000000 --- a/build/packages/gleeunit/gleam.toml +++ /dev/null @@ -1,17 +0,0 @@ -name = "gleeunit" -version = "0.11.0" -licences = ["Apache-2.0"] -description = "Gleam bindings to Erlang's EUnit test framework" - -[javascript.deno] -allow_read = [ - "gleam.toml", - "test", - "build", -] - -[dependencies] -gleam_stdlib = "~> 0.27" - -[dev-dependencies] -# some_test_package = "~> 1.0.0" diff --git a/build/packages/gleeunit/src/gleeunit.app.src b/build/packages/gleeunit/src/gleeunit.app.src deleted file mode 100644 index 2f98842..0000000 --- a/build/packages/gleeunit/src/gleeunit.app.src +++ /dev/null @@ -1,8 +0,0 @@ -{application, gleeunit, [ - {vsn, "0.11.0"}, - {applications, [gleam_stdlib]}, - {description, "Gleam bindings to Erlang's EUnit test framework"}, - {modules, [gleeunit, - gleeunit@should]}, - {registered, []} -]}. diff --git a/build/packages/gleeunit/src/gleeunit.erl b/build/packages/gleeunit/src/gleeunit.erl deleted file mode 100644 index 32e1a83..0000000 --- a/build/packages/gleeunit/src/gleeunit.erl +++ /dev/null @@ -1,59 +0,0 @@ --module(gleeunit). --compile([no_auto_import, nowarn_unused_vars]). - --export([main/0]). --export_type([atom_/0, encoding/0, report_module_name/0, gleeunit_progress_option/0, eunit_option/0]). - --type atom_() :: any(). - --type encoding() :: utf8. - --type report_module_name() :: gleeunit_progress. - --type gleeunit_progress_option() :: {colored, boolean()}. - --type eunit_option() :: verbose | - no_tty | - {report, {report_module_name(), list(gleeunit_progress_option())}}. - --spec gleam_to_erlang_module_name(binary()) -> binary(). -gleam_to_erlang_module_name(Path) -> - _pipe = Path, - _pipe@1 = gleam@string:replace(_pipe, <<".gleam"/utf8>>, <<""/utf8>>), - _pipe@2 = gleam@string:replace(_pipe@1, <<".erl"/utf8>>, <<""/utf8>>), - gleam@string:replace(_pipe@2, <<"/"/utf8>>, <<"@"/utf8>>). - --spec do_main() -> nil. -do_main() -> - Options = [verbose, - no_tty, - {report, {gleeunit_progress, [{colored, true}]}}], - Result = begin - _pipe = gleeunit_ffi:find_files( - <<"**/*.{erl,gleam}"/utf8>>, - <<"test"/utf8>> - ), - _pipe@1 = gleam@list:map(_pipe, fun gleam_to_erlang_module_name/1), - _pipe@2 = gleam@list:map( - _pipe@1, - fun(_capture) -> erlang:binary_to_atom(_capture, utf8) end - ), - _pipe@3 = eunit:test(_pipe@2, Options), - _pipe@4 = (gleam@dynamic:result( - fun gleam@dynamic:dynamic/1, - fun gleam@dynamic:dynamic/1 - ))(_pipe@3), - gleam@result:unwrap(_pipe@4, {error, gleam@dynamic:from(nil)}) - end, - Code = case Result of - {ok, _} -> - 0; - - {error, _} -> - 1 - end, - erlang:halt(Code). - --spec main() -> nil. -main() -> - do_main(). diff --git a/build/packages/gleeunit/src/gleeunit.gleam b/build/packages/gleeunit/src/gleeunit.gleam deleted file mode 100644 index e5d4b46..0000000 --- a/build/packages/gleeunit/src/gleeunit.gleam +++ /dev/null @@ -1,92 +0,0 @@ -/// Find and run all test functions for the current project using Erlang's EUnit -/// test framework. -/// -/// Any Erlang or Gleam function in the `test` directory with a name editing in -/// `_test` is considered a test function and will be run. -/// -/// If running on JavaScript tests will be run with a custom test runner. -/// -pub fn main() -> Nil { - do_main() -} - -@target(javascript) -@external(javascript, "./gleeunit_ffi.mjs", "main") -fn do_main() -> Nil - -@target(erlang) -import gleam/list -@target(erlang) -import gleam/result -@target(erlang) -import gleam/string -@target(erlang) -import gleam/dynamic.{Dynamic} - -@target(erlang) -fn do_main() -> Nil { - let options = [Verbose, NoTty, Report(#(GleeunitProgress, [Colored(True)]))] - - let result = - find_files(matching: "**/*.{erl,gleam}", in: "test") - |> list.map(gleam_to_erlang_module_name) - |> list.map(dangerously_convert_string_to_atom(_, Utf8)) - |> run_eunit(options) - |> dynamic.result(dynamic.dynamic, dynamic.dynamic) - |> result.unwrap(Error(dynamic.from(Nil))) - - let code = case result { - Ok(_) -> 0 - Error(_) -> 1 - } - halt(code) -} - -@target(erlang) -@external(erlang, "erlang", "halt") -fn halt(a: Int) -> Nil - -@target(erlang) -fn gleam_to_erlang_module_name(path: String) -> String { - path - |> string.replace(".gleam", "") - |> string.replace(".erl", "") - |> string.replace("/", "@") -} - -@target(erlang) -@external(erlang, "gleeunit_ffi", "find_files") -fn find_files(matching matching: String, in in: String) -> List(String) - -@target(erlang) -type Atom - -@target(erlang) -type Encoding { - Utf8 -} - -@target(erlang) -@external(erlang, "erlang", "binary_to_atom") -fn dangerously_convert_string_to_atom(a: String, b: Encoding) -> Atom - -@target(erlang) -type ReportModuleName { - GleeunitProgress -} - -@target(erlang) -type GleeunitProgressOption { - Colored(Bool) -} - -@target(erlang) -type EunitOption { - Verbose - NoTty - Report(#(ReportModuleName, List(GleeunitProgressOption))) -} - -@target(erlang) -@external(erlang, "eunit", "test") -fn run_eunit(a: List(Atom), b: List(EunitOption)) -> Dynamic diff --git a/build/packages/gleeunit/src/gleeunit/should.gleam b/build/packages/gleeunit/src/gleeunit/should.gleam deleted file mode 100644 index c393c23..0000000 --- a/build/packages/gleeunit/src/gleeunit/should.gleam +++ /dev/null @@ -1,90 +0,0 @@ -//// A module for testing your Gleam code. The functions found here are -//// compatible with the Erlang eunit test framework. -//// -//// More information on running eunit can be found in [the rebar3 -//// documentation](https://rebar3.org/docs/testing/eunit/). - -@target(erlang) -@external(erlang, "gleeunit_ffi", "should_equal") -pub fn equal(a: a, b: a) -> Nil - -@target(erlang) -@external(erlang, "gleeunit_ffi", "should_not_equal") -pub fn not_equal(a: a, b: a) -> Nil - -@target(erlang) -@external(erlang, "gleeunit_ffi", "should_be_ok") -pub fn be_ok(a: Result(a, b)) -> a - -@target(erlang) -@external(erlang, "gleeunit_ffi", "should_be_error") -pub fn be_error(a: Result(a, b)) -> b - -@target(javascript) -import gleam/string - -@target(javascript) -@external(javascript, "../gleam.mjs", "inspect") -fn stringify(a: anything) -> String - -@target(javascript) -@external(javascript, "../gleeunit_ffi.mjs", "crash") -fn crash(a: String) -> anything - -@target(javascript) -pub fn equal(a, b) { - case a == b { - True -> Nil - _ -> - crash(string.concat([ - "\n\t", - stringify(a), - "\n\tshould equal \n\t", - stringify(b), - ])) - } -} - -@target(javascript) -pub fn not_equal(a, b) { - case a != b { - True -> Nil - _ -> - crash(string.concat([ - "\n", - stringify(a), - "\nshould not equal \n", - stringify(b), - ])) - } -} - -@target(javascript) -pub fn be_ok(a) { - case a { - Ok(value) -> value - _ -> crash(string.concat(["\n", stringify(a), "\nshould be ok"])) - } -} - -@target(javascript) -pub fn be_error(a) { - case a { - Error(error) -> error - _ -> crash(string.concat(["\n", stringify(a), "\nshould be error"])) - } -} - -pub fn be_true(actual: Bool) -> Nil { - actual - |> equal(True) -} - -pub fn be_false(actual: Bool) -> Nil { - actual - |> equal(False) -} - -pub fn fail() -> Nil { - be_true(False) -} diff --git a/build/packages/gleeunit/src/gleeunit@should.erl b/build/packages/gleeunit/src/gleeunit@should.erl deleted file mode 100644 index acf032e..0000000 --- a/build/packages/gleeunit/src/gleeunit@should.erl +++ /dev/null @@ -1,34 +0,0 @@ --module(gleeunit@should). --compile([no_auto_import, nowarn_unused_vars]). - --export([equal/2, not_equal/2, be_ok/1, be_error/1, be_true/1, be_false/1, fail/0]). - --spec equal(EYG, EYG) -> nil. -equal(A, B) -> - gleeunit_ffi:should_equal(A, B). - --spec not_equal(EYH, EYH) -> nil. -not_equal(A, B) -> - gleeunit_ffi:should_not_equal(A, B). - --spec be_ok({ok, EYI} | {error, any()}) -> EYI. -be_ok(A) -> - gleeunit_ffi:should_be_ok(A). - --spec be_error({ok, any()} | {error, EYN}) -> EYN. -be_error(A) -> - gleeunit_ffi:should_be_error(A). - --spec be_true(boolean()) -> nil. -be_true(Actual) -> - _pipe = Actual, - gleeunit_ffi:should_equal(_pipe, true). - --spec be_false(boolean()) -> nil. -be_false(Actual) -> - _pipe = Actual, - gleeunit_ffi:should_equal(_pipe, false). - --spec fail() -> nil. -fail() -> - be_true(false). diff --git a/build/packages/gleeunit/src/gleeunit_ffi.erl b/build/packages/gleeunit/src/gleeunit_ffi.erl deleted file mode 100644 index 31f9ef9..0000000 --- a/build/packages/gleeunit/src/gleeunit_ffi.erl +++ /dev/null @@ -1,24 +0,0 @@ --module(gleeunit_ffi). - --export([find_files/2, should_equal/2, should_not_equal/2, should_be_ok/1, - should_be_error/1]). - --include_lib("eunit/include/eunit.hrl"). - -find_files(Pattern, In) -> - Results = filelib:wildcard(binary_to_list(Pattern), binary_to_list(In)), - lists:map(fun list_to_binary/1, Results). - - -should_equal(Actual, Expected) -> - ?assertEqual(Expected, Actual), - nil. -should_not_equal(Actual, Expected) -> - ?assertNotEqual(Expected, Actual), - nil. -should_be_ok(A) -> - ?assertMatch({ok, _}, A), - element(2, A). -should_be_error(A) -> - ?assertMatch({error, _}, A), - element(2, A). diff --git a/build/packages/gleeunit/src/gleeunit_ffi.mjs b/build/packages/gleeunit/src/gleeunit_ffi.mjs deleted file mode 100644 index 339a843..0000000 --- a/build/packages/gleeunit/src/gleeunit_ffi.mjs +++ /dev/null @@ -1,101 +0,0 @@ -async function* gleamFiles(directory) { - for (let entry of await read_dir(directory)) { - let path = join_path(directory, entry); - if (path.endsWith(".gleam")) { - yield path; - } else { - try { - yield* gleamFiles(path); - } catch (error) { - // Could not read directory, assume it's a file - } - } - } -} - -async function readRootPackageName() { - let toml = await read_file("gleam.toml", "utf-8"); - for (let line of toml.split("\n")) { - let matches = line.match(/\s*name\s*=\s*"([a-z][a-z0-9_]*)"/); // Match regexp in compiler-cli/src/new.rs in validate_name() - if (matches) return matches[1]; - } - throw new Error("Could not determine package name from gleam.toml"); -} - -export async function main() { - let passes = 0; - let failures = 0; - - let packageName = await readRootPackageName(); - let dist = `../${packageName}/`; - - for await (let path of await gleamFiles("test")) { - let js_path = path.slice("test/".length).replace(".gleam", ".mjs"); - let module = await import(join_path(dist, js_path)); - for (let fnName of Object.keys(module)) { - if (!fnName.endsWith("_test")) continue; - try { - await module[fnName](); - write(`\u001b[32m.\u001b[0m`); - passes++; - } catch (error) { - let moduleName = "\n" + js_path.slice(0, -4); - let line = error.line ? `:${error.line}` : ""; - write(`\n❌ ${moduleName}.${fnName}${line}: ${error}\n`); - failures++; - } - } - } - - console.log(` -${passes + failures} tests, ${failures} failures`); - exit(failures ? 1 : 0); -} - -export function crash(message) { - throw new Error(message); -} - -function write(message) { - if (globalThis.Deno) { - Deno.stdout.writeSync(new TextEncoder().encode(message)); - } else { - process.stdout.write(message); - } -} - -function exit(code) { - if (globalThis.Deno) { - Deno.exit(code); - } else { - process.exit(code); - } -} - -async function read_dir(path) { - if (globalThis.Deno) { - let items = []; - for await (let item of Deno.readDir(path, { withFileTypes: true })) { - items.push(item.name); - } - return items; - } else { - let { readdir } = await import("fs/promises"); - return readdir(path); - } -} - -function join_path(a, b) { - if (a.endsWith("/")) return a + b; - return a + "/" + b; -} - -async function read_file(path) { - if (globalThis.Deno) { - return Deno.readTextFile(path); - } else { - let { readFile } = await import("fs/promises"); - let contents = await readFile(path); - return contents.toString(); - } -} diff --git a/build/packages/gleeunit/src/gleeunit_progress.erl b/build/packages/gleeunit/src/gleeunit_progress.erl deleted file mode 100644 index 1f68eb9..0000000 --- a/build/packages/gleeunit/src/gleeunit_progress.erl +++ /dev/null @@ -1,607 +0,0 @@ -%% A formatter adapted from Sean Cribb's https://github.com/seancribbs/eunit_formatters - -%% @doc A listener/reporter for eunit that prints '.' for each -%% success, 'F' for each failure, and 'E' for each error. It can also -%% optionally summarize the failures at the end. --compile({nowarn_unused_function, [insert/2, to_list/1, to_list/2, size/1]}). --module(gleeunit_progress). --behaviour(eunit_listener). --define(NOTEST, true). --include_lib("eunit/include/eunit.hrl"). - --define(RED, "\e[0;31m"). --define(GREEN, "\e[0;32m"). --define(YELLOW, "\e[0;33m"). --define(WHITE, "\e[0;37m"). --define(CYAN, "\e[0;36m"). --define(RESET, "\e[0m"). - --record(node,{ - rank = 0 :: non_neg_integer(), - key :: term(), - value :: term(), - children = new() :: binomial_heap() - }). - --export_type([binomial_heap/0, heap_node/0]). --type binomial_heap() :: [ heap_node() ]. --type heap_node() :: #node{}. - -%% eunit_listener callbacks --export([ - init/1, - handle_begin/3, - handle_end/3, - handle_cancel/3, - terminate/2, - start/0, - start/1 - ]). - -%% -- binomial_heap.erl content start -- - --record(state, { - status = dict:new() :: euf_dict(), - failures = [] :: [[pos_integer()]], - skips = [] :: [[pos_integer()]], - timings = new() :: binomial_heap(), - colored = true :: boolean(), - profile = false :: boolean() - }). - --type euf_dict() :: dict:dict(). - --spec new() -> binomial_heap(). -new() -> - []. - -% Inserts a new pair into the heap (or creates a new heap) --spec insert(term(), term()) -> binomial_heap(). -insert(Key,Value) -> - insert(Key,Value,[]). - --spec insert(term(), term(), binomial_heap()) -> binomial_heap(). -insert(Key,Value,Forest) -> - insTree(#node{key=Key,value=Value},Forest). - -% Merges two heaps --spec merge(binomial_heap(), binomial_heap()) -> binomial_heap(). -merge(TS1,[]) when is_list(TS1) -> TS1; -merge([],TS2) when is_list(TS2) -> TS2; -merge([#node{rank=R1}=T1|TS1]=F1,[#node{rank=R2}=T2|TS2]=F2) -> - if - R1 < R2 -> - [T1 | merge(TS1,F2)]; - R2 < R1 -> - [T2 | merge(F1, TS2)]; - true -> - insTree(link(T1,T2),merge(TS1,TS2)) - end. - -% Deletes the top entry from the heap and returns it --spec delete(binomial_heap()) -> {{term(), term()}, binomial_heap()}. -delete(TS) -> - {#node{key=Key,value=Value,children=TS1},TS2} = getMin(TS), - {{Key,Value},merge(lists:reverse(TS1),TS2)}. - -% Turns the heap into list in heap order --spec to_list(binomial_heap()) -> [{term(), term()}]. -to_list([]) -> []; -to_list(List) when is_list(List) -> - to_list([],List). -to_list(Acc, []) -> - lists:reverse(Acc); -to_list(Acc,Forest) -> - {Next, Trees} = delete(Forest), - to_list([Next|Acc], Trees). - -% Take N elements from the top of the heap --spec take(non_neg_integer(), binomial_heap()) -> [{term(), term()}]. -take(N,Trees) when is_integer(N), is_list(Trees) -> - take(N,Trees,[]). -take(0,_Trees,Acc) -> - lists:reverse(Acc); -take(_N,[],Acc)-> - lists:reverse(Acc); -take(N,Trees,Acc) -> - {Top,T2} = delete(Trees), - take(N-1,T2,[Top|Acc]). - -% Get an estimate of the size based on the binomial property --spec size(binomial_heap()) -> non_neg_integer(). -size(Forest) -> - erlang:trunc(lists:sum([math:pow(2,R) || #node{rank=R} <- Forest])). - -%% Private API --spec link(heap_node(), heap_node()) -> heap_node(). -link(#node{rank=R,key=X1,children=C1}=T1,#node{key=X2,children=C2}=T2) -> - case X1 < X2 of - true -> - T1#node{rank=R+1,children=[T2|C1]}; - _ -> - T2#node{rank=R+1,children=[T1|C2]} - end. - -insTree(Tree, []) -> - [Tree]; -insTree(#node{rank=R1}=T1, [#node{rank=R2}=T2|Rest] = TS) -> - case R1 < R2 of - true -> - [T1|TS]; - _ -> - insTree(link(T1,T2),Rest) - end. - -getMin([T]) -> - {T,[]}; -getMin([#node{key=K} = T|TS]) -> - {#node{key=K1} = T1,TS1} = getMin(TS), - case K < K1 of - true -> {T,TS}; - _ -> {T1,[T|TS1]} - end. - -%% -- binomial_heap.erl content end -- - -%% Startup -start() -> - start([]). - -start(Options) -> - eunit_listener:start(?MODULE, Options). - -%%------------------------------------------ -%% eunit_listener callbacks -%%------------------------------------------ -init(Options) -> - #state{colored=proplists:get_bool(colored, Options), - profile=proplists:get_bool(profile, Options)}. - -handle_begin(group, Data, St) -> - GID = proplists:get_value(id, Data), - Dict = St#state.status, - St#state{status=dict:store(GID, orddict:from_list([{type, group}|Data]), Dict)}; -handle_begin(test, Data, St) -> - TID = proplists:get_value(id, Data), - Dict = St#state.status, - St#state{status=dict:store(TID, orddict:from_list([{type, test}|Data]), Dict)}. - -handle_end(group, Data, St) -> - St#state{status=merge_on_end(Data, St#state.status)}; -handle_end(test, Data, St) -> - NewStatus = merge_on_end(Data, St#state.status), - St1 = print_progress(Data, St), - St2 = record_timing(Data, St1), - St2#state{status=NewStatus}. - -handle_cancel(_, Data, #state{status=Status, skips=Skips}=St) -> - Status1 = merge_on_end(Data, Status), - ID = proplists:get_value(id, Data), - St#state{status=Status1, skips=[ID|Skips]}. - -terminate({ok, Data}, St) -> - print_failures(St), - print_pending(St), - print_profile(St), - print_timing(St), - print_results(Data, St); -terminate({error, Reason}, St) -> - io:nl(), io:nl(), - print_colored(io_lib:format("Eunit failed: ~25p~n", [Reason]), ?RED, St), - sync_end(error). - -sync_end(Result) -> - receive - {stop, Reference, ReplyTo} -> - ReplyTo ! {result, Reference, Result}, - ok - end. - -%%------------------------------------------ -%% Print and collect information during run -%%------------------------------------------ -print_progress(Data, St) -> - TID = proplists:get_value(id, Data), - case proplists:get_value(status, Data) of - ok -> - print_progress_success(St), - St; - {skipped, _Reason} -> - print_progress_skipped(St), - St#state{skips=[TID|St#state.skips]}; - {error, Exception} -> - print_progress_failed(Exception, St), - St#state{failures=[TID|St#state.failures]} - end. - -record_timing(Data, State=#state{timings=T, profile=true}) -> - TID = proplists:get_value(id, Data), - case lists:keyfind(time, 1, Data) of - {time, Int} -> - %% It's a min-heap, so we insert negative numbers instead - %% of the actuals and normalize when we report on them. - T1 = insert(-Int, TID, T), - State#state{timings=T1}; - false -> - State - end; -record_timing(_Data, State) -> - State. - -print_progress_success(St) -> - print_colored(".", ?GREEN, St). - -print_progress_skipped(St) -> - print_colored("*", ?YELLOW, St). - -print_progress_failed(_Exc, St) -> - print_colored("F", ?RED, St). - -merge_on_end(Data, Dict) -> - ID = proplists:get_value(id, Data), - dict:update(ID, - fun(Old) -> - orddict:merge(fun merge_data/3, Old, orddict:from_list(Data)) - end, Dict). - -merge_data(_K, undefined, X) -> X; -merge_data(_K, X, undefined) -> X; -merge_data(_K, _, X) -> X. - -%%------------------------------------------ -%% Print information at end of run -%%------------------------------------------ -print_failures(#state{failures=[]}) -> - ok; -print_failures(#state{failures=Fails}=State) -> - io:nl(), - io:fwrite("Failures:~n",[]), - lists:foldr(print_failure_fun(State), 1, Fails), - ok. - -print_failure_fun(#state{status=Status}=State) -> - fun(Key, Count) -> - TestData = dict:fetch(Key, Status), - TestId = format_test_identifier(TestData), - io:fwrite("~n ~p) ~ts~n", [Count, TestId]), - print_failure_reason(proplists:get_value(status, TestData), - proplists:get_value(output, TestData), - State), - io:nl(), - Count + 1 - end. - -print_gleam_location(#{function := Function, line := Line, module := Module }, State) -> - X = indent(5, "location: ~s.~s:~p~n", [Module, Function, Line]), - print_colored(X, ?CYAN, State); -print_gleam_location(_, _) -> - ok. - -inspect(X) -> - gleam@string:inspect(X). - -print_gleam_failure_reason( - #{gleam_error := assert, message := Message, value := Value}, - State -) -> - print_colored(indent(5, "~s~n", [Message]), ?RED, State), - print_colored(indent(5, " value: ", []), ?RED, State), - print_colored(indent(0, "~ts~n", [inspect(Value)]), ?RESET, State); -print_gleam_failure_reason( - #{gleam_error := todo, message := Message}, - State -) -> - print_colored(indent(5, "todo expression run~n", []), ?RED, State), - print_colored(indent(5, " message: ", []), ?RED, State), - print_colored(indent(0, "~s~n", [Message]), ?RESET, State); -print_gleam_failure_reason(Error, State) -> - print_colored(indent(5, "~p~n", [Error]), ?RED, State). - -% New Gleeunit specific formatters -print_failure_reason( - {error, {error, #{gleam_error := _} = Error, Stack}}, Output, State -) when is_list(Stack) -> - print_gleam_failure_reason(Error, State), - print_gleam_location(Error, State), - print_stack(Stack, State), - print_failure_output(5, Output, State); -print_failure_reason({error, {error, {case_clause, Value}, Stack}}, Output, State) when is_list(Stack) -> - print_colored(indent(5, "No case clause matched~n", []), ?RED, State), - print_colored(indent(5, "Value: ", []), ?CYAN, State), - print_colored(indent(0, "~ts~n", [inspect(Value)]), ?RESET, State), - print_stack(Stack, State), - print_failure_output(5, Output, State); -% From the original Erlang version -print_failure_reason({skipped, Reason}, _Output, State) -> - print_colored(io_lib:format(" ~ts~n", [format_pending_reason(Reason)]), - ?RED, State); -print_failure_reason({error, {_Class, Term, _}}, Output, State) when - is_tuple(Term), tuple_size(Term) == 2, is_list(element(2, Term)) -> - print_assertion_failure(Term, State), - print_failure_output(5, Output, State); -print_failure_reason({error, {error, Error, Stack}}, Output, State) when is_list(Stack) -> - print_colored(indent(5, "Failure: ~p~n", [Error]), ?RED, State), - print_stack(Stack, State), - print_failure_output(5, Output, State); -print_failure_reason({error, Reason}, Output, State) -> - print_colored(indent(5, "Failure: ~p~n", [Reason]), ?RED, State), - print_failure_output(5, Output, State). - -gleam_format_module_name(Module) -> - string:replace(atom_to_list(Module), "@", "/", all). - -print_stack(Stack, State) -> - print_colored(indent(5, "stacktrace:~n", []), ?CYAN, State), - print_stackframes(Stack, State). -print_stackframes([{eunit_test, _, _, _} | Stack], State) -> - print_stackframes(Stack, State); -print_stackframes([{eunit_proc, _, _, _} | Stack], State) -> - print_stackframes(Stack, State); -print_stackframes([{Module, Function, _Arity, _Location} | Stack], State) -> - GleamModule = gleam_format_module_name(Module), - print_colored(indent(7, "~s.~p~n", [GleamModule, Function]), ?CYAN, State), - print_stackframes(Stack, State); -print_stackframes([], _State) -> - ok. - - -print_failure_output(_, <<>>, _) -> ok; -print_failure_output(_, undefined, _) -> ok; -print_failure_output(Indent, Output, State) -> - print_colored(indent(Indent, "output: ~ts", [Output]), ?CYAN, State). - -print_assertion_failure({Type, Props}, State) -> - FailureDesc = format_assertion_failure(Type, Props, 5), - print_colored(FailureDesc, ?RED, State), - io:nl(). - -print_pending(#state{skips=[]}) -> - ok; -print_pending(#state{status=Status, skips=Skips}=State) -> - io:nl(), - io:fwrite("Pending:~n", []), - lists:foreach(fun(ID) -> - Info = dict:fetch(ID, Status), - case proplists:get_value(reason, Info) of - undefined -> - ok; - Reason -> - print_pending_reason(Reason, Info, State) - end - end, lists:reverse(Skips)), - io:nl(). - -print_pending_reason(Reason0, Data, State) -> - Text = case proplists:get_value(type, Data) of - group -> - io_lib:format(" ~ts~n", [proplists:get_value(desc, Data)]); - test -> - io_lib:format(" ~ts~n", [format_test_identifier(Data)]) - end, - Reason = io_lib:format(" %% ~ts~n", [format_pending_reason(Reason0)]), - print_colored(Text, ?YELLOW, State), - print_colored(Reason, ?CYAN, State). - -print_profile(#state{timings=T, status=Status, profile=true}=State) -> - TopN = take(10, T), - TopNTime = abs(lists:sum([ Time || {Time, _} <- TopN ])), - TLG = dict:fetch([], Status), - TotalTime = proplists:get_value(time, TLG), - if TotalTime =/= undefined andalso TotalTime > 0 andalso TopN =/= [] -> - TopNPct = (TopNTime / TotalTime) * 100, - io:nl(), io:nl(), - io:fwrite("Top ~p slowest tests (~ts, ~.1f% of total time):", [length(TopN), format_time(TopNTime), TopNPct]), - lists:foreach(print_timing_fun(State), TopN), - io:nl(); - true -> ok - end; -print_profile(#state{profile=false}) -> - ok. - -print_timing(#state{status=Status}) -> - TLG = dict:fetch([], Status), - Time = proplists:get_value(time, TLG), - io:nl(), - io:fwrite("Finished in ~ts~n", [format_time(Time)]), - ok. - -print_results(Data, State) -> - Pass = proplists:get_value(pass, Data, 0), - Fail = proplists:get_value(fail, Data, 0), - Skip = proplists:get_value(skip, Data, 0), - Cancel = proplists:get_value(cancel, Data, 0), - Total = Pass + Fail + Skip + Cancel, - {Color, Result} = if Fail > 0 -> {?RED, error}; - Skip > 0; Cancel > 0 -> {?YELLOW, error}; - Pass =:= 0 -> {?YELLOW, ok}; - true -> {?GREEN, ok} - end, - print_results(Color, Total, Fail, Skip, Cancel, State), - sync_end(Result). - -print_results(Color, 0, _, _, _, State) -> - print_colored(Color, "0 tests\n", State); -print_results(Color, Total, Fail, Skip, Cancel, State) -> - SkipText = format_optional_result(Skip, "skipped"), - CancelText = format_optional_result(Cancel, "cancelled"), - Text = io_lib:format("~p tests, ~p failures~ts~ts~n", [Total, Fail, SkipText, CancelText]), - print_colored(Text, Color, State). - -print_timing_fun(#state{status=Status}=State) -> - fun({Time, Key}) -> - TestData = dict:fetch(Key, Status), - TestId = format_test_identifier(TestData), - io:nl(), - io:fwrite(" ~ts~n", [TestId]), - print_colored([" "|format_time(abs(Time))], ?CYAN, State) - end. - -%%------------------------------------------ -%% Print to the console with the given color -%% if enabled. -%%------------------------------------------ -print_colored(Text, Color, #state{colored=true}) -> - io:fwrite("~s~ts~s", [Color, Text, ?RESET]); -print_colored(Text, _Color, #state{colored=false}) -> - io:fwrite("~ts", [Text]). - -%%------------------------------------------ -%% Generic data formatters -%%------------------------------------------ -format_function_name(M, F) -> - M1 = gleam_format_module_name(M), - io_lib:format("~ts.~ts", [M1, F]). - -format_optional_result(0, _) -> - []; -format_optional_result(Count, Text) -> - io_lib:format(", ~p ~ts", [Count, Text]). - -format_test_identifier(Data) -> - {Mod, Fun, _} = proplists:get_value(source, Data), - Line = case proplists:get_value(line, Data) of - 0 -> ""; - L -> io_lib:format(":~p", [L]) - end, - Desc = case proplists:get_value(desc, Data) of - undefined -> ""; - DescText -> io_lib:format(": ~ts", [DescText]) - end, - io_lib:format("~ts~ts~ts", [format_function_name(Mod, Fun), Line, Desc]). - -format_time(undefined) -> - "? seconds"; -format_time(Time) -> - io_lib:format("~.3f seconds", [Time / 1000]). - -format_pending_reason({module_not_found, M}) -> - M1 = gleam_format_module_name(M), - io_lib:format("Module '~ts' missing", [M1]); -format_pending_reason({no_such_function, {M,F,_}}) -> - M1 = gleam_format_module_name(M), - io_lib:format("Function ~ts undefined", [format_function_name(M1,F)]); -format_pending_reason({exit, Reason}) -> - io_lib:format("Related process exited with reason: ~p", [Reason]); -format_pending_reason(Reason) -> - io_lib:format("Unknown error: ~p", [Reason]). - -%% @doc Formats all the known eunit assertions, you're on your own if -%% you make an assertion yourself. -format_assertion_failure(Type, Props, I) when Type =:= assertion_failed - ; Type =:= assert -> - Keys = proplists:get_keys(Props), - HasEUnitProps = ([expression, value] -- Keys) =:= [], - HasHamcrestProps = ([expected, actual, matcher] -- Keys) =:= [], - if - HasEUnitProps -> - [indent(I, "Failure: ?assert(~ts)~n", [proplists:get_value(expression, Props)]), - indent(I, " expected: true~n", []), - case proplists:get_value(value, Props) of - false -> - indent(I, " got: false", []); - {not_a_boolean, V} -> - indent(I, " got: ~p", [V]) - end]; - HasHamcrestProps -> - [indent(I, "Failure: ?assertThat(~p)~n", [proplists:get_value(matcher, Props)]), - indent(I, " expected: ~ts~n", [inspect(proplists:get_value(expected, Props))]), - indent(I, " got: ~ts", [inspect(proplists:get_value(actual, Props))])]; - true -> - [indent(I, "Failure: unknown assert: ~p", [Props])] - end; - -format_assertion_failure(Type, Props, I) when Type =:= assertMatch_failed - ; Type =:= assertMatch -> - Expr = proplists:get_value(expression, Props), - Pattern = proplists:get_value(pattern, Props), - Value = proplists:get_value(value, Props), - [indent(I, "Failure: ?assertMatch(~ts, ~ts)~n", [Pattern, Expr]), - indent(I, " expected: = ~ts~n", [Pattern]), - indent(I, " got: ~p", [Value])]; - -format_assertion_failure(Type, Props, I) when Type =:= assertNotMatch_failed - ; Type =:= assertNotMatch -> - Expr = proplists:get_value(expression, Props), - Pattern = proplists:get_value(pattern, Props), - Value = proplists:get_value(value, Props), - [indent(I, "Failure: ?assertNotMatch(~ts, ~ts)~n", [Pattern, Expr]), - indent(I, " expected not: = ~ts~n", [Pattern]), - indent(I, " got: ~p", [Value])]; - -format_assertion_failure(Type, Props, I) when Type =:= assertEqual_failed - ; Type =:= assertEqual -> - Expected = inspect(proplists:get_value(expected, Props)), - Value = inspect(proplists:get_value(value, Props)), - [indent(I, "Values were not equal~n", []), - indent(I, "expected: ~ts~n", [Expected]), - indent(I, " got: ~ts", [Value])]; - -format_assertion_failure(Type, Props, I) when Type =:= assertNotEqual_failed - ; Type =:= assertNotEqual -> - Value = inspect(proplists:get_value(value, Props)), - [indent(I, "Values were equal~n", []), - indent(I, "expected: not ~ts~n,", [Value]), - indent(I, " got: ~ts", [Value])]; - -format_assertion_failure(Type, Props, I) when Type =:= assertException_failed - ; Type =:= assertException -> - Expr = proplists:get_value(expression, Props), - Pattern = proplists:get_value(pattern, Props), - {Class, Term} = extract_exception_pattern(Pattern), % I hate that we have to do this, why not just give DATA - [indent(I, "Failure: ?assertException(~ts, ~ts, ~ts)~n", [Class, Term, Expr]), - case proplists:is_defined(unexpected_success, Props) of - true -> - [indent(I, " expected: exception ~ts but nothing was raised~n", [Pattern]), - indent(I, " got: value ~p", [proplists:get_value(unexpected_success, Props)])]; - false -> - Ex = proplists:get_value(unexpected_exception, Props), - [indent(I, " expected: exception ~ts~n", [Pattern]), - indent(I, " got: exception ~p", [Ex])] - end]; - -format_assertion_failure(Type, Props, I) when Type =:= assertNotException_failed - ; Type =:= assertNotException -> - Expr = proplists:get_value(expression, Props), - Pattern = proplists:get_value(pattern, Props), - {Class, Term} = extract_exception_pattern(Pattern), % I hate that we have to do this, why not just give DAT - Ex = proplists:get_value(unexpected_exception, Props), - [indent(I, "Failure: ?assertNotException(~ts, ~ts, ~ts)~n", [Class, Term, Expr]), - indent(I, " expected not: exception ~ts~n", [Pattern]), - indent(I, " got: exception ~p", [Ex])]; - -format_assertion_failure(Type, Props, I) when Type =:= command_failed - ; Type =:= command -> - Cmd = proplists:get_value(command, Props), - Expected = proplists:get_value(expected_status, Props), - Status = proplists:get_value(status, Props), - [indent(I, "Failure: ?cmdStatus(~p, ~p)~n", [Expected, Cmd]), - indent(I, " expected: status ~p~n", [Expected]), - indent(I, " got: status ~p", [Status])]; - -format_assertion_failure(Type, Props, I) when Type =:= assertCmd_failed - ; Type =:= assertCmd -> - Cmd = proplists:get_value(command, Props), - Expected = proplists:get_value(expected_status, Props), - Status = proplists:get_value(status, Props), - [indent(I, "Failure: ?assertCmdStatus(~p, ~p)~n", [Expected, Cmd]), - indent(I, " expected: status ~p~n", [Expected]), - indent(I, " got: status ~p", [Status])]; - -format_assertion_failure(Type, Props, I) when Type =:= assertCmdOutput_failed - ; Type =:= assertCmdOutput -> - Cmd = proplists:get_value(command, Props), - Expected = proplists:get_value(expected_output, Props), - Output = proplists:get_value(output, Props), - [indent(I, "Failure: ?assertCmdOutput(~p, ~p)~n", [Expected, Cmd]), - indent(I, " expected: ~p~n", [Expected]), - indent(I, " got: ~p", [Output])]; - -format_assertion_failure(Type, Props, I) -> - indent(I, "~p", [{Type, Props}]). - -indent(I, Fmt, Args) -> - io_lib:format("~" ++ integer_to_list(I) ++ "s" ++ Fmt, [" "|Args]). - -extract_exception_pattern(Str) -> - ["{", Class, Term|_] = re:split(Str, "[, ]{1,2}", [unicode,{return,list}]), - {Class, Term}. diff --git a/build/packages/packages.toml b/build/packages/packages.toml deleted file mode 100644 index 2d9025b..0000000 --- a/build/packages/packages.toml +++ /dev/null @@ -1,3 +0,0 @@ -[packages] -gleeunit = "0.11.0" -gleam_stdlib = "0.31.0" diff --git a/build/prod/erlang/gleam.lock b/build/prod/erlang/gleam.lock deleted file mode 100644 index e69de29..0000000 diff --git a/build/prod/javascript/gleam.lock b/build/prod/javascript/gleam.lock deleted file mode 100644 index e69de29..0000000 diff --git a/gleam.toml b/gleam.toml index 5af7e92..ca2c423 100644 --- a/gleam.toml +++ b/gleam.toml @@ -4,9 +4,9 @@ version = "0.1.0" # Fill out these fields if you intend to generate HTML documentation or publish # your project to the Hex package manager. # -# description = "" -# licences = ["Apache-2.0"] -# repository = { type = "github", user = "username", repo = "project" } +description = "A library for benchmarking gleam code." +licences = ["Apache-2.0"] +repository = { type = "github", user = "schurhammer", repo = "gleamy_bench" } # links = [{ title = "Website", href = "https://gleam.run" }] [dependencies]

g-oKV+sOS%GT zAQubs;_al+7vpEpp9OsQC^f2o3cmSRi%2cZBt>(ZFA$X(wO;PT-yt*fX}%7gsvSE1 zV2K+PAjDRrEYwq64yV^p7E_ovG=s$-;V{#$PJ;dVAz-oPH4SnimVy6dN-YFg86340^YkGD*2Q*XFBGg#0HiB?1! z4`}dYRcw%L4fk0*L9(jw%xK2eJ=wCzr!BJhgoRNBla!Y<>ViDJF&G|&87?X+DYGN5dCUX^!HL_l^W*HIv%D4PD7>;+8*0W35ZX@!( z9i(VWY;O%=>8#0#Z!67YdCt$>6=7J?S@|f>O=;N}IpY0LvB= zCY=ox^n&Ik0rRyT{PLYIB*I?b)O$BqhLogY=$cd?h9tak&eFm?eN{keGJHnL85Rj+cu+HIf+d(zK_=*CFnJ{85qtIoNsQJ>C|FKmF}0B{UIwhZsV3;panb=tKz6v z8q=Uo48M&z^84a@NlRf0nb zPh_@gnN`dw{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-^ZEzF5vt_t)A)5m5L{mFD;-PN&-;@i9>|@uly*PbU^#UmA`(f6U`TZZFav zd*6ym+)C-l>K+v=nNKLi*G-$YL@LttVyhw*E7EY}<=!$bQ$DLtk1r6;rMk~}>RVA# zSE_USI{q&_Jn|QjH*6rO<>KjZ7Tab!%V7UoyJuqX3{pmj72<&SApi+MqL2in0vSR^ zkSSyanL~DvJ>(3zL!QtB$OrO;f}mI^4vL48p%f?s%7==fYN!UPg&Lqns1U^bW=z5?^W0KNv_fN#Pwuso~`--hqQRa!LQ)ga1mSySHo}Ndbk;GgWKUw_#^xo?uFA~SJ(}9fX!i5SOeCC^70hWZX z!t5{y%m`+{0+;~fpbd0`Y>*FL0w>@Oe1Q=#1NVV0xCU;3n}82o0&LI$vl*gdt9d`~Q=9Cov54I-8OI-W;If`g@*4@$bLm TLc;xDO?vh`0{w6QJn4S`+_`7} diff --git a/build/dev/erlang/gleam_stdlib/ebin/gleam@list.beam b/build/dev/erlang/gleam_stdlib/ebin/gleam@list.beam deleted file mode 100644 index b250ff58ee8b543e683455c0e0c74001e45b1f5d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 34048 zcmaeu2|U#A)4SI34a>4hIk#5XVskAP$+~kSMM)*Zx^L^s5m8a;(D_xO`%uw=N^(?m zqJ!k_qJ(sygL>y#TfhFt`@Ve|Gds^bGxN+d&pgMj&7vhb1VYAF3v2U*=DekB0zu?1 zfk4=^f_lDc~XBVSql~ zJkbdx<`?44<8i|4fWst_uAAY#JLqbU2VF@UDYXc)l z0OHZSs6Zbc`iKEHCJYD>{$DA+RhW_J2sEt{fnk4WAsA{*SYTuf7YpS^`ExyEB82>T z;uExQcwCrJ$nQ_l;ZZ!2Z(yu2BIFATWe0@fVE+b0IV^ZZy`2@CXtBnsz|^ zY5$Fp7|>z}M{{|?TyLKMQW%60g%*84Nd!*u0(pVqVUzw)k`R>87@jxcMxzXf16$#7 zq7z7B0(q`U@YEGYnKj`cnn;vb6Q9KYA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WP9$SgN~5@{F?oHZlW3C7qg zQKIAXTNPvY@%A5rb=K%x?d`2TXY(4o?#aeayqx|UUs%~ykyQV^_V%uuODAj3SX-^* z52h~1;A@g@ca+gR>N6BHv+{1?lTX*{jK+a!ryq_&voZBW7-1;uF9vO#e2Bo+>KYAOXf~r`pE-*@OyH4Nl5O+pn#4&3rs5- zZ~l$$J=#W0y0>2xdf)5mrIl37*)tgUsyb%XaQ908RbL8YFZb->bh6y1Y!D{lxEr+vtx+j-+p>I<)SN+3oSGlPzBiJr>$? zV~3{v3mWRGqAvA?@N)(&$@iA+`>@_$R(W`B_v+fPx-!nS*qVniHNW(ZC)|8`>(kP% z*wvX^wsoEU)%*K_t=Zp(I-GHQlAS+y`-h+EINRrD`0Kwdt=%Pm8M=Ks&PQhQqh-_A zj-H;|EG{CxNo-^UMow6cM;=Yy_c$v&;?L6g*$Y~t3v=sx1e@{7q1~Ns=jP4V#o^-7 zq&mZmvHKQlQeyI1r^ukmjhjuaIXkM%&YmrYrvL037eBPa>pLvat_>ZSf7Xs$x>Mgp zoM=uV@+@uZN4yK2%81R$O)0LKC9%h{q?U@lUMzpfNH<#R(m!(L>hkc5&s3g8z9@CP~kE#MB|2Q&{v*DZTun(0v{jJmIOPgL!{ zlQpsEdc2`G{#8ct*s)-*Goo$#ukILLQU2sFdHv^kowI2d^NQATJj@jrqBd5H^p-X{ zxqV!om|(2(Ki_#XJ-dtR?rQDpF1hcKGOd&%A{@E^kjN7=Q8Io+5i8^ W0v?`_rK8qGo%Ph24g0)?pnm}_3c0EP diff --git a/build/dev/erlang/gleam_stdlib/ebin/gleam@queue.beam b/build/dev/erlang/gleam_stdlib/ebin/gleam@queue.beam deleted file mode 100644 index 37055248c42aaa3d277396540f520d4d00fb159f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5268 zcmcgwc{o&U*q_BR2b0sxFxJA1P#DdOHEFDs%DzO4buf&XF=j%0357&aji@YMa#-#2X#V8ah)4|z( zjlIa%3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OzJp?fAF1y*cS#(`=dUzG|EU*_l+jFX}GWfBf`sJLS_)&h*tT zoIDr3&F{`Ozk5l3OYE+vYiM)|oaXLY_w_krWYoOBa);)aNx$FJ;o_|=_4uj7!lA9J zk|vJSeC6w^Gxhqj%u-N(juxS{KVmd(7G0akZ=PsaaOAC)iL#KJH`7V@=09Zcqvfzw zu%cG=C9Uc^*1;JKwJKG0`X^#GxIx-{gkgP9nD?M;er2Ip{@Y@ zx%7dd3xFmR^+E)Q2$3K%qy}k1T97uR3+X}n&;rN^qCpEGOK2%%1vx`5kUQiHZG=Lg jC@31@LPAIcZGsa2AAa-rBnc4xN&v`jKFs`|FzSB*I3}=u diff --git a/build/dev/erlang/gleam_stdlib/ebin/gleam@regex.beam b/build/dev/erlang/gleam_stdlib/ebin/gleam@regex.beam deleted file mode 100644 index 2a588997e7540b856539aa81bf0ff472b32963a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2060 zcmcgtiB}Wn7N1GjLXd=jxKto076O_8`mAjzCL$39!ft&^$vR{qn@J$S62TV&kBUVR zfryAe0hePfi=qMwfhr0mNLxVLLPgQmr9v$&3h0{&*yCUDzH@$afAhQdyWgENcjhvp zVgmrc&T4ZgJ(8|Y*a!eXF$_nnKmu{3G$kZ}w6;9CR3VZ;4i=52Qu8Gu?xF>eWeLG1 zE9FwyqZG*m);uA^OTk)nmW5lZ6cUkoL9uWv6^|pcpASJORx0PGN+6a0?szX z)nK%dh9Yo@Aln$tB;rAZk&Pn!hX`gF6-*)#JY>v55vqvbN#h|V(I5QU2%rci0Bolb z&`dlH?6=(G!Cz=-XG9`Kqv1p2)XI3+0NbPr#74ldfq}TJV4xPb?K>Rv4#zI=MX+^* z0m698QK4E(&YiG^>~~o3BXI~v7GmvTAm<>~Zh<2fsRPjwYYhX*{kA4VM@5L#NXjg{cqd3lpwFG46Hx>Pt+x5A@4e3x>fc|V{@D_Sc5XN;l~%yl zbywlXrbv~xV~y&z0=pFzZHw~e*ljm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.beam b/build/dev/erlang/gleam_stdlib/ebin/gleam@result.beam deleted file mode 100644 index 8a4da3a031aa07711474b8a3abb785b28bf1afc0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6812 zcmcgxi9b~B`<^kDb1)e*$k>_^%FftkEZHLan>%O07&hmT?D<@|y6iVv2`BpOrGq#%n z3Wfd$g+gr<4rb745vDA942Qwy3ytw*hV#)`EGCPG8P3aQap-(OG)4>^0!Nm^mqPmItQwg3?J1?7YTnZ8jp7CV$3%8Z0pJpmRyia`sYV^{1SIsRB0 zgF}xI3<_ni=`4gUgvhYy0nAuBODKXF$YIcZLnDKj{B#zB78xuOOlSN4CyZ13qoARs z7Q~5E(^SK%fwoph1hv)9S7R6uvS0?%Q7Aqku&y`&ssHBFr{1hlECKluKKOR~kF{kWPucoq&FMJdHlOaJDVg8UQa zY3QWo%p=RJGh9=UU(Nl82cJSh-=)lBsPoJD@`m#BApe7TANr{<3RJ{lxPEpxoF?u( zW-S=vQ3Uib0X@r&0(=O^P2$1llF*PS1uKT30w6sC4XhXt!4k}|cr=73pdrFvts|>i z+RIvy821dKB+jko!JosSAqfhW2$YC_yT=j{B}sGaS~Rp4X$PoD0uZ@(5uOzHDG$B| zbRbQ^$^o9-Y6o%%Pu3hOgN9`ORv)&*ArpXP0pz%|h`>57gyX^A0}3R55>^@wt>;3b zJoslIuz`YA0Fnx;k_w3AMsut@8j@dWWuqwp=}3VK;Sn`OE=1tLzXN0?3RW4Al~>8i z2zj$Pb`u)fv_jqt`T~3|BxZ+N?n{{qi6b&9Tu6ckKL=z~DOe34qp>QZfyk(vW7W`* z+Mn9$D{2~CXe~n4ctIRkOf3qQ4A|slHaK;#WQ474j@3p(+AB0N7a}4w9WEpV zXrh3oi__Oc&PNgscM(NcivkNHiiY&KkTgiZgRb-`SSrw^u69L5bSdUo12kj+mV@%A zGb$I7L8J}2kSt&l0Mm$q-2#|fR+(E6rinS$7!4T%rpezWky}}kEnH|FqG8H~NI*jj zv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ib/ebin/gleam@set.beam b/build/dev/erlang/gleam_stdlib/ebin/gleam@set.beam deleted file mode 100644 index 7e81cb9ae7da8ede76ae8077acbfea7205284e00..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4716 zcmcIni$7Fb8{RYHGMkazOlDkbGUQUzj8b&LAe4%VXq3BQW{eq^86ickl{zX>TczVr z>L4O1P6yRNrBV`cJRw#Z$Go%^}f&hu4k>iX0I80=Pf1>L=LdA zv)*Ve-D(a&I06JgI&hGP=NrO_;7JK$-p=V>h;JwXc;q4kF+2rcxX4!=q{tKTLU>}S zf3zri8C1R;Bun9ptDQT)kI4?pblFADryd}X30e~;%DM}^YB0+>yE|?b`0SAUl zLMFRPQwfuiK#3?oAy6Qa^1|f;!X=?{Qr}>nyd*q;7cMUo3nXHaKn!9LJbx+ZD2GS_ zWFnroKpZGh1w(uP&_|e4Wmrp?fif|Z&78%=inEqZcPY&80$3)~KFC%Qz=I(C5LgQY z0K19+3;`%O1V!*NDJh>0S)uKH!s!(Lp>}2|;i@Bn06QwTJN~DtgD8;4w+5C5jCc}bMz*=nkaEDC{F|BwZPLviSy*>D(c^L zBZVBG+lBy9YzPQJo~?pFIHER6q=OuFkfTFF=$I0eI3LRcL^+Iz5_RQ}zowpqJY9u~ z;D~ck2;^vh^m!aI*iE%KB7MpQg7Yyd@Y0)cL|w4ffT_jC5g8Y+pi z2xxO~M12y(;VfmWr%whJphP_o&;fc3z;<+Ev%$CDMH=o3_BpgJBou40eLo8TdoSPt zuuA~|?4QX#=9dS+0bn+9y2WfI04zrt0DM`#b5y4N7)N#5KO3}U0L+KsN1ForSRKr- zHf>`XGy$-2XKcJ()THLCz=zegfQ`rfn_I&eWy?d(N~UYiGvC zG|lM3-U}G8@v-&6fZ5nQXXb~^9|pk2!qx=?W@CD1)=X~N2O0=(FB4;H9t(iQF?|@{ z0AT7`-7*RcZ2&A!9{?K@2Tl30IbdtV0KoEQ{6Ff!;?OkzM?F}*N&iNk)E8LVi6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8z35N(i1YbfZA&d}7h#|xh z;t8pQG(tMz1mWcWA1|CB5OzmG!5SclKoS9~=GkzYu7kw|c;fvhG_t L^jF)!2QdE+KMLam diff --git a/build/dev/erlang/gleam_stdlib/ebin/gleam@string_builder.beam b/build/dev/erlang/gleam_stdlib/ebin/gleam@string_builder.beam deleted file mode 100644 index 20d811e5578ae30474bf0b558457b5a66b87a417..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4092 zcmcgvi9b|r|DH3pb1XS#Y=am}vc)LPBPByoDO0ve-Y~|YVHVAdt&&0>DWON|B!w0v zq>UCmT97tUQptm&vXx3NQTg3RdVhW1Kj1x|&o$rczP{J}{oeOI+zz+ZUbZBX>WGW0 zvxl?P*PcXz_#_g^SUrr7aRe-hRLm2G1qMg)_#v2BHByX4V#1JLW92DRphOzN=LM_q zL?Ik0Cy*0KSZ4eTznn5cEC%L!DgdA}k5*#PR0wugHm^>!tbA(|^JQ1HKkxogn z;Ub<;@#mfhQHducW=8^G2wxO~iMbpJCjWCyNEFz@l%OESq6rHe0+tZT=SgKae7@Wi zQv?z?4L*m90oPQ7d6GbEa}$&~#ll#k~V!?XBVGNllOYVlfP*o-%mDd*@=moiFc$;h&( zGI*CPTE~*5%F$g>Xc!+RQ*P2B82$e|j1mSJDoa*o$^)z6uo{`tfn#=gfIwOyh$P|}fEfTpN)~`T%@sg|0EnFGG*<(WGR@UN)Bqs-S^$~=grDHrzj4}c zTn})f58=@VAo>xU4)CjvA>c$EqL=Z1ak6Xd)S5?tPV_gL&Rb1$5J(mPziOBPZU8{k zHU%Jh68%j8h_w(p9pKj*3GLU~bpZdhCqknF5Pm`m}3dF_46A2?oa`x7C*0zKsij)FHGF2ua3Y)rg z!a-7AB8n1ou?SMQ%_flmvk8yl^Eg7ANUCf!+MQ;=M^V;W#rC2Dqg{SBK*WU_jFf*J)S{fY214n!&X$|;6x)XaO{qT41$IG=F zcDCeHDf-&?W;)BNYS-QE>NZT$W8BS8(u>aY6q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5SV+xudhPGc<9m2h}SSgTfI38E0l5;#R+_1vmV~rtOAf8{npI+5Gf9w3}oHTQ- zv%ow_vSYa>&pV;4jrqaIqJp-9+wbt>oEMyW78SahONNPwoQ=O;%=nI02kHO7Nh$og zIBz7Fa4Ky^K(DjebXGvm_>Z~7Z*I=?gCnIbPoI{YXZ!S%TdTzLC-*9F-}8}3T5G2% zaUi{w-Rc*kL^Pe*nPt10PkQXbCpNe3a{9zoA}E0bi|s@|<~n(lb!^C8dFdHibeAK>%wv0B|KWa%DUJ!^33IQrE`BczHB%iZ_5&0Rh1PUbT6|TBX-%JudTFD*rvD8O4E;BZisWBEh~E#&aYi92 z{bLFKRe<=9}i^je6(u=(!w_`1eGaU~To$~4MQdBPr>bI)LG~Sz}pS(0hKiM4wBER1Ksj2hs<%YxWhu&vm zEIj5pJ?FEsGLH_FPt1&O9u<}m9vx>N9l!KBNN#j|z$CZDnzr;luFf&~2`= zE?1W6Z&$kK`Jc@5%UwTtr=hv)VcE&v@!>DSON;B@BG%4KRIpn)&TQ*tXupriUXG2i z{Sq6~KZ*R)z8vcrQJwj5`EruUVbA<$xo;|%V=`O6{6TyyS33;-;b7@UCPC921b=_D zAVeJkBs;(cumk%5PJjpC1^59$Ko}4J!~h9E8ju8J0XYBgI-m+z1NMLea2Rj` ze1H((G7t`=0+|36$OY1XLZApJ0qz0iKn+k2JOmnncHkv22#f$zzzi@C%mPcmGEn({ Y{?CQusSr3;_&+W9{~8*>KOo}&0m$g3IsgCw diff --git a/build/dev/erlang/gleam_stdlib/ebin/gleam_stdlib.app b/build/dev/erlang/gleam_stdlib/ebin/gleam_stdlib.app deleted file mode 100644 index bd283ca..0000000 --- a/build/dev/erlang/gleam_stdlib/ebin/gleam_stdlib.app +++ /dev/null @@ -1,7 +0,0 @@ -{application, gleam_stdlib, [ - {vsn, "0.31.0"}, - {applications, []}, - {description, "A standard library for the Gleam programming language"}, - {modules, []}, - {registered, []} -]}. diff --git a/build/dev/erlang/gleam_stdlib/ebin/gleam_stdlib.beam b/build/dev/erlang/gleam_stdlib/ebin/gleam_stdlib.beam deleted file mode 100644 index 72c83880986188190a217ac631a80fb925750692..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25632 zcmb5Wc|27A_c%Ud2G?+F7&|c_GcB+8=l9R=_2|s=-19u!^E}UaF4uj$jJMe+qflOg21fdp`jPe; zC=@$*MxEyJ4f1vmc8!Si3i9{hhzbky4)=7A@MiN44{{IjMU&Zs-NRgcy(6)pjllZ& zhj_7ihlhuT!~UUO?vd`U?m!~M3-b5!4vF-SjKzC-dxm;>yV7}FgCl&o{w3f&gWMw` z{C#3wy<$V$gZ(`*A^t(Q$f&R&Z`TO_IPbOoA(7s`-r=s1p{_yx5s`TRP^3W~J^Vx5 z!((wwZNM3p&_HhHlZSsK7(lpxi0|)ypy#(?pP*3pNY3A!p`k&)aYXYUCV%fBFKk3; zus4kO;Tr1WO81I`;Tsq~TAtlI$U7K}^0y4V3uY>&KdAiYN%cQZYX5ms|IgFL-%p`o zk^Z3}*pSc=Z)`|ZP!LB{h?h5rxwqGEj&SdYsGvw*Fg{nG@X%ma4=`8Ev2!y*ganHj zMvgG|aL^5&I2jl{7Hj|V(Vsbjydxr9BmLY%(AqqVFanM4;gJ!p(f*Ns*vRlGZw`;x zNX8Vg`nU&0cyls!0JV`A9W5O^Qx2p8LkhdI`D+geIUAz~1A5q_Li~|z;q~-$ z4|n&B^bQAp{GMt8Q-goVUiTn>FW0C@9}P}MveJ|5cYjzY$j@;1Fh4LkaENzIKPj1=^n}bH=80E>hb^ZL zf&b~HPYdW@;~f$a6%HyP28=8y7WNDc4)X_j9u5*bhMh6f5fD;qNc=g1!L<4ZfvLts zd4{osd$Tk7|H#n?%}JMb_4M=h48(*-g z>2=CXuRT%TphTm>{h1jFd-+F1czZ^=(mU25OADwUSMLyH($_NM;~wb>R-lN;HDTfY zd)+~nF;*0edr%MaD`IR8?@S;2ThB3b-HIl`hM!Hj`YWT%sYLOAIyV~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B_Ws9lvx0((c!)-O4VZhxomE_iHDZ{-J<9WtXwt4JHAN zKQjU$wO5n+TlsyOUy9 gleam@iterator:action(any()))}). diff --git a/build/dev/erlang/gleam_stdlib/include/gleam@iterator_Next.hrl b/build/dev/erlang/gleam_stdlib/include/gleam@iterator_Next.hrl deleted file mode 100644 index 1f61922..0000000 --- a/build/dev/erlang/gleam_stdlib/include/gleam@iterator_Next.hrl +++ /dev/null @@ -1 +0,0 @@ --record(next, {element :: any(), accumulator :: any()}). diff --git a/build/dev/erlang/gleam_stdlib/include/gleam@queue_Queue.hrl b/build/dev/erlang/gleam_stdlib/include/gleam@queue_Queue.hrl deleted file mode 100644 index 88ac25e..0000000 --- a/build/dev/erlang/gleam_stdlib/include/gleam@queue_Queue.hrl +++ /dev/null @@ -1 +0,0 @@ --record(queue, {in :: list(any()), out :: list(any())}). diff --git a/build/dev/erlang/gleam_stdlib/include/gleam@regex_CompileError.hrl b/build/dev/erlang/gleam_stdlib/include/gleam@regex_CompileError.hrl deleted file mode 100644 index ad5511e..0000000 --- a/build/dev/erlang/gleam_stdlib/include/gleam@regex_CompileError.hrl +++ /dev/null @@ -1 +0,0 @@ --record(compile_error, {error :: binary(), byte_index :: integer()}). diff --git a/build/dev/erlang/gleam_stdlib/include/gleam@regex_Match.hrl b/build/dev/erlang/gleam_stdlib/include/gleam@regex_Match.hrl deleted file mode 100644 index 4216619..0000000 --- a/build/dev/erlang/gleam_stdlib/include/gleam@regex_Match.hrl +++ /dev/null @@ -1,4 +0,0 @@ --record(match, { - content :: binary(), - submatches :: list(gleam@option:option(binary())) -}). diff --git a/build/dev/erlang/gleam_stdlib/include/gleam@regex_Options.hrl b/build/dev/erlang/gleam_stdlib/include/gleam@regex_Options.hrl deleted file mode 100644 index 0074603..0000000 --- a/build/dev/erlang/gleam_stdlib/include/gleam@regex_Options.hrl +++ /dev/null @@ -1 +0,0 @@ --record(options, {case_insensitive :: boolean(), multi_line :: boolean()}). diff --git a/build/dev/erlang/gleam_stdlib/include/gleam@set_Set.hrl b/build/dev/erlang/gleam_stdlib/include/gleam@set_Set.hrl deleted file mode 100644 index 9c90312..0000000 --- a/build/dev/erlang/gleam_stdlib/include/gleam@set_Set.hrl +++ /dev/null @@ -1 +0,0 @@ --record(set, {map :: gleam@map:map_(any(), list(nil))}). diff --git a/build/dev/erlang/gleam_stdlib/include/gleam@uri_Uri.hrl b/build/dev/erlang/gleam_stdlib/include/gleam@uri_Uri.hrl deleted file mode 100644 index 50150f4..0000000 --- a/build/dev/erlang/gleam_stdlib/include/gleam@uri_Uri.hrl +++ /dev/null @@ -1,9 +0,0 @@ --record(uri, { - scheme :: gleam@option:option(binary()), - userinfo :: gleam@option:option(binary()), - host :: gleam@option:option(binary()), - port :: gleam@option:option(integer()), - path :: binary(), - 'query' :: gleam@option:option(binary()), - fragment :: gleam@option:option(binary()) -}). diff --git a/build/dev/erlang/gleam_version b/build/dev/erlang/gleam_version deleted file mode 100644 index f0e1a43..0000000 --- a/build/dev/erlang/gleam_version +++ /dev/null @@ -1 +0,0 @@ -0.31.0 \ No newline at end of file diff --git a/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleam@@compile.erl b/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleam@@compile.erl deleted file mode 100644 index 543db88..0000000 --- a/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleam@@compile.erl +++ /dev/null @@ -1,157 +0,0 @@ -#!/usr/bin/env escript - -% TODO: Don't concurrently print warnings and errors -% TODO: Some tests - --record(arguments, {lib = "./", out = "./", modules = []}). - -main(Args) -> - #arguments{out = Out, lib = Lib, modules = Modules} = parse(Args), - IsElixirModule = fun(Module) -> - filename:extension(Module) =:= ".ex" - end, - {ElixirModules, ErlangModules} = lists:partition(IsElixirModule, Modules), - ok = configure_logging(), - ok = add_lib_to_erlang_path(Lib), - ok = filelib:ensure_dir([Out, $/]), - {ErlangOk, _ErlangBeams} = compile_erlang(ErlangModules, Out), - {ElixirOk, _ElixirBeams} = case ErlangOk of - true -> compile_elixir(ElixirModules, Out); - false -> {false, []} - end, - case ErlangOk and ElixirOk of - true -> ok; - false -> erlang:halt(1) - end. - -compile_erlang(Modules, Out) -> - Workers = start_compiler_workers(Out), - ok = producer_loop(Modules, Workers), - collect_results({true, []}). - -collect_results(Acc = {Result, Beams}) -> - receive - {compiled, Beam} -> collect_results({Result, [Beam | Beams]}); - failed -> collect_results({false, Beams}) - after 0 -> Acc - end. - -producer_loop([], 0) -> - ok; -producer_loop([], Workers) -> - receive - {work_please, _} -> producer_loop([], Workers - 1) - end; -producer_loop([Module | Modules], Workers) -> - receive - {work_please, Worker} -> - erlang:send(Worker, {module, Module}), - producer_loop(Modules, Workers) - end. - -start_compiler_workers(Out) -> - Parent = self(), - NumSchedulers = erlang:system_info(schedulers), - SpawnWorker = fun(_) -> - erlang:spawn_link(fun() -> worker_loop(Parent, Out) end) - end, - lists:foreach(SpawnWorker, lists:seq(1, NumSchedulers)), - NumSchedulers. - -worker_loop(Parent, Out) -> - Options = [report_errors, report_warnings, debug_info, {outdir, Out}], - erlang:send(Parent, {work_please, self()}), - receive - {module, Module} -> - log({compiling, Module}), - case compile:file(Module, Options) of - {ok, ModuleName} -> - Beam = filename:join(Out, ModuleName) ++ ".beam", - Message = {compiled, Beam}, - log(Message), - erlang:send(Parent, Message); - error -> - log({failed, Module}), - erlang:send(Parent, failed) - end, - worker_loop(Parent, Out) - end. - -compile_elixir(Modules, Out) -> - Error = [ - "The program elixir was not found. Is it installed?", - $\n, - "Documentation for installing Elixir can be viewed here:", - $\n, - "https://elixir-lang.org/install.html" - ], - case Modules of - [] -> {true, []}; - _ -> - log({starting, "compiler.app"}), - ok = application:start(compiler), - log({starting, "elixir.app"}), - case application:start(elixir) of - ok -> do_compile_elixir(Modules, Out); - _ -> - io:put_chars(standard_error, [Error, $\n]), - {false, []} - end - end. - -do_compile_elixir(Modules, Out) -> - ModuleBins = lists:map(fun(Module) -> - log({compiling, Module}), - list_to_binary(Module) - end, Modules), - OutBin = list_to_binary(Out), - Options = [{dest, OutBin}], - % Silence "redefining module" warnings. - % Compiled modules in the build directory are added to the code path. - % These warnings result from recompiling loaded modules. - % TODO: This line can likely be removed if/when the build directory is cleaned before every compilation. - 'Elixir.Code':compiler_options([{ignore_module_conflict, true}]), - case 'Elixir.Kernel.ParallelCompiler':compile_to_path(ModuleBins, OutBin, Options) of - {ok, ModuleAtoms, _} -> - ToBeam = fun(ModuleAtom) -> - Beam = filename:join(Out, atom_to_list(ModuleAtom)) ++ ".beam", - log({compiled, Beam}), - Beam - end, - {true, lists:map(ToBeam, ModuleAtoms)}; - {error, Errors, _} -> - % Log all filenames associated with modules that failed to compile. - % Note: The compiler prints compilation errors upon encountering them. - ErrorFiles = lists:usort([File || {File, _, _} <- Errors]), - Log = fun(File) -> - log({failed, binary_to_list(File)}) - end, - lists:foreach(Log, ErrorFiles), - {false, []}; - _ -> {false, []} - end. - -add_lib_to_erlang_path(Lib) -> - code:add_paths(filelib:wildcard([Lib, "/*/ebin"])). - -parse(Args) -> - parse(Args, #arguments{}). - -parse([], Arguments) -> - Arguments; -parse(["--lib", Lib | Rest], Arguments) -> - parse(Rest, Arguments#arguments{lib = Lib}); -parse(["--out", Out | Rest], Arguments) -> - parse(Rest, Arguments#arguments{out = Out}); -parse([Module | Rest], Arguments = #arguments{modules = Modules}) -> - parse(Rest, Arguments#arguments{modules = [Module | Modules]}). - -configure_logging() -> - Enabled = os:getenv("GLEAM_LOG") /= false, - persistent_term:put(gleam_logging_enabled, Enabled). - -log(Term) -> - case persistent_term:get(gleam_logging_enabled) of - true -> erlang:display(Term), ok; - false -> ok - end. diff --git a/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench.cache b/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench.cache deleted file mode 100644 index 417870d4294bb81b131a8a88e7296978d1348870..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7404 zcmc&(ZDis?QmXwLqez35|$5pD)8pMsO7S(n!^d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%_w+&!?U0u#GM`k_)KEm<4rP!zm{auT+i z=MJ`R;6I7~IUZX8J44S~wQ9|hqE@U$rru58u{odHccfJRmJ9XsHvct;c&FKXa|cF3 z@l0uw2V{LF3W-s~o9M#3V5%@wfYNyF&~2{Aqc_2!3wC2$FRo#~*3o9St@Fs>G1)pN z6|T+(dnYkXGRKZDejG5?Gv4G66uqP3T3FG8HAT#9-EhPWTibEFsxC;aoiJ_=htc0I zdabonI8iHBEhO-2v9h{Z0byiAmaGt|CI;_)SF`d?ETBqr3(0{@2yUKu`PEX;) zz}<~pc8YHZA94K#CGXD{+l@(>~6Z|1;s9qAu zQ(G%G))>g=W2IuVq}D$sufBxy9w<z0_*nji|Q@u<+F=s$IJJ!?Sr81Rc`U0 z!&rru$cL4Ctu*PuL+whV-xpYn*ivh)z9PGq!aR}t{XpbC;f>sk9l1DSiaG7c_*#&thus@PFm@- z26Noc+`eV}NZN8#f;+9zX&vW?Nc~H?eBqRX4LD}aXN~jX<{f8yp#3=>5aKvaf4~_~ z#8Kh5V22?MG>RP`-3a#%cXf3;y*yimhkn&}Odc-Uq-aI%rAw8Lvu^vG^`zkoF4RO( z76EuL5M1HPiMu!(x;y0%dVxa%KjuIe})0{N-;Bj9(-_MZXy1DxJ1T_WjPsDk1iQa#@l;gDeyvWTN9u@^$J{ZEa1rOfEK%JDgV)>-tu=GgKdSp zi^x5MT<4(R$HJ9ByVc412~?Tu`F)%|TcG(7%IlOLA<<*^kdY%}4_(se(iwUsL$8d` zO`UFzcoRo(F3%y3?G$3VJxQFb*DDm&D5@vUH#V*GnPO$bI=*CWY*v~Soy70z=O0O* zZZzr*iJGRyXbRhX`-LN#Nt#*$!)J>z&^~eEFZRjuR6!indJ3p~T%>}tqp*vOKqCKr F{4XBH2owMS diff --git a/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench.cache_meta b/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench.cache_meta deleted file mode 100644 index 285f20e08ef170e4c5c8bb832c7afad8ce05d85d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 119 zcmaEO%rTV#2>$)!Wng3lv4DURLNTQ0q$cL-XXce~qX?ws WZ)}. - --type set() :: {set, binary(), binary(), list(float())}. - --type bench(XA, XB) :: {bench, list(input(XA)), list(function_(XA, XB))}. - --type stat() :: {p, integer()} | - ips | - min | - max | - mean | - sd | - sd_percent | - {stat, binary(), fun((set()) -> float())}. - --spec now() -> float(). -now() -> - Ns = os:perf_counter(1000000000), - gleam@int:to_float(Ns) / 1000000.0. - --spec mean(list(float())) -> float(). -mean(Data) -> - Count = gleam@int:to_float(gleam@list:length(Data)), - case Count of - 0.0 -> 0.0; - Gleam@denominator -> gleam@float:sum(Data) / Gleam@denominator - end. - --spec standard_deviation(list(float())) -> float(). -standard_deviation(Data) -> - Count = gleam@int:to_float(gleam@list:length(Data)), - Mean = mean(Data), - _assert_subject = begin - _pipe = (case Count of - 0.0 -> 0.0; - Gleam@denominator -> gleam@float:sum( - gleam@list:map( - Data, - fun(X) -> - Y = X - Mean, - Y * Y - end - ) - ) - / Gleam@denominator - end), - gleam@float:square_root(_pipe) - end, - {ok, Value} = case _assert_subject of - {ok, _} -> _assert_subject; - _assert_fail -> - erlang:error(#{gleam_error => let_assert, - message => <<"Assertion pattern match failed"/utf8>>, - value => _assert_fail, - module => <<"gleamy_bench"/utf8>>, - function => <<"standard_deviation"/utf8>>, - line => 54}) - end, - Value. - --spec min(list(float())) -> float(). -min(Data) -> - First = case Data of - [X | _] -> - X; - - _ -> - 0.0 - end, - gleam@list:fold(Data, First, fun(A, X@1) -> gleam@float:min(A, X@1) end). - --spec percentile(integer(), list(float())) -> float(). -percentile(N, Data) -> - Data@1 = begin - _pipe = Data, - _pipe@1 = gleam@list:sort(_pipe, fun gleam@float:compare/2), - gleam@list:drop(_pipe@1, (N * gleam@list:length(Data)) div 100) - end, - case Data@1 of - [X | _] -> - X; - - _ -> - 0.0 - end. - --spec max(list(float())) -> float(). -max(Data) -> - First = case Data of - [X | _] -> - X; - - _ -> - 0.0 - end, - gleam@list:fold(Data, First, fun(A, X@1) -> gleam@float:max(A, X@1) end). - --spec do_repeat_until(list(float()), float(), XJ, fun((XJ) -> any())) -> list(float()). -do_repeat_until(Acc, Stop, Value, Fun) -> - Start = now(), - _ = Fun(Value), - End = now(), - case End of - _ when End < Stop -> - do_repeat_until([End - Start | Acc], Stop, Value, Fun); - - _ -> - Acc - end. - --spec repeat_until(float(), XM, fun((XM) -> any())) -> list(float()). -repeat_until(Duration, Value, Fun) -> - do_repeat_until([], now() + Duration, Value, Fun). - --spec run(bench(any(), any())) -> list(set()). -run(Bench) -> - gleam@list:flat_map( - erlang:element(2, Bench), - fun(_use0) -> - {input, Input_label, Input} = _use0, - gleam@list:map( - erlang:element(3, Bench), - fun(Function) -> case Function of - {function, Fun_label, Fun} -> - gleam@io:println( - <<<<<<"benching set "/utf8, Input_label/binary>>/binary, - " "/utf8>>/binary, - Fun_label/binary>> - ), - _ = repeat_until(10.0, Input, Fun), - Timings = repeat_until(500.0, Input, Fun), - {set, Input_label, Fun_label, Timings} - end end - ) - end - ). - --spec do_repeat(integer(), XU, fun((XU) -> any())) -> nil. -do_repeat(N, Input, Fun) -> - case N of - 0 -> - nil; - - _ -> - _ = Fun(Input), - do_repeat(N - 1, Input, Fun) - end. - --spec repeat(integer(), fun((XX) -> any())) -> fun((XX) -> nil). -repeat(N, Fun) -> - fun(Input) -> do_repeat(N, Input, Fun) end. - --spec format_float(float(), integer()) -> binary(). -format_float(F, Decimals) -> - _assert_subject = gleam@int:power(10, gleam@int:to_float(Decimals)), - {ok, Factor} = case _assert_subject of - {ok, _} -> _assert_subject; - _assert_fail -> - erlang:error(#{gleam_error => let_assert, - message => <<"Assertion pattern match failed"/utf8>>, - value => _assert_fail, - module => <<"gleamy_bench"/utf8>>, - function => <<"format_float"/utf8>>, - line => 148}) - end, - Whole = gleam@float:truncate(F), - Decimal = gleam@float:truncate(F * Factor) - (Whole * gleam@float:truncate( - Factor - )), - gleam@string:concat( - [gleam@string:pad_left( - gleam@int:to_string(Whole), - (14 - Decimals) - 1, - <<" "/utf8>> - ), - <<"."/utf8>>, - gleam@string:pad_left( - gleam@int:to_string(Decimal), - Decimals, - <<"0"/utf8>> - )] - ). - --spec header_row(list(stat())) -> binary(). -header_row(Stats) -> - _pipe = [gleam@string:pad_right(<<"Input"/utf8>>, 20, <<" "/utf8>>), - gleam@string:pad_right(<<"Function"/utf8>>, 20, <<" "/utf8>>) | - gleam@list:map( - Stats, - fun(Stat) -> - Stat@1 = case Stat of - {p, N} -> - <<"P"/utf8, (gleam@int:to_string(N))/binary>>; - - ips -> - <<"IPS"/utf8>>; - - min -> - <<"Min"/utf8>>; - - max -> - <<"Max"/utf8>>; - - mean -> - <<"Mean"/utf8>>; - - sd -> - <<"SD"/utf8>>; - - sd_percent -> - <<"SD%"/utf8>>; - - {stat, Name, _} -> - Name - end, - gleam@string:pad_left(Stat@1, 14, <<" "/utf8>>) - end - )], - gleam@string:join(_pipe, <<"\t"/utf8>>). - --spec stat_row(set(), list(stat())) -> binary(). -stat_row(Set, Stats) -> - _pipe@2 = [gleam@string:pad_right(erlang:element(2, Set), 20, <<" "/utf8>>), - gleam@string:pad_right(erlang:element(3, Set), 20, <<" "/utf8>>) | - gleam@list:map( - Stats, - fun(Stat) -> - Stat@1 = case Stat of - {p, N} -> - percentile(N, erlang:element(4, Set)); - - ips -> - case gleam@float:sum(erlang:element(4, Set)) of - 0.0 -> 0.0; - Gleam@denominator -> (1000.0 * gleam@int:to_float( - gleam@list:length(erlang:element(4, Set)) - )) - / Gleam@denominator - end; - - min -> - min(erlang:element(4, Set)); - - max -> - max(erlang:element(4, Set)); - - mean -> - mean(erlang:element(4, Set)); - - sd -> - standard_deviation(erlang:element(4, Set)); - - sd_percent -> - case mean(erlang:element(4, Set)) of - 0.0 -> 0.0; - Gleam@denominator@1 -> (100.0 * standard_deviation( - erlang:element(4, Set) - )) - / Gleam@denominator@1 - end; - - {stat, _, Calc} -> - Calc(Set) - end, - _pipe = Stat@1, - _pipe@1 = format_float(_pipe, 4), - gleam@string:pad_left(_pipe@1, 14, <<" "/utf8>>) - end - )], - gleam@string:join(_pipe@2, <<"\t"/utf8>>). - --spec table(list(set()), list(stat())) -> binary(). -table(Sets, Stats) -> - Header = header_row(Stats), - Body = gleam@list:map(Sets, fun(_capture) -> stat_row(_capture, Stats) end), - _pipe = [Header | Body], - gleam@string:join(_pipe, <<"\n"/utf8>>). diff --git a/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench@@main.erl b/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench@@main.erl deleted file mode 100644 index 76ff33d..0000000 --- a/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench@@main.erl +++ /dev/null @@ -1,34 +0,0 @@ --module('gleamy_bench@@main'). - --export([run/1]). - -run(Module) -> - io:setopts(standard_io, [binary, {encoding, utf8}]), - io:setopts(standard_error, [{encoding, utf8}]), - try - {ok, _} = application:ensure_all_started('gleamy_bench'), - Module:main(), - erlang:halt(0) - catch - Class:Reason:StackTrace -> - print_error(Class, Reason, StackTrace), - erlang:halt(127, [{flush, true}]) - end. - -print_error(Class, Reason, StackTrace) -> - E = erl_error:format_exception( - 1, Class, Reason, StackTrace, fun stack_filter/3, - fun print_stack_frame/2, unicode - ), - io:put_chars(E). - -stack_filter(Module, _F, _A) -> - case Module of - ?MODULE -> true; - erl_eval -> true; - init -> true; - _ -> false - end. - -print_stack_frame(Term, I) -> - io_lib:format("~." ++ integer_to_list(I) ++ "tP", [Term, 50]). \ No newline at end of file diff --git a/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench_example.cache b/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench_example.cache deleted file mode 100644 index 80c0b0a52ce8e9a80fa626c741ec6959fd40ea81..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 740 zcmchV!AiqG5QcYlUDFgxIur{PrEQ>UbCIMsQCbTsf~ac+k2Te3t4Ski3wr8{D0uEG zsITDB*U?SDVx+lx*`1kXcfR@m&3-oKadCnb1uOeG&J@Jk9I&;o8`rVD$94yt{$;oA zJlL9d?>f^m(ZYIz?qn&h7-AV1zBk1iu-r2kttXJdHZ@vX6qt71>sW+{1R2Ai*KP*P=Pm=2#0MQU7xn(9;l1V!1GX;!u6I#o{DvYoE z_Ai>37|mF8BO1vmX-pkW3r$6aRUNAqR>QEYW7)!ToG}I*OXQ82Q*kL5He>WZXo&;h z>qj`D`A integer(). -fib1(N) -> - case N of - 0 -> - 0; - - 1 -> - 1; - - N@1 -> - fib1(N@1 - 1) + fib1(N@1 - 2) - end. - --spec do_fib2(integer(), integer(), integer()) -> integer(). -do_fib2(A, B, N) -> - case N of - 0 -> - A; - - _ -> - do_fib2(B, A + B, N - 1) - end. - --spec fib2(integer()) -> integer(). -fib2(N) -> - do_fib2(0, 1, N). - --spec main() -> nil. -main() -> - _pipe = {bench, - [{input, <<"n=5"/utf8>>, 5}, - {input, <<"n=10"/utf8>>, 10}, - {input, <<"n=15"/utf8>>, 15}], - [{function, <<"fib1"/utf8>>, fun fib1/1}, - {function, <<"fib2"/utf8>>, fun fib2/1}]}, - _pipe@1 = gleamy_bench:run(_pipe), - _pipe@2 = gleamy_bench:table(_pipe@1, [ips, min, {p, 99}]), - gleam@io:println(_pipe@2). diff --git a/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench_ffi.mjs b/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench_ffi.mjs deleted file mode 100644 index 7e9d5d6..0000000 --- a/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench_ffi.mjs +++ /dev/null @@ -1,3 +0,0 @@ -export function now() { - return performance.now() -} diff --git a/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench_test.cache b/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench_test.cache deleted file mode 100644 index a0dfa7e88dd1427b62b743f6f9df8d11e97315dc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 385 zcmbV|K}*9x5QTSkiD^PZe3TaAB}FI=ITpNlF$(smuIM>LU2N;N3rR}pUnmGt{J(Wm zq&An6L9EQj6zFUaN}g17l$WGk)3P z2vXT5f%lF4BoWSw>4HeMxsVw-AfGWJ#^AZK#RX$`b`ZQ%cq7Z)o2icXBFl+@RQBx( zw&>f#-+wzue*|G1$=PnAv^M$5P^n*)mPus*g5A$`3>cX}EFj>3Pz>ogsi~!TnI-&aeEs5#{L-8huJ0~6Z&bUj0JTpL ARR910 diff --git a/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench_test.erl b/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench_test.erl deleted file mode 100644 index 01cf8b2..0000000 --- a/build/dev/erlang/gleamy_bench/_gleam_artefacts/gleamy_bench_test.erl +++ /dev/null @@ -1,13 +0,0 @@ --module(gleamy_bench_test). --compile([no_auto_import, nowarn_unused_vars]). - --export([main/0, hello_world_test/0]). - --spec main() -> nil. -main() -> - gleeunit:main(). - --spec hello_world_test() -> nil. -hello_world_test() -> - _pipe = 1, - gleeunit_ffi:should_equal(_pipe, 1). diff --git a/build/dev/erlang/gleamy_bench/_gleam_artefacts/test.cache b/build/dev/erlang/gleamy_bench/_gleam_artefacts/test.cache deleted file mode 100644 index 292a51edf4c67f38ceee38f7a1829e4257beedd4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1972 zcmbtVOHUI~6rOW$OCP~BCs05_Qy|8~NytFakTjYW6cbq}*U?lH6D=@-+83El7p%aY zMp?OFg9{TEZ2S+n(zrDE6HHvW(lwrYXU1>~6r;&xdOBzBd3@(P-%NgC#U4zXm>I+u zJAK>9K}U@*Hz|r*k1^GqL8Z$9jAJ5)iCFA*rS_*K3XG-}UquVUe`E)2v%c;& z>+4>SVNc6Y5|0!RI*OEyh$Ann6T{B&69Kw_#|$5WIjzL7qOi)(@C{;ayFt?=+KDGx zg*pZ&lJF=vw;G-X&bXFYW(l(*KhLudj}UB2C)lQa85A~D6J?mn<5Ui(e1=`J#B=FW zbbD`!efg&oDzz8K>1ISvC0jRFxMu%&I?ebWDn9VHIq7%r<3X(~0&Oh9%xo{i^f2}- z63Ba=Y~EZ4NG&%T9{cC@ws7)wYN^s#2?qCF8(c~3D)<6wkr2^kDZ~iAtI~Ij zOx$3;ngH)ct23NF=Q`Fx))|Z*4}Kh0muV-OEr(_(NoN=J;g`gxuy|E*#uAhAf%gaVOIjC znN%|$R!Sv52uT$;OmlIfph?ZXmZ;>5@`-{S6a5m<&J7BL@5H4C29a(Yi3HM<*90Ia zFsOL?CG3I!?W4P5qZ}4qiAhO0C9T1WOsz;B(*rnW;@ALAm^d*|xa+jqH4mf17|roJ j)$F|MHeD5!KCbjkffX#>T(emVp5AlYPWEQG)^dIW;LATC diff --git a/build/dev/erlang/gleamy_bench/_gleam_artefacts/test.cache_meta b/build/dev/erlang/gleamy_bench/_gleam_artefacts/test.cache_meta deleted file mode 100644 index bcab1e8706543bcd2d46c462ba3c7b2afbe3390a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 45 rcmXRmP)=n40{<*?OGZWz3kWzM6hnGWYGST_X8u9Js{2_ETb}^{mPrZR diff --git a/build/dev/erlang/gleamy_bench/_gleam_artefacts/test.erl b/build/dev/erlang/gleamy_bench/_gleam_artefacts/test.erl deleted file mode 100644 index 45258a1..0000000 --- a/build/dev/erlang/gleamy_bench/_gleam_artefacts/test.erl +++ /dev/null @@ -1,74 +0,0 @@ --module(test). --compile([no_auto_import, nowarn_unused_vars]). - --export([yield/2, mprompt/2, prompt/2, main/0]). --export_type([ctrl/1]). - --type ctrl(FDV) :: {pure, FDV} | - {yield, - binary(), - fun((fun((FDV) -> ctrl(FDV))) -> ctrl(FDV)), - fun((FDV) -> ctrl(FDV))}. - --spec yield(binary(), fun((fun((FES) -> ctrl(FES))) -> ctrl(FES))) -> ctrl(FES). -yield(Marker, Op) -> - {yield, Marker, Op, fun(Field@0) -> {pure, Field@0} end}. - --spec mprompt(binary(), ctrl(FEX)) -> ctrl(FEX). -mprompt(Marker, Ctl) -> - case Ctl of - {pure, X} -> - {pure, X}; - - {yield, M, Op, Cont} -> - Cont@1 = fun(X@1) -> mprompt(Marker, Cont(X@1)) end, - case Marker =:= M of - true -> - Op(Cont@1); - - false -> - {yield, M, Op, Cont@1} - end - end. - --spec prompt(binary(), fun(() -> ctrl(FFA))) -> ctrl(FFA). -prompt(Marker, Action) -> - mprompt(Marker, Action()). - --spec bind(ctrl(FEB), fun((FEB) -> ctrl(FEB))) -> ctrl(FEB). -bind(Ctl, F) -> - case Ctl of - {pure, X} -> - F(X); - - {yield, M, Op, Cont} -> - {yield, M, Op, kcompose(F, Cont)} - end. - --spec kcompose(fun((FEB) -> ctrl(FEB)), fun((FEB) -> ctrl(FEB))) -> fun((FEB) -> ctrl(FEB)). -kcompose(G, F) -> - fun(X) -> _pipe = F(X), - bind(_pipe, G) end. - --spec run() -> ctrl(integer()). -run() -> - prompt( - <<"read"/utf8>>, - fun() -> - bind( - {pure, 5}, - fun(A) -> - bind( - yield(<<"read"/utf8>>, fun(K) -> K(2) end), - fun(B) -> {pure, A + B} end - ) - end - ) - end - ). - --spec main() -> nil. -main() -> - _pipe = run(), - gleam@io:debug(_pipe), - gleam@io:println(<<"Hello from deli!"/utf8>>). diff --git a/build/dev/erlang/gleamy_bench/ebin/gleamy_bench.app b/build/dev/erlang/gleamy_bench/ebin/gleamy_bench.app deleted file mode 100644 index 0e0a1f6..0000000 --- a/build/dev/erlang/gleamy_bench/ebin/gleamy_bench.app +++ /dev/null @@ -1,9 +0,0 @@ -{application, gleamy_bench, [ - {vsn, "0.1.0"}, - {applications, [gleam_stdlib, - gleeunit]}, - {description, ""}, - {modules, [gleamy_bench, - gleamy_bench_example]}, - {registered, []} -]}. diff --git a/build/dev/erlang/gleamy_bench/ebin/gleamy_bench.beam b/build/dev/erlang/gleamy_bench/ebin/gleamy_bench.beam deleted file mode 100644 index 433114a4ef3a100f781d13ca6af05cc1f3dc5eeb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11648 zcmch7cUTia*Ka}s?1mNyy#_*&9s~p_8hY;{pcDgyPC^My5mA~26|fNj1wj!(Km`ke zNL3LO#R6Cmm8vu=isjA*^!5Fo@7_Oep66svesj*5(`I(FiM5Nn4hp52Y;I-dWXAL~ zM4>q9Q7DuXZ)g;a8l4glNTUaZVd#t`4n{n03@t7sAc&DbXVT(ewg4rZ&V-nZfRHE# zm5Gg}QR%p4JSse%$rVMThcd%>mJzlHCO#orD4t2B2UFvM1A=LZ;Z$ZggN})&#_+_) zCQ##O0dWillYWBPtjNoDZVWnc-11Y&;{5iB`h|hbLl#;}|hu z^<;ryMnD`bhDK!ufbhbjc>n!?iA$h!)1qk6KpzT;0y4l~_^$?r9v+3(lME zNiZ@M7akhM#6~c}=@3XA6Tvx|)W9ej&vMuS;q(xOKqyGfzn?YPBHF7pK_WHDnnId? zbpJwF1VP7O!ein&;)8MV!2v5d64v~W2iiI-2Dp};1=7Qw6-MpzsD{U<6M@p|+@?FhVE-n#`hb2*u&i6kZ~}MhuUoV1!w&+<0ID zPr+c-JuxgUG0o;-~qelW-2*&&u5=d>YW@M1S{cpEZK5GRBqz-w^AHWZwQjVn$R!+Hhbw-C|w zta%P0oCF?y)9^9o6oz0rhVBQh5zw!evj!X^R^v%xC>DfwCdZ)XS&$%5kRqZXJTH+* zAt1S<5HJ**Ed&-M#7#`E!eUqu0R+9B6Q3uH!GNLE3xkJ)2^1^{jffTICe|DB34+xy zNRlBzBo%BfMuplY0z5*EyN%E4(6cUy~5T;-h zS&%eXgl$_<1t0j2;lJGoa-vHSCQ&#rh*4lbiUr94TO>Rhl4e1&Je)V>F@(Q8LaZiZ zK#x>mKooM$#C|j+!-9xFUKyy$s`JTV&=i~s2KXfRuOmo(NI*p%30z@2C+d}=AZTn7 z$Ob2wPZsDB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Y|k1^*le#Xc|X%N>p;pG zi-(p&4{PfR6Ti<0>nGhxG7!>y4HtW77E~NfOutylJ?zpve0gSda#1+*SR|$P z_e4XA;+sYzGe7EPR^PUs=w0JqBwIa&i}f_VOdMr>cwtdv=upM3=e~bzmu69OI|AMP z&w9svi0>K$ABitra4CE7x~n0eo$Yx~8q(J`{^TieVTG}8ZA(qgA%9QNP!sj=OAa}) z^-2A!KEHEAEhDYqjQ66!u7KVI2aV4Hwa+Sa?MVLP=Rh}2>tKwVuYWeVGjT^m|LCnR zyL~%ZZy(v#3}ov4=X6v)0F+YZX0uU@3|F+eW)W_;;6jA+_%X^_g92@1ZVG= zd;cBcW#O<$OuO!VWwBjto+he=UNmYM)so}CM^Kk?;k!b#@AUr6Sy#S(@L^x|-)aj9 zk`2vy)vl!{r;k)PS-b!HT4(vCN_uO%*lIG}xuj$I?5o8+#6UXb;5T!UHysZsNoNhED@O z-%RHUeH#U)Ory-8%%;qxI8zo-7XCjsO8|&SQsK2RG2rI}an2+V#^hqmG(I!%zq~_j AI{*Lx diff --git a/build/dev/erlang/gleamy_bench/ebin/gleamy_bench_test.beam b/build/dev/erlang/gleamy_bench/ebin/gleamy_bench_test.beam deleted file mode 100644 index 22ec172fa8b4d316e035ac35e1f2b4c5966b6ff4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1264 zcmZ?s4>Dw6V0q!>>gelO5^BM~z)%FloPy~&sfoFj@kyz9$r5>jGdRG6vY$H2g7Fw=lZ z$ccf`!9h^iL6CW-gP(!`W57%XCZQq*#smi;WVs1M7DzDFMZWI$S+- zS#cg%Z=L{yvdE1y&ddJ=ePO>>wf|C{e^wTQvu9o!Q2lDKdS;;c>}9D%#hLke*$k`} zdM0{?Affz%5}-&i*qCyzl+>isba2dM0VUar^Gl18Q?nV;^)vEwQ}we-b21b2^b3me zvr>~wiuIAxgnm+KW=@KJN@|%tBu-IfYb~~839Qt<*%)*fJcm+pE% z@sG^$uzsU!TQX~9buax)e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49v9_CrS(pj)6 zrmgzUdX;NCd2Koyez{q3v-5t+P@&08|5+tfZBMn-7n(`OT1k4Ij&*x~Z~uHDch@uL z&#&Gl-&7Y!J-W4wMR^4m-#?%(|8CYMeLL@N#fn0v$kIEF@-(xyDZIF zM%N35HSRzMGarmH`}Jg(Gp`_%){YZ;q2lFE0Rk}}+zSo^d|3v75ce1o+D}7ivuGHN zNi(Hc&}?XPX_hp5+B}*!&4=bo^P{=a7Sa~c7SkMP`oH`??**Wk6 any())}). diff --git a/build/dev/erlang/gleamy_bench/include/gleamy_bench_Input.hrl b/build/dev/erlang/gleamy_bench/include/gleamy_bench_Input.hrl deleted file mode 100644 index 99682c9..0000000 --- a/build/dev/erlang/gleamy_bench/include/gleamy_bench_Input.hrl +++ /dev/null @@ -1 +0,0 @@ --record(input, {label :: binary(), value :: any()}). diff --git a/build/dev/erlang/gleamy_bench/include/gleamy_bench_RepeatFunction.hrl b/build/dev/erlang/gleamy_bench/include/gleamy_bench_RepeatFunction.hrl deleted file mode 100644 index 09f8c59..0000000 --- a/build/dev/erlang/gleamy_bench/include/gleamy_bench_RepeatFunction.hrl +++ /dev/null @@ -1,5 +0,0 @@ --record(repeat_function, { - label :: binary(), - n :: integer(), - function :: fun((any()) -> any()) -}). diff --git a/build/dev/erlang/gleamy_bench/include/gleamy_bench_Set.hrl b/build/dev/erlang/gleamy_bench/include/gleamy_bench_Set.hrl deleted file mode 100644 index a98e3e0..0000000 --- a/build/dev/erlang/gleamy_bench/include/gleamy_bench_Set.hrl +++ /dev/null @@ -1 +0,0 @@ --record(set, {input :: binary(), function :: binary(), reps :: list(float())}). diff --git a/build/dev/erlang/gleamy_bench/include/gleamy_bench_SetSummary.hrl b/build/dev/erlang/gleamy_bench/include/gleamy_bench_SetSummary.hrl deleted file mode 100644 index d50131b..0000000 --- a/build/dev/erlang/gleamy_bench/include/gleamy_bench_SetSummary.hrl +++ /dev/null @@ -1,9 +0,0 @@ --record(set_summary, { - input :: binary(), - function :: binary(), - ips :: float(), - mean :: float(), - sd_percent :: float(), - min :: float(), - max :: float() -}). diff --git a/build/dev/erlang/gleamy_bench/include/gleamy_bench_Stat.hrl b/build/dev/erlang/gleamy_bench/include/gleamy_bench_Stat.hrl deleted file mode 100644 index a21d335..0000000 --- a/build/dev/erlang/gleamy_bench/include/gleamy_bench_Stat.hrl +++ /dev/null @@ -1,4 +0,0 @@ --record(stat, { - name :: binary(), - calculate :: fun((gleamy_bench:set()) -> float()) -}). diff --git a/build/dev/erlang/gleamy_bench/include/test_Yield.hrl b/build/dev/erlang/gleamy_bench/include/test_Yield.hrl deleted file mode 100644 index 56d84c4..0000000 --- a/build/dev/erlang/gleamy_bench/include/test_Yield.hrl +++ /dev/null @@ -1,5 +0,0 @@ --record(yield, { - marker :: binary(), - op :: fun((fun((any()) -> test:ctrl(any()))) -> test:ctrl(any())), - cont :: fun((any()) -> test:ctrl(any())) -}). diff --git a/build/dev/erlang/gleeunit/_gleam_artefacts/gleam@@compile.erl b/build/dev/erlang/gleeunit/_gleam_artefacts/gleam@@compile.erl deleted file mode 100644 index 543db88..0000000 --- a/build/dev/erlang/gleeunit/_gleam_artefacts/gleam@@compile.erl +++ /dev/null @@ -1,157 +0,0 @@ -#!/usr/bin/env escript - -% TODO: Don't concurrently print warnings and errors -% TODO: Some tests - --record(arguments, {lib = "./", out = "./", modules = []}). - -main(Args) -> - #arguments{out = Out, lib = Lib, modules = Modules} = parse(Args), - IsElixirModule = fun(Module) -> - filename:extension(Module) =:= ".ex" - end, - {ElixirModules, ErlangModules} = lists:partition(IsElixirModule, Modules), - ok = configure_logging(), - ok = add_lib_to_erlang_path(Lib), - ok = filelib:ensure_dir([Out, $/]), - {ErlangOk, _ErlangBeams} = compile_erlang(ErlangModules, Out), - {ElixirOk, _ElixirBeams} = case ErlangOk of - true -> compile_elixir(ElixirModules, Out); - false -> {false, []} - end, - case ErlangOk and ElixirOk of - true -> ok; - false -> erlang:halt(1) - end. - -compile_erlang(Modules, Out) -> - Workers = start_compiler_workers(Out), - ok = producer_loop(Modules, Workers), - collect_results({true, []}). - -collect_results(Acc = {Result, Beams}) -> - receive - {compiled, Beam} -> collect_results({Result, [Beam | Beams]}); - failed -> collect_results({false, Beams}) - after 0 -> Acc - end. - -producer_loop([], 0) -> - ok; -producer_loop([], Workers) -> - receive - {work_please, _} -> producer_loop([], Workers - 1) - end; -producer_loop([Module | Modules], Workers) -> - receive - {work_please, Worker} -> - erlang:send(Worker, {module, Module}), - producer_loop(Modules, Workers) - end. - -start_compiler_workers(Out) -> - Parent = self(), - NumSchedulers = erlang:system_info(schedulers), - SpawnWorker = fun(_) -> - erlang:spawn_link(fun() -> worker_loop(Parent, Out) end) - end, - lists:foreach(SpawnWorker, lists:seq(1, NumSchedulers)), - NumSchedulers. - -worker_loop(Parent, Out) -> - Options = [report_errors, report_warnings, debug_info, {outdir, Out}], - erlang:send(Parent, {work_please, self()}), - receive - {module, Module} -> - log({compiling, Module}), - case compile:file(Module, Options) of - {ok, ModuleName} -> - Beam = filename:join(Out, ModuleName) ++ ".beam", - Message = {compiled, Beam}, - log(Message), - erlang:send(Parent, Message); - error -> - log({failed, Module}), - erlang:send(Parent, failed) - end, - worker_loop(Parent, Out) - end. - -compile_elixir(Modules, Out) -> - Error = [ - "The program elixir was not found. Is it installed?", - $\n, - "Documentation for installing Elixir can be viewed here:", - $\n, - "https://elixir-lang.org/install.html" - ], - case Modules of - [] -> {true, []}; - _ -> - log({starting, "compiler.app"}), - ok = application:start(compiler), - log({starting, "elixir.app"}), - case application:start(elixir) of - ok -> do_compile_elixir(Modules, Out); - _ -> - io:put_chars(standard_error, [Error, $\n]), - {false, []} - end - end. - -do_compile_elixir(Modules, Out) -> - ModuleBins = lists:map(fun(Module) -> - log({compiling, Module}), - list_to_binary(Module) - end, Modules), - OutBin = list_to_binary(Out), - Options = [{dest, OutBin}], - % Silence "redefining module" warnings. - % Compiled modules in the build directory are added to the code path. - % These warnings result from recompiling loaded modules. - % TODO: This line can likely be removed if/when the build directory is cleaned before every compilation. - 'Elixir.Code':compiler_options([{ignore_module_conflict, true}]), - case 'Elixir.Kernel.ParallelCompiler':compile_to_path(ModuleBins, OutBin, Options) of - {ok, ModuleAtoms, _} -> - ToBeam = fun(ModuleAtom) -> - Beam = filename:join(Out, atom_to_list(ModuleAtom)) ++ ".beam", - log({compiled, Beam}), - Beam - end, - {true, lists:map(ToBeam, ModuleAtoms)}; - {error, Errors, _} -> - % Log all filenames associated with modules that failed to compile. - % Note: The compiler prints compilation errors upon encountering them. - ErrorFiles = lists:usort([File || {File, _, _} <- Errors]), - Log = fun(File) -> - log({failed, binary_to_list(File)}) - end, - lists:foreach(Log, ErrorFiles), - {false, []}; - _ -> {false, []} - end. - -add_lib_to_erlang_path(Lib) -> - code:add_paths(filelib:wildcard([Lib, "/*/ebin"])). - -parse(Args) -> - parse(Args, #arguments{}). - -parse([], Arguments) -> - Arguments; -parse(["--lib", Lib | Rest], Arguments) -> - parse(Rest, Arguments#arguments{lib = Lib}); -parse(["--out", Out | Rest], Arguments) -> - parse(Rest, Arguments#arguments{out = Out}); -parse([Module | Rest], Arguments = #arguments{modules = Modules}) -> - parse(Rest, Arguments#arguments{modules = [Module | Modules]}). - -configure_logging() -> - Enabled = os:getenv("GLEAM_LOG") /= false, - persistent_term:put(gleam_logging_enabled, Enabled). - -log(Term) -> - case persistent_term:get(gleam_logging_enabled) of - true -> erlang:display(Term), ok; - false -> ok - end. diff --git a/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit.cache b/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit.cache deleted file mode 100644 index 86def1a0e6e369b070628942360cf5ec989a35a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3231 zcmbVOPi)gx827W2xCxZ-sT2XC>nnm$tZ9V=BpMBsbSoRt1~rBuDov@AytD?#?raAX zF4Yd~5bZK)haIMg%kEqzZD>18+I7;T32l>h;%?DsR2Z*JZ0)(%TeBH!J60e`QhZ%LAj65S{u)u>!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v{sQlHe} z)fi0xqOTyWLAsE??zP$UCDZoVsQCp*ci6ZjA&%d+14ti12<7UX=_Su|y>KYrnd>DW Inz%6k19Ctz1^@s6 diff --git a/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit.cache_meta b/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit.cache_meta deleted file mode 100644 index fa9b21d070bd05c4956cb04546f4aa901bc525d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 108 zcmYdhxRAmC1&l0E1{ai0&q+ binary(). -gleam_to_erlang_module_name(Path) -> - _pipe = Path, - _pipe@1 = gleam@string:replace(_pipe, <<".gleam"/utf8>>, <<""/utf8>>), - _pipe@2 = gleam@string:replace(_pipe@1, <<".erl"/utf8>>, <<""/utf8>>), - gleam@string:replace(_pipe@2, <<"/"/utf8>>, <<"@"/utf8>>). - --spec do_main() -> nil. -do_main() -> - Options = [verbose, - no_tty, - {report, {gleeunit_progress, [{colored, true}]}}], - Result = begin - _pipe = gleeunit_ffi:find_files( - <<"**/*.{erl,gleam}"/utf8>>, - <<"test"/utf8>> - ), - _pipe@1 = gleam@list:map(_pipe, fun gleam_to_erlang_module_name/1), - _pipe@2 = gleam@list:map( - _pipe@1, - fun(_capture) -> erlang:binary_to_atom(_capture, utf8) end - ), - _pipe@3 = eunit:test(_pipe@2, Options), - _pipe@4 = (gleam@dynamic:result( - fun gleam@dynamic:dynamic/1, - fun gleam@dynamic:dynamic/1 - ))(_pipe@3), - gleam@result:unwrap(_pipe@4, {error, gleam@dynamic:from(nil)}) - end, - Code = case Result of - {ok, _} -> - 0; - - {error, _} -> - 1 - end, - erlang:halt(Code). - --spec main() -> nil. -main() -> - do_main(). diff --git a/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@should.cache b/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@should.cache deleted file mode 100644 index ff69c3504bf9bbe96d70f4840eb6ef7350a01eda..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1128 zcmb`GO=}ZT6o${acRre67!EPjN@N--DC43vT99sx0lUaTy&a(|jVYbjq|*#08QdsB zmTp9F>rW8Wf8o~OqHg24^N}_-7C{$t=FA;t-siseJsXd)VNqp5HJfTL$~DubQmcH~ zygGdr20=XNjm7%tAd16%$QJ+_;%-&YW=q{hNk5wEJIeAqZ29kzn@!>Qw*)tzMcx0T znc-?+wFn4`AU2cuNi1O zjDrm3>2EOCPQrKzjO{d|C`?f_D^p%cU)cA1$Lk4EQ&pL$G@&ZjVy-na7;}Re=B@R` z((ZIS;V3wE=RX6rQi~>;MJMzYLVdG-T28mq3p0BfbN1N!BmmAZK_7=V=Rxwfg<2Qv z>$b~4(c!-ZgQKBCA(P5|auEH+(Evy5&2S)3#(8l=xWV(dlW+WBZsWUZBgsV)L^Kj5 z1B^cfL2xD)>IdLxjnn$u_ynheXx!EefPX__CKTqG6mQfTpGc)oYg}goGQdnI1UQZI v5x*i&{gR;47L}H1#iNzwY#zzHL}pz+ICSsnnN9|SOpn)`M?6#Rw$Ab|IZWYG diff --git a/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@should.cache_meta b/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@should.cache_meta deleted file mode 100644 index 880771043414cca96ad885520f0eaee518a6efe4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29 YcmYdhxRAmC1&lBTLs8}=!&C-e05&TF=>Px# diff --git a/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@should.erl b/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@should.erl deleted file mode 100644 index 2c2f766..0000000 --- a/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit@should.erl +++ /dev/null @@ -1,34 +0,0 @@ --module(gleeunit@should). --compile([no_auto_import, nowarn_unused_vars]). - --export([equal/2, not_equal/2, be_ok/1, be_error/1, be_true/1, be_false/1, fail/0]). - --spec equal(FCX, FCX) -> nil. -equal(A, B) -> - gleeunit_ffi:should_equal(A, B). - --spec not_equal(FCY, FCY) -> nil. -not_equal(A, B) -> - gleeunit_ffi:should_not_equal(A, B). - --spec be_ok({ok, FCZ} | {error, any()}) -> FCZ. -be_ok(A) -> - gleeunit_ffi:should_be_ok(A). - --spec be_error({ok, any()} | {error, FDE}) -> FDE. -be_error(A) -> - gleeunit_ffi:should_be_error(A). - --spec be_true(boolean()) -> nil. -be_true(Actual) -> - _pipe = Actual, - gleeunit_ffi:should_equal(_pipe, true). - --spec be_false(boolean()) -> nil. -be_false(Actual) -> - _pipe = Actual, - gleeunit_ffi:should_equal(_pipe, false). - --spec fail() -> nil. -fail() -> - be_true(false). diff --git a/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit_ffi.erl b/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit_ffi.erl deleted file mode 100644 index 31f9ef9..0000000 --- a/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit_ffi.erl +++ /dev/null @@ -1,24 +0,0 @@ --module(gleeunit_ffi). - --export([find_files/2, should_equal/2, should_not_equal/2, should_be_ok/1, - should_be_error/1]). - --include_lib("eunit/include/eunit.hrl"). - -find_files(Pattern, In) -> - Results = filelib:wildcard(binary_to_list(Pattern), binary_to_list(In)), - lists:map(fun list_to_binary/1, Results). - - -should_equal(Actual, Expected) -> - ?assertEqual(Expected, Actual), - nil. -should_not_equal(Actual, Expected) -> - ?assertNotEqual(Expected, Actual), - nil. -should_be_ok(A) -> - ?assertMatch({ok, _}, A), - element(2, A). -should_be_error(A) -> - ?assertMatch({error, _}, A), - element(2, A). diff --git a/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit_ffi.mjs b/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit_ffi.mjs deleted file mode 100644 index 339a843..0000000 --- a/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit_ffi.mjs +++ /dev/null @@ -1,101 +0,0 @@ -async function* gleamFiles(directory) { - for (let entry of await read_dir(directory)) { - let path = join_path(directory, entry); - if (path.endsWith(".gleam")) { - yield path; - } else { - try { - yield* gleamFiles(path); - } catch (error) { - // Could not read directory, assume it's a file - } - } - } -} - -async function readRootPackageName() { - let toml = await read_file("gleam.toml", "utf-8"); - for (let line of toml.split("\n")) { - let matches = line.match(/\s*name\s*=\s*"([a-z][a-z0-9_]*)"/); // Match regexp in compiler-cli/src/new.rs in validate_name() - if (matches) return matches[1]; - } - throw new Error("Could not determine package name from gleam.toml"); -} - -export async function main() { - let passes = 0; - let failures = 0; - - let packageName = await readRootPackageName(); - let dist = `../${packageName}/`; - - for await (let path of await gleamFiles("test")) { - let js_path = path.slice("test/".length).replace(".gleam", ".mjs"); - let module = await import(join_path(dist, js_path)); - for (let fnName of Object.keys(module)) { - if (!fnName.endsWith("_test")) continue; - try { - await module[fnName](); - write(`\u001b[32m.\u001b[0m`); - passes++; - } catch (error) { - let moduleName = "\n" + js_path.slice(0, -4); - let line = error.line ? `:${error.line}` : ""; - write(`\n❌ ${moduleName}.${fnName}${line}: ${error}\n`); - failures++; - } - } - } - - console.log(` -${passes + failures} tests, ${failures} failures`); - exit(failures ? 1 : 0); -} - -export function crash(message) { - throw new Error(message); -} - -function write(message) { - if (globalThis.Deno) { - Deno.stdout.writeSync(new TextEncoder().encode(message)); - } else { - process.stdout.write(message); - } -} - -function exit(code) { - if (globalThis.Deno) { - Deno.exit(code); - } else { - process.exit(code); - } -} - -async function read_dir(path) { - if (globalThis.Deno) { - let items = []; - for await (let item of Deno.readDir(path, { withFileTypes: true })) { - items.push(item.name); - } - return items; - } else { - let { readdir } = await import("fs/promises"); - return readdir(path); - } -} - -function join_path(a, b) { - if (a.endsWith("/")) return a + b; - return a + "/" + b; -} - -async function read_file(path) { - if (globalThis.Deno) { - return Deno.readTextFile(path); - } else { - let { readFile } = await import("fs/promises"); - let contents = await readFile(path); - return contents.toString(); - } -} diff --git a/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit_progress.erl b/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit_progress.erl deleted file mode 100644 index 1f68eb9..0000000 --- a/build/dev/erlang/gleeunit/_gleam_artefacts/gleeunit_progress.erl +++ /dev/null @@ -1,607 +0,0 @@ -%% A formatter adapted from Sean Cribb's https://github.com/seancribbs/eunit_formatters - -%% @doc A listener/reporter for eunit that prints '.' for each -%% success, 'F' for each failure, and 'E' for each error. It can also -%% optionally summarize the failures at the end. --compile({nowarn_unused_function, [insert/2, to_list/1, to_list/2, size/1]}). --module(gleeunit_progress). --behaviour(eunit_listener). --define(NOTEST, true). --include_lib("eunit/include/eunit.hrl"). - --define(RED, "\e[0;31m"). --define(GREEN, "\e[0;32m"). --define(YELLOW, "\e[0;33m"). --define(WHITE, "\e[0;37m"). --define(CYAN, "\e[0;36m"). --define(RESET, "\e[0m"). - --record(node,{ - rank = 0 :: non_neg_integer(), - key :: term(), - value :: term(), - children = new() :: binomial_heap() - }). - --export_type([binomial_heap/0, heap_node/0]). --type binomial_heap() :: [ heap_node() ]. --type heap_node() :: #node{}. - -%% eunit_listener callbacks --export([ - init/1, - handle_begin/3, - handle_end/3, - handle_cancel/3, - terminate/2, - start/0, - start/1 - ]). - -%% -- binomial_heap.erl content start -- - --record(state, { - status = dict:new() :: euf_dict(), - failures = [] :: [[pos_integer()]], - skips = [] :: [[pos_integer()]], - timings = new() :: binomial_heap(), - colored = true :: boolean(), - profile = false :: boolean() - }). - --type euf_dict() :: dict:dict(). - --spec new() -> binomial_heap(). -new() -> - []. - -% Inserts a new pair into the heap (or creates a new heap) --spec insert(term(), term()) -> binomial_heap(). -insert(Key,Value) -> - insert(Key,Value,[]). - --spec insert(term(), term(), binomial_heap()) -> binomial_heap(). -insert(Key,Value,Forest) -> - insTree(#node{key=Key,value=Value},Forest). - -% Merges two heaps --spec merge(binomial_heap(), binomial_heap()) -> binomial_heap(). -merge(TS1,[]) when is_list(TS1) -> TS1; -merge([],TS2) when is_list(TS2) -> TS2; -merge([#node{rank=R1}=T1|TS1]=F1,[#node{rank=R2}=T2|TS2]=F2) -> - if - R1 < R2 -> - [T1 | merge(TS1,F2)]; - R2 < R1 -> - [T2 | merge(F1, TS2)]; - true -> - insTree(link(T1,T2),merge(TS1,TS2)) - end. - -% Deletes the top entry from the heap and returns it --spec delete(binomial_heap()) -> {{term(), term()}, binomial_heap()}. -delete(TS) -> - {#node{key=Key,value=Value,children=TS1},TS2} = getMin(TS), - {{Key,Value},merge(lists:reverse(TS1),TS2)}. - -% Turns the heap into list in heap order --spec to_list(binomial_heap()) -> [{term(), term()}]. -to_list([]) -> []; -to_list(List) when is_list(List) -> - to_list([],List). -to_list(Acc, []) -> - lists:reverse(Acc); -to_list(Acc,Forest) -> - {Next, Trees} = delete(Forest), - to_list([Next|Acc], Trees). - -% Take N elements from the top of the heap --spec take(non_neg_integer(), binomial_heap()) -> [{term(), term()}]. -take(N,Trees) when is_integer(N), is_list(Trees) -> - take(N,Trees,[]). -take(0,_Trees,Acc) -> - lists:reverse(Acc); -take(_N,[],Acc)-> - lists:reverse(Acc); -take(N,Trees,Acc) -> - {Top,T2} = delete(Trees), - take(N-1,T2,[Top|Acc]). - -% Get an estimate of the size based on the binomial property --spec size(binomial_heap()) -> non_neg_integer(). -size(Forest) -> - erlang:trunc(lists:sum([math:pow(2,R) || #node{rank=R} <- Forest])). - -%% Private API --spec link(heap_node(), heap_node()) -> heap_node(). -link(#node{rank=R,key=X1,children=C1}=T1,#node{key=X2,children=C2}=T2) -> - case X1 < X2 of - true -> - T1#node{rank=R+1,children=[T2|C1]}; - _ -> - T2#node{rank=R+1,children=[T1|C2]} - end. - -insTree(Tree, []) -> - [Tree]; -insTree(#node{rank=R1}=T1, [#node{rank=R2}=T2|Rest] = TS) -> - case R1 < R2 of - true -> - [T1|TS]; - _ -> - insTree(link(T1,T2),Rest) - end. - -getMin([T]) -> - {T,[]}; -getMin([#node{key=K} = T|TS]) -> - {#node{key=K1} = T1,TS1} = getMin(TS), - case K < K1 of - true -> {T,TS}; - _ -> {T1,[T|TS1]} - end. - -%% -- binomial_heap.erl content end -- - -%% Startup -start() -> - start([]). - -start(Options) -> - eunit_listener:start(?MODULE, Options). - -%%------------------------------------------ -%% eunit_listener callbacks -%%------------------------------------------ -init(Options) -> - #state{colored=proplists:get_bool(colored, Options), - profile=proplists:get_bool(profile, Options)}. - -handle_begin(group, Data, St) -> - GID = proplists:get_value(id, Data), - Dict = St#state.status, - St#state{status=dict:store(GID, orddict:from_list([{type, group}|Data]), Dict)}; -handle_begin(test, Data, St) -> - TID = proplists:get_value(id, Data), - Dict = St#state.status, - St#state{status=dict:store(TID, orddict:from_list([{type, test}|Data]), Dict)}. - -handle_end(group, Data, St) -> - St#state{status=merge_on_end(Data, St#state.status)}; -handle_end(test, Data, St) -> - NewStatus = merge_on_end(Data, St#state.status), - St1 = print_progress(Data, St), - St2 = record_timing(Data, St1), - St2#state{status=NewStatus}. - -handle_cancel(_, Data, #state{status=Status, skips=Skips}=St) -> - Status1 = merge_on_end(Data, Status), - ID = proplists:get_value(id, Data), - St#state{status=Status1, skips=[ID|Skips]}. - -terminate({ok, Data}, St) -> - print_failures(St), - print_pending(St), - print_profile(St), - print_timing(St), - print_results(Data, St); -terminate({error, Reason}, St) -> - io:nl(), io:nl(), - print_colored(io_lib:format("Eunit failed: ~25p~n", [Reason]), ?RED, St), - sync_end(error). - -sync_end(Result) -> - receive - {stop, Reference, ReplyTo} -> - ReplyTo ! {result, Reference, Result}, - ok - end. - -%%------------------------------------------ -%% Print and collect information during run -%%------------------------------------------ -print_progress(Data, St) -> - TID = proplists:get_value(id, Data), - case proplists:get_value(status, Data) of - ok -> - print_progress_success(St), - St; - {skipped, _Reason} -> - print_progress_skipped(St), - St#state{skips=[TID|St#state.skips]}; - {error, Exception} -> - print_progress_failed(Exception, St), - St#state{failures=[TID|St#state.failures]} - end. - -record_timing(Data, State=#state{timings=T, profile=true}) -> - TID = proplists:get_value(id, Data), - case lists:keyfind(time, 1, Data) of - {time, Int} -> - %% It's a min-heap, so we insert negative numbers instead - %% of the actuals and normalize when we report on them. - T1 = insert(-Int, TID, T), - State#state{timings=T1}; - false -> - State - end; -record_timing(_Data, State) -> - State. - -print_progress_success(St) -> - print_colored(".", ?GREEN, St). - -print_progress_skipped(St) -> - print_colored("*", ?YELLOW, St). - -print_progress_failed(_Exc, St) -> - print_colored("F", ?RED, St). - -merge_on_end(Data, Dict) -> - ID = proplists:get_value(id, Data), - dict:update(ID, - fun(Old) -> - orddict:merge(fun merge_data/3, Old, orddict:from_list(Data)) - end, Dict). - -merge_data(_K, undefined, X) -> X; -merge_data(_K, X, undefined) -> X; -merge_data(_K, _, X) -> X. - -%%------------------------------------------ -%% Print information at end of run -%%------------------------------------------ -print_failures(#state{failures=[]}) -> - ok; -print_failures(#state{failures=Fails}=State) -> - io:nl(), - io:fwrite("Failures:~n",[]), - lists:foldr(print_failure_fun(State), 1, Fails), - ok. - -print_failure_fun(#state{status=Status}=State) -> - fun(Key, Count) -> - TestData = dict:fetch(Key, Status), - TestId = format_test_identifier(TestData), - io:fwrite("~n ~p) ~ts~n", [Count, TestId]), - print_failure_reason(proplists:get_value(status, TestData), - proplists:get_value(output, TestData), - State), - io:nl(), - Count + 1 - end. - -print_gleam_location(#{function := Function, line := Line, module := Module }, State) -> - X = indent(5, "location: ~s.~s:~p~n", [Module, Function, Line]), - print_colored(X, ?CYAN, State); -print_gleam_location(_, _) -> - ok. - -inspect(X) -> - gleam@string:inspect(X). - -print_gleam_failure_reason( - #{gleam_error := assert, message := Message, value := Value}, - State -) -> - print_colored(indent(5, "~s~n", [Message]), ?RED, State), - print_colored(indent(5, " value: ", []), ?RED, State), - print_colored(indent(0, "~ts~n", [inspect(Value)]), ?RESET, State); -print_gleam_failure_reason( - #{gleam_error := todo, message := Message}, - State -) -> - print_colored(indent(5, "todo expression run~n", []), ?RED, State), - print_colored(indent(5, " message: ", []), ?RED, State), - print_colored(indent(0, "~s~n", [Message]), ?RESET, State); -print_gleam_failure_reason(Error, State) -> - print_colored(indent(5, "~p~n", [Error]), ?RED, State). - -% New Gleeunit specific formatters -print_failure_reason( - {error, {error, #{gleam_error := _} = Error, Stack}}, Output, State -) when is_list(Stack) -> - print_gleam_failure_reason(Error, State), - print_gleam_location(Error, State), - print_stack(Stack, State), - print_failure_output(5, Output, State); -print_failure_reason({error, {error, {case_clause, Value}, Stack}}, Output, State) when is_list(Stack) -> - print_colored(indent(5, "No case clause matched~n", []), ?RED, State), - print_colored(indent(5, "Value: ", []), ?CYAN, State), - print_colored(indent(0, "~ts~n", [inspect(Value)]), ?RESET, State), - print_stack(Stack, State), - print_failure_output(5, Output, State); -% From the original Erlang version -print_failure_reason({skipped, Reason}, _Output, State) -> - print_colored(io_lib:format(" ~ts~n", [format_pending_reason(Reason)]), - ?RED, State); -print_failure_reason({error, {_Class, Term, _}}, Output, State) when - is_tuple(Term), tuple_size(Term) == 2, is_list(element(2, Term)) -> - print_assertion_failure(Term, State), - print_failure_output(5, Output, State); -print_failure_reason({error, {error, Error, Stack}}, Output, State) when is_list(Stack) -> - print_colored(indent(5, "Failure: ~p~n", [Error]), ?RED, State), - print_stack(Stack, State), - print_failure_output(5, Output, State); -print_failure_reason({error, Reason}, Output, State) -> - print_colored(indent(5, "Failure: ~p~n", [Reason]), ?RED, State), - print_failure_output(5, Output, State). - -gleam_format_module_name(Module) -> - string:replace(atom_to_list(Module), "@", "/", all). - -print_stack(Stack, State) -> - print_colored(indent(5, "stacktrace:~n", []), ?CYAN, State), - print_stackframes(Stack, State). -print_stackframes([{eunit_test, _, _, _} | Stack], State) -> - print_stackframes(Stack, State); -print_stackframes([{eunit_proc, _, _, _} | Stack], State) -> - print_stackframes(Stack, State); -print_stackframes([{Module, Function, _Arity, _Location} | Stack], State) -> - GleamModule = gleam_format_module_name(Module), - print_colored(indent(7, "~s.~p~n", [GleamModule, Function]), ?CYAN, State), - print_stackframes(Stack, State); -print_stackframes([], _State) -> - ok. - - -print_failure_output(_, <<>>, _) -> ok; -print_failure_output(_, undefined, _) -> ok; -print_failure_output(Indent, Output, State) -> - print_colored(indent(Indent, "output: ~ts", [Output]), ?CYAN, State). - -print_assertion_failure({Type, Props}, State) -> - FailureDesc = format_assertion_failure(Type, Props, 5), - print_colored(FailureDesc, ?RED, State), - io:nl(). - -print_pending(#state{skips=[]}) -> - ok; -print_pending(#state{status=Status, skips=Skips}=State) -> - io:nl(), - io:fwrite("Pending:~n", []), - lists:foreach(fun(ID) -> - Info = dict:fetch(ID, Status), - case proplists:get_value(reason, Info) of - undefined -> - ok; - Reason -> - print_pending_reason(Reason, Info, State) - end - end, lists:reverse(Skips)), - io:nl(). - -print_pending_reason(Reason0, Data, State) -> - Text = case proplists:get_value(type, Data) of - group -> - io_lib:format(" ~ts~n", [proplists:get_value(desc, Data)]); - test -> - io_lib:format(" ~ts~n", [format_test_identifier(Data)]) - end, - Reason = io_lib:format(" %% ~ts~n", [format_pending_reason(Reason0)]), - print_colored(Text, ?YELLOW, State), - print_colored(Reason, ?CYAN, State). - -print_profile(#state{timings=T, status=Status, profile=true}=State) -> - TopN = take(10, T), - TopNTime = abs(lists:sum([ Time || {Time, _} <- TopN ])), - TLG = dict:fetch([], Status), - TotalTime = proplists:get_value(time, TLG), - if TotalTime =/= undefined andalso TotalTime > 0 andalso TopN =/= [] -> - TopNPct = (TopNTime / TotalTime) * 100, - io:nl(), io:nl(), - io:fwrite("Top ~p slowest tests (~ts, ~.1f% of total time):", [length(TopN), format_time(TopNTime), TopNPct]), - lists:foreach(print_timing_fun(State), TopN), - io:nl(); - true -> ok - end; -print_profile(#state{profile=false}) -> - ok. - -print_timing(#state{status=Status}) -> - TLG = dict:fetch([], Status), - Time = proplists:get_value(time, TLG), - io:nl(), - io:fwrite("Finished in ~ts~n", [format_time(Time)]), - ok. - -print_results(Data, State) -> - Pass = proplists:get_value(pass, Data, 0), - Fail = proplists:get_value(fail, Data, 0), - Skip = proplists:get_value(skip, Data, 0), - Cancel = proplists:get_value(cancel, Data, 0), - Total = Pass + Fail + Skip + Cancel, - {Color, Result} = if Fail > 0 -> {?RED, error}; - Skip > 0; Cancel > 0 -> {?YELLOW, error}; - Pass =:= 0 -> {?YELLOW, ok}; - true -> {?GREEN, ok} - end, - print_results(Color, Total, Fail, Skip, Cancel, State), - sync_end(Result). - -print_results(Color, 0, _, _, _, State) -> - print_colored(Color, "0 tests\n", State); -print_results(Color, Total, Fail, Skip, Cancel, State) -> - SkipText = format_optional_result(Skip, "skipped"), - CancelText = format_optional_result(Cancel, "cancelled"), - Text = io_lib:format("~p tests, ~p failures~ts~ts~n", [Total, Fail, SkipText, CancelText]), - print_colored(Text, Color, State). - -print_timing_fun(#state{status=Status}=State) -> - fun({Time, Key}) -> - TestData = dict:fetch(Key, Status), - TestId = format_test_identifier(TestData), - io:nl(), - io:fwrite(" ~ts~n", [TestId]), - print_colored([" "|format_time(abs(Time))], ?CYAN, State) - end. - -%%------------------------------------------ -%% Print to the console with the given color -%% if enabled. -%%------------------------------------------ -print_colored(Text, Color, #state{colored=true}) -> - io:fwrite("~s~ts~s", [Color, Text, ?RESET]); -print_colored(Text, _Color, #state{colored=false}) -> - io:fwrite("~ts", [Text]). - -%%------------------------------------------ -%% Generic data formatters -%%------------------------------------------ -format_function_name(M, F) -> - M1 = gleam_format_module_name(M), - io_lib:format("~ts.~ts", [M1, F]). - -format_optional_result(0, _) -> - []; -format_optional_result(Count, Text) -> - io_lib:format(", ~p ~ts", [Count, Text]). - -format_test_identifier(Data) -> - {Mod, Fun, _} = proplists:get_value(source, Data), - Line = case proplists:get_value(line, Data) of - 0 -> ""; - L -> io_lib:format(":~p", [L]) - end, - Desc = case proplists:get_value(desc, Data) of - undefined -> ""; - DescText -> io_lib:format(": ~ts", [DescText]) - end, - io_lib:format("~ts~ts~ts", [format_function_name(Mod, Fun), Line, Desc]). - -format_time(undefined) -> - "? seconds"; -format_time(Time) -> - io_lib:format("~.3f seconds", [Time / 1000]). - -format_pending_reason({module_not_found, M}) -> - M1 = gleam_format_module_name(M), - io_lib:format("Module '~ts' missing", [M1]); -format_pending_reason({no_such_function, {M,F,_}}) -> - M1 = gleam_format_module_name(M), - io_lib:format("Function ~ts undefined", [format_function_name(M1,F)]); -format_pending_reason({exit, Reason}) -> - io_lib:format("Related process exited with reason: ~p", [Reason]); -format_pending_reason(Reason) -> - io_lib:format("Unknown error: ~p", [Reason]). - -%% @doc Formats all the known eunit assertions, you're on your own if -%% you make an assertion yourself. -format_assertion_failure(Type, Props, I) when Type =:= assertion_failed - ; Type =:= assert -> - Keys = proplists:get_keys(Props), - HasEUnitProps = ([expression, value] -- Keys) =:= [], - HasHamcrestProps = ([expected, actual, matcher] -- Keys) =:= [], - if - HasEUnitProps -> - [indent(I, "Failure: ?assert(~ts)~n", [proplists:get_value(expression, Props)]), - indent(I, " expected: true~n", []), - case proplists:get_value(value, Props) of - false -> - indent(I, " got: false", []); - {not_a_boolean, V} -> - indent(I, " got: ~p", [V]) - end]; - HasHamcrestProps -> - [indent(I, "Failure: ?assertThat(~p)~n", [proplists:get_value(matcher, Props)]), - indent(I, " expected: ~ts~n", [inspect(proplists:get_value(expected, Props))]), - indent(I, " got: ~ts", [inspect(proplists:get_value(actual, Props))])]; - true -> - [indent(I, "Failure: unknown assert: ~p", [Props])] - end; - -format_assertion_failure(Type, Props, I) when Type =:= assertMatch_failed - ; Type =:= assertMatch -> - Expr = proplists:get_value(expression, Props), - Pattern = proplists:get_value(pattern, Props), - Value = proplists:get_value(value, Props), - [indent(I, "Failure: ?assertMatch(~ts, ~ts)~n", [Pattern, Expr]), - indent(I, " expected: = ~ts~n", [Pattern]), - indent(I, " got: ~p", [Value])]; - -format_assertion_failure(Type, Props, I) when Type =:= assertNotMatch_failed - ; Type =:= assertNotMatch -> - Expr = proplists:get_value(expression, Props), - Pattern = proplists:get_value(pattern, Props), - Value = proplists:get_value(value, Props), - [indent(I, "Failure: ?assertNotMatch(~ts, ~ts)~n", [Pattern, Expr]), - indent(I, " expected not: = ~ts~n", [Pattern]), - indent(I, " got: ~p", [Value])]; - -format_assertion_failure(Type, Props, I) when Type =:= assertEqual_failed - ; Type =:= assertEqual -> - Expected = inspect(proplists:get_value(expected, Props)), - Value = inspect(proplists:get_value(value, Props)), - [indent(I, "Values were not equal~n", []), - indent(I, "expected: ~ts~n", [Expected]), - indent(I, " got: ~ts", [Value])]; - -format_assertion_failure(Type, Props, I) when Type =:= assertNotEqual_failed - ; Type =:= assertNotEqual -> - Value = inspect(proplists:get_value(value, Props)), - [indent(I, "Values were equal~n", []), - indent(I, "expected: not ~ts~n,", [Value]), - indent(I, " got: ~ts", [Value])]; - -format_assertion_failure(Type, Props, I) when Type =:= assertException_failed - ; Type =:= assertException -> - Expr = proplists:get_value(expression, Props), - Pattern = proplists:get_value(pattern, Props), - {Class, Term} = extract_exception_pattern(Pattern), % I hate that we have to do this, why not just give DATA - [indent(I, "Failure: ?assertException(~ts, ~ts, ~ts)~n", [Class, Term, Expr]), - case proplists:is_defined(unexpected_success, Props) of - true -> - [indent(I, " expected: exception ~ts but nothing was raised~n", [Pattern]), - indent(I, " got: value ~p", [proplists:get_value(unexpected_success, Props)])]; - false -> - Ex = proplists:get_value(unexpected_exception, Props), - [indent(I, " expected: exception ~ts~n", [Pattern]), - indent(I, " got: exception ~p", [Ex])] - end]; - -format_assertion_failure(Type, Props, I) when Type =:= assertNotException_failed - ; Type =:= assertNotException -> - Expr = proplists:get_value(expression, Props), - Pattern = proplists:get_value(pattern, Props), - {Class, Term} = extract_exception_pattern(Pattern), % I hate that we have to do this, why not just give DAT - Ex = proplists:get_value(unexpected_exception, Props), - [indent(I, "Failure: ?assertNotException(~ts, ~ts, ~ts)~n", [Class, Term, Expr]), - indent(I, " expected not: exception ~ts~n", [Pattern]), - indent(I, " got: exception ~p", [Ex])]; - -format_assertion_failure(Type, Props, I) when Type =:= command_failed - ; Type =:= command -> - Cmd = proplists:get_value(command, Props), - Expected = proplists:get_value(expected_status, Props), - Status = proplists:get_value(status, Props), - [indent(I, "Failure: ?cmdStatus(~p, ~p)~n", [Expected, Cmd]), - indent(I, " expected: status ~p~n", [Expected]), - indent(I, " got: status ~p", [Status])]; - -format_assertion_failure(Type, Props, I) when Type =:= assertCmd_failed - ; Type =:= assertCmd -> - Cmd = proplists:get_value(command, Props), - Expected = proplists:get_value(expected_status, Props), - Status = proplists:get_value(status, Props), - [indent(I, "Failure: ?assertCmdStatus(~p, ~p)~n", [Expected, Cmd]), - indent(I, " expected: status ~p~n", [Expected]), - indent(I, " got: status ~p", [Status])]; - -format_assertion_failure(Type, Props, I) when Type =:= assertCmdOutput_failed - ; Type =:= assertCmdOutput -> - Cmd = proplists:get_value(command, Props), - Expected = proplists:get_value(expected_output, Props), - Output = proplists:get_value(output, Props), - [indent(I, "Failure: ?assertCmdOutput(~p, ~p)~n", [Expected, Cmd]), - indent(I, " expected: ~p~n", [Expected]), - indent(I, " got: ~p", [Output])]; - -format_assertion_failure(Type, Props, I) -> - indent(I, "~p", [{Type, Props}]). - -indent(I, Fmt, Args) -> - io_lib:format("~" ++ integer_to_list(I) ++ "s" ++ Fmt, [" "|Args]). - -extract_exception_pattern(Str) -> - ["{", Class, Term|_] = re:split(Str, "[, ]{1,2}", [unicode,{return,list}]), - {Class, Term}. diff --git a/build/dev/erlang/gleeunit/ebin/gleeunit.app b/build/dev/erlang/gleeunit/ebin/gleeunit.app deleted file mode 100644 index eefe533..0000000 --- a/build/dev/erlang/gleeunit/ebin/gleeunit.app +++ /dev/null @@ -1,7 +0,0 @@ -{application, gleeunit, [ - {vsn, "0.11.0"}, - {applications, [gleam_stdlib]}, - {description, "Gleam bindings to Erlang's EUnit test framework"}, - {modules, []}, - {registered, []} -]}. diff --git a/build/dev/erlang/gleeunit/ebin/gleeunit.beam b/build/dev/erlang/gleeunit/ebin/gleeunit.beam deleted file mode 100644 index 32d40599a4a8e3b18176640e35de3bae1e03e0d9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3164 zcmcImdpuO>8$V-)xwsw1HJ4_)kjNlyBAN)f%XPaYHY0??g`!BygSeb1AvTi9mzDb9giw@F zaoNI-Lt=ASas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%pNR9rKho|%U!y4cYP ztiIj8{r3-Q=j4pe-P#Z+*H)<@G43xv=(h?=op~xy_jZ$D^_*iRgVSRtG^R4E-YD0) z$nKlDk-nys9;B8vX`vW*M(^ob-KXkvc6+Q_-dwEO|M=y-yZaMbYwoUhGmpw+jc<$? zCv}_T()V7opUW^=%*^lXtUgpc=wHK3nY^v>ADg}l)#lw-v`r>_fx#9okx2AQ6;JoHHex-Eus#QLR?2&Pc$NK hB$^Vp63vL#M8p5*$p`qw@zK1{JDT*2U;PyT{tG+(uR{O; diff --git a/build/dev/erlang/gleeunit/ebin/gleeunit@should.beam b/build/dev/erlang/gleeunit/ebin/gleeunit@should.beam deleted file mode 100644 index 44a7d3dbd50d4cf6a54dc5855b2190b51f6ae61d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2036 zcmcgti(3;{7N3~_A!5joAYiKysfrIIP+6c#F+2jxLr8cCqI_YJOh`h=J7A;&E%Fk1 z$fG)nMH;9@YjtI-uAr@0ZELqROSL}uM8&e8vQ#WWF)i$!2>tr)AF%iPe)s(5ch0$U z=H}j$=%nNT2%?Tg@WMBT8`44`2>Kj=$;eUSxKSlHaP=~^Q7N&@dc?^2n)h|4#5w&gA@m}1Aaz82y+1n!Hy`GNl8Sxu%pW> z356Y*TndX+*?bBpF2$fr1qO=E(~vd+zyW}C*#RJPoYdyIBjE6yzF>~K0L%Ozj_`Ka z*3gXI z4A>>5N-)DRqyWWLm`I6Bgi;(c767m%+vIu_|soje76rr{Wl%i#yryyZPvPxUG|P*ufKJ$ZVEZSDZ9t}kXvi}jfxh*rn_FU ztLF|SJ8yk5EH7HVZFbRVvGV&qx3vwkQN;nV9Obz4bZ~`T=C7v4U%#Y!OCeQ&)LiS$+J0_VXgyoGI(Lu9?lpOn`Kxx;oa_2F zg*bx!ysRq^pwy1v+neiqtJG6nl+sTb_-$S7b;7QGx$Ngi>b84(M?3%dIpb_x$jFeHr71pJ z9oYJ9%oWd786GYZ4==cddxc$dT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X+(8Z^*DrUBq{S>|J6|(|+Z_Bhr#e-Z?KQE2*L!uzmn930{>S*+6*)|x(OR!=@ zPTn3Y{W%6FjF-$$Oq9RJi}C}C_nDs;>G|RMYKL+N%8B3uQtQVdqiu(tZHM}gp<%NZ z_ggv+rqA6}WA3*idF=3~eL4Qyf-{!;U~u+d{2>w>89nr!{G$SPnQIcQfiGCK?1TIP zyoK~Sv?Eza7Y-WD5h6ZdO`l@vsY-wsL{5G)?(7wm^QfC28ye1Bh8M_<|2u5rYc3An zAK3HHOl^f1P3XVXKvvh3L@m)9p1 z=PXA3Tmy7m9b5vvwL`|6>podml@9Fctq7$J%(MAPH?ogbtC_0SCT|19U+@aes#;gh zWS-wp6)V?H9Xet^TzrTBwrb+#$A^?}+8`=Q>e?;>42q`D-`}9Wy{g*yn*3FbpU2#^M30C_+OPyt>6nt&Fd4OjwJfHhzX*aHrL2jC6(0RBKI5CKF3 zDL@*K4&(s2KpyZ3CUK{k*b zW~Jc328yvkRtRF zf*>VG8BziF!2|FR`~&_4kHItW1iS>Vz-#ap(uWKnBgh!61?#|iumSu6Hi8bIBZvp$ zg8)bX5`sh^F-QU&1ONVC6jij)*L0$v!RKiHqccOma3?K|_Wv0KnD`j4A7G;8ZGsqI Q|4#`mvUB%;5eEK$0Ta&AnE(I) diff --git a/build/dev/javascript/gleam.lock b/build/dev/javascript/gleam.lock deleted file mode 100644 index e69de29..0000000 diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@base.cache b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@base.cache deleted file mode 100644 index 10bcc7855ffc29714c2f436f48e81402011500a8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1639 zcmd5+&ui0A9M4OdW-XTTrEDxx>8lKsvbD7xW9+gyoJc8ZT4k`ymYBCRHBBT*@htc+ zc=R&-3%m)Q{4W&o;KBbw;(IUcn%1m%l3kLQe8bD<=WD)02U%D>fvN&ktAw%&6o#eW z@}0}(5yc0-i34@d@-7X*X^0dfuPt|-w-hF%fm_8`}S zoU-2!ecQDv9Msd~=y<TOV4peoU!9r8^CG}}gbY&(~G z$_N2;v<-Hk38+71W!d9RCg*Tm#gCY(QYdbxe&o8095diw>5r+T( diff --git a/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_builder.cache b/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_builder.cache deleted file mode 100644 index 5b19db23b035732fa87fac6f08b82d05d4c4df75..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7594 zcmdT}Pi!M+6`wa_$A8w2`!aFaU9@G$Z@$KODnajBB2$i3ql-vLOoPfZ=hBPsjVm+5OAvii9Z*(nD>1%izvrR!64$j0)e*%%%ELWe)|!}sI+r5}*x>Ms%prFRl^_%OLz`c0A!Pp9scE~V(O zkiJ)XCQXOGrFTmI97Hy?$Gs-463Yv`o{>Uf2Zr;Q=rboK(!N~w&~hG zL4WCbF%9YlT{{_259qp&puSDlfl6l;I$L&QmvFVgv}ywGSXBU-k`?_HL=lpb1RzP6 znAb1KiX`a~`b|LEnEnX|vgF$I*437jV2E-Cj2>X4u}%4R@Q_H%*7p=Mid)cb|CwiB4tD zWo5_Qmw-`za#-t!!8$>HazM{wqJW85>;=osiMk=61#(6Gc@AJ3pNEC4E%%!dj#rVn zE!%S98abhny-aItiL;N~Qx1p5WrPf&#JzI*Ve8_M+ZFD^;^mX<DEj*%`cy7WDwidB#G|mU>S!y%Zzt9ZG;xHV z1O$jk0ZXt#cmgaF#n68M)&W39cxojsV|ocwl!&M4_p;O4+A?oZ*Kr$?wD{Ml7h>JG zfR`lYijTRUE&qScenY?DarOnkQ@uPIwl@q>%BSz*FEMkK-ExnEKUr$?h518QgP=~m|V;p)} z`I(X-hIM?0nnMnKuHT^|rVE%BW&Eg&9BL=GV~m|m<+jrCdrdjuPoISbgK*6c!f4Z3 z!np#@9f^e=nQjH+G(EcIj3Y-!tPk_Fqxp?T<&DQ9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/_gleam_artefacts/gleam@bit_string.cache deleted file mode 100644 index 6856346359cbb31940fbef9d944ff5edd15d1213..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3785 zcmdT{&u<$=6yDj5z40cNHMFisMVqPHs7cf~bWKI%15VPWf~tb99aL0WC2M=^Olt31 zyW=LQKt+NBih4qb6NplA>H$>2i9dh?5)v1LD#4u#5=bBchnhFD>(p-7p_Ph&%jWHj zXXpL+zVE#}eO;T6lm5Ei=SdeC{!)t|-A8yeg?` zgO%sig=bVu^HvpUdv2p*>2n0e>uS05h6=`#wqAN(1LG&{YUyWTd@y8|-X8*^9bYeP z#=)TanbMjL#+~6}>HA?YeoI^^{hk2hBV)02!vN#bNWOG&1dOfGV(GO}q!sK|i#k<= ztWj07uA>-6hN2*(C^&K6I;U!iVhzI+;R8i{$i#CFL!$ z?lK3GO!$TiJC5x!>Sqmu96n5zHtlAsL49~zU0szv8{|0>WMPuKc~bM-W>}@kOu5ZD z^)ge(h~KW&*yerPwZ>LvYRZT@Bex7P4!0NvLgx^I5Yf?vVHGFycogE?56?pIS*SI4 z6(#qU_O;e2Z*jWfv#ScCVOgquWtp{($+8T|vh12xk@gHum^h*9FF1UsMlr}UE?TF= zpKW{!9Z#ET@4eAEFH+w29A784Lzu&9oqA+rjaAkN^9f(0#A!Fnu;$jF2v8jOkzDQ; zXWXen6%>^F107U5-8?Hglxjerlf8lFgFp%rarf}{_t1hM%hr4l>paBzC+fdEI@*)2 zbA@_5?gPYLUOqiDM^=NIR|(&0QIP=`wmf@-taf=&hrI%9$}sU)zjmtbiY%v+f`U@u zl3>|CQ_j3a1bc2`0`VG!26gIut&`2pN{}Ofw9uKX-dy(;HTRzSnJT=KRZt26cLw