From 3f505f24bcb9daf0bd3c87849398c1d8603d4d20 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 5 Jun 2026 14:39:56 +0000 Subject: [PATCH 1/2] =?UTF-8?q?chore(betlang):=20housekeeping=20=E2=80=94?= =?UTF-8?q?=20axiom-free=20doc=20reconciliation,=20rot=20untrack,=20SPDX,?= =?UTF-8?q?=20license=20badge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reconcile docs to the axiom-free reality. substTop_preserves_typing is a proved theorem (proofs/BetLang.lean:918), verified by `lake build`; zero `axiom` declarations remain. Six artefacts still called it a live axiom: - docs/proof-debt.adoc: move substTop from §(c) NECESSARY AXIOM to §(a) DISCHARGED; marker count 1 -> 0. - PROOF-STATUS.md: TP-4 -> Done; axiom-free note; banned-patterns wording. - PROOF-NEEDS.md: TP-4 status -> done. - .machine_readable/6a2/STATE.a2ml: M4 done; axioms=[]; remaining 10->9; drop already-merged-PR (#53/#54/#55) next-actions. - README.md / README.adoc / EXPLAINME.adoc: "one permitted axiom" -> axiom-free. Untrack build rot + tidy: - remove 8 stale *.bak.20250719-182140 backups. - untrack 321 Gleam build artefacts under lsp/bet-lsp/build/ (already gitignored). - remove broken root symlink SPEC.core.scm (target migrated .scm -> .a2ml). - gitignore lake-manifest.json (zero-dep project; regenerated on every build). Conformance: - add SPDX headers to core/betlang.rkt, lib/ternary.rkt, repl/shell.rkt, tests/basics.rkt (Mustfile requires SPDX on .rkt). - drop redundant/incorrect PMPL-1.0 license badge (LICENSE + SPDX = MPL-2.0). Verified: `lake build` green (Lean v4.15.0), tools/proof-scan.sh clean, working tree clean. No Lean sources changed. https://claude.ai/code/session_01VwbFNQJw23tW8tqM7utWku --- .gitignore | 1 + .machine_readable/6a2/STATE.a2ml | 17 +- EXPLAINME.adoc | 9 +- PROOF-NEEDS.md | 2 +- PROOF-STATUS.md | 15 +- README.adoc | 4 +- README.md | 5 +- SPEC.core.scm | 1 - core/betlang.rkt | 2 + core/betlang.rkt.bak.20250719-182140 | 9 - docs/architecture.md.bak.20250719-182140 | 8 - docs/proof-debt.adoc | 68 +- docs/semantics.md.bak.20250719-182140 | 14 - homepage/index.html.bak.20250719-182140 | 17 - homepage/style.css.bak.20250719-182141 | 13 - lib/ternary.rkt | 2 + lib/ternary.rkt.bak.20250719-182140 | 6 - .../gleam_stdlib/_gleam_artefacts/dict.mjs | 710 ---- .../_gleam_artefacts/gleam@@compile.erl | 180 -- .../_gleam_artefacts/gleam@bit_array.cache | Bin 14764 -> 0 bytes .../gleam@bit_array.cache_inline | Bin 8 -> 0 bytes .../gleam@bit_array.cache_meta | Bin 1253 -> 0 bytes .../_gleam_artefacts/gleam@bit_array.erl | 347 -- .../_gleam_artefacts/gleam@bool.cache | Bin 8850 -> 0 bytes .../_gleam_artefacts/gleam@bool.cache_inline | Bin 1449 -> 0 bytes .../_gleam_artefacts/gleam@bool.cache_meta | Bin 1317 -> 0 bytes .../_gleam_artefacts/gleam@bool.erl | 352 -- .../_gleam_artefacts/gleam@bytes_tree.cache | Bin 13613 -> 0 bytes .../gleam@bytes_tree.cache_inline | Bin 8 -> 0 bytes .../gleam@bytes_tree.cache_meta | Bin 903 -> 0 bytes .../_gleam_artefacts/gleam@bytes_tree.erl | 211 -- .../_gleam_artefacts/gleam@dict.cache | Bin 28261 -> 0 bytes .../_gleam_artefacts/gleam@dict.cache_inline | Bin 8 -> 0 bytes .../_gleam_artefacts/gleam@dict.cache_meta | Bin 2441 -> 0 bytes .../_gleam_artefacts/gleam@dict.erl | 521 --- .../_gleam_artefacts/gleam@dynamic.cache | Bin 7151 -> 0 bytes .../gleam@dynamic.cache_inline | Bin 8 -> 0 bytes .../_gleam_artefacts/gleam@dynamic.cache_meta | Bin 479 -> 0 bytes .../_gleam_artefacts/gleam@dynamic.erl | 106 - .../gleam@dynamic@decode.cache | Bin 60584 -> 0 bytes .../gleam@dynamic@decode.cache_inline | Bin 8 -> 0 bytes .../gleam@dynamic@decode.cache_meta | Bin 4650 -> 0 bytes .../_gleam_artefacts/gleam@dynamic@decode.erl | 1112 ------- .../_gleam_artefacts/gleam@float.cache | Bin 24078 -> 0 bytes .../_gleam_artefacts/gleam@float.cache_inline | Bin 8 -> 0 bytes .../_gleam_artefacts/gleam@float.cache_meta | Bin 2776 -> 0 bytes .../_gleam_artefacts/gleam@float.erl | 764 ----- .../_gleam_artefacts/gleam@function.cache | Bin 674 -> 0 bytes .../gleam@function.cache_inline | Bin 8 -> 0 bytes .../gleam@function.cache_meta | Bin 73 -> 0 bytes .../_gleam_artefacts/gleam@function.erl | 18 - .../_gleam_artefacts/gleam@int.cache | Bin 27832 -> 0 bytes .../_gleam_artefacts/gleam@int.cache_inline | Bin 8 -> 0 bytes .../_gleam_artefacts/gleam@int.cache_meta | Bin 3355 -> 0 bytes .../_gleam_artefacts/gleam@int.erl | 954 ------ .../_gleam_artefacts/gleam@io.cache | Bin 2707 -> 0 bytes .../_gleam_artefacts/gleam@io.cache_inline | Bin 8 -> 0 bytes .../_gleam_artefacts/gleam@io.cache_meta | Bin 289 -> 0 bytes .../_gleam_artefacts/gleam@io.erl | 80 - .../_gleam_artefacts/gleam@list.cache | Bin 88132 -> 0 bytes .../_gleam_artefacts/gleam@list.cache_inline | Bin 8 -> 0 bytes .../_gleam_artefacts/gleam@list.cache_meta | Bin 9786 -> 0 bytes .../_gleam_artefacts/gleam@list.erl | 2852 ----------------- .../_gleam_artefacts/gleam@option.cache | Bin 13728 -> 0 bytes .../gleam@option.cache_inline | Bin 8 -> 0 bytes .../_gleam_artefacts/gleam@option.cache_meta | Bin 1485 -> 0 bytes .../_gleam_artefacts/gleam@option.erl | 413 --- .../_gleam_artefacts/gleam@order.cache | Bin 5941 -> 0 bytes .../_gleam_artefacts/gleam@order.cache_inline | Bin 8 -> 0 bytes .../_gleam_artefacts/gleam@order.cache_meta | Bin 677 -> 0 bytes .../_gleam_artefacts/gleam@order.erl | 200 -- .../_gleam_artefacts/gleam@pair.cache | Bin 2770 -> 0 bytes .../_gleam_artefacts/gleam@pair.cache_inline | Bin 8 -> 0 bytes .../_gleam_artefacts/gleam@pair.cache_meta | Bin 393 -> 0 bytes .../_gleam_artefacts/gleam@pair.erl | 110 - .../_gleam_artefacts/gleam@result.cache | Bin 14634 -> 0 bytes .../gleam@result.cache_inline | Bin 3168 -> 0 bytes .../_gleam_artefacts/gleam@result.cache_meta | Bin 1827 -> 0 bytes .../_gleam_artefacts/gleam@result.erl | 532 --- .../_gleam_artefacts/gleam@set.cache | Bin 17215 -> 0 bytes .../_gleam_artefacts/gleam@set.cache_inline | Bin 8 -> 0 bytes .../_gleam_artefacts/gleam@set.cache_meta | Bin 1785 -> 0 bytes .../_gleam_artefacts/gleam@set.erl | 433 --- .../_gleam_artefacts/gleam@string.cache | Bin 38471 -> 0 bytes .../gleam@string.cache_inline | Bin 8 -> 0 bytes .../_gleam_artefacts/gleam@string.cache_meta | Bin 4057 -> 0 bytes .../_gleam_artefacts/gleam@string.erl | 1012 ------ .../_gleam_artefacts/gleam@string_tree.cache | Bin 14588 -> 0 bytes .../gleam@string_tree.cache_inline | Bin 8 -> 0 bytes .../gleam@string_tree.cache_meta | Bin 911 -> 0 bytes .../_gleam_artefacts/gleam@string_tree.erl | 207 -- .../_gleam_artefacts/gleam@uri.cache | Bin 33212 -> 0 bytes .../_gleam_artefacts/gleam@uri.cache_inline | Bin 8 -> 0 bytes .../_gleam_artefacts/gleam@uri.cache_meta | Bin 3297 -> 0 bytes .../_gleam_artefacts/gleam@uri.erl | 1049 ------ .../_gleam_artefacts/gleam_stdlib.erl | 534 --- .../_gleam_artefacts/gleam_stdlib.mjs | 1026 ------ .../gleam_stdlib/ebin/gleam@bit_array.beam | Bin 10328 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@bool.beam | Bin 4648 -> 0 bytes .../gleam_stdlib/ebin/gleam@bytes_tree.beam | Bin 5652 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@dict.beam | Bin 10312 -> 0 bytes .../gleam_stdlib/ebin/gleam@dynamic.beam | Bin 3312 -> 0 bytes .../ebin/gleam@dynamic@decode.beam | Bin 24728 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@float.beam | Bin 12012 -> 0 bytes .../gleam_stdlib/ebin/gleam@function.beam | Bin 1340 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@int.beam | Bin 12276 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@io.beam | Bin 2020 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@list.beam | Bin 50888 -> 0 bytes .../gleam_stdlib/ebin/gleam@option.beam | Bin 6244 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@order.beam | Bin 3352 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@pair.beam | Bin 2688 -> 0 bytes .../gleam_stdlib/ebin/gleam@result.beam | Bin 8412 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@set.beam | Bin 8944 -> 0 bytes .../gleam_stdlib/ebin/gleam@string.beam | Bin 18068 -> 0 bytes .../gleam_stdlib/ebin/gleam@string_tree.beam | Bin 5412 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam@uri.beam | Bin 23560 -> 0 bytes .../erlang/gleam_stdlib/ebin/gleam_stdlib.app | 26 - .../gleam_stdlib/ebin/gleam_stdlib.beam | Bin 27968 -> 0 bytes .../gleam@dynamic@decode_DecodeError.hrl | 5 - .../include/gleam@dynamic@decode_Decoder.hrl | 4 - .../gleam_stdlib/include/gleam@set_Set.hrl | 1 - .../gleam_stdlib/include/gleam@uri_Uri.hrl | 9 - lsp/bet-lsp/build/dev/erlang/gleam_version | 1 - lsp/bet-lsp/build/gleam-dev-erlang.lock | 0 lsp/bet-lsp/build/gleam-dev-javascript.lock | 0 lsp/bet-lsp/build/gleam-lsp-erlang.lock | 0 lsp/bet-lsp/build/gleam-lsp-javascript.lock | 0 lsp/bet-lsp/build/gleam-prod-erlang.lock | 0 lsp/bet-lsp/build/gleam-prod-javascript.lock | 0 lsp/bet-lsp/build/packages/gleam.lock | 0 .../build/packages/gleam_erlang/LICENSE | 191 -- .../build/packages/gleam_erlang/README.md | 38 - .../build/packages/gleam_erlang/gleam.toml | 18 - .../include/gleam@erlang@process_Abnormal.hrl | 1 - .../gleam@erlang@process_CalleeDown.hrl | 1 - .../gleam@erlang@process_Cancelled.hrl | 1 - .../gleam@erlang@process_ExitMessage.hrl | 4 - .../gleam@erlang@process_ProcessDown.hrl | 4 - .../gleam@erlang@process_ProcessMonitor.hrl | 1 - .../include/gleam@erlang@process_Subject.hrl | 4 - .../gleam@erlang_ApplicationFailedToStart.hrl | 4 - .../gleam@erlang_UnknownApplication.hrl | 1 - .../gleam_erlang/src/gleam/erlang.gleam | 224 -- .../gleam_erlang/src/gleam/erlang/atom.gleam | 85 - .../src/gleam/erlang/charlist.gleam | 25 - .../gleam_erlang/src/gleam/erlang/node.gleam | 62 - .../gleam_erlang/src/gleam/erlang/os.gleam | 36 - .../gleam_erlang/src/gleam/erlang/port.gleam | 27 - .../src/gleam/erlang/process.gleam | 860 ----- .../gleam_erlang/src/gleam@erlang.erl | 257 -- .../gleam_erlang/src/gleam@erlang@atom.erl | 90 - .../src/gleam@erlang@charlist.erl | 36 - .../gleam_erlang/src/gleam@erlang@node.erl | 73 - .../gleam_erlang/src/gleam@erlang@os.erl | 41 - .../gleam_erlang/src/gleam@erlang@port.erl | 34 - .../gleam_erlang/src/gleam@erlang@process.erl | 855 ----- .../gleam_erlang/src/gleam_erlang.app.src | 13 - .../gleam_erlang/src/gleam_erlang_ffi.erl | 224 -- lsp/bet-lsp/build/packages/gleam_http/LICENSE | 191 -- .../build/packages/gleam_http/README.md | 69 - .../build/packages/gleam_http/gleam.toml | 17 - .../include/gleam@http@cookie_Attributes.hrl | 8 - .../include/gleam@http@request_Request.hrl | 10 - .../include/gleam@http@response_Response.hrl | 5 - .../gleam@http_MoreRequiredForBody.hrl | 5 - .../gleam@http_MoreRequiredForHeaders.hrl | 4 - .../include/gleam@http_MultipartBody.hrl | 5 - .../include/gleam@http_MultipartHeaders.hrl | 4 - .../packages/gleam_http/src/gleam/http.gleam | 563 ---- .../gleam_http/src/gleam/http/cookie.gleam | 127 - .../gleam_http/src/gleam/http/request.gleam | 305 -- .../gleam_http/src/gleam/http/response.gleam | 158 - .../gleam_http/src/gleam/http/service.gleam | 61 - .../packages/gleam_http/src/gleam@http.erl | 661 ---- .../gleam_http/src/gleam@http@cookie.erl | 153 - .../gleam_http/src/gleam@http@request.erl | 327 -- .../gleam_http/src/gleam@http@response.erl | 115 - .../gleam_http/src/gleam@http@service.erl | 85 - .../gleam_http/src/gleam_http.app.src | 11 - .../gleam_http/src/gleam_http_native.erl | 88 - .../gleam_http/src/gleam_http_native.mjs | 38 - lsp/bet-lsp/build/packages/gleam_json/LICENCE | 191 -- .../build/packages/gleam_json/README.md | 53 - .../build/packages/gleam_json/gleam.toml | 19 - .../include/gleam@json_UnexpectedByte.hrl | 1 - .../include/gleam@json_UnexpectedSequence.hrl | 1 - .../packages/gleam_json/src/gleam/json.gleam | 305 -- .../packages/gleam_json/src/gleam@json.erl | 96 - .../gleam_json/src/gleam_json.app.src | 9 - .../gleam_json/src/gleam_json_ffi.erl | 25 - .../gleam_json/src/gleam_json_ffi.mjs | 193 -- lsp/bet-lsp/build/packages/gleam_otp/LICENCE | 191 -- .../build/packages/gleam_otp/README.md | 94 - .../build/packages/gleam_otp/gleam.toml | 20 - .../include/gleam@otp@actor_Continue.hrl | 4 - .../include/gleam@otp@actor_Ready.hrl | 1 - .../include/gleam@otp@actor_Spec.hrl | 5 - ...otp@intensity_tracker_IntensityTracker.hrl | 5 - .../gleam@otp@static_supervisor_Builder.hrl | 7 - ...eam@otp@static_supervisor_ChildBuilder.hrl | 8 - .../gleam@otp@static_supervisor_Worker.hrl | 1 - .../gleam@otp@supervisor_ChildSpec.hrl | 5 - .../include/gleam@otp@supervisor_Spec.hrl | 6 - .../include/gleam@otp@system_StatusInfo.hrl | 7 - .../gleam_otp/include/gleam@otp@task_Exit.hrl | 1 - .../gleam_otp/include/gleam@otp@task_Task.hrl | 5 - .../gleam_otp/src/gleam/otp/actor.gleam | 551 ---- .../src/gleam/otp/intensity_tracker.gleam | 45 - .../gleam_otp/src/gleam/otp/port.gleam | 12 - .../src/gleam/otp/static_supervisor.gleam | 306 -- .../gleam_otp/src/gleam/otp/supervisor.gleam | 459 --- .../gleam_otp/src/gleam/otp/system.gleam | 95 - .../gleam_otp/src/gleam/otp/task.gleam | 457 --- .../gleam_otp/src/gleam@otp@actor.erl | 507 --- .../src/gleam@otp@intensity_tracker.erl | 77 - .../packages/gleam_otp/src/gleam@otp@port.erl | 8 - .../src/gleam@otp@static_supervisor.erl | 296 -- .../gleam_otp/src/gleam@otp@supervisor.erl | 455 --- .../gleam_otp/src/gleam@otp@system.erl | 83 - .../packages/gleam_otp/src/gleam@otp@task.erl | 530 --- .../packages/gleam_otp/src/gleam_otp.app.src | 14 - .../gleam_otp/src/gleam_otp_external.erl | 52 - .../build/packages/gleam_stdlib/LICENCE | 191 -- .../build/packages/gleam_stdlib/README.md | 34 - .../build/packages/gleam_stdlib/gleam.toml | 14 - .../gleam@dynamic@decode_DecodeError.hrl | 5 - .../include/gleam@dynamic@decode_Decoder.hrl | 4 - .../gleam_stdlib/include/gleam@set_Set.hrl | 1 - .../gleam_stdlib/include/gleam@uri_Uri.hrl | 9 - .../build/packages/gleam_stdlib/src/dict.mjs | 710 ---- .../gleam_stdlib/src/gleam/bit_array.gleam | 280 -- .../gleam_stdlib/src/gleam/bool.gleam | 316 -- .../gleam_stdlib/src/gleam/bytes_tree.gleam | 190 -- .../gleam_stdlib/src/gleam/dict.gleam | 590 ---- .../gleam_stdlib/src/gleam/dynamic.gleam | 100 - .../src/gleam/dynamic/decode.gleam | 1103 ------- .../gleam_stdlib/src/gleam/float.gleam | 674 ---- .../gleam_stdlib/src/gleam/function.gleam | 5 - .../packages/gleam_stdlib/src/gleam/int.gleam | 812 ----- .../packages/gleam_stdlib/src/gleam/io.gleam | 59 - .../gleam_stdlib/src/gleam/list.gleam | 2407 -------------- .../gleam_stdlib/src/gleam/option.gleam | 358 --- .../gleam_stdlib/src/gleam/order.gleam | 156 - .../gleam_stdlib/src/gleam/pair.gleam | 85 - .../gleam_stdlib/src/gleam/result.gleam | 437 --- .../packages/gleam_stdlib/src/gleam/set.gleam | 413 --- .../gleam_stdlib/src/gleam/string.gleam | 900 ------ .../gleam_stdlib/src/gleam/string_tree.gleam | 208 -- .../packages/gleam_stdlib/src/gleam/uri.gleam | 776 ----- .../gleam_stdlib/src/gleam@bit_array.erl | 347 -- .../packages/gleam_stdlib/src/gleam@bool.erl | 352 -- .../gleam_stdlib/src/gleam@bytes_tree.erl | 211 -- .../packages/gleam_stdlib/src/gleam@dict.erl | 521 --- .../gleam_stdlib/src/gleam@dynamic.erl | 106 - .../gleam_stdlib/src/gleam@dynamic@decode.erl | 1112 ------- .../packages/gleam_stdlib/src/gleam@float.erl | 764 ----- .../gleam_stdlib/src/gleam@function.erl | 18 - .../packages/gleam_stdlib/src/gleam@int.erl | 954 ------ .../packages/gleam_stdlib/src/gleam@io.erl | 80 - .../packages/gleam_stdlib/src/gleam@list.erl | 2852 ----------------- .../gleam_stdlib/src/gleam@option.erl | 413 --- .../packages/gleam_stdlib/src/gleam@order.erl | 200 -- .../packages/gleam_stdlib/src/gleam@pair.erl | 110 - .../gleam_stdlib/src/gleam@result.erl | 532 --- .../packages/gleam_stdlib/src/gleam@set.erl | 433 --- .../gleam_stdlib/src/gleam@string.erl | 1012 ------ .../gleam_stdlib/src/gleam@string_tree.erl | 207 -- .../packages/gleam_stdlib/src/gleam@uri.erl | 1049 ------ .../gleam_stdlib/src/gleam_stdlib.app.src | 31 - .../gleam_stdlib/src/gleam_stdlib.erl | 534 --- .../gleam_stdlib/src/gleam_stdlib.mjs | 1026 ------ lsp/bet-lsp/build/packages/gleeunit/LICENCE | 191 -- lsp/bet-lsp/build/packages/gleeunit/README.md | 44 - .../build/packages/gleeunit/gleam.toml | 16 - .../gleeunit@internal@gleam_panic_Assert.hrl | 6 - ...nternal@gleam_panic_AssertedExpression.hrl | 5 - ...it@internal@gleam_panic_BinaryOperator.hrl | 5 - ...eeunit@internal@gleam_panic_Expression.hrl | 1 - ...unit@internal@gleam_panic_FunctionCall.hrl | 3 - ...eeunit@internal@gleam_panic_GleamPanic.hrl | 8 - ...leeunit@internal@gleam_panic_LetAssert.hrl | 7 - .../gleeunit@internal@gleam_panic_Literal.hrl | 1 - ...t@internal@gleam_panic_OtherExpression.hrl | 3 - .../gleeunit@internal@reporting_State.hrl | 1 - .../packages/gleeunit/src/gleeunit.app.src | 16 - .../build/packages/gleeunit/src/gleeunit.erl | 89 - .../packages/gleeunit/src/gleeunit.gleam | 86 - .../src/gleeunit/internal/gleam_panic.gleam | 49 - .../internal/gleeunit_gleam_panic_ffi.erl | 49 - .../internal/gleeunit_gleam_panic_ffi.mjs | 91 - .../src/gleeunit/internal/reporting.gleam | 240 -- .../gleeunit/src/gleeunit/should.gleam | 72 - .../src/gleeunit@internal@gleam_panic.erl | 56 - .../src/gleeunit@internal@reporting.erl | 343 -- .../packages/gleeunit/src/gleeunit@should.erl | 153 - .../packages/gleeunit/src/gleeunit_ffi.erl | 21 - .../packages/gleeunit/src/gleeunit_ffi.mjs | 100 - .../gleeunit/src/gleeunit_progress.erl | 72 - lsp/bet-lsp/build/packages/glisten/README.md | 80 - lsp/bet-lsp/build/packages/glisten/gleam.toml | 14 - ...listen@internal@acceptor_AcceptorState.hrl | 5 - .../glisten@internal@acceptor_Pool.hrl | 9 - .../glisten@internal@handler_Connection.hrl | 7 - .../glisten@internal@handler_Handler.hrl | 8 - .../glisten@internal@handler_LoopState.hrl | 8 - .../glisten/include/glisten_Connection.hrl | 7 - .../glisten/include/glisten_Handler.hrl | 7 - .../packages/glisten/src/glisten.app.src | 18 - .../build/packages/glisten/src/glisten.erl | 210 -- .../build/packages/glisten/src/glisten.gleam | 234 -- .../src/glisten/internal/acceptor.gleam | 126 - .../src/glisten/internal/handler.gleam | 201 -- .../glisten/src/glisten/internal/logger.gleam | 8 - .../packages/glisten/src/glisten/socket.gleam | 93 - .../glisten/src/glisten/socket/options.gleam | 82 - .../packages/glisten/src/glisten/ssl.gleam | 87 - .../packages/glisten/src/glisten/tcp.gleam | 85 - .../glisten/src/glisten/transport.gleam | 149 - .../glisten/src/glisten@internal@acceptor.erl | 151 - .../glisten/src/glisten@internal@handler.erl | 285 -- .../glisten/src/glisten@internal@logger.erl | 8 - .../packages/glisten/src/glisten@socket.erl | 90 - .../glisten/src/glisten@socket@options.erl | 80 - .../packages/glisten/src/glisten@ssl.erl | 104 - .../packages/glisten/src/glisten@tcp.erl | 102 - .../glisten/src/glisten@transport.erl | 174 - .../packages/glisten/src/glisten_ssl_ffi.erl | 60 - .../packages/glisten/src/glisten_tcp_ffi.erl | 43 - lsp/bet-lsp/build/packages/packages.toml | 9 - lsp/bet-lsp/build/packages/thoas/CHANGELOG.md | 45 - lsp/bet-lsp/build/packages/thoas/LICENSE | 13 - lsp/bet-lsp/build/packages/thoas/README.md | 124 - lsp/bet-lsp/build/packages/thoas/rebar.config | 18 - lsp/bet-lsp/build/packages/thoas/rebar.lock | 1 - .../build/packages/thoas/src/thoas.app.src | 10 - .../build/packages/thoas/src/thoas.erl | 151 - .../build/packages/thoas/src/thoas_decode.erl | 1185 ------- .../build/packages/thoas/src/thoas_encode.erl | 1764 ---------- repl/shell.rkt | 2 + repl/shell.rkt.bak.20250719-182140 | 20 - tests/basics.rkt | 2 + tests/basics.rkt.bak.20250719-182140 | 8 - 342 files changed, 59 insertions(+), 56639 deletions(-) delete mode 120000 SPEC.core.scm delete mode 100644 core/betlang.rkt.bak.20250719-182140 delete mode 100644 docs/architecture.md.bak.20250719-182140 delete mode 100644 docs/semantics.md.bak.20250719-182140 delete mode 100644 homepage/index.html.bak.20250719-182140 delete mode 100644 homepage/style.css.bak.20250719-182141 delete mode 100644 lib/ternary.rkt.bak.20250719-182140 delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/dict.mjs delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@@compile.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_array.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dict.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dict.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_tree.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.cache delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_inline delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_meta delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam_stdlib.erl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam_stdlib.mjs delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@bit_array.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@bool.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@bytes_tree.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@dict.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@dynamic.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@dynamic@decode.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@float.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@function.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@int.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@io.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@list.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@option.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@order.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@pair.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@result.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@set.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@string.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@string_tree.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@uri.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam_stdlib.app delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam_stdlib.beam delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/include/gleam@dynamic@decode_DecodeError.hrl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/include/gleam@dynamic@decode_Decoder.hrl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/include/gleam@set_Set.hrl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_stdlib/include/gleam@uri_Uri.hrl delete mode 100644 lsp/bet-lsp/build/dev/erlang/gleam_version delete mode 100644 lsp/bet-lsp/build/gleam-dev-erlang.lock delete mode 100644 lsp/bet-lsp/build/gleam-dev-javascript.lock delete mode 100644 lsp/bet-lsp/build/gleam-lsp-erlang.lock delete mode 100644 lsp/bet-lsp/build/gleam-lsp-javascript.lock delete mode 100644 lsp/bet-lsp/build/gleam-prod-erlang.lock delete mode 100644 lsp/bet-lsp/build/gleam-prod-javascript.lock delete mode 100644 lsp/bet-lsp/build/packages/gleam.lock delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/LICENSE delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/README.md delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/gleam.toml delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_Abnormal.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_CalleeDown.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_Cancelled.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_ExitMessage.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_ProcessDown.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_ProcessMonitor.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_Subject.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang_ApplicationFailedToStart.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang_UnknownApplication.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/atom.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/charlist.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/node.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/os.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/port.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/process.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@atom.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@charlist.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@node.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@os.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@port.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@process.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/src/gleam_erlang.app.src delete mode 100644 lsp/bet-lsp/build/packages/gleam_erlang/src/gleam_erlang_ffi.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/LICENSE delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/README.md delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/gleam.toml delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/include/gleam@http@cookie_Attributes.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/include/gleam@http@request_Request.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/include/gleam@http@response_Response.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/include/gleam@http_MoreRequiredForBody.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/include/gleam@http_MoreRequiredForHeaders.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/include/gleam@http_MultipartBody.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/include/gleam@http_MultipartHeaders.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/src/gleam/http.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/src/gleam/http/cookie.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/src/gleam/http/request.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/src/gleam/http/response.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/src/gleam/http/service.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/src/gleam@http.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/src/gleam@http@cookie.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/src/gleam@http@request.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/src/gleam@http@response.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/src/gleam@http@service.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/src/gleam_http.app.src delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/src/gleam_http_native.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_http/src/gleam_http_native.mjs delete mode 100644 lsp/bet-lsp/build/packages/gleam_json/LICENCE delete mode 100644 lsp/bet-lsp/build/packages/gleam_json/README.md delete mode 100644 lsp/bet-lsp/build/packages/gleam_json/gleam.toml delete mode 100644 lsp/bet-lsp/build/packages/gleam_json/include/gleam@json_UnexpectedByte.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_json/include/gleam@json_UnexpectedSequence.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_json/src/gleam/json.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_json/src/gleam@json.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_json/src/gleam_json.app.src delete mode 100644 lsp/bet-lsp/build/packages/gleam_json/src/gleam_json_ffi.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_json/src/gleam_json_ffi.mjs delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/LICENCE delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/README.md delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/gleam.toml delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@actor_Continue.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@actor_Ready.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@actor_Spec.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@intensity_tracker_IntensityTracker.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@static_supervisor_Builder.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@static_supervisor_ChildBuilder.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@static_supervisor_Worker.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@supervisor_ChildSpec.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@supervisor_Spec.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@system_StatusInfo.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@task_Exit.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@task_Task.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/actor.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/intensity_tracker.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/port.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/static_supervisor.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/supervisor.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/system.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/task.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@actor.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@intensity_tracker.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@port.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@static_supervisor.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@supervisor.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@system.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@task.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/src/gleam_otp.app.src delete mode 100644 lsp/bet-lsp/build/packages/gleam_otp/src/gleam_otp_external.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/LICENCE delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/README.md delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/gleam.toml delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/include/gleam@dynamic@decode_DecodeError.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/include/gleam@dynamic@decode_Decoder.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/include/gleam@set_Set.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/include/gleam@uri_Uri.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/dict.mjs delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/bit_array.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/bool.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/bytes_tree.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/dict.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/dynamic.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/dynamic/decode.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/float.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/function.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/int.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/io.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/list.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/option.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/order.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/pair.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/result.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/set.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/string.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/string_tree.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/uri.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@bit_array.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@bool.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@bytes_tree.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@dict.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@dynamic.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@dynamic@decode.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@float.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@function.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@int.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@io.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@list.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@option.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@order.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@pair.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@result.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@set.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@string.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@string_tree.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@uri.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam_stdlib.app.src delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam_stdlib.erl delete mode 100644 lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam_stdlib.mjs delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/LICENCE delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/README.md delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/gleam.toml delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_Assert.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_AssertedExpression.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_BinaryOperator.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_Expression.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_FunctionCall.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_GleamPanic.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_LetAssert.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_Literal.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_OtherExpression.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@reporting_State.hrl delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/src/gleeunit.app.src delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/src/gleeunit.erl delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/src/gleeunit.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/internal/gleam_panic.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/internal/gleeunit_gleam_panic_ffi.erl delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/internal/gleeunit_gleam_panic_ffi.mjs delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/internal/reporting.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/should.gleam delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/src/gleeunit@internal@gleam_panic.erl delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/src/gleeunit@internal@reporting.erl delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/src/gleeunit@should.erl delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/src/gleeunit_ffi.erl delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/src/gleeunit_ffi.mjs delete mode 100644 lsp/bet-lsp/build/packages/gleeunit/src/gleeunit_progress.erl delete mode 100644 lsp/bet-lsp/build/packages/glisten/README.md delete mode 100644 lsp/bet-lsp/build/packages/glisten/gleam.toml delete mode 100644 lsp/bet-lsp/build/packages/glisten/include/glisten@internal@acceptor_AcceptorState.hrl delete mode 100644 lsp/bet-lsp/build/packages/glisten/include/glisten@internal@acceptor_Pool.hrl delete mode 100644 lsp/bet-lsp/build/packages/glisten/include/glisten@internal@handler_Connection.hrl delete mode 100644 lsp/bet-lsp/build/packages/glisten/include/glisten@internal@handler_Handler.hrl delete mode 100644 lsp/bet-lsp/build/packages/glisten/include/glisten@internal@handler_LoopState.hrl delete mode 100644 lsp/bet-lsp/build/packages/glisten/include/glisten_Connection.hrl delete mode 100644 lsp/bet-lsp/build/packages/glisten/include/glisten_Handler.hrl delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten.app.src delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten.erl delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten.gleam delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten/internal/acceptor.gleam delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten/internal/handler.gleam delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten/internal/logger.gleam delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten/socket.gleam delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten/socket/options.gleam delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten/ssl.gleam delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten/tcp.gleam delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten/transport.gleam delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten@internal@acceptor.erl delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten@internal@handler.erl delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten@internal@logger.erl delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten@socket.erl delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten@socket@options.erl delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten@ssl.erl delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten@tcp.erl delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten@transport.erl delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten_ssl_ffi.erl delete mode 100644 lsp/bet-lsp/build/packages/glisten/src/glisten_tcp_ffi.erl delete mode 100644 lsp/bet-lsp/build/packages/packages.toml delete mode 100644 lsp/bet-lsp/build/packages/thoas/CHANGELOG.md delete mode 100644 lsp/bet-lsp/build/packages/thoas/LICENSE delete mode 100644 lsp/bet-lsp/build/packages/thoas/README.md delete mode 100644 lsp/bet-lsp/build/packages/thoas/rebar.config delete mode 100644 lsp/bet-lsp/build/packages/thoas/rebar.lock delete mode 100644 lsp/bet-lsp/build/packages/thoas/src/thoas.app.src delete mode 100644 lsp/bet-lsp/build/packages/thoas/src/thoas.erl delete mode 100644 lsp/bet-lsp/build/packages/thoas/src/thoas_decode.erl delete mode 100644 lsp/bet-lsp/build/packages/thoas/src/thoas_encode.erl delete mode 100644 repl/shell.rkt.bak.20250719-182140 delete mode 100644 tests/basics.rkt.bak.20250719-182140 diff --git a/.gitignore b/.gitignore index 7c716bb..acce7d7 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,4 @@ dist/ *.olean lake-packages/ lakefile.olean +lake-manifest.json diff --git a/.machine_readable/6a2/STATE.a2ml b/.machine_readable/6a2/STATE.a2ml index 5d77875..5a86b14 100644 --- a/.machine_readable/6a2/STATE.a2ml +++ b/.machine_readable/6a2/STATE.a2ml @@ -34,7 +34,7 @@ milestones = [ "M1: Proof foundation — lakefile.lean + proofs.yml CI + banned-pattern gate [DONE #53]", "M2: Governance clean — licence, language policy, Racket tests, timeout [DONE #54]", "M3: Echo types core — Type::Echo/EchoR, unify, lower, Lean Ty.echo/echoR [DONE #55]", - "M4: Discharge substTop_preserves_typing axiom (PROOF-STATUS TP-4)", + "M4: Discharge substTop_preserves_typing axiom (PROOF-STATUS TP-4) [DONE — now a proved theorem; axiom-free core]", "M5: Echo operations — echo_intro, proj1, echo_to_residue; typing rules", "M6: sample_echo / bet_echo probabilistic bridge", "M7: Julia backend Phase 2 — core language features", @@ -42,25 +42,22 @@ milestones = [ [proof-obligations] # See PROOF-STATUS.md for the full register (13 obligations) -proved = ["TP-1 Progress", "TP-2 Preservation", "TP-3 Monad laws"] -axioms = ["substTop_preserves_typing (classified, standards#203, docs/proof-debt.adoc)"] -remaining = 10 +proved = ["TP-1 Progress", "TP-2 Preservation", "TP-3 Monad laws", "TP-4 substTop_preserves_typing (discharged — axiom-free)"] +axioms = [] +remaining = 9 [blockers-and-issues] issues = [ "bet-wasm E0308: pre-existing WASM backend breakage (match arm type mismatch, not caused by any of #53-55)", - "substTop_preserves_typing: classified axiom; discharge is M4 (Phase 2 proofs)", "Echo operations deferred: no echo_intro/proj1/echo_to_residue until runtime/proof story settled", ] [critical-next-actions] actions = [ - "Merge PR #54 → main (all-green)", - "Rebase PR #53 onto updated main, re-CI, merge", - "Retarget PR #55 to main, mark ready, merge", - "Phase 2 proof obligations: discharge substTop_preserves_typing", - "Echo operations pass: introduce echo_intro, echo_to_residue, proj1; typing rules in Lean", + "TP-5: Echo-operation typing rules + metatheory in Lean (echo_intro, echo_to_residue, proj1)", "sample_echo / bet_echo probabilistic bridge (Dist T → Echo T)", + "Julia backend Phase 2 — core language features", + "bet-wasm E0308: fix pre-existing WASM backend match-arm type mismatch", ] [language-policy] diff --git a/EXPLAINME.adoc b/EXPLAINME.adoc index 9c40e6a..8a990de 100644 --- a/EXPLAINME.adoc +++ b/EXPLAINME.adoc @@ -80,8 +80,8 @@ there. * **Preservation** — typing is invariant under small-step reduction. * **Distribution monad laws** — the probability monad is correctly structured. -One permitted axiom: `substTop_preserves_typing` — classified, triaged in -`docs/proof-debt.adoc`, tracked as standards#203. +Axiom-free: `substTop_preserves_typing` is a proved theorem (formerly a +classified axiom, since discharged; see `docs/proof-debt.adoc` §(a), standards#203). Proof infrastructure: `lakefile.lean`, `lean-toolchain` (pins `leanprover/lean4:v4.15.0`), `.github/workflows/proofs.yml` (runs `lake build` + `tools/proof-scan.sh` on every PR). @@ -222,8 +222,8 @@ structurally: `Echo T ~ Echo T'` iff `T ~ T'`. === Proof debt -`docs/proof-debt.adoc` — records the single classified axiom -(`substTop_preserves_typing`, standards#203). No other unsoundness. +`docs/proof-debt.adoc` — records the discharged `substTop_preserves_typing` +lemma (formerly a classified axiom; standards#203). No axioms remain; no other unsoundness. === PROOF-STATUS.md @@ -269,7 +269,6 @@ Tracks the 13 proof obligations across their completion stages. Currently 3/13 d * Runtime residue payload for `Echo T` / `EchoR T` — ghost-erased until operations demand * WASM backend (`compiler/bet-wasm/`) — pre-existing breakage, non-critical * Julia backend Phase 2 — active but separate work stream -* `substTop_preserves_typing` discharge — Phase 2 proof obligation == For AI agents diff --git a/PROOF-NEEDS.md b/PROOF-NEEDS.md index a3be0d2..34daff1 100644 --- a/PROOF-NEEDS.md +++ b/PROOF-NEEDS.md @@ -27,7 +27,7 @@ This file defines *what* must be proven. Completion is tracked in | TP-1 | Progress (well-typed ⇒ value or steps) | TP | Lean4 | P1 | ✅ done | | TP-2 | Preservation (typing preserved under step) | TP | Lean4 | P1 | ✅ done | | TP-3 | Distribution monad laws (×3) | TP | Lean4 | P1 | ✅ done | -| TP-4 | Discharge `substTop_preserves_typing` axiom | TP | Lean4 | P1 | remaining | +| TP-4 | Discharge `substTop_preserves_typing` axiom | TP | Lean4 | P1 | ✅ done | | TP-5 | Echo-operation typing rules + metatheory (Progress/Preservation) | TP | Lean4 | P2 | remaining | | SEM-1 | Continuous measure-theoretic denotation | SEM | Lean4 | P2 | remaining | | STAT-1 | Maximum entropy of uniform ternary = log₂3 | STAT | Lean4 | P2 | remaining | diff --git a/PROOF-STATUS.md b/PROOF-STATUS.md index 615e56d..c581a6f 100644 --- a/PROOF-STATUS.md +++ b/PROOF-STATUS.md @@ -29,11 +29,12 @@ See `docs/AFFINESCRIPT-ALIGNMENT.adoc` for the phased plan and | TP-1 | Progress — well-typed closed term is a value or steps | Lean4 | `proofs/BetLang.lean` | `lake build` (CI: `proofs.yml`) | | TP-2 | Preservation — typing preserved under reduction | Lean4 | `proofs/BetLang.lean` | `lake build` (CI: `proofs.yml`) | | TP-3 | Distribution monad laws (left id, right id, assoc) | Lean4 | `proofs/BetLang.lean` | `lake build` (CI: `proofs.yml`) | +| TP-4 | Discharge `substTop_preserves_typing` (de Bruijn subst lemma) — now a proved theorem, axiom-free | Lean4 | `proofs/BetLang.lean` | `lake build` (CI: `proofs.yml`) | -> Note: TP-2 currently depends on the classified necessary axiom -> `substTop_preserves_typing` (`proofs/BetLang.lean`). It is an explicit -> axiom, **not** a `sorry` — see `docs/proof-debt.adoc` §(c). Discharging -> it (TP-4) yields an axiom-free core. +> Note: TP-2 is axiom-free. `substTop_preserves_typing` +> (`proofs/BetLang.lean:918`) is a fully proved `theorem` — the former +> classified axiom (TP-4) has been discharged (see `docs/proof-debt.adoc` +> §(a)). No `axiom` declarations remain. ## Proofs In Progress @@ -51,7 +52,6 @@ See `docs/AFFINESCRIPT-ALIGNMENT.adoc` for the phased plan and | ID | Proof | Category | Prover | Phase | Priority | |----|-------|----------|--------|-------|----------| -| TP-4 | Discharge `substTop_preserves_typing` (de Bruijn subst lemma) | TP | Lean4 | 2 | P1 | | TP-5 | Echo-operation typing rules + metatheory — mirror `bet-check`'s functor/comonad surface (`echo`, `echo_map`, `echo_output`, `echo_duplicate`, `echo_to_residue`, `sample_echo`), incl. the comonad laws from `EchoGradedComonad.agda` | TP | Lean4 | 2 | P2 | | SEM-1 | Continuous measure-theoretic denotational semantics | SEM | Lean4 | 2 | P2 | | STAT-1 | Maximum entropy of uniform ternary = log₂3 bits | STAT | Lean4 | 2 | P2 | @@ -75,8 +75,9 @@ just proof-scan # banned-pattern gate only `sorry` / `admit` (Lean), `Admitted` (Coq), `postulate` / `believe_me` / `assert_total` (Idris2/Agda), `unsafeCoerce`. Enforced by -`tools/proof-scan.sh` in CI (`.github/workflows/proofs.yml`). The single -classified `axiom` is permitted by policy (standards#203). +`tools/proof-scan.sh` in CI (`.github/workflows/proofs.yml`). No `axiom` +declarations remain; any future classified `axiom` would be permitted by +policy (standards#203) and registered in `docs/proof-debt.adoc`. ## Changelog diff --git a/README.adoc b/README.adoc index cbef1f3..3ef8843 100644 --- a/README.adoc +++ b/README.adoc @@ -79,8 +79,8 @@ Over time, the full **uncertainty number tower migrates here**. === Lean 4 — Proof / Verification Layer * Machine-checks **Progress**, **Preservation**, and distribution **monad laws** -* **Zero `sorry`** — one permitted classified axiom (`substTop_preserves_typing`, - see `docs/proof-debt.adoc`) +* **Zero `sorry`, zero `axiom`** — `substTop_preserves_typing` is fully proved + (formerly a classified axiom, since discharged; see `docs/proof-debt.adoc`) * `lakefile.lean` + `lean-toolchain` make proofs a first-class Lake project * `.github/workflows/proofs.yml` verifies every PR via `lake build` diff --git a/README.md b/README.md index 69a26e2..f50acbf 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ [![Sponsor](https://img.shields.io/badge/Sponsor-%E2%9D%A4-pink?logo=github)](https://github.com/sponsors/hyperpolymath) [![License: MPL-2.0](https://img.shields.io/badge/License-MPL--2.0-blue.svg)](LICENSE) -[![License: PMPL-1.0](https://img.shields.io/badge/License-PMPL--1.0-indigo.svg)](PALIMPSEST.adoc) # BetLang @@ -64,7 +63,7 @@ demand a payload. See [docs/echo-types.adoc](docs/echo-types.adoc). - `lakefile.lean` + `lean-toolchain` → buildable Lake project - `.github/workflows/proofs.yml` → CI-checked on every PR (`lake build` + banned-pattern scan) -- One permitted classified axiom: `substTop_preserves_typing` (see `docs/proof-debt.adoc`) +- Axiom-free: `substTop_preserves_typing` is fully proved — no `axiom`/`sorry` (see `docs/proof-debt.adoc`) --- @@ -117,7 +116,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md). For a guided tour, read [EXPLAINME.adoc] ## License -BetLang uses **PMPL-1.0** (Palimpsest Public License). SPDX identifier: `MPL-2.0`. +BetLang is licensed under **MPL-2.0**. SPDX identifier: `MPL-2.0`. See [LICENSE](LICENSE) and [PALIMPSEST.adoc](PALIMPSEST.adoc). diff --git a/SPEC.core.scm b/SPEC.core.scm deleted file mode 120000 index a4c339f..0000000 --- a/SPEC.core.scm +++ /dev/null @@ -1 +0,0 @@ -.machine_readable/SPEC.core.scm \ No newline at end of file diff --git a/core/betlang.rkt b/core/betlang.rkt index 222f9df..22cbc63 100644 --- a/core/betlang.rkt +++ b/core/betlang.rkt @@ -1,4 +1,6 @@ #lang racket +; SPDX-License-Identifier: MPL-2.0 +; SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) (provide bet bet/weighted bet/conditional diff --git a/core/betlang.rkt.bak.20250719-182140 b/core/betlang.rkt.bak.20250719-182140 deleted file mode 100644 index 86dd5fd..0000000 --- a/core/betlang.rkt.bak.20250719-182140 +++ /dev/null @@ -1,9 +0,0 @@ -#lang racket -(provide bet) - -;; (bet A B C) randomly chooses A, B, or C -(define (bet a b c) - (match (random 3) - [0 a] - [1 b] - [_ c])) diff --git a/docs/architecture.md.bak.20250719-182140 b/docs/architecture.md.bak.20250719-182140 deleted file mode 100644 index cf1267a..0000000 --- a/docs/architecture.md.bak.20250719-182140 +++ /dev/null @@ -1,8 +0,0 @@ -# Project Architecture - -- core/betlang.rkt — DSL operators -- lib/ternary.rkt — Conditional constructs -- epl/shell.rkt — REPL interface + logging -- ests/ — Probabilistic tests -- docs/ — Theory and specification -- homepage/ — Public face of the project diff --git a/docs/proof-debt.adoc b/docs/proof-debt.adoc index 4843859..6a0dc5d 100644 --- a/docs/proof-debt.adoc +++ b/docs/proof-debt.adoc @@ -11,61 +11,45 @@ of: (a) DISCHARGED, (b) BUDGETED, (c) NECESSARY AXIOM, or (d) DEBT. Supersedes the thin index in https://github.com/hyperpolymath/betlang/pull/37[betlang#37] (which -declared "3 escape hatches" — the actual count is 1). +declared "3 escape hatches" — the actual count is now 0; the single +classified axiom has since been discharged to a theorem, see §(a)). == Marker count -1 soundness-relevant escape hatch in this repo: +0 soundness-relevant escape hatches in this repo. -* `proofs/BetLang.lean:392` — `axiom substTop_preserves_typing` - -Zero `sorry` declarations. Zero `noncomputable` in soundness positions. +The former `axiom substTop_preserves_typing` has been discharged to a +proved theorem (`proofs/BetLang.lean:918`); see §(a). Zero `axiom`, zero +`sorry` declarations, zero `noncomputable` in soundness positions. == (a) Discharged -No entries. - -== (b) Budgeted — tested with refutation budget - -No entries. - -== (c) NECESSARY AXIOM - -=== `proofs/BetLang.lean:392` — `axiom substTop_preserves_typing` +=== `proofs/BetLang.lean:918` — `theorem substTop_preserves_typing` (formerly an axiom) [source,lean] ---- -axiom substTop_preserves_typing : +theorem substTop_preserves_typing : ∀ (Γ : Ctx) (S T : Ty) (body v : Expr), HasType (S :: Γ) body T → HasType Γ v S → HasType Γ (substTop v body) T ---- * **Kind**: classical substitution lemma for typed lambda terms under - de Bruijn substitution. -* **Justification**: discharging requires the full shifting / - substitution calculus over de Bruijn indices, which would triple - the file size and is orthogonal to the BetLang-specific content of - this formalisation. The property is standard and well-known to - hold for this style of substitution. -* **Citation**: {tapl} ("Pure Simply Typed Lambda Calculus" — the - substitution lemma is the canonical preservation prerequisite). - Mechanised independently in many libraries: Software Foundations - Volume 2 § STLC, Programming Language Foundations in Agda § - Properties, Lean Mathlib's `Mathlib.Logic.Function.Iterate` - substitution machinery. -* **Used by**: `preservation` theorem at `proofs/BetLang.lean:398` - (invoked in the `appLam` case to thread typing across - beta-reduction). -* **Author's framing**: the in-file comment at - `proofs/BetLang.lean:387-391` is explicit that this is an axiom, - not a `sorry`: _"IMPORTANT: This is NOT sorry — it is an axiom. - The difference is that axioms are explicit assumptions in the - logical framework, whereas sorry is a proof hole."_ -* **Promotion path** (optional, not blocking): see - link:{discharge-pr}[betlang PR #27] body for a discharge recipe. - Promotion would move this entry to §(a) DISCHARGED and remove the - `axiom` declaration in favour of a proof using the Lean Mathlib - substitution lemmas. + de Bruijn substitution — the canonical preservation prerequisite ({tapl}). +* **Status**: DISCHARGED. Formerly classified (c) NECESSARY AXIOM; now a + fully proved `theorem`, with no `axiom` declaration remaining anywhere in + `proofs/BetLang.lean`. Machine-checked by `lake build` (CI: `proofs.yml`). +* **Used by**: the `preservation` theorem (threaded through the `appLam` + beta-reduction case). +* **History**: discharge recipe in link:{discharge-pr}[betlang PR #27]. + +== (b) Budgeted — tested with refutation budget + +No entries. + +== (c) NECESSARY AXIOM + +No entries. (The former `substTop_preserves_typing` axiom was discharged to +a theorem — see §(a).) == (d) DEBT — actively to be closed @@ -77,8 +61,8 @@ principled disposition today.) * link:{policy}[standards#203] — trusted-base reduction policy (canonical estate-wide definition) -* `proofs/BetLang.lean` — the formal model where the axiom is - declared and used +* `proofs/BetLang.lean` — the formal model where the (now proved) + substitution lemma is stated and used * `docs/semantics.md` — language semantics overview * link:{discharge-pr}[betlang PR #27] — discharge recipe (optional promotion to §(a)) diff --git a/docs/semantics.md.bak.20250719-182140 b/docs/semantics.md.bak.20250719-182140 deleted file mode 100644 index ac66985..0000000 --- a/docs/semantics.md.bak.20250719-182140 +++ /dev/null @@ -1,14 +0,0 @@ -# betlang Semantics - -Betlang is a ternary DSL built for probabilistic reasoning and strategic expression. - -## Core Form: -(bet A B C) → randomly selects one of three values. - -Used for: -- Logic games -- Confidence trees -- Narrative speculation -- Symbolic betting and uncertainty modeling - -Inspired by musical ternary form: A–B–A. diff --git a/homepage/index.html.bak.20250719-182140 b/homepage/index.html.bak.20250719-182140 deleted file mode 100644 index fdb2607..0000000 --- a/homepage/index.html.bak.20250719-182140 +++ /dev/null @@ -1,17 +0,0 @@ - - - - - betlang - - - -

🎲 betlang: strategic recursion

- - A - B - A - -

A ternary language for wagering, recursion, and ambiguity.

- - diff --git a/homepage/style.css.bak.20250719-182141 b/homepage/style.css.bak.20250719-182141 deleted file mode 100644 index 1eb9741..0000000 --- a/homepage/style.css.bak.20250719-182141 +++ /dev/null @@ -1,13 +0,0 @@ -body { - background: #000; - color: #ccc; - font-family: monospace; - display: flex; - flex-direction: column; - align-items: center; - justify-content: start; - padding: 40px; -} -svg text:nth-child(2) { - fill: #999; -} diff --git a/lib/ternary.rkt b/lib/ternary.rkt index 693e75c..e3a628c 100644 --- a/lib/ternary.rkt +++ b/lib/ternary.rkt @@ -1,4 +1,6 @@ #lang racket +; SPDX-License-Identifier: MPL-2.0 +; SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) (require "../core/betlang.rkt") ;; Ternary Logic and Utilities for betlang diff --git a/lib/ternary.rkt.bak.20250719-182140 b/lib/ternary.rkt.bak.20250719-182140 deleted file mode 100644 index 8e352db..0000000 --- a/lib/ternary.rkt.bak.20250719-182140 +++ /dev/null @@ -1,6 +0,0 @@ -#lang racket -(provide ternary-eval) - -;; Abstract ternary condition -(define (ternary-eval cond truth fallback) - (if cond truth fallback)) diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/dict.mjs b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/dict.mjs deleted file mode 100644 index 3db3b5f..0000000 --- a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/dict.mjs +++ /dev/null @@ -1,710 +0,0 @@ -/** - * This file uses jsdoc to annotate types. - * These types can be checked using the typescript compiler with "checkjs" option. - */ - -import { isEqual, Result$Error, Result$Ok } from "./gleam.mjs"; - -// -- HASH -------------------------------------------------------------------- - -const referenceMap = /* @__PURE__ */ new WeakMap(); -const tempDataView = /* @__PURE__ */ new DataView( - /* @__PURE__ */ 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 - } -} - -// -- DICT -------------------------------------------------------------------- - -/** - * An implementation of the CHAMP data structure, an optimised HAMT. - * - * See: M. J. Steindorfer, J.J. Vinju (2015). Optimizing Hash-Array Mapped Tries for - Fast and Lean Immutable JVM Collections. Available: https://michael.steindorfer.name/publications/oopsla15.pdf - */ -export default class Dict { - constructor(size, root) { - this.size = size; - this.root = root; - } -} - -/// The power-of-2 branching factor for the dict. For example, a value of `5` indicates a 32-ary tree. -const bits = 5; -const mask = (1 << bits) - 1; - -/// This symbol is used internally to avoid constructing results. -const noElementMarker = Symbol(); - -/// This symbol is used to store the "generation" on a node. -/// Using a symbol makes the property not enumerable, which means the generation -/// will be ignored during equality checks. -const generationKey = Symbol(); - -// Some commonly used constants throughout the code. -const emptyNode = /* @__PURE__ */ newNode(0); -const emptyDict = /* @__PURE__ */ new Dict(0, emptyNode); -const errorNil = /* @__PURE__ */ Result$Error(undefined); - -function makeNode(generation, datamap, nodemap, data) { - // The order of fields is important, as they define the order `isEqual` will - // compare our fields. Putting the bitmaps first means that equality can - // early-out if the bitmaps are not equal. - return { - // A node is a high-arity (32 in practice) hybrid tree node. - // Hybrid means that it stores data directly as well as pointers to child nodes. - // - // Each node contains 2 bitmaps: - // - The datamap has a bit set if that slot in the node contains direct data - // - The nodemap has a bit set if that slot in the node contains another node. - // - // Both are exclusive to on another, so datamap & nodemap == 0. - // - // Every key/hash value directly correlates to a specific bit by using a trie - // suffix (least significant bits first) encoding. - // For example, if the last 5 bits of the hash are 1101, the bit to check for - // that value is the 13th bit. - datamap, - nodemap, - // The slots itself are stored in a single contiguous array that contains - // both direct k/v-pairs and child nodes. - // - // The direct children come first, followed by the child nodes in _reverse order_: - // - // 7654321 - // datamap: 1000100 - // nodemap: 10011 - // data: [key3, value3, key7, value7, child5, child2, child1] - // -------------------------> <--------------------- - // datamap nodemap - // - // Every `1` bit in the datamap corresponds to a pair of [key, value] entries, - // and every `1` bit in the nodemap corresponds to a child node entry. - // - // Children are stored in reverse order to avoid having to store or calculate an - // "offset" value to skip over the direct children. - data, - // The generation is used to track which nodes need to be copied during transient updates. - // Using a symbol here makes `isEqual` ignore this field. - [generationKey]: generation, - }; -} - -function newNode(generation) { - return makeNode(generation, 0, 0, []); -} - -/** - * Copies a node and its data array if it's from another generation, making it safe - * to mutate the node. - */ -function copyNode(node, generation) { - if (node[generationKey] === generation) { - return node; - } - - const newData = node.data.slice(0); - return makeNode(generation, node.datamap, node.nodemap, newData); -} - -/** - * Copies a node if needed and sets a new value. - */ -function copyAndSet(node, generation, idx, val) { - if (node.data[idx] === val) { - return node; - } - - // Using copyNode is faster than a specialised implementation. - node = copyNode(node, generation); - node.data[idx] = val; - return node; -} - -/** - * Copies a node if needed, and then inserts a new key-value pair. - */ -function copyAndInsertPair(node, generation, bit, idx, key, val) { - const data = node.data; - const length = data.length; - - // the fastest way to insert a pair is to always copy. - const newData = new Array(length + 2); - - let readIndex = 0; - let writeIndex = 0; - - while (readIndex < idx) newData[writeIndex++] = data[readIndex++]; - newData[writeIndex++] = key; - newData[writeIndex++] = val; - while (readIndex < length) newData[writeIndex++] = data[readIndex++]; - - return makeNode(generation, node.datamap | bit, node.nodemap, newData); -} - -function copyAndRemovePair(node, generation, bit, idx) { - node = copyNode(node, generation); - - const data = node.data; - const length = data.length; - for (let w = idx, r = idx + 2; r < length; ++r, ++w) { - data[w] = data[r]; - } - data.pop(); - data.pop(); - - node.datamap ^= bit; - return node; -} - -export function make() { - return emptyDict; -} - -export function from(iterable) { - let transient = toTransient(emptyDict); - for (const [key, value] of iterable) { - transient = destructiveTransientInsert(key, value, transient); - } - return fromTransient(transient); -} - -export function size(dict) { - return dict.size; -} - -export function get(dict, key) { - const result = lookup(dict.root, key, getHash(key)); - return result !== noElementMarker ? Result$Ok(result) : errorNil; -} - -export function has(dict, key) { - return lookup(dict.root, key, getHash(key)) !== noElementMarker; -} - -function lookup(node, key, hash) { - for (let shift = 0; shift < 32; shift += bits) { - const data = node.data; - const bit = hashbit(hash, shift); - - if (node.nodemap & bit) { - // we found our hash inside the nodemap, so we can continue our search there. - node = data[data.length - 1 - index(node.nodemap, bit)]; - } else if (node.datamap & bit) { - // we store this hash directly! - // - // this also means that there are no other values with the same - // hash prefix in this dict. - // - // We still need to check if the key matches, but if it does we know for - // sure that this is the correct value, and if it doesn't that we don't - // contain the value in question. - const dataidx = Math.imul(index(node.datamap, bit), 2); - return isEqual(key, data[dataidx]) ? data[dataidx + 1] : noElementMarker; - } else { - // if the hash bit is not set in neither bitmaps, we immediately know that - // this key cannot be inside this dict. - return noElementMarker; - } - } - - // our shift has exceeded 32 bits. Everything that follows is - // implicitely an overflow node and only contains direct children. - const overflow = node.data; - for (let i = 0; i < overflow.length; i += 2) { - if (isEqual(key, overflow[i])) { - return overflow[i + 1]; - } - } - - return noElementMarker; -} - -/** - * We use "transient" values to allow for safer internal mutations of the data - * structure. This is an optimisation only. No mutable API is exposed to the user. - * - * Transients are to be treated as having a linear (single-use, think rust) type. - * A transient value becomes invalid as soon as it's passed to one of the functions. - * - * Internally, we track a "generation" value on each node. If the generation - * doesn't match the one for the current transient, we have to copy - the node - * could still be referenced by another dict instance! - * After that, no other references than the transient one exists, so it's safe - * to mutate in place. - */ -export function toTransient(dict) { - return { - generation: nextGeneration(dict), - root: dict.root, - size: dict.size, - dict: dict, - }; -} - -/** - * Consume a transient, producing a normal Dict again. - */ -export function fromTransient(transient) { - if (transient.root === transient.dict.root) { - return transient.dict; - } - - return new Dict(transient.size, transient.root); -} - -/** - * Find and allocate the next generation id. - * - * @template K,V - * @param {Dict} dict - * @returns {number} - */ -function nextGeneration(dict) { - const root = dict.root; - if (root[generationKey] < Number.MAX_SAFE_INTEGER) { - return root[generationKey] + 1; - } - - // we have reached MAX_SAFE_INTEGER generations - - // at this point, we have to walk the dictionary once to reset the counter - // on every node. This is safe since it's part of the contract for transient - // that only one of them exists at any given time. - // - const queue = [root]; - while (queue.length) { - // order doesn't matter, so we can use push/pop for faster array usage. - const node = queue.pop(); - - // reset the generation to 0 - node[generationKey] = 0; - - // queue all other referenced nodes - // We need to query the length from the nodemap, as we don't know if this - // is an overflow node or not! if it is, it will never have datamap set! - const nodeStart = data.length - popcount(node.nodemap); - for (let i = nodeStart; i < node.data.length; ++i) { - queue.push(node.data[i]); - } - } - - return 1; -} - -/// Insert is the second-most performance-sensitive operation. -/// We use a global "transient" value here to avoid doing a memory allocation. -const globalTransient = /* @__PURE__ */ toTransient(emptyDict); - -export function insert(dict, key, value) { - globalTransient.generation = nextGeneration(dict); - globalTransient.size = dict.size; - - const hash = getHash(key); - const root = insertIntoNode(globalTransient, dict.root, key, value, hash, 0); - if (root === dict.root) { - return dict; - } - - return new Dict(globalTransient.size, root); -} - -/** - * Consume a transient, writing a new key/value pair into the dictionary it - * represents. If the key already exists, it will be overwritten. - * - * Returns a new transient. - */ -export function destructiveTransientInsert(key, value, transient) { - const hash = getHash(key); - transient.root = insertIntoNode(transient, transient.root, key, value, hash, 0); - return transient; -} - -/** - * Consume a transient, writing a new key/value pair if the key doesn't exist or updating - * the existing value with a function if it does. - * - * Returns a new transient. - */ -export function destructiveTransientUpdateWith(key, fun, value, transient) { - const hash = getHash(key); - - const existing = lookup(transient.root, key, hash); - if (existing !== noElementMarker) { - value = fun(existing); - } - transient.root = insertIntoNode(transient, transient.root, key, value, hash, 0); - return transient; -} - -function insertIntoNode(transient, node, key, value, hash, shift) { - const data = node.data; - const generation = transient.generation; - - // 1. Overflow Node - // overflow nodes only contain key/value-pairs. we walk the data linearly trying to find a match. - if (shift > 32) { - for (let i = 0; i < data.length; i += 2) { - if (isEqual(key, data[i])) { - return copyAndSet(node, generation, i + 1, value); - } - } - - transient.size += 1; - return copyAndInsertPair(node, generation, 0, data.length, key, value); - } - - const bit = hashbit(hash, shift); - - // 2. Child Node - // We have to check first if there is already a child node we have to traverse to. - if (node.nodemap & bit) { - const nodeidx = data.length - 1 - index(node.nodemap, bit); - - let child = data[nodeidx]; - child = insertIntoNode(transient, child, key, value, hash, shift + bits); - return copyAndSet(node, generation, nodeidx, child); - } - - // 3. New Data Node - // No child node and no data node exists yet, so we can potentially just insert a new value. - const dataidx = Math.imul(index(node.datamap, bit), 2); - if ((node.datamap & bit) === 0) { - transient.size += 1; - return copyAndInsertPair(node, generation, bit, dataidx, key, value); - } - - // 4. Existing Data Node - // We have a match that we can update, or remove. - if (isEqual(key, data[dataidx])) { - return copyAndSet(node, generation, dataidx + 1, value); - } - - // 5. Collision - // There is no child node, but a data node with the same hash, but with a different key. - // To resolve this, we push both nodes down one level. - const childShift = shift + bits; - - let child = emptyNode; - child = insertIntoNode(transient, child, key, value, hash, childShift); - - const key2 = data[dataidx]; - const value2 = data[dataidx + 1]; - const hash2 = getHash(key2); - child = insertIntoNode(transient, child, key2, value2, hash2, childShift); - - // we inserted 2 elements, but implicitely deleted the one we pushed down from the datamap. - transient.size -= 1; - - // remove the old data pair, and insert the new child node. - const length = data.length; - const nodeidx = length - 1 - index(node.nodemap, bit); - - // writing these loops in javascript instead of a combination of splices - // turns out to be faster. Copying always turned out to be faster. - const newData = new Array(length - 1); - - let readIndex = 0; - let writeIndex = 0; - - // [0..dataidx, skip 2 elements, ..nodeidx, newChild, ..rest] - while (readIndex < dataidx) newData[writeIndex++] = data[readIndex++]; - readIndex += 2; - while (readIndex <= nodeidx) newData[writeIndex++] = data[readIndex++]; - newData[writeIndex++] = child; - while (readIndex < length) newData[writeIndex++] = data[readIndex++]; - - return makeNode(generation, node.datamap ^ bit, node.nodemap | bit, newData); -} - -/** - * Consume a transient, removing a key if it exists. - * Returns a new transient. - */ -export function destructiveTransientDelete(key, transient) { - const hash = getHash(key); - transient.root = deleteFromNode(transient, transient.root, key, hash, 0); - return transient; -} - -function deleteFromNode(transient, node, key, hash, shift) { - const data = node.data; - const generation = transient.generation; - - // 1. Overflow Node - // overflow nodes only contain key/value-pairs. we walk the data linearly trying to find a match. - if (shift > 32) { - for (let i = 0; i < data.length; i += 2) { - if (isEqual(key, data[i])) { - transient.size -= 1; - return copyAndRemovePair(node, generation, 0, i); - } - } - - return node; - } - - const bit = hashbit(hash, shift); - const dataidx = Math.imul(index(node.datamap, bit), 2); - - // 2. Child Node - // We have to check first if there is already a child node we have to traverse to. - if ((node.nodemap & bit) !== 0) { - const nodeidx = data.length - 1 - index(node.nodemap, bit); - - let child = data[nodeidx]; - child = deleteFromNode(transient, child, key, hash, shift + bits); - - // the node did change, so let's copy to incorporate that change. - if (child.nodemap !== 0 || child.data.length > 2) { - return copyAndSet(node, generation, nodeidx, child); - } - - // this node only has a single data (k/v-pair) child. - // to restore the CHAMP invariant, we "pull" that pair up into ourselves. - // this ensures that every tree stays in its single optimal representation, - // and allows dicts to be structurally compared. - const length = data.length; - const newData = new Array(length + 1); - - let readIndex = 0; - let writeIndex = 0; - - while (readIndex < dataidx) newData[writeIndex++] = data[readIndex++]; - newData[writeIndex++] = child.data[0]; - newData[writeIndex++] = child.data[1]; - while (readIndex < nodeidx) newData[writeIndex++] = data[readIndex++]; - readIndex++; - while (readIndex < length) newData[writeIndex++] = data[readIndex++]; - - return makeNode(generation, node.datamap | bit, node.nodemap ^ bit, newData); - } - - // 3. Data Node - // There is no data entry here, or it is a prefix for a different key - if ((node.datamap & bit) === 0 || !isEqual(key, data[dataidx])) { - return node; - } - - // we found a data entry that we can delete. - transient.size -= 1; - return copyAndRemovePair(node, generation, bit, dataidx); -} - -export function map(dict, fun) { - // map can never modify the structure, so we can walk the dictionary directly, - // but still move to a new generation to make sure we get a new copy of every node. - const generation = nextGeneration(dict); - const root = copyNode(dict.root, generation); - const queue = [root]; - - while (queue.length) { - // order doesn't matter, so we can use push/pop for faster array usage. - const node = queue.pop(); - const data = node.data; - // every node contains popcount(datamap) direct entries - // We need to query the length from the nodemap, as we don't know if this - // is an overflow node or not! if it is, it will never have datamap set! - const edgesStart = data.length - popcount(node.nodemap); - for (let i = 0; i < edgesStart; i += 2) { - // we copied the node while queueing it, so direct mutation here is safe. - data[i + 1] = fun(data[i], data[i + 1]); - } - // the remaining entries are other nodes we can queue - for (let i = edgesStart; i < data.length; ++i) { - // copy the node first to make it safe to mutate - data[i] = copyNode(data[i], generation); - queue.push(data[i]); - } - } - - return new Dict(dict.size, root); -} - -export function fold(dict, state, fun) { - const queue = [dict.root]; - - while (queue.length) { - // order doesn't matter, so we can use push/pop for faster array usage. - const node = queue.pop(); - const data = node.data; - // every node contains popcount(datamap) direct entries - // We need to query the length from the nodemap, as we don't know if this - // is an overflow node or not! if it is, it will never have datamap set! - const edgesStart = data.length - popcount(node.nodemap); - for (let i = 0; i < edgesStart; i += 2) { - state = fun(state, data[i], data[i + 1]); - } - // the remaining entries are child nodes we can queue. - for (let i = edgesStart; i < data.length; ++i) { - queue.push(data[i]); - } - } - - return state; -} - -/** - * How many `1` bits are set in a 32-bit integer. - */ -function popcount(n) { - n -= (n >>> 1) & 0x55555555; - n = (n & 0x33333333) + ((n >>> 2) & 0x33333333); - return Math.imul((n + (n >>> 4)) & 0x0f0f0f0f, 0x01010101) >>> 24; -} - -/** - * Given a population bitmap and a bit selected from that map, returns - * how many less significant 1 bits there are. - * - * For example, index(10101, 100) returns 1, since there is a single less - * significant `1` bit. This translates to the 0-based "index" of that bit. - */ -function index(bitmap, bit) { - return popcount(bitmap & (bit - 1)); -} - -/** - * Extracts a single slice of the hash, and returns a bitmask for the resulting value. - * For example, if the slice returns 5, this function returns 10000 = 1 << 5. - */ -function hashbit(hash, shift) { - return 1 << ((hash >>> shift) & mask); -} diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@@compile.erl b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@@compile.erl deleted file mode 100644 index a33a205..0000000 --- a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@@compile.erl +++ /dev/null @@ -1,180 +0,0 @@ -#!/usr/bin/env escript --mode(compile). - -% TODO: Don't concurrently print warnings and errors -% TODO: Some tests - -main(_) -> - ok = io:setopts([binary, {encoding, utf8}]), - ok = configure_logging(), - compile_package_loop(). - -compile_package_loop() -> - case io:get_line("") of - eof -> ok; - Line -> - Chars = unicode:characters_to_list(Line), - {ok, Tokens, _} = erl_scan:string(Chars), - {ok, {Lib, Out, Modules}} = erl_parse:parse_term(Tokens), - case compile_package(Lib, Out, Modules) of - {ok, ModuleNames} -> - PrintModuleName = fun(ModuleName) -> - io:put_chars("gleam-compile-module:" ++ atom_to_list(ModuleName) ++ "\n") - end, - lists:map(PrintModuleName, ModuleNames), - io:put_chars("gleam-compile-result-ok\n"); - err -> - io:put_chars("gleam-compile-result-error\n") - end, - compile_package_loop() - end. - -compile_package(Lib, Out, Modules) -> - IsElixirModule = fun(Module) -> - filename:extension(Module) =:= ".ex" - end, - {ElixirModules, ErlangModules} = lists:partition(IsElixirModule, Modules), - ok = filelib:ensure_dir([Out, $/]), - ok = add_lib_to_erlang_path(Lib), - {ErlangOk, ErlangBeams} = compile_erlang(ErlangModules, Out), - {ElixirOk, ElixirBeams} = case ErlangOk of - true -> compile_elixir(ElixirModules, Out); - false -> {false, []} - end, - ok = del_lib_from_erlang_path(Lib), - case ErlangOk andalso ElixirOk of - true -> - ModuleNames = proplists:get_keys(ErlangBeams ++ ElixirBeams), - {ok, ModuleNames}; - false -> - err - 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, ModuleName, Beam} -> collect_results({Result, [{ModuleName, 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, ModuleName, 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,elixir.app"}), - case application:ensure_all_started([compiler, 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}, {return_diagnostics, true}], - % 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}), - {ModuleAtom, 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(expand_lib_paths(Lib)). - --if(?OTP_RELEASE >= 26). -del_lib_from_erlang_path(Lib) -> - code:del_paths(expand_lib_paths(Lib)). --else. -del_lib_from_erlang_path(Lib) -> - lists:foreach(fun code:del_path/1, expand_lib_paths(Lib)). --endif. - -expand_lib_paths(Lib) -> - filelib:wildcard([Lib, "/*/ebin"]). - -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 -> io:fwrite("~p~n", [Term]), ok; - false -> ok - end. diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache deleted file mode 100644 index fe337e57bbade021ed6033f66447c9d383906326..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14764 zcmdU04|rTvm7n|O&zpJ4Oy=fgl9@?n<~0TT$F^zawgs|htj>1Ejv@W zmf=jHszvJ?N{{5VmYg<{&A0Swg`retpk*jO!apz7%hB{uf6GX!@4D20mTxI`#QSN< z=lYBn7|I-JnO?!+SSz$&E6|7A+Q00QZxcG#-66Q-lxuKZzsn`R-`%n91~kX9U(-$1uy%HOR@B!zNin%x}26OXn7^2WVBrh#HZ+rqV$d_gV}T@of%MuM~4dO zks%GgW>UGdmR}}G%KZ7t`rWBvyw2lWPfw4&Qb{p*w(x!1bJ=0&Sq>d6Z0;Q`6trCP zq9sbn>+M5h&5O1zl9ZMfW$7iQzZp&R8oYb4N0JEstre(ykoxu;E5QH`Lz9boN5;C1 z88{q9<-^p!e{$I}Lp=!^aD`na4iDxhXSNa8C#xQwswLKpi1#uF@G`7p#+pjB5MLY7o$xE-eop7ptjWU8Pob(uL<>Y! zpe3vEu8!E3Z7>-7nG{upFWM47&iLIXfK(p*>h5+P&PZFZ@w>AVEz_6^XI%>AOT~u+5}b8kZJy=F4dW})?n6o z2D3^hTAp7HH#;OgCX&eBzU=TwDyQk|d24DtrZL&49@N(|o8)JxLnYf$(WqeMNgC>< z=feOE(lAk*2uWu_-O0Y?NnuS2~btA~|&99BjU>9>jcQRvT2 zczFXUF4E#ftf)K6I%D}tVOMs_$iV94mArQSsFvx23CeDV)qyRV-Mr{*T)295>m`>g zQC6=`UUG?LKsFX&icChMMss^da~szsqh@n^d-1E)Vnb<*)+I`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sp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_meta b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_meta deleted file mode 100644 index ade12045a8ce34e373cd0a89ab923b667c5f5832..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1253 zcmY+@YiN&A7y$4y+iY{0yD=MEeqRD&hx&#=RD83e>=Z0L`GC} zqLPUMvuXd|!rJ2H1;trHOX%?5()yC(!lD&R#Y#B-=|^SL&AmyzqasPB3|c?i`hIKP z1~zh$%QQ1Ueiqr3afCZWw+UeogDIkzW4t29CSsXI4hMKbhzTKz@nkTI92Rqed(=`- zQfvq#8O<2-Sw;odiESG~0;3qqDk``^1Mm4okGK$el1Vn3I7lgnI7uzf`9N}f2tydg za7HkdBKC2VOH@)tH7|Khs-mS+zzM2p;yXY2%^!xg3t=AfIYb%doTrMD z<}B6J@PH4*_i!`}WE!){WhpwPgoIAA8t&due!Z-@q!8PiL zOR;wrQNau1QbU-*e#*JXWv)`m7c%;~|7@g&+tky*D-!zYN75L;N-j{(W18rn<~}l( J@ev_1{sA!;t|b5f diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_array.erl b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_array.erl deleted file mode 100644 index 7df56ce..0000000 --- a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bit_array.erl +++ /dev/null @@ -1,347 +0,0 @@ --module(gleam@bit_array). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/bit_array.gleam"). --export([from_string/1, bit_size/1, byte_size/1, pad_to_bytes/1, slice/3, is_utf8/1, to_string/1, concat/1, append/2, base64_encode/2, base64_decode/1, base64_url_encode/2, base64_url_decode/1, base16_encode/1, base16_decode/1, inspect/1, compare/2, starts_with/2]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC(" BitArrays are a sequence of binary data of any length.\n"). - --file("src/gleam/bit_array.gleam", 11). -?DOC(" Converts a UTF-8 `String` type into a `BitArray`.\n"). --spec from_string(binary()) -> bitstring(). -from_string(X) -> - gleam_stdlib:identity(X). - --file("src/gleam/bit_array.gleam", 17). -?DOC(" Returns an integer which is the number of bits in the bit array.\n"). --spec bit_size(bitstring()) -> integer(). -bit_size(X) -> - erlang:bit_size(X). - --file("src/gleam/bit_array.gleam", 23). -?DOC(" Returns an integer which is the number of bytes in the bit array.\n"). --spec byte_size(bitstring()) -> integer(). -byte_size(X) -> - erlang:byte_size(X). - --file("src/gleam/bit_array.gleam", 29). -?DOC(" Pads a bit array with zeros so that it is a whole number of bytes.\n"). --spec pad_to_bytes(bitstring()) -> bitstring(). -pad_to_bytes(X) -> - gleam_stdlib:bit_array_pad_to_bytes(X). - --file("src/gleam/bit_array.gleam", 54). -?DOC( - " Extracts a sub-section of a bit array.\n" - "\n" - " The slice will start at given position and continue up to specified\n" - " length.\n" - " A negative length can be used to extract bytes at the end of a bit array.\n" - "\n" - " This function runs in constant time.\n" -). --spec slice(bitstring(), integer(), integer()) -> {ok, bitstring()} | - {error, nil}. -slice(String, Position, Length) -> - gleam_stdlib:bit_array_slice(String, Position, Length). - --file("src/gleam/bit_array.gleam", 67). --spec is_utf8_loop(bitstring()) -> boolean(). -is_utf8_loop(Bits) -> - case Bits of - <<>> -> - true; - - <<_/utf8, Rest/binary>> -> - is_utf8_loop(Rest); - - _ -> - false - end. - --file("src/gleam/bit_array.gleam", 62). -?DOC(" Tests to see whether a bit array is valid UTF-8.\n"). --spec is_utf8(bitstring()) -> boolean(). -is_utf8(Bits) -> - is_utf8_loop(Bits). - --file("src/gleam/bit_array.gleam", 88). -?DOC( - " Converts a bit array to a string.\n" - "\n" - " Returns an error if the bit array is invalid UTF-8 data.\n" -). --spec to_string(bitstring()) -> {ok, binary()} | {error, nil}. -to_string(Bits) -> - case is_utf8(Bits) of - true -> - {ok, gleam_stdlib:identity(Bits)}; - - false -> - {error, nil} - end. - --file("src/gleam/bit_array.gleam", 109). -?DOC( - " Creates a new bit array by joining multiple binaries.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " concat([from_string(\"butter\"), from_string(\"fly\")])\n" - " // -> from_string(\"butterfly\")\n" - " ```\n" -). --spec concat(list(bitstring())) -> bitstring(). -concat(Bit_arrays) -> - gleam_stdlib:bit_array_concat(Bit_arrays). - --file("src/gleam/bit_array.gleam", 40). -?DOC( - " Creates a new bit array by joining two bit arrays.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " append(to: from_string(\"butter\"), suffix: from_string(\"fly\"))\n" - " // -> from_string(\"butterfly\")\n" - " ```\n" -). --spec append(bitstring(), bitstring()) -> bitstring(). -append(First, Second) -> - gleam_stdlib:bit_array_concat([First, Second]). - --file("src/gleam/bit_array.gleam", 118). -?DOC( - " Encodes a BitArray into a base 64 encoded string.\n" - "\n" - " If the bit array does not contain a whole number of bytes then it is padded\n" - " with zero bits prior to being encoded.\n" -). --spec base64_encode(bitstring(), boolean()) -> binary(). -base64_encode(Input, Padding) -> - gleam_stdlib:base64_encode(Input, Padding). - --file("src/gleam/bit_array.gleam", 122). -?DOC(" Decodes a base 64 encoded string into a `BitArray`.\n"). --spec base64_decode(binary()) -> {ok, bitstring()} | {error, nil}. -base64_decode(Encoded) -> - Padded = case erlang:byte_size(gleam_stdlib:identity(Encoded)) rem 4 of - 0 -> - Encoded; - - N -> - gleam@string:append( - Encoded, - gleam@string:repeat(<<"="/utf8>>, 4 - N) - ) - end, - gleam_stdlib:base64_decode(Padded). - --file("src/gleam/bit_array.gleam", 140). -?DOC( - " Encodes a `BitArray` into a base 64 encoded string with URL and filename\n" - " safe alphabet.\n" - "\n" - " If the bit array does not contain a whole number of bytes then it is padded\n" - " with zero bits prior to being encoded.\n" -). --spec base64_url_encode(bitstring(), boolean()) -> binary(). -base64_url_encode(Input, Padding) -> - _pipe = Input, - _pipe@1 = gleam_stdlib:base64_encode(_pipe, Padding), - _pipe@2 = gleam@string:replace(_pipe@1, <<"+"/utf8>>, <<"-"/utf8>>), - gleam@string:replace(_pipe@2, <<"/"/utf8>>, <<"_"/utf8>>). - --file("src/gleam/bit_array.gleam", 150). -?DOC( - " Decodes a base 64 encoded string with URL and filename safe alphabet into a\n" - " `BitArray`.\n" -). --spec base64_url_decode(binary()) -> {ok, bitstring()} | {error, nil}. -base64_url_decode(Encoded) -> - _pipe = Encoded, - _pipe@1 = gleam@string:replace(_pipe, <<"-"/utf8>>, <<"+"/utf8>>), - _pipe@2 = gleam@string:replace(_pipe@1, <<"_"/utf8>>, <<"/"/utf8>>), - base64_decode(_pipe@2). - --file("src/gleam/bit_array.gleam", 164). -?DOC( - " Encodes a `BitArray` into a base 16 encoded string.\n" - "\n" - " If the bit array does not contain a whole number of bytes then it is padded\n" - " with zero bits prior to being encoded.\n" -). --spec base16_encode(bitstring()) -> binary(). -base16_encode(Input) -> - gleam_stdlib:base16_encode(Input). - --file("src/gleam/bit_array.gleam", 170). -?DOC(" Decodes a base 16 encoded string into a `BitArray`.\n"). --spec base16_decode(binary()) -> {ok, bitstring()} | {error, nil}. -base16_decode(Input) -> - gleam_stdlib:base16_decode(Input). - --file("src/gleam/bit_array.gleam", 191). --spec inspect_loop(bitstring(), binary()) -> binary(). -inspect_loop(Input, Accumulator) -> - case Input of - <<>> -> - Accumulator; - - <> -> - <<<>/binary, - ":size(1)"/utf8>>; - - <> -> - <<<>/binary, - ":size(2)"/utf8>>; - - <> -> - <<<>/binary, - ":size(3)"/utf8>>; - - <> -> - <<<>/binary, - ":size(4)"/utf8>>; - - <> -> - <<<>/binary, - ":size(5)"/utf8>>; - - <> -> - <<<>/binary, - ":size(6)"/utf8>>; - - <> -> - <<<>/binary, - ":size(7)"/utf8>>; - - <> -> - Suffix = case Rest of - <<>> -> - <<""/utf8>>; - - _ -> - <<", "/utf8>> - end, - Accumulator@1 = <<<>/binary, - Suffix/binary>>, - inspect_loop(Rest, Accumulator@1); - - _ -> - Accumulator - end. - --file("src/gleam/bit_array.gleam", 187). -?DOC( - " Converts a bit array to a string containing the decimal value of each byte.\n" - "\n" - " Use this over `string.inspect` when you have a bit array you want printed\n" - " in the array syntax even if it is valid UTF-8.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " inspect(<<0, 20, 0x20, 255>>)\n" - " // -> \"<<0, 20, 32, 255>>\"\n" - "\n" - " inspect(<<100, 5:3>>)\n" - " // -> \"<<100, 5:size(3)>>\"\n" - " ```\n" -). --spec inspect(bitstring()) -> binary(). -inspect(Input) -> - <<(inspect_loop(Input, <<"<<"/utf8>>))/binary, ">>"/utf8>>. - --file("src/gleam/bit_array.gleam", 232). -?DOC( - " Compare two bit arrays as sequences of bytes.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " compare(<<1>>, <<2>>)\n" - " // -> Lt\n" - "\n" - " compare(<<\"AB\":utf8>>, <<\"AA\":utf8>>)\n" - " // -> Gt\n" - "\n" - " compare(<<1, 2:size(2)>>, with: <<1, 2:size(2)>>)\n" - " // -> Eq\n" - " ```\n" -). --spec compare(bitstring(), bitstring()) -> gleam@order:order(). -compare(A, B) -> - case {A, B} of - {<>, - <>} -> - case {First_byte, Second_byte} of - {F, S} when F > S -> - gt; - - {F@1, S@1} when F@1 < S@1 -> - lt; - - {_, _} -> - compare(First_rest, Second_rest) - end; - - {<<>>, <<>>} -> - eq; - - {_, <<>>} -> - gt; - - {<<>>, _} -> - lt; - - {First, Second} -> - case {gleam_stdlib:bit_array_to_int_and_size(First), - gleam_stdlib:bit_array_to_int_and_size(Second)} of - {{A@1, _}, {B@1, _}} when A@1 > B@1 -> - gt; - - {{A@2, _}, {B@2, _}} when A@2 < B@2 -> - lt; - - {{_, Size_a}, {_, Size_b}} when Size_a > Size_b -> - gt; - - {{_, Size_a@1}, {_, Size_b@1}} when Size_a@1 < Size_b@1 -> - lt; - - {_, _} -> - eq - end - end. - --file("src/gleam/bit_array.gleam", 273). -?DOC( - " Checks whether the first `BitArray` starts with the second one.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " starts_with(<<1, 2, 3, 4>>, <<1, 2>>)\n" - " // -> True\n" - " ```\n" -). --spec starts_with(bitstring(), bitstring()) -> boolean(). -starts_with(Bits, Prefix) -> - Prefix_size = erlang:bit_size(Prefix), - case Bits of - <> when Pref =:= Prefix -> - true; - - _ -> - false - end. diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.cache deleted file mode 100644 index 72525c246aead8001a24610a46b1a2aec5805475..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8850 zcmd5?4RBo5b>91a_U*pim2~&*t|DsC)q?+oELl3HHmd)GY`_K_tz_331>=3%eOf(x zf5h9jvSlCx2@S=QP#~sBrp<&&NMaHvPzntUagv#4hBO0|bke3{rmaJ0Qm6?j(9qB( z>bdvru68Bam<;WBtljtay>rjK_ndRj&v)EK6!~xD5fb+K=$dhAYt;UVu`^8Q@&m?r zm>8#8NPpK$lJSl~jCbP1h{lMaC&*kbZ<&R@iIPt)<-H&K%dW3Ao3|(C`esb0uTXUL zJ}Z;Ar^{BKV@;RJeG`_OH;cKxe0iGRuMyXZozM17o0)@V&MNl_w#bR|=_@-K?*YzJ z%J=5-8qT>@8d@dM8wQ51R}88+!!boM{zE-5{FbU1&uN3h&uWUXJ(wKc7E}y1G&&pz zDMlfD(QrPj82eh1!#B1l##ItAM)C8KiknhNXRcy8+0+Llf9k(TFclz#65S^ef-;Fe zlX_h8`{Yy@zX{#bP4^7YeHu;abcCdK6G9}PUr_dIskNN4^(tI!r`U*(jPOzTC8&^6 zB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wxy?vT+oY@3$0I#taeRLBA1a~Mn)Y9@?F^wWQ+~uoeAZM zbmVXV<_M~&2+D*(|3GJqW_P}&IVbv;TQb!MmEuoQSM*3#Oe8G(Wie0kOHR%?IXUO#|6Ht{voO4?xc>(; zvi3J#TQQ^Ui1#xgWLhj@C70-GZ4qT01mt5xY9Y1o5)YkSglr+XLodx8xjCGW7n4dY$S$^ds%B*06^|{KPS;xy~&f(nPd<2%pf4 z-b`W&d3;R~B^;rGU#OvhMxOCE@f||=n8Bp+8RM8wF>Bet396}~mPVTShgKhi(1}kO z$>)q`8pUj8JG&{PmO6f;o(Dt{yoqE|nM@Y5m`w?#lv61xpDCac^okQqM4+fCUVhUKn z8mK$6X%N!W*KAAxt2LRcvGndpXW!ns`ZvBspOOqe&;mPEJxu zBr2PHM2xXaXBG=t&uLnSbk(2qWdLbRWHR&EMIFtgbPHh^napGkg?!6VZctAP?Yqk| M{pkOWuKBP21vwwBrvLx| diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.erl b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.erl deleted file mode 100644 index 36b5a0b..0000000 --- a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bool.erl +++ /dev/null @@ -1,352 +0,0 @@ --module(gleam@bool). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/bool.gleam"). --export(['and'/2, 'or'/2, negate/1, nor/2, nand/2, exclusive_or/2, exclusive_nor/2, to_string/1, guard/3, lazy_guard/3]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " A type with two possible values, `True` and `False`. Used to indicate whether\n" - " things are... true or false!\n" - "\n" - " It is often clearer and offers more type safety to define a custom type\n" - " than to use `Bool`. For example, rather than having a `is_teacher: Bool`\n" - " field consider having a `role: SchoolRole` field where `SchoolRole` is a custom\n" - " type that can be either `Student` or `Teacher`.\n" -). - --file("src/gleam/bool.gleam", 31). -?DOC( - " Returns the and of two bools, but it evaluates both arguments.\n" - "\n" - " It's the function equivalent of the `&&` operator.\n" - " This function is useful in higher order functions or pipes.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " and(True, True)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " and(False, True)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " False |> and(True)\n" - " // -> False\n" - " ```\n" -). --spec 'and'(boolean(), boolean()) -> boolean(). -'and'(A, B) -> - A andalso B. - --file("src/gleam/bool.gleam", 57). -?DOC( - " Returns the or of two bools, but it evaluates both arguments.\n" - "\n" - " It's the function equivalent of the `||` operator.\n" - " This function is useful in higher order functions or pipes.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " or(True, True)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " or(False, True)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " False |> or(True)\n" - " // -> True\n" - " ```\n" -). --spec 'or'(boolean(), boolean()) -> boolean(). -'or'(A, B) -> - A orelse B. - --file("src/gleam/bool.gleam", 77). -?DOC( - " Returns the opposite bool value.\n" - "\n" - " This is the same as the `!` or `not` operators in some other languages.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " negate(True)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " negate(False)\n" - " // -> True\n" - " ```\n" -). --spec negate(boolean()) -> boolean(). -negate(Bool) -> - not Bool. - --file("src/gleam/bool.gleam", 105). -?DOC( - " Returns the nor of two bools.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " nor(False, False)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " nor(False, True)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " nor(True, False)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " nor(True, True)\n" - " // -> False\n" - " ```\n" -). --spec nor(boolean(), boolean()) -> boolean(). -nor(A, B) -> - not (A orelse B). - --file("src/gleam/bool.gleam", 133). -?DOC( - " Returns the nand of two bools.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " nand(False, False)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " nand(False, True)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " nand(True, False)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " nand(True, True)\n" - " // -> False\n" - " ```\n" -). --spec nand(boolean(), boolean()) -> boolean(). -nand(A, B) -> - not (A andalso B). - --file("src/gleam/bool.gleam", 161). -?DOC( - " Returns the exclusive or of two bools.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " exclusive_or(False, False)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " exclusive_or(False, True)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " exclusive_or(True, False)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " exclusive_or(True, True)\n" - " // -> False\n" - " ```\n" -). --spec exclusive_or(boolean(), boolean()) -> boolean(). -exclusive_or(A, B) -> - A /= B. - --file("src/gleam/bool.gleam", 189). -?DOC( - " Returns the exclusive nor of two bools.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " exclusive_nor(False, False)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " exclusive_nor(False, True)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " exclusive_nor(True, False)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " exclusive_nor(True, True)\n" - " // -> True\n" - " ```\n" -). --spec exclusive_nor(boolean(), boolean()) -> boolean(). -exclusive_nor(A, B) -> - A =:= B. - --file("src/gleam/bool.gleam", 207). -?DOC( - " Returns a string representation of the given bool.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_string(True)\n" - " // -> \"True\"\n" - " ```\n" - "\n" - " ```gleam\n" - " to_string(False)\n" - " // -> \"False\"\n" - " ```\n" -). --spec to_string(boolean()) -> binary(). -to_string(Bool) -> - case Bool of - false -> - <<"False"/utf8>>; - - true -> - <<"True"/utf8>> - end. - --file("src/gleam/bool.gleam", 266). -?DOC( - " Run a callback function if the given bool is `False`, otherwise return a\n" - " default value.\n" - "\n" - " With a `use` expression this function can simulate the early-return pattern\n" - " found in some other programming languages.\n" - "\n" - " In a procedural language:\n" - "\n" - " ```js\n" - " if (predicate) return value;\n" - " // ...\n" - " ```\n" - "\n" - " In Gleam with a `use` expression:\n" - "\n" - " ```gleam\n" - " use <- guard(when: predicate, return: value)\n" - " // ...\n" - " ```\n" - "\n" - " Like everything in Gleam `use` is an expression, so it short circuits the\n" - " current block, not the entire function. As a result you can assign the value\n" - " to a variable:\n" - "\n" - " ```gleam\n" - " let x = {\n" - " use <- guard(when: predicate, return: value)\n" - " // ...\n" - " }\n" - " ```\n" - "\n" - " Note that unlike in procedural languages the `return` value is evaluated\n" - " even when the predicate is `False`, so it is advisable not to perform\n" - " expensive computation nor side-effects there.\n" - "\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let name = \"\"\n" - " use <- guard(when: name == \"\", return: \"Welcome!\")\n" - " \"Hello, \" <> name\n" - " // -> \"Welcome!\"\n" - " ```\n" - "\n" - " ```gleam\n" - " let name = \"Kamaka\"\n" - " use <- guard(when: name == \"\", return: \"Welcome!\")\n" - " \"Hello, \" <> name\n" - " // -> \"Hello, Kamaka\"\n" - " ```\n" -). --spec guard(boolean(), BTS, fun(() -> BTS)) -> BTS. -guard(Requirement, Consequence, Alternative) -> - case Requirement of - true -> - Consequence; - - false -> - Alternative() - end. - --file("src/gleam/bool.gleam", 307). -?DOC( - " Runs a callback function if the given bool is `True`, otherwise runs an\n" - " alternative callback function.\n" - "\n" - " Useful when further computation should be delayed regardless of the given\n" - " bool's value.\n" - "\n" - " See [`guard`](#guard) for more info.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let name = \"Kamaka\"\n" - " let inquiry = fn() { \"How may we address you?\" }\n" - " use <- lazy_guard(when: name == \"\", return: inquiry)\n" - " \"Hello, \" <> name\n" - " // -> \"Hello, Kamaka\"\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - "\n" - " let name = \"\"\n" - " let greeting = fn() { \"Hello, \" <> name }\n" - " use <- lazy_guard(when: name == \"\", otherwise: greeting)\n" - " let number = int.random(99)\n" - " let name = \"User \" <> int.to_string(number)\n" - " \"Welcome, \" <> name\n" - " // -> \"Welcome, User 54\"\n" - " ```\n" -). --spec lazy_guard(boolean(), fun(() -> BTT), fun(() -> BTT)) -> BTT. -lazy_guard(Requirement, Consequence, Alternative) -> - case Requirement of - true -> - Consequence(); - - false -> - Alternative() - end. diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache deleted file mode 100644 index 3f5a88ea3d1b3ea3e4c1fbffebf303595722f1c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13613 zcmeHO4R9RQeZRMRcYC+G)7`th!`Q~YwLyce*b>r%F;z?DlM%u$2CpoJprj-3No#4v zefjQWBlBqo%Ai6@T|1B#7t(2y^3e{ZKpPhlhfq3Y(heU(8k4v!%`^iHnbaAQKtihi z-rHU2B(JCpYMM3~`Q2N;d;8w|fB)bA|Gza-urqQU*+F7~0Npr6_bg*^vWaL9uOW2( zxVEi@Xk8y89W5zY%eP^e5p6&EV~k9X7A&*ao}VOjt2R`xT2>(7j1AT5fy79`&QG`R zHLLB#QoX6&8ZOwCn$=#lD&<;x-l`YO(rA03R^iVZML%H|M%pXp@O9>>RcjZkVCb56mvm|hWc|6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W&Cz;jNtG}NT4MmkOM5s z?DpiRaRFzSC9m?QrE5=z0wNvZZHE{CPI<+b6mHQ{!_0TWKMs2bo8>C5n|J{cvAn5( zVI))Zg~6>JSctG@Y!pFd_IT*8Ir>K8(( zhb=Z=-|WFPhyTS3P~u)u0l%(+;$X?sKC$nAB>t1rw;n#oIefeF2?gC%@!#}?f#;~a zBjDXX2>oHm?+9KVE_aTE+6yjui}=L0Pp7_`LZ@jfG<09pUf|t@>0eD_uM1L}_;){~ zKc(n4WSB3d#KmXvGJjTR1t(cHdM@YqwrD5shN8o~``y?PPE{!#PJ1xUvX4g;Zf!k; zfF_5v2Rtd6Q;P305D(6JjEBlKH?qO?8324YO)`{t=BL5BG)%)5=cd-Dc)(sHz2+AD zHw3pD-oesq!t25dzH?|A9>DzC|Y0W#X~9?trx_N2Dp zzWZm>X5HfT#+PyE3)LQ#l0kPHrEkiody3jUhy>Jq?lYVB9zakouJJDLvV2Sa(M_!Az%n$q1I~x*m{_06$&j(+` z?;uzqv6l;aB$Nte1@ko4nC8xt=;b^MeWssSaeMe`t~#>H`CN7A@pW-@p=6w6?@00} z@4m@P(Fog>8sjotOWnY`9|fm_&Pm+D6n_8+8&!+kVjgO`kK5uc&0GET9`{0P1L7wq zxq?K$LFkL*=lK&1@@@P?1t9$~PrpOcg)iZV9OPk7U{Go1_}rkN;FYj{QQqL)y9(jn zNjQR>E@A%^`B&bZiu{;&(>%gW*p=!v99vcXy8^oy!%9Ih9 diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_meta b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_meta deleted file mode 100644 index 3c85044d9b3b1b3dff0e7f0674eb77d02afd5fee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 903 zcmY+?Nk|ny7y#hWvNE?)>rhdr$ijuXBpwQbIz|f}>hiEMeW4XkJxDHOrFE$wmy4nu zS}ce#@L+BPd5{QH3M%Rl6bgk1Nre)9#=AK1F~j`BKR+}7tKmpA#7Dx4_#z`dmsOOO zR2H0$R!2%=v69+`l_9jUc3HS0T2R4&%L%|73YOeh4xRKgC z5!9j2RU_9leT%xfmtmKZ{mK4$sJK4sqI1*4?PTf~0qSt@g>prtz}nPQfNq!6;n zC7%N7xI-(?7-ED`ezCyDRUvHR9CvA>opIhU!w(8qhfqox<#ch6K}N}3<4$(7hqIJ( zl@1M>1B$yydya^gfw!<J;S6O&InRB1dC3@aY}pXP4hpHKF;2_>AO8R^J%?rh diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.erl b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.erl deleted file mode 100644 index e9c906b..0000000 --- a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.erl +++ /dev/null @@ -1,211 +0,0 @@ --module(gleam@bytes_tree). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/bytes_tree.gleam"). --export([append_tree/2, prepend_tree/2, concat/1, new/0, from_string/1, prepend_string/2, append_string/2, from_string_tree/1, from_bit_array/1, prepend/2, append/2, concat_bit_arrays/1, to_bit_array/1, byte_size/1]). --export_type([bytes_tree/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " `BytesTree` is a type used for efficiently building binary content to be\n" - " written to a file or a socket. Internally it is represented as a tree so to\n" - " append or prepend to a bytes tree is a constant time operation that\n" - " allocates a new node in the tree without copying any of the content. When\n" - " writing to an output stream the tree is traversed and the content is sent\n" - " directly rather than copying it into a single buffer beforehand.\n" - "\n" - " If we append one bit array to another the bit arrays must be copied to a\n" - " new location in memory so that they can sit together. This behaviour\n" - " enables efficient reading of the data but copying can be expensive,\n" - " especially if we want to join many bit arrays together.\n" - "\n" - " BytesTree is different in that it can be joined together in constant\n" - " time using minimal memory, and then can be efficiently converted to a\n" - " bit array using the `to_bit_array` function.\n" - "\n" - " Byte trees are always byte aligned, so that a number of bits that is not\n" - " divisible by 8 will be padded with 0s.\n" - "\n" - " On Erlang this type is compatible with Erlang's iolists.\n" -). - --opaque bytes_tree() :: {bytes, bitstring()} | - {text, gleam@string_tree:string_tree()} | - {many, list(bytes_tree())}. - --file("src/gleam/bytes_tree.gleam", 68). -?DOC( - " Appends a bytes tree onto the end of another.\n" - "\n" - " Runs in constant time.\n" -). --spec append_tree(bytes_tree(), bytes_tree()) -> bytes_tree(). -append_tree(First, Second) -> - gleam_stdlib:iodata_append(First, Second). - --file("src/gleam/bytes_tree.gleam", 59). -?DOC( - " Prepends a bytes tree onto the start of another.\n" - "\n" - " Runs in constant time.\n" -). --spec prepend_tree(bytes_tree(), bytes_tree()) -> bytes_tree(). -prepend_tree(Second, First) -> - gleam_stdlib:iodata_append(First, Second). - --file("src/gleam/bytes_tree.gleam", 98). -?DOC( - " Joins a list of bytes trees into a single one.\n" - "\n" - " Runs in constant time.\n" -). --spec concat(list(bytes_tree())) -> bytes_tree(). -concat(Trees) -> - gleam_stdlib:identity(Trees). - --file("src/gleam/bytes_tree.gleam", 35). -?DOC( - " Create an empty `BytesTree`. Useful as the start of a pipe chaining many\n" - " trees together.\n" -). --spec new() -> bytes_tree(). -new() -> - gleam_stdlib:identity([]). - --file("src/gleam/bytes_tree.gleam", 118). -?DOC( - " Creates a new bytes tree from a string.\n" - "\n" - " Runs in constant time when running on Erlang.\n" - " Runs in linear time otherwise.\n" -). --spec from_string(binary()) -> bytes_tree(). -from_string(String) -> - gleam_stdlib:wrap_list(String). - --file("src/gleam/bytes_tree.gleam", 80). -?DOC( - " Prepends a string onto the start of a bytes tree.\n" - "\n" - " Runs in constant time when running on Erlang.\n" - " Runs in linear time with the length of the string otherwise.\n" -). --spec prepend_string(bytes_tree(), binary()) -> bytes_tree(). -prepend_string(Second, First) -> - gleam_stdlib:iodata_append(gleam_stdlib:wrap_list(First), Second). - --file("src/gleam/bytes_tree.gleam", 89). -?DOC( - " Appends a string onto the end of a bytes tree.\n" - "\n" - " Runs in constant time when running on Erlang.\n" - " Runs in linear time with the length of the string otherwise.\n" -). --spec append_string(bytes_tree(), binary()) -> bytes_tree(). -append_string(First, Second) -> - gleam_stdlib:iodata_append(First, gleam_stdlib:wrap_list(Second)). - --file("src/gleam/bytes_tree.gleam", 128). -?DOC( - " Creates a new bytes tree from a string tree.\n" - "\n" - " Runs in constant time when running on Erlang.\n" - " Runs in linear time otherwise.\n" -). --spec from_string_tree(gleam@string_tree:string_tree()) -> bytes_tree(). -from_string_tree(Tree) -> - gleam_stdlib:wrap_list(Tree). - --file("src/gleam/bytes_tree.gleam", 136). -?DOC( - " Creates a new bytes tree from a bit array.\n" - "\n" - " Runs in constant time.\n" -). --spec from_bit_array(bitstring()) -> bytes_tree(). -from_bit_array(Bits) -> - _pipe = Bits, - _pipe@1 = gleam_stdlib:bit_array_pad_to_bytes(_pipe), - gleam_stdlib:wrap_list(_pipe@1). - --file("src/gleam/bytes_tree.gleam", 43). -?DOC( - " Prepends a bit array to the start of a bytes tree.\n" - "\n" - " Runs in constant time.\n" -). --spec prepend(bytes_tree(), bitstring()) -> bytes_tree(). -prepend(Second, First) -> - gleam_stdlib:iodata_append(from_bit_array(First), Second). - --file("src/gleam/bytes_tree.gleam", 51). -?DOC( - " Appends a bit array to the end of a bytes tree.\n" - "\n" - " Runs in constant time.\n" -). --spec append(bytes_tree(), bitstring()) -> bytes_tree(). -append(First, Second) -> - gleam_stdlib:iodata_append(First, from_bit_array(Second)). - --file("src/gleam/bytes_tree.gleam", 106). -?DOC( - " Joins a list of bit arrays into a single bytes tree.\n" - "\n" - " Runs in constant time.\n" -). --spec concat_bit_arrays(list(bitstring())) -> bytes_tree(). -concat_bit_arrays(Bits) -> - _pipe = Bits, - _pipe@1 = gleam@list:map(_pipe, fun from_bit_array/1), - gleam_stdlib:identity(_pipe@1). - --file("src/gleam/bytes_tree.gleam", 162). --spec to_list(list(list(bytes_tree())), list(bitstring())) -> list(bitstring()). -to_list(Stack, Acc) -> - case Stack of - [] -> - Acc; - - [[] | Remaining_stack] -> - to_list(Remaining_stack, Acc); - - [[{bytes, Bits} | Rest] | Remaining_stack@1] -> - to_list([Rest | Remaining_stack@1], [Bits | Acc]); - - [[{text, Tree} | Rest@1] | Remaining_stack@2] -> - Bits@1 = gleam_stdlib:identity(unicode:characters_to_binary(Tree)), - to_list([Rest@1 | Remaining_stack@2], [Bits@1 | Acc]); - - [[{many, Trees} | Rest@2] | Remaining_stack@3] -> - to_list([Trees, Rest@2 | Remaining_stack@3], Acc) - end. - --file("src/gleam/bytes_tree.gleam", 155). -?DOC( - " Turns a bytes tree into a bit array.\n" - "\n" - " Runs in linear time.\n" - "\n" - " When running on Erlang this function is implemented natively by the\n" - " virtual machine and is highly optimised.\n" -). --spec to_bit_array(bytes_tree()) -> bitstring(). -to_bit_array(Tree) -> - erlang:list_to_bitstring(Tree). - --file("src/gleam/bytes_tree.gleam", 186). -?DOC( - " Returns the size of the bytes tree's content in bytes.\n" - "\n" - " Runs in linear time.\n" -). --spec byte_size(bytes_tree()) -> integer(). -byte_size(Tree) -> - erlang:iolist_size(Tree). diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dict.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dict.cache deleted file mode 100644 index 370927e73070256fef5658d68d6c9f52bf2c32ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 28261 zcmeHv3v^V~x&NFq36o5oCnq7~eKH{=nY_qs0(k-n&9w)cdu@GGz1CK-w%Thga&0g8*DlI(m1?yQTCI9*m!-B0lA^{gskq{Evx$h&t=S05AK#vZyWY{M(PKA7Hf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=H;dw_&*x6i;g;O5(qUuXrNroc1%t%s;iBCnhYuGW zphJ0a73uFK#Z7d0OgltEa69DoBpG0YG-9;3)eW~tdI$Ypd zPdSD4Yy-ItcQoEj>4SHdeL&uTtto|)7p!R+9e&;PA|2jndXo+xHT{DQhgzQ?fxN1% HukC*T4jJs? diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_inline b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_inline deleted file mode 100644 index 1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 KcmZQzfB*mh2mk>9 diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_meta b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_meta deleted file mode 100644 index 6785fdb8225aacfc71e2ba88e60bfc21c8773490..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2441 zcmXZd3rtpJ7y#f8G7C&g5K~byG_cSpt;jG}trpqMs4QWbQeXsPEi*JVqXfHJqcX?P z(y7^nV6BOboH4tJMmLzabd|N#$)E&b*{?k{&i3q_ot^Xk=Y7BT{r=Cl-(MK|j;N@< zi?jO9bBpum%uApD$b!Q8CI8(zpV-F*o4o=R4;nfIt? z7p)xNS2{>MBZO4anZ(_cv6**hV?XWu$w`KsDQD71X9^FpfF&&FeYUfM&lnUVJ{der z3Ck#>kuUgxLv#}%DmH}aETEJXe9J%d8xX>oOkfT*)KW(mz1(0i3wW4U`I2LFbDWrg za^O1dB9C%5a+r2H=w#|3&ymdx9$*z~*~GhS)1dC5uyf%Fqj0AnMMwI6z~{T)KX6ahe?Rjm)y!TRM1Q(UG$4rM-sS{Y;u@I z5o`E_M!uk%8;69D&s-kjIlkg+jxZrXt+<7ISxhCbage__PXD3$m2;U)5tUT2jwTY% z4dDu|WHLEavz8{B89gk7`MgUF+i9ek2yw&B97$Y55gXXZCR%7?{D=^iQcnZB`Ih|* zO!Ph}T*PfW$;WJ^p4gG*f>bidB#RQNXkaH_(ZUImM~TG@awuduo7qMydub!WwMik| z!z$k406j#AJ}-o!3}ZOOJkQIlWj!C#!XaWt>nRdQCX0MtWewGIF!1~k&gL8@vXB~T zsiTorIv9`~!YC$j2L+Vz1E-G>i^0S*gggrPh!)y7Ogn!wZmil+Ks6iL!fui-2qBmI zm_;pn`H7=+5@BLW2zQdp{S@;yduXAJQK=!!CXWZGU>EV@d?$0M;03B!$NT(3^o7=* zK_oJrB|OVYUgt-S(nT-RF4Bk0ql8NKF(6Hi7{o}Xl0z{o*g_{=9H)ny#+z@d*v~Kg zNjK3G)R61BlVX-p&WpT49pBSR4`VL2Z;{Sa?xuip-lUeJj7|?>EGeW?%G0c1FDaMU zo5|;K7Ew+kF_-F9l1L_<8@ZVZ>N&vgbQ2+JVh9(L$z2rk0&mbvI~{ZqH_2Kvn-8d` zfe2BTsV~W-u#m;P#;5G$dw!#b*vrLZD0w{13U=@-o%9mn6yXXpO*ZTKjYIVE4>1|` z2l83XH?*>kBb+4uO1W|kkMjhjyv2v?=4ZM&W3t*=lFhDJ`1d6oZA7V#3Rc!h0* zOnW0^$>2I3WGTy7NfW*N%?V= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --type dict(JG, JH) :: any() | {gleam_phantom, JG, JH}. - --type transient_dict(JI, JJ) :: any() | {gleam_phantom, JI, JJ}. - --file("src/gleam/dict.gleam", 55). -?DOC( - " Determines the number of key-value pairs in the dict.\n" - " This function runs in constant time and does not need to iterate the dict.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new() |> size\n" - " // -> 0\n" - " ```\n" - "\n" - " ```gleam\n" - " new() |> insert(\"key\", \"value\") |> size\n" - " // -> 1\n" - " ```\n" -). --spec size(dict(any(), any())) -> integer(). -size(Dict) -> - maps:size(Dict). - --file("src/gleam/dict.gleam", 71). -?DOC( - " Determines whether or not the dict is empty.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new() |> is_empty\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " new() |> insert(\"b\", 1) |> is_empty\n" - " // -> False\n" - " ```\n" -). --spec is_empty(dict(any(), any())) -> boolean(). -is_empty(Dict) -> - maps:size(Dict) =:= 0. - --file("src/gleam/dict.gleam", 138). -?DOC( - " Determines whether or not a value is present in the dict for a given key.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new() |> insert(\"a\", 0) |> has_key(\"a\")\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " new() |> insert(\"a\", 0) |> has_key(\"b\")\n" - " // -> False\n" - " ```\n" -). --spec has_key(dict(KV, any()), KV) -> boolean(). -has_key(Dict, Key) -> - maps:is_key(Key, Dict). - --file("src/gleam/dict.gleam", 149). -?DOC(" Creates a fresh dict that contains no values.\n"). --spec new() -> dict(any(), any()). -new() -> - maps:new(). - --file("src/gleam/dict.gleam", 170). -?DOC( - " Fetches a value from a dict for a given key.\n" - "\n" - " The dict may not have a value for the key, so the value is wrapped in a\n" - " `Result`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new() |> insert(\"a\", 0) |> get(\"a\")\n" - " // -> Ok(0)\n" - " ```\n" - "\n" - " ```gleam\n" - " new() |> insert(\"a\", 0) |> get(\"b\")\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec get(dict(LH, LI), LH) -> {ok, LI} | {error, nil}. -get(From, Get) -> - gleam_stdlib:map_get(From, Get). - --file("src/gleam/dict.gleam", 190). -?DOC( - " Inserts a value into the dict with the given key.\n" - "\n" - " If the dict already has a value for the given key then the value is\n" - " replaced with the new value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new() |> insert(\"a\", 0)\n" - " // -> from_list([#(\"a\", 0)])\n" - " ```\n" - "\n" - " ```gleam\n" - " new() |> insert(\"a\", 0) |> insert(\"a\", 5)\n" - " // -> from_list([#(\"a\", 5)])\n" - " ```\n" -). --spec insert(dict(LN, LO), LN, LO) -> dict(LN, LO). -insert(Dict, Key, Value) -> - maps:put(Key, Value, Dict). - --file("src/gleam/dict.gleam", 112). --spec from_list_loop(transient_dict(KO, KP), list({KO, KP})) -> dict(KO, KP). -from_list_loop(Transient, List) -> - case List of - [] -> - gleam_stdlib:identity(Transient); - - [{Key, Value} | Rest] -> - from_list_loop(maps:put(Key, Value, Transient), Rest) - end. - --file("src/gleam/dict.gleam", 108). -?DOC( - " Converts a list of 2-element tuples `#(key, value)` to a dict.\n" - "\n" - " If two tuples have the same key the last one in the list will be the one\n" - " that is present in the dict.\n" -). --spec from_list(list({KJ, KK})) -> dict(KJ, KK). -from_list(List) -> - maps:from_list(List). - --file("src/gleam/dict.gleam", 217). -?DOC( - " Updates all values in a given dict by calling a given function on each key\n" - " and value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([#(3, 3), #(2, 4)])\n" - " |> map_values(fn(key, value) { key * value })\n" - " // -> from_list([#(3, 9), #(2, 8)])\n" - " ```\n" -). --spec map_values(dict(MF, MG), fun((MF, MG) -> MJ)) -> dict(MF, MJ). -map_values(Dict, Fun) -> - maps:map(Fun, Dict). - --file("src/gleam/dict.gleam", 322). --spec do_take_loop(dict(OD, OE), list(OD), transient_dict(OD, OE)) -> dict(OD, OE). -do_take_loop(Dict, Desired_keys, Acc) -> - case Desired_keys of - [] -> - gleam_stdlib:identity(Acc); - - [Key | Rest] -> - case gleam_stdlib:map_get(Dict, Key) of - {ok, Value} -> - do_take_loop(Dict, Rest, maps:put(Key, Value, Acc)); - - {error, _} -> - do_take_loop(Dict, Rest, Acc) - end - end. - --file("src/gleam/dict.gleam", 313). -?DOC( - " Creates a new dict from a given dict, only including any entries for which the\n" - " keys are in a given list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " |> take([\"b\"])\n" - " // -> from_list([#(\"b\", 1)])\n" - " ```\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " |> take([\"a\", \"b\", \"c\"])\n" - " // -> from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " ```\n" -). --spec take(dict(NP, NQ), list(NP)) -> dict(NP, NQ). -take(Dict, Desired_keys) -> - maps:with(Desired_keys, Dict). - --file("src/gleam/dict.gleam", 371). -?DOC( - " Creates a new dict from a given dict with all the same entries except for the\n" - " one with a given key, if it exists.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)]) |> delete(\"a\")\n" - " // -> from_list([#(\"b\", 1)])\n" - " ```\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)]) |> delete(\"c\")\n" - " // -> from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " ```\n" -). --spec delete(dict(OU, OV), OU) -> dict(OU, OV). -delete(Dict, Key) -> - _pipe = gleam_stdlib:identity(Dict), - _pipe@1 = maps:remove(Key, _pipe), - gleam_stdlib:identity(_pipe@1). - --file("src/gleam/dict.gleam", 408). --spec drop_loop(transient_dict(PU, PV), list(PU)) -> dict(PU, PV). -drop_loop(Transient, Disallowed_keys) -> - case Disallowed_keys of - [] -> - gleam_stdlib:identity(Transient); - - [Key | Rest] -> - drop_loop(maps:remove(Key, Transient), Rest) - end. - --file("src/gleam/dict.gleam", 399). -?DOC( - " Creates a new dict from a given dict with all the same entries except any with\n" - " keys found in a given list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)]) |> drop([\"a\"])\n" - " // -> from_list([#(\"b\", 1)])\n" - " ```\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)]) |> drop([\"c\"])\n" - " // -> from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " ```\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)]) |> drop([\"a\", \"b\", \"c\"])\n" - " // -> from_list([])\n" - " ```\n" -). --spec drop(dict(PG, PH), list(PG)) -> dict(PG, PH). -drop(Dict, Disallowed_keys) -> - maps:without(Disallowed_keys, Dict). - --file("src/gleam/dict.gleam", 441). -?DOC( - " Creates a new dict with one entry inserted or updated using a given function.\n" - "\n" - " If there was not an entry in the dict for the given key then the function\n" - " gets `None` as its argument, otherwise it gets `Some(value)`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let dict = from_list([#(\"a\", 0)])\n" - " let increment = fn(x) {\n" - " case x {\n" - " Some(i) -> i + 1\n" - " None -> 0\n" - " }\n" - " }\n" - "\n" - " upsert(dict, \"a\", increment)\n" - " // -> from_list([#(\"a\", 1)])\n" - "\n" - " upsert(dict, \"b\", increment)\n" - " // -> from_list([#(\"a\", 0), #(\"b\", 0)])\n" - " ```\n" -). --spec upsert(dict(QB, QC), QB, fun((gleam@option:option(QC)) -> QC)) -> dict(QB, QC). -upsert(Dict, Key, Fun) -> - case gleam_stdlib:map_get(Dict, Key) of - {ok, Value} -> - insert(Dict, Key, Fun({some, Value})); - - {error, _} -> - insert(Dict, Key, Fun(none)) - end. - --file("src/gleam/dict.gleam", 478). -?DOC( - " Combines all entries into a single value by calling a given function on each\n" - " one.\n" - "\n" - " Dicts are not ordered so the values are not returned in any specific order. Do\n" - " not write code that relies on the order entries are used by this function\n" - " as it may change in later versions of Gleam or Erlang.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let dict = from_list([#(\"a\", 1), #(\"b\", 3), #(\"c\", 9)])\n" - " fold(dict, 0, fn(accumulator, key, value) { accumulator + value })\n" - " // -> 13\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/string\n" - "\n" - " let dict = from_list([#(\"a\", 1), #(\"b\", 3), #(\"c\", 9)])\n" - " fold(dict, \"\", fn(accumulator, key, value) {\n" - " string.append(accumulator, key)\n" - " })\n" - " // -> \"abc\"\n" - " ```\n" -). --spec fold(dict(QI, QJ), QM, fun((QM, QI, QJ) -> QM)) -> QM. -fold(Dict, Initial, Fun) -> - Fun@1 = fun(Key, Value, Acc) -> Fun(Acc, Key, Value) end, - maps:fold(Fun@1, Initial, Dict). - --file("src/gleam/dict.gleam", 98). -?DOC( - " Converts the dict to a list of 2-element tuples `#(key, value)`, one for\n" - " each key-value pair in the dict.\n" - "\n" - " The tuples in the list have no specific order.\n" - "\n" - " ## Examples\n" - "\n" - " Calling `to_list` on an empty `dict` returns an empty list.\n" - "\n" - " ```gleam\n" - " new() |> to_list\n" - " // -> []\n" - " ```\n" - "\n" - " The ordering of elements in the resulting list is an implementation detail\n" - " that should not be relied upon.\n" - "\n" - " ```gleam\n" - " new() |> insert(\"b\", 1) |> insert(\"a\", 0) |> insert(\"c\", 2) |> to_list\n" - " // -> [#(\"a\", 0), #(\"b\", 1), #(\"c\", 2)]\n" - " ```\n" -). --spec to_list(dict(KE, KF)) -> list({KE, KF}). -to_list(Dict) -> - maps:to_list(Dict). - --file("src/gleam/dict.gleam", 238). -?DOC( - " Gets a list of all keys in a given dict.\n" - "\n" - " Dicts are not ordered so the keys are not returned in any specific order. Do\n" - " not write code that relies on the order keys are returned by this function\n" - " as it may change in later versions of Gleam or Erlang.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)]) |> keys\n" - " // -> [\"a\", \"b\"]\n" - " ```\n" -). --spec keys(dict(MT, any())) -> list(MT). -keys(Dict) -> - maps:keys(Dict). - --file("src/gleam/dict.gleam", 256). -?DOC( - " Gets a list of all values in a given dict.\n" - "\n" - " Dicts are not ordered so the values are not returned in any specific order. Do\n" - " not write code that relies on the order values are returned by this function\n" - " as it may change in later versions of Gleam or Erlang.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)]) |> values\n" - " // -> [0, 1]\n" - " ```\n" -). --spec values(dict(any(), MZ)) -> list(MZ). -values(Dict) -> - maps:values(Dict). - --file("src/gleam/dict.gleam", 277). -?DOC( - " Creates a new dict from a given dict, minus any entries that a given function\n" - " returns `False` for.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " |> filter(fn(key, value) { value != 0 })\n" - " // -> from_list([#(\"b\", 1)])\n" - " ```\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " |> filter(fn(key, value) { True })\n" - " // -> from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " ```\n" -). --spec filter(dict(ND, NE), fun((ND, NE) -> boolean())) -> dict(ND, NE). -filter(Dict, Predicate) -> - maps:filter(Predicate, Dict). - --file("src/gleam/dict.gleam", 512). -?DOC( - " Calls a function for each key and value in a dict, discarding the return\n" - " value.\n" - "\n" - " Useful for producing a side effect for every item of a dict.\n" - "\n" - " ```gleam\n" - " import gleam/io\n" - "\n" - " let dict = from_list([#(\"a\", \"apple\"), #(\"b\", \"banana\"), #(\"c\", \"cherry\")])\n" - "\n" - " each(dict, fn(k, v) {\n" - " io.println(key <> \" => \" <> value)\n" - " })\n" - " // -> Nil\n" - " // a => apple\n" - " // b => banana\n" - " // c => cherry\n" - " ```\n" - "\n" - " The order of elements in the iteration is an implementation detail that\n" - " should not be relied upon.\n" -). --spec each(dict(QS, QT), fun((QS, QT) -> any())) -> nil. -each(Dict, Fun) -> - fold( - Dict, - nil, - fun(Nil, K, V) -> - Fun(K, V), - Nil - end - ). - --file("src/gleam/dict.gleam", 533). -?DOC( - " Creates a new dict from a pair of given dicts by combining their entries.\n" - "\n" - " If there are entries with the same keys in both dicts the given function is\n" - " used to determine the new value to use in the resulting dict.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let a = from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " let b = from_list([#(\"a\", 2), #(\"c\", 3)])\n" - " combine(a, b, fn(one, other) { one + other })\n" - " // -> from_list([#(\"a\", 2), #(\"b\", 1), #(\"c\", 3)])\n" - " ```\n" -). --spec combine(dict(QX, QY), dict(QX, QY), fun((QY, QY) -> QY)) -> dict(QX, QY). -combine(Dict, Other, Fun) -> - maps:merge_with(fun(_, L, R) -> Fun(L, R) end, Dict, Other). - --file("src/gleam/dict.gleam", 352). -?DOC( - " Creates a new dict from a pair of given dicts by combining their entries.\n" - "\n" - " If there are entries with the same keys in both dicts the entry from the\n" - " second dict takes precedence.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let a = from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " let b = from_list([#(\"b\", 2), #(\"c\", 3)])\n" - " merge(a, b)\n" - " // -> from_list([#(\"a\", 0), #(\"b\", 2), #(\"c\", 3)])\n" - " ```\n" -). --spec merge(dict(OM, ON), dict(OM, ON)) -> dict(OM, ON). -merge(Dict, New_entries) -> - maps:merge(Dict, New_entries). - --file("src/gleam/dict.gleam", 574). --spec group_loop(transient_dict(RZ, list(SA)), fun((SA) -> RZ), list(SA)) -> dict(RZ, list(SA)). -group_loop(Transient, To_key, List) -> - case List of - [] -> - gleam_stdlib:identity(Transient); - - [Value | Rest] -> - Key = To_key(Value), - Update = fun(Existing) -> [Value | Existing] end, - _pipe = Transient, - _pipe@1 = maps:update_with(Key, Update, [Value], _pipe), - group_loop(_pipe@1, To_key, Rest) - end. - --file("src/gleam/dict.gleam", 570). -?DOC(false). --spec group(fun((RT) -> RU), list(RT)) -> dict(RU, list(RT)). -group(Key, List) -> - group_loop(gleam_stdlib:identity(maps:new()), Key, List). diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache deleted file mode 100644 index 0acfff5bf2a85d1f31d9d9e1a7d7b1535db7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#**p8{n8tx^Ur1`qe=dihrp8YHPkg_&0_U$lsKIE3GqS^03L~(fE;g zs}0@!n@lc~*R>`)t3 z>NzS8m!o$gI5S+hZy?6y@V_5eo+zqxl|K_-rNyh#uR-0ByJGjnpdj*)48WP}3MrA-)IArI8x YVb@k?XD}k)ia$;Vl#~P=Nl<0=e=M_Nng9R* diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_inline b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_inline deleted file mode 100644 index 1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 KcmZQzfB*mh2mk>9 diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_meta b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_meta deleted file mode 100644 index ad4dd8e377ce2b716b6e97ec0bb9c7a673e1af5b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 479 zcmXZYy-Px26vy$Oy;xR@IaGtxR8*vMZxAFkhz(6{5hj;Q-N9a{p)rc?Al#v;KOu6E z&?pcJoNCITf<}iXp`nP->T5g)KAgkhaCn|mF0I%y;q#fI%VcXKz3N2Q?9_I%5yZhu z@O8wC6w+p*nR*ezGEQ)TOMGF0l^$})qmF?VDU1lBaFD?b{H@X`CNPC0*0F_MoTG-m zHmM(Th+z|FxWhd@@s0U*X%Rcf;Q= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --type dynamic_() :: any(). - --file("src/gleam/dynamic.gleam", 30). -?DOC( - " Return a string indicating the type of the dynamic value.\n" - "\n" - " This function may be useful for constructing error messages or logs. If you\n" - " want to turn dynamic data into well typed data then you want the\n" - " `gleam/dynamic/decode` module.\n" - "\n" - " ```gleam\n" - " classify(string(\"Hello\"))\n" - " // -> \"String\"\n" - " ```\n" -). --spec classify(dynamic_()) -> binary(). -classify(Data) -> - gleam_stdlib:classify_dynamic(Data). - --file("src/gleam/dynamic.gleam", 36). -?DOC(" Create a dynamic value from a bool.\n"). --spec bool(boolean()) -> dynamic_(). -bool(A) -> - gleam_stdlib:identity(A). - --file("src/gleam/dynamic.gleam", 44). -?DOC( - " Create a dynamic value from a string.\n" - "\n" - " On Erlang this will be a binary string rather than a character list.\n" -). --spec string(binary()) -> dynamic_(). -string(A) -> - gleam_stdlib:identity(A). - --file("src/gleam/dynamic.gleam", 50). -?DOC(" Create a dynamic value from a float.\n"). --spec float(float()) -> dynamic_(). -float(A) -> - gleam_stdlib:identity(A). - --file("src/gleam/dynamic.gleam", 56). -?DOC(" Create a dynamic value from an int.\n"). --spec int(integer()) -> dynamic_(). -int(A) -> - gleam_stdlib:identity(A). - --file("src/gleam/dynamic.gleam", 62). -?DOC(" Create a dynamic value from a bit array.\n"). --spec bit_array(bitstring()) -> dynamic_(). -bit_array(A) -> - gleam_stdlib:identity(A). - --file("src/gleam/dynamic.gleam", 68). -?DOC(" Create a dynamic value from a list.\n"). --spec list(list(dynamic_())) -> dynamic_(). -list(A) -> - gleam_stdlib:identity(A). - --file("src/gleam/dynamic.gleam", 77). -?DOC( - " Create a dynamic value from a list, converting it to a sequential runtime\n" - " format rather than the regular list format.\n" - "\n" - " On Erlang this will be a tuple, on JavaScript this will be an array.\n" -). --spec array(list(dynamic_())) -> dynamic_(). -array(A) -> - erlang:list_to_tuple(A). - --file("src/gleam/dynamic.gleam", 85). -?DOC( - " Create a dynamic value made of an unordered series of keys and values, where\n" - " the keys are unique.\n" - "\n" - " On Erlang this will be a map, on JavaScript this will be a Gleam dict\n" - " object.\n" -). --spec properties(list({dynamic_(), dynamic_()})) -> dynamic_(). -properties(Entries) -> - gleam_stdlib:identity(maps:from_list(Entries)). - --file("src/gleam/dynamic.gleam", 94). -?DOC( - " A dynamic value representing nothing.\n" - "\n" - " On Erlang this will be the atom `nil`, on JavaScript this will be\n" - " `undefined`.\n" -). --spec nil() -> dynamic_(). -nil() -> - gleam_stdlib:identity(nil). diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache deleted file mode 100644 index 7241fddf2222bbf3bded98f30a8da589c9f59b68..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 60584 zcmeHw3tU{qz5kwFU}1s4$w|z^L=Kx^fba-AArDMKAP@opk_GZ25LlK4mMptucL^Z| z^SJfKq_s7CI)z-G!s;$>*YpqsWA8q-6e>3MSyDUpg zOtklZ%_qa0J&!qaW`6JAZ+??$ikmZHPB*4EUYm1m38>klt62!EY-|G0Iar%BGv;JIc#$H!DY^@>Q2f=8*~)-Bjr} znEgJ#eStAS9x}`F3HvNblBZf^k5trmvlQb~3~^{uo^e9XH_NkoWmU4zm88fPV>~%# z5DbR(#sq_eKkUsp33Er(N_Bw)YZ@1dz_w`v+*RG(;?{#?a?R00S8W;)$U44N9i$&ey8&Cs1z5!3C>UHgO z`PB}W>hyVW#2Xm$4fydwkB7fQ8?vBJ)u4m-4$T-0dj$xH$v;*VHu={}MK|=CLn9Cg z$J(f!kaMc!8NKo>$-a_Cjf0av#xqfaXOA-`NJc}VRwuB!tnRE4wM^}#c4pzDFv$*e zr^7RVv7#Y#I=u9u0|5*MzJ}mK|0IXUGo*d2HVe*ni#7{hx|fe2pN)Y4jWJC?yMMsj zu67N0ok6$HOXJ!|gNY#z^r1oYfOo~^59qIU`uaND1e9p9&#~R5dK~`l@cVeR7c)ic^-FYgR2Y$0@DJ)>SRZ zaY}iTq%@$snkFg6bV>0~m6QW09p_5QZj_msl9G$^NS36$h;lebQm#cQ$;WdjuP(-O zOK`kGQhHHxjYg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x2pfGSJAOp`4aO)o;F7R{q-LCIp`H?EZ)P*iqc9z757lZs!OU-RaCE~YWCK-gt~cK8C92UyMh4r>)URm>aJ}MP<6EHIB5{q zbX`x?jXk%L%JH+F=cszX{fHY?TJJf%sIKsQ$%E<^&v&U><6TGUh|}9kmESu=Rf=CB zd|u#ROjWtRnyTTzrwE^$2Dc8PI)6ByIMX%zuHT31+xu>#>gA1p+K8&LzL|*84*M=5 zMqg|CCJ`g=<^iHY|F!n!wF0qt9>VdFA7rNf%hbgA2XcwyZLM#s7Y~V@{w8K}Z#Mmn zUij38Ul2VeuHQgwspTQvC9gX?H4U*7ZD9#olg=gmd6VD2KSR?V%Z>N{)ih-uZT z;JSIG*t)B%-zYyX$ zIaS6BQi=KH))W)*G}lh1Vf=di%>*U)*&ii9`)5-U&2-hK2I6{8ZT=0xTV2a$;$=Hq z_EU95%e7SfqUCo~{l5J#?WoEewM6oFJ1(Z`8pk)N`XBcjgfoA4n+a!H13d)$#{*xb K>WZvuv;H59 diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_meta b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_meta deleted file mode 100644 index ba0e92235529f6f34a099c88b363eb103eb75f74..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4650 zcmY+{3wVxY9{}*jwB$^sNLtb47@ZvI6NMzqS<=Ebn%Tk391{|02~Fk@>XXvc_31z@ zrzT=5+bk5H<&gT2nA38Mey&{Kb$PG-uIIg;d(Zvc_y7Li|L1uV3;V|fS3f1Lzxt)( z)njbJz^KGV(Q&E$qEb?#MmMP$1RW`JP4j@bnAA?r4yOFIEu)j7660dxHH@e9HH~pe zsS})hgKPUsh#Qug?(DmiyXKN1$*FNek`_C^m6&@nw@>;{bY_?9uKtrlcb0OAUL}Iy zSw1B+Bna9Q!MmKHS;-)1K{~(jfPPx@By;(dvY|mxi8~2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N5 z19T&u4CXMG^_-{W0M{~&w|JXVv>fOeOm||4C6#OrbAn<*o_7z1Fp?Mef*l;AVyv~M zJENGuD@IGy<1fk#wN50lh)lL|h~u25WQyNXw4gI1Sk6X% zqUtdDLoLFoO;esEf!A2dYI4crD7917c_Ns?3^JIorToEh9v)>q8O$n5k5= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " The `Dynamic` type is used to represent dynamically typed data. That is, data\n" - " that we don't know the precise type of yet, so we need to introspect the data to\n" - " see if it is of the desired type before we can use it. Typically data like this\n" - " would come from user input or from untyped languages such as Erlang or JavaScript.\n" - "\n" - " This module provides the `Decoder` type and associated functions, which provides\n" - " a type-safe and composable way to convert dynamic data into some desired type,\n" - " or into errors if the data doesn't have the desired structure.\n" - "\n" - " The `Decoder` type is generic and has 1 type parameter, which is the type that\n" - " it attempts to decode. A `Decoder(String)` can be used to decode strings, and a\n" - " `Decoder(Option(Int))` can be used to decode `Option(Int)`s\n" - "\n" - " Decoders work using _runtime reflection_ and the data structures of the target\n" - " platform. Differences between Erlang and JavaScript data structures may impact\n" - " your decoders, so it is important to test your decoders on all supported\n" - " platforms.\n" - "\n" - " The decoding technique used by this module was inspired by Juraj Petráš'\n" - " [Toy](https://github.com/Hackder/toy), Go's `encoding/json`, and Elm's\n" - " `Json.Decode`. Thank you to them!\n" - "\n" - " # Examples\n" - "\n" - " Dynamic data may come from various sources and so many different syntaxes could\n" - " be used to describe or construct them. In these examples a pseudocode\n" - " syntax is used to describe the data.\n" - "\n" - " ## Simple types\n" - "\n" - " This module defines decoders for simple data types such as [`string`](#string),\n" - " [`int`](#int), [`float`](#float), [`bit_array`](#bit_array), and [`bool`](#bool).\n" - "\n" - " ```gleam\n" - " // Data:\n" - " // \"Hello, Joe!\"\n" - "\n" - " let result = decode.run(data, decode.string)\n" - " assert result == Ok(\"Hello, Joe!\")\n" - " ```\n" - "\n" - " ## Lists\n" - "\n" - " The [`list`](#list) decoder decodes `List`s. To use it you must construct it by\n" - " passing in another decoder into the `list` function, which is the decoder that\n" - " is to be used for the elements of the list, type checking both the list and its\n" - " elements.\n" - "\n" - " ```gleam\n" - " // Data:\n" - " // [1, 2, 3, 4]\n" - "\n" - " let result = decode.run(data, decode.list(decode.int))\n" - " assert result == Ok([1, 2, 3, 4])\n" - " ```\n" - "\n" - " On Erlang this decoder can decode from lists, and on JavaScript it can\n" - " decode from lists as well as JavaScript arrays.\n" - "\n" - " ## Options\n" - "\n" - " The [`optional`](#optional) decoder is used to decode values that may or may not\n" - " be present. In other environments these might be called \"nullable\" values.\n" - "\n" - " Like the `list` decoder, the `optional` decoder takes another decoder,\n" - " which is used to decode the value if it is present.\n" - "\n" - " ```gleam\n" - " // Data:\n" - " // 12.45\n" - "\n" - " let result = decode.run(data, decode.optional(decode.float))\n" - " assert result == Ok(option.Some(12.45))\n" - " ```\n" - " ```gleam\n" - " // Data:\n" - " // null\n" - "\n" - " let result = decode.run(data, decode.optional(decode.int))\n" - " assert result == Ok(option.None)\n" - " ```\n" - "\n" - " This decoder knows how to handle multiple different runtime representations of\n" - " absent values, including `Nil`, `None`, `null`, and `undefined`.\n" - "\n" - " ## Dicts\n" - "\n" - " The [`dict`](#dict) decoder decodes `Dicts` and contains two other decoders, one\n" - " for the keys, one for the values.\n" - "\n" - " ```gleam\n" - " // Data:\n" - " // { \"Lucy\" -> 10, \"Nubi\" -> 20 }\n" - "\n" - " let result = decode.run(data, decode.dict(decode.string, decode.int))\n" - " assert result == Ok(dict.from_list([\n" - " #(\"Lucy\", 10),\n" - " #(\"Nubi\", 20),\n" - " ]))\n" - " ```\n" - "\n" - " ## Indexing objects\n" - "\n" - " The [`at`](#at) decoder can be used to decode a value that is nested within\n" - " key-value containers such as Gleam dicts, Erlang maps, or JavaScript objects.\n" - "\n" - " ```gleam\n" - " // Data:\n" - " // { \"one\" -> { \"two\" -> 123 } }\n" - "\n" - " let result = decode.run(data, decode.at([\"one\", \"two\"], decode.int))\n" - " assert result == Ok(123)\n" - " ```\n" - "\n" - " ## Indexing arrays\n" - "\n" - " If you use ints as keys then the [`at`](#at) decoder can be used to index into\n" - " array-like containers such as Gleam or Erlang tuples, or JavaScript arrays.\n" - "\n" - " ```gleam\n" - " // Data:\n" - " // [\"one\", \"two\", \"three\"]\n" - "\n" - " let result = decode.run(data, decode.at([1], decode.string))\n" - " assert result == Ok(\"two\")\n" - " ```\n" - "\n" - " ## Records\n" - "\n" - " Decoding records from dynamic data is more complex and requires combining a\n" - " decoder for each field and a special constructor that builds your records with\n" - " the decoded field values.\n" - "\n" - " ```gleam\n" - " // Data:\n" - " // {\n" - " // \"score\" -> 180,\n" - " // \"name\" -> \"Mel Smith\",\n" - " // \"is-admin\" -> false,\n" - " // \"enrolled\" -> true,\n" - " // \"colour\" -> \"Red\",\n" - " // }\n" - "\n" - " let decoder = {\n" - " use name <- decode.field(\"name\", decode.string)\n" - " use score <- decode.field(\"score\", decode.int)\n" - " use colour <- decode.field(\"colour\", decode.string)\n" - " use enrolled <- decode.field(\"enrolled\", decode.bool)\n" - " decode.success(Player(name:, score:, colour:, enrolled:))\n" - " }\n" - "\n" - " let result = decode.run(data, decoder)\n" - " assert result == Ok(Player(\"Mel Smith\", 180, \"Red\", True))\n" - " ```\n" - "\n" - " ## Enum variants\n" - "\n" - " Imagine you have a custom type where all the variants do not contain any values.\n" - "\n" - " ```gleam\n" - " pub type PocketMonsterType {\n" - " Fire\n" - " Water\n" - " Grass\n" - " Electric\n" - " }\n" - " ```\n" - "\n" - " You might choose to encode these variants as strings, `\"fire\"` for `Fire`,\n" - " `\"water\"` for `Water`, and so on. To decode them you'll need to decode the dynamic\n" - " data as a string, but then you'll need to decode it further still as not all\n" - " strings are valid values for the enum. This can be done with the `then`\n" - " function, which enables running a second decoder after the first one\n" - " succeeds.\n" - "\n" - " ```gleam\n" - " let decoder = {\n" - " use decoded_string <- decode.then(decode.string)\n" - " case decoded_string {\n" - " // Return succeeding decoders for valid strings\n" - " \"fire\" -> decode.success(Fire)\n" - " \"water\" -> decode.success(Water)\n" - " \"grass\" -> decode.success(Grass)\n" - " \"electric\" -> decode.success(Electric)\n" - " // Return a failing decoder for any other strings\n" - " _ -> decode.failure(Fire, expected: \"PocketMonsterType\")\n" - " }\n" - " }\n" - "\n" - " let result = decode.run(dynamic.string(\"water\"), decoder)\n" - " assert result == Ok(Water)\n" - "\n" - " let result = decode.run(dynamic.string(\"wobble\"), decoder)\n" - " assert result == Error([DecodeError(\"PocketMonsterType\", \"String\", [])])\n" - " ```\n" - "\n" - " ## Record variants\n" - "\n" - " Decoding type variants that contain other values is done by combining the\n" - " techniques from the \"enum variants\" and \"records\" examples. Imagine you have\n" - " this custom type that you want to decode:\n" - "\n" - " ```gleam\n" - " pub type PocketMonsterPerson {\n" - " Trainer(name: String, badge_count: Int)\n" - " GymLeader(name: String, speciality: PocketMonsterType)\n" - " }\n" - " ```\n" - " And you would like to be able to decode these from dynamic data like this:\n" - " ```erlang\n" - " {\n" - " \"type\" -> \"trainer\",\n" - " \"name\" -> \"Ash\",\n" - " \"badge-count\" -> 1,\n" - " }\n" - " ```\n" - " ```erlang\n" - " {\n" - " \"type\" -> \"gym-leader\",\n" - " \"name\" -> \"Misty\",\n" - " \"speciality\" -> \"water\",\n" - " }\n" - " ```\n" - "\n" - " Notice how both documents have a `\"type\"` field, which is used to indicate which\n" - " variant the data is for.\n" - "\n" - " First, define decoders for each of the variants:\n" - "\n" - " ```gleam\n" - " let trainer_decoder = {\n" - " use name <- decode.field(\"name\", decode.string)\n" - " use badge_count <- decode.field(\"badge-count\", decode.int)\n" - " decode.success(Trainer(name, badge_count))\n" - " }\n" - "\n" - " let gym_leader_decoder = {\n" - " use name <- decode.field(\"name\", decode.string)\n" - " use speciality <- decode.field(\"speciality\", pocket_monster_type_decoder)\n" - " decode.success(GymLeader(name, speciality))\n" - " }\n" - " ```\n" - "\n" - " A third decoder can be used to extract and decode the `\"type\"` field, and the\n" - " expression can evaluate to whichever decoder is suitable for the document.\n" - "\n" - " ```gleam\n" - " // Data:\n" - " // {\n" - " // \"type\" -> \"gym-leader\",\n" - " // \"name\" -> \"Misty\",\n" - " // \"speciality\" -> \"water\",\n" - " // }\n" - "\n" - " let decoder = {\n" - " use tag <- decode.field(\"type\", decode.string)\n" - " case tag {\n" - " \"gym-leader\" -> gym_leader_decoder\n" - " _ -> trainer_decoder\n" - " }\n" - " }\n" - "\n" - " let result = decode.run(data, decoder)\n" - " assert result == Ok(GymLeader(\"Misty\", Water))\n" - " ```\n" -). - --type decode_error() :: {decode_error, binary(), binary(), list(binary())}. - --opaque decoder(BVQ) :: {decoder, - fun((gleam@dynamic:dynamic_()) -> {BVQ, list(decode_error())})}. - --file("src/gleam/dynamic/decode.gleam", 356). -?DOC( - " Run a decoder on a `Dynamic` value, decoding the value if it is of the\n" - " desired type, or returning errors.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let decoder = {\n" - " use name <- decode.field(\"name\", decode.string)\n" - " use email <- decode.field(\"email\", decode.string)\n" - " decode.success(SignUp(name: name, email: email))\n" - " }\n" - "\n" - " decode.run(data, decoder)\n" - " ```\n" -). --spec run(gleam@dynamic:dynamic_(), decoder(BVY)) -> {ok, BVY} | - {error, list(decode_error())}. -run(Data, Decoder) -> - {Maybe_invalid_data, Errors} = (erlang:element(2, Decoder))(Data), - case Errors of - [] -> - {ok, Maybe_invalid_data}; - - [_ | _] -> - {error, Errors} - end. - --file("src/gleam/dynamic/decode.gleam", 478). -?DOC( - " Finalise a decoder having successfully extracted a value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let data = dynamic.properties([\n" - " #(dynamic.string(\"email\"), dynamic.string(\"lucy@example.com\")),\n" - " #(dynamic.string(\"name\"), dynamic.string(\"Lucy\")),\n" - " ])\n" - "\n" - " let decoder = {\n" - " use name <- decode.field(\"name\", string)\n" - " use email <- decode.field(\"email\", string)\n" - " decode.success(SignUp(name: name, email: email))\n" - " }\n" - "\n" - " let result = decode.run(data, decoder)\n" - " assert result == Ok(SignUp(name: \"Lucy\", email: \"lucy@example.com\"))\n" - " ```\n" -). --spec success(BWZ) -> decoder(BWZ). -success(Data) -> - {decoder, fun(_) -> {Data, []} end}. - --file("src/gleam/dynamic/decode.gleam", 732). --spec decode_dynamic(gleam@dynamic:dynamic_()) -> {gleam@dynamic:dynamic_(), - list(decode_error())}. -decode_dynamic(Data) -> - {Data, []}. - --file("src/gleam/dynamic/decode.gleam", 889). -?DOC( - " Apply a transformation function to any value decoded by the decoder.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let decoder = decode.int |> decode.map(int.to_string)\n" - " let result = decode.run(dynamic.int(1000), decoder)\n" - " assert result == Ok(\"1000\")\n" - " ```\n" -). --spec map(decoder(BZW), fun((BZW) -> BZY)) -> decoder(BZY). -map(Decoder, Transformer) -> - {decoder, - fun(D) -> - {Data, Errors} = (erlang:element(2, Decoder))(D), - {Transformer(Data), Errors} - end}. - --file("src/gleam/dynamic/decode.gleam", 898). -?DOC(" Apply a transformation function to any errors returned by the decoder.\n"). --spec map_errors( - decoder(CAA), - fun((list(decode_error())) -> list(decode_error())) -) -> decoder(CAA). -map_errors(Decoder, Transformer) -> - {decoder, - fun(D) -> - {Data, Errors} = (erlang:element(2, Decoder))(D), - {Data, Transformer(Errors)} - end}. - --file("src/gleam/dynamic/decode.gleam", 936). -?DOC( - " Create a new decoder based upon the value of a previous decoder.\n" - "\n" - " This may be useful to run one previous decoder to use in further decoding.\n" -). --spec then(decoder(CAI), fun((CAI) -> decoder(CAK))) -> decoder(CAK). -then(Decoder, Next) -> - {decoder, - fun(Dynamic_data) -> - {Data, Errors} = (erlang:element(2, Decoder))(Dynamic_data), - Decoder@1 = Next(Data), - {Data@1, _} = Layer = (erlang:element(2, Decoder@1))(Dynamic_data), - case Errors of - [] -> - Layer; - - [_ | _] -> - {Data@1, Errors} - end - end}. - --file("src/gleam/dynamic/decode.gleam", 979). --spec run_decoders( - gleam@dynamic:dynamic_(), - {CAS, list(decode_error())}, - list(decoder(CAS)) -) -> {CAS, list(decode_error())}. -run_decoders(Data, Failure, Decoders) -> - case Decoders of - [] -> - Failure; - - [Decoder | Decoders@1] -> - {_, Errors} = Layer = (erlang:element(2, Decoder))(Data), - case Errors of - [] -> - Layer; - - [_ | _] -> - run_decoders(Data, Failure, Decoders@1) - end - end. - --file("src/gleam/dynamic/decode.gleam", 966). -?DOC( - " Create a new decoder from several other decoders. Each of the inner\n" - " decoders is run in turn, and the value from the first to succeed is used.\n" - "\n" - " If no decoder succeeds then the errors from the first decoder are used.\n" - " If you wish for different errors then you may wish to use the\n" - " `collapse_errors` or `map_errors` functions.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let decoder = decode.one_of(decode.string, or: [\n" - " decode.int |> decode.map(int.to_string),\n" - " decode.float |> decode.map(float.to_string),\n" - " ])\n" - " decode.run(dynamic.int(1000), decoder)\n" - " // -> Ok(\"1000\")\n" - " ```\n" -). --spec one_of(decoder(CAN), list(decoder(CAN))) -> decoder(CAN). -one_of(First, Alternatives) -> - {decoder, - fun(Dynamic_data) -> - {_, Errors} = Layer = (erlang:element(2, First))(Dynamic_data), - case Errors of - [] -> - Layer; - - [_ | _] -> - run_decoders(Dynamic_data, Layer, Alternatives) - end - end}. - --file("src/gleam/dynamic/decode.gleam", 1090). -?DOC( - " Create a decoder that can refer to itself, useful for decoding deeply\n" - " nested data.\n" - "\n" - " Attempting to create a recursive decoder without this function could result\n" - " in an infinite loop. If you are using `field` or other `use`able functions\n" - " then you may not need to use this function.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " type Nested {\n" - " Nested(List(Nested))\n" - " Value(String)\n" - " }\n" - "\n" - " fn nested_decoder() -> decode.Decoder(Nested) {\n" - " use <- decode.recursive\n" - " decode.one_of(decode.string |> decode.map(Value), [\n" - " decode.list(nested_decoder()) |> decode.map(Nested),\n" - " ])\n" - " }\n" - " ```\n" -). --spec recursive(fun(() -> decoder(CBD))) -> decoder(CBD). -recursive(Inner) -> - {decoder, - fun(Data) -> - Decoder = Inner(), - (erlang:element(2, Decoder))(Data) - end}. - --file("src/gleam/dynamic/decode.gleam", 867). -?DOC( - " A decoder that decodes nullable values of a type decoded by with a given\n" - " decoder.\n" - "\n" - " This function can handle common representations of null on all runtimes, such as\n" - " `nil`, `null`, and `undefined` on Erlang, and `undefined` and `null` on\n" - " JavaScript.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let result = decode.run(dynamic.int(100), decode.optional(decode.int))\n" - " assert result == Ok(option.Some(100))\n" - " ```\n" - "\n" - " ```gleam\n" - " let result = decode.run(dynamic.nil(), decode.optional(decode.int))\n" - " assert result == Ok(option.None)\n" - " ```\n" -). --spec optional(decoder(BZS)) -> decoder(gleam@option:option(BZS)). -optional(Inner) -> - {decoder, fun(Data) -> case gleam_stdlib:is_null(Data) of - true -> - {none, []}; - - false -> - {Data@1, Errors} = (erlang:element(2, Inner))(Data), - {{some, Data@1}, Errors} - end end}. - --file("src/gleam/dynamic/decode.gleam", 484). -?DOC(" Construct a decode error for some unexpected dynamic data.\n"). --spec decode_error(binary(), gleam@dynamic:dynamic_()) -> list(decode_error()). -decode_error(Expected, Found) -> - [{decode_error, Expected, gleam_stdlib:classify_dynamic(Found), []}]. - --file("src/gleam/dynamic/decode.gleam", 607). --spec run_dynamic_function( - gleam@dynamic:dynamic_(), - binary(), - fun((gleam@dynamic:dynamic_()) -> {ok, BXT} | {error, BXT}) -) -> {BXT, list(decode_error())}. -run_dynamic_function(Data, Name, F) -> - case F(Data) of - {ok, Data@1} -> - {Data@1, []}; - - {error, Placeholder} -> - {Placeholder, - [{decode_error, Name, gleam_stdlib:classify_dynamic(Data), []}]} - end. - --file("src/gleam/dynamic/decode.gleam", 658). --spec decode_bool(gleam@dynamic:dynamic_()) -> {boolean(), list(decode_error())}. -decode_bool(Data) -> - case gleam_stdlib:identity(true) =:= Data of - true -> - {true, []}; - - false -> - case gleam_stdlib:identity(false) =:= Data of - true -> - {false, []}; - - false -> - {false, decode_error(<<"Bool"/utf8>>, Data)} - end - end. - --file("src/gleam/dynamic/decode.gleam", 687). --spec decode_int(gleam@dynamic:dynamic_()) -> {integer(), list(decode_error())}. -decode_int(Data) -> - run_dynamic_function(Data, <<"Int"/utf8>>, fun gleam_stdlib:int/1). - --file("src/gleam/dynamic/decode.gleam", 713). --spec decode_float(gleam@dynamic:dynamic_()) -> {float(), list(decode_error())}. -decode_float(Data) -> - run_dynamic_function(Data, <<"Float"/utf8>>, fun gleam_stdlib:float/1). - --file("src/gleam/dynamic/decode.gleam", 747). --spec decode_bit_array(gleam@dynamic:dynamic_()) -> {bitstring(), - list(decode_error())}. -decode_bit_array(Data) -> - run_dynamic_function( - Data, - <<"BitArray"/utf8>>, - fun gleam_stdlib:bit_array/1 - ). - --file("src/gleam/dynamic/decode.gleam", 922). -?DOC( - " Replace all errors produced by a decoder with one single error for a named\n" - " expected type.\n" - "\n" - " This function may be useful if you wish to simplify errors before\n" - " presenting them to a user, particularly when using the `one_of` function.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let decoder = decode.string |> decode.collapse_errors(\"MyThing\")\n" - " let result = decode.run(dynamic.int(1000), decoder)\n" - " assert result == Error([DecodeError(\"MyThing\", \"Int\", [])])\n" - " ```\n" -). --spec collapse_errors(decoder(CAF), binary()) -> decoder(CAF). -collapse_errors(Decoder, Name) -> - {decoder, - fun(Dynamic_data) -> - {Data, Errors} = Layer = (erlang:element(2, Decoder))(Dynamic_data), - case Errors of - [] -> - Layer; - - [_ | _] -> - {Data, decode_error(Name, Dynamic_data)} - end - end}. - --file("src/gleam/dynamic/decode.gleam", 1012). -?DOC( - " Define a decoder that always fails.\n" - "\n" - " The first parameter is a \"placeholder\" value, which is some default value that the\n" - " decoder uses internally in place of the value that would have been produced\n" - " if the decoder was successful. It doesn't matter what this value is, it is\n" - " never returned by the decoder or shown to the user, so pick some arbitrary\n" - " value. If it is an int you might pick `0`, if it is a list you might pick\n" - " `[]`.\n" - "\n" - " The second parameter is the name of the type that has failed to decode.\n" - "\n" - " ```gleam\n" - " decode.failure(User(name: \"\", score: 0, tags: []), expected: \"User\")\n" - " ```\n" -). --spec failure(CAX, binary()) -> decoder(CAX). -failure(Placeholder, Name) -> - {decoder, fun(D) -> {Placeholder, decode_error(Name, D)} end}. - --file("src/gleam/dynamic/decode.gleam", 1053). -?DOC( - " Create a decoder for a new data type from a decoding function.\n" - "\n" - " This function is used for new primitive types. For example, you might\n" - " define a decoder for Erlang's pid type.\n" - "\n" - " A default \"placeholder\" value is also required to make a decoder. When this\n" - " decoder is used as part of a larger decoder this placeholder value is used\n" - " so that the rest of the decoder can continue to run and\n" - " collect all decoding errors. It doesn't matter what this value is, it is\n" - " never returned by the decoder or shown to the user, so pick some arbitrary\n" - " value. If it is an int you might pick `0`, if it is a list you might pick\n" - " `[]`.\n" - "\n" - " If you were to make a decoder for the `Int` type (rather than using the\n" - " build-in `Int` decoder) you would define it like so:\n" - "\n" - " ```gleam\n" - " pub fn int_decoder() -> decode.Decoder(Int) {\n" - " let default = \"\"\n" - " decode.new_primitive_decoder(\"Int\", int_from_dynamic)\n" - " }\n" - "\n" - " @external(erlang, \"my_module\", \"int_from_dynamic\")\n" - " fn int_from_dynamic(data: Int) -> Result(Int, Int)\n" - " ```\n" - "\n" - " ```erlang\n" - " -module(my_module).\n" - " -export([int_from_dynamic/1]).\n" - "\n" - " int_from_dynamic(Data) ->\n" - " case is_integer(Data) of\n" - " true -> {ok, Data};\n" - " false -> {error, 0}\n" - " end.\n" - " ```\n" -). --spec new_primitive_decoder( - binary(), - fun((gleam@dynamic:dynamic_()) -> {ok, CAZ} | {error, CAZ}) -) -> decoder(CAZ). -new_primitive_decoder(Name, Decoding_function) -> - {decoder, fun(D) -> case Decoding_function(D) of - {ok, T} -> - {T, []}; - - {error, Placeholder} -> - {Placeholder, - [{decode_error, - Name, - gleam_stdlib:classify_dynamic(D), - []}]} - end end}. - --file("src/gleam/dynamic/decode.gleam", 636). --spec dynamic_string(gleam@dynamic:dynamic_()) -> {ok, binary()} | - {error, binary()}. -dynamic_string(Data) -> - case gleam_stdlib:bit_array(Data) of - {ok, Data@1} -> - case gleam@bit_array:to_string(Data@1) of - {ok, String} -> - {ok, String}; - - {error, _} -> - {error, <<""/utf8>>} - end; - - {error, _} -> - {error, <<""/utf8>>} - end. - --file("src/gleam/dynamic/decode.gleam", 631). --spec decode_string(gleam@dynamic:dynamic_()) -> {binary(), - list(decode_error())}. -decode_string(Data) -> - run_dynamic_function(Data, <<"String"/utf8>>, fun dynamic_string/1). - --file("src/gleam/dynamic/decode.gleam", 821). --spec fold_dict( - {gleam@dict:dict(BZE, BZF), list(decode_error())}, - gleam@dynamic:dynamic_(), - gleam@dynamic:dynamic_(), - fun((gleam@dynamic:dynamic_()) -> {BZE, list(decode_error())}), - fun((gleam@dynamic:dynamic_()) -> {BZF, list(decode_error())}) -) -> {gleam@dict:dict(BZE, BZF), list(decode_error())}. -fold_dict(Acc, Key, Value, Key_decoder, Value_decoder) -> - case Key_decoder(Key) of - {Key@1, []} -> - case Value_decoder(Value) of - {Value@1, []} -> - Dict = gleam@dict:insert( - erlang:element(1, Acc), - Key@1, - Value@1 - ), - {Dict, erlang:element(2, Acc)}; - - {_, Errors} -> - push_path({maps:new(), Errors}, [<<"values"/utf8>>]) - end; - - {_, Errors@1} -> - push_path({maps:new(), Errors@1}, [<<"keys"/utf8>>]) - end. - --file("src/gleam/dynamic/decode.gleam", 801). -?DOC( - " A decoder that decodes dicts where all keys and values are decoded with\n" - " given decoders.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let values = dynamic.properties([\n" - " #(dynamic.string(\"one\"), dynamic.int(1)),\n" - " #(dynamic.string(\"two\"), dynamic.int(2)),\n" - " ])\n" - "\n" - " let result =\n" - " decode.run(values, decode.dict(decode.string, decode.int))\n" - " assert result == Ok(values)\n" - " ```\n" -). --spec dict(decoder(BYX), decoder(BYZ)) -> decoder(gleam@dict:dict(BYX, BYZ)). -dict(Key, Value) -> - {decoder, fun(Data) -> case gleam_stdlib:dict(Data) of - {error, _} -> - {maps:new(), decode_error(<<"Dict"/utf8>>, Data)}; - - {ok, Dict} -> - gleam@dict:fold( - Dict, - {maps:new(), []}, - fun(A, K, V) -> case erlang:element(2, A) of - [] -> - fold_dict( - A, - K, - V, - erlang:element(2, Key), - erlang:element(2, Value) - ); - - [_ | _] -> - A - end end - ) - end end}. - --file("src/gleam/dynamic/decode.gleam", 769). -?DOC( - " A decoder that decodes lists where all elements are decoded with a given\n" - " decoder.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let result =\n" - " [1, 2, 3]\n" - " |> list.map(dynamic.int)\n" - " |> dynamic.list\n" - " |> decode.run(decode.list(of: decode.int))\n" - " assert result == Ok([1, 2, 3])\n" - " ```\n" -). --spec list(decoder(BYL)) -> decoder(list(BYL)). -list(Inner) -> - {decoder, - fun(Data) -> - gleam_stdlib:list( - Data, - erlang:element(2, Inner), - fun(P, K) -> push_path(P, [K]) end, - 0, - [] - ) - end}. - --file("src/gleam/dynamic/decode.gleam", 438). --spec push_path({BWU, list(decode_error())}, list(any())) -> {BWU, - list(decode_error())}. -push_path(Layer, Path) -> - Decoder = one_of( - {decoder, fun decode_string/1}, - [begin - _pipe = {decoder, fun decode_int/1}, - map(_pipe, fun erlang:integer_to_binary/1) - end] - ), - Path@1 = gleam@list:map( - Path, - fun(Key) -> - Key@1 = gleam_stdlib:identity(Key), - case run(Key@1, Decoder) of - {ok, Key@2} -> - Key@2; - - {error, _} -> - <<<<"<"/utf8, - (gleam_stdlib:classify_dynamic(Key@1))/binary>>/binary, - ">"/utf8>> - end - end - ), - Errors = gleam@list:map( - erlang:element(2, Layer), - fun(Error) -> - {decode_error, - erlang:element(2, Error), - erlang:element(3, Error), - lists:append(Path@1, erlang:element(4, Error))} - end - ), - {erlang:element(1, Layer), Errors}. - --file("src/gleam/dynamic/decode.gleam", 402). --spec index( - list(BWI), - list(BWI), - fun((gleam@dynamic:dynamic_()) -> {BWL, list(decode_error())}), - gleam@dynamic:dynamic_(), - fun((gleam@dynamic:dynamic_(), list(BWI)) -> {BWL, list(decode_error())}) -) -> {BWL, list(decode_error())}. -index(Path, Position, Inner, Data, Handle_miss) -> - case Path of - [] -> - _pipe = Data, - _pipe@1 = Inner(_pipe), - push_path(_pipe@1, lists:reverse(Position)); - - [Key | Path@1] -> - case gleam_stdlib:index(Data, Key) of - {ok, {some, Data@1}} -> - index(Path@1, [Key | Position], Inner, Data@1, Handle_miss); - - {ok, none} -> - Handle_miss(Data, [Key | Position]); - - {error, Kind} -> - {Default, _} = Inner(Data), - _pipe@2 = {Default, - [{decode_error, - Kind, - gleam_stdlib:classify_dynamic(Data), - []}]}, - push_path(_pipe@2, lists:reverse(Position)) - end - end. - --file("src/gleam/dynamic/decode.gleam", 324). -?DOC( - " The same as [`field`](#field), except taking a path to the value rather\n" - " than a field name.\n" - "\n" - " This function will index into dictionaries with any key type, and if the key is\n" - " an int then it'll also index into Erlang tuples and JavaScript arrays, and\n" - " the first eight elements of Gleam lists.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let data = dynamic.properties([\n" - " #(dynamic.string(\"data\"), dynamic.properties([\n" - " #(dynamic.string(\"email\"), dynamic.string(\"lucy@example.com\")),\n" - " #(dynamic.string(\"name\"), dynamic.string(\"Lucy\")),\n" - " ])\n" - " ])\n" - "\n" - " let decoder = {\n" - " use name <- decode.subfield([\"data\", \"name\"], decode.string)\n" - " use email <- decode.subfield([\"data\", \"email\"], decode.string)\n" - " decode.success(SignUp(name: name, email: email))\n" - " }\n" - " let result = decode.run(data, decoder)\n" - " assert result == Ok(SignUp(name: \"Lucy\", email: \"lucy@example.com\"))\n" - " ```\n" -). --spec subfield(list(any()), decoder(BVT), fun((BVT) -> decoder(BVV))) -> decoder(BVV). -subfield(Field_path, Field_decoder, Next) -> - {decoder, - fun(Data) -> - {Out, Errors1} = index( - Field_path, - [], - erlang:element(2, Field_decoder), - Data, - fun(Data@1, Position) -> - {Default, _} = (erlang:element(2, Field_decoder))(Data@1), - _pipe = {Default, - [{decode_error, - <<"Field"/utf8>>, - <<"Nothing"/utf8>>, - []}]}, - push_path(_pipe, lists:reverse(Position)) - end - ), - {Out@1, Errors2} = (erlang:element(2, Next(Out)))(Data), - {Out@1, lists:append(Errors1, Errors2)} - end}. - --file("src/gleam/dynamic/decode.gleam", 392). -?DOC( - " A decoder that decodes a value that is nested within other values. For\n" - " example, decoding a value that is within some deeply nested JSON objects.\n" - "\n" - " This function will index into dictionaries with any key type, and if the key is\n" - " an int then it'll also index into Erlang tuples and JavaScript arrays, and\n" - " the first eight elements of Gleam lists.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let decoder = decode.at([\"one\", \"two\"], decode.int)\n" - "\n" - " let data = dynamic.properties([\n" - " #(dynamic.string(\"one\"), dynamic.properties([\n" - " #(dynamic.string(\"two\"), dynamic.int(1000)),\n" - " ]),\n" - " ])\n" - "\n" - " decode.run(data, decoder)\n" - " // -> Ok(1000)\n" - " ```\n" - "\n" - " ```gleam\n" - " dynamic.nil()\n" - " |> decode.run(decode.optional(decode.int))\n" - " // -> Ok(option.None)\n" - " ```\n" -). --spec at(list(any()), decoder(BWF)) -> decoder(BWF). -at(Path, Inner) -> - {decoder, - fun(Data) -> - index( - Path, - [], - erlang:element(2, Inner), - Data, - fun(Data@1, Position) -> - {Default, _} = (erlang:element(2, Inner))(Data@1), - _pipe = {Default, - [{decode_error, - <<"Field"/utf8>>, - <<"Nothing"/utf8>>, - []}]}, - push_path(_pipe, lists:reverse(Position)) - end - ) - end}. - --file("src/gleam/dynamic/decode.gleam", 523). -?DOC( - " Run a decoder on a field of a `Dynamic` value, decoding the value if it is\n" - " of the desired type, or returning errors. An error is returned if there is\n" - " no field for the specified key.\n" - "\n" - " This function will index into dictionaries with any key type, and if the key is\n" - " an int then it'll also index into Erlang tuples and JavaScript arrays, and\n" - " the first eight elements of Gleam lists.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let data = dynamic.properties([\n" - " #(dynamic.string(\"email\"), dynamic.string(\"lucy@example.com\")),\n" - " #(dynamic.string(\"name\"), dynamic.string(\"Lucy\")),\n" - " ])\n" - "\n" - " let decoder = {\n" - " use name <- decode.field(\"name\", string)\n" - " use email <- decode.field(\"email\", string)\n" - " decode.success(SignUp(name: name, email: email))\n" - " }\n" - "\n" - " let result = decode.run(data, decoder)\n" - " assert result == Ok(SignUp(name: \"Lucy\", email: \"lucy@example.com\"))\n" - " ```\n" - "\n" - " If you wish to decode a value that is more deeply nested within the dynamic\n" - " data, see [`subfield`](#subfield) and [`at`](#at).\n" - "\n" - " If you wish to return a default in the event that a field is not present,\n" - " see [`optional_field`](#optional_field) and / [`optionally_at`](#optionally_at).\n" -). --spec field(any(), decoder(BXD), fun((BXD) -> decoder(BXF))) -> decoder(BXF). -field(Field_name, Field_decoder, Next) -> - subfield([Field_name], Field_decoder, Next). - --file("src/gleam/dynamic/decode.gleam", 556). -?DOC( - " Run a decoder on a field of a `Dynamic` value, decoding the value if it is\n" - " of the desired type, or returning errors. The given default value is\n" - " returned if there is no field for the specified key.\n" - "\n" - " This function will index into dictionaries with any key type, and if the key is\n" - " an int then it'll also index into Erlang tuples and JavaScript arrays, and\n" - " the first eight elements of Gleam lists.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let data = dynamic.properties([\n" - " #(dynamic.string(\"name\"), dynamic.string(\"Lucy\")),\n" - " ])\n" - "\n" - " let decoder = {\n" - " use name <- decode.field(\"name\", string)\n" - " use email <- decode.optional_field(\"email\", \"n/a\", string)\n" - " decode.success(SignUp(name: name, email: email))\n" - " }\n" - "\n" - " let result = decode.run(data, decoder)\n" - " assert result == Ok(SignUp(name: \"Lucy\", email: \"n/a\"))\n" - " ```\n" -). --spec optional_field(any(), BXJ, decoder(BXJ), fun((BXJ) -> decoder(BXL))) -> decoder(BXL). -optional_field(Key, Default, Field_decoder, Next) -> - {decoder, - fun(Data) -> - {Out, Errors1} = begin - _pipe = case gleam_stdlib:index(Data, Key) of - {ok, {some, Data@1}} -> - (erlang:element(2, Field_decoder))(Data@1); - - {ok, none} -> - {Default, []}; - - {error, Kind} -> - {Default, - [{decode_error, - Kind, - gleam_stdlib:classify_dynamic(Data), - []}]} - end, - push_path(_pipe, [Key]) - end, - {Out@1, Errors2} = (erlang:element(2, Next(Out)))(Data), - {Out@1, lists:append(Errors1, Errors2)} - end}. - --file("src/gleam/dynamic/decode.gleam", 597). -?DOC( - " A decoder that decodes a value that is nested within other values. For\n" - " example, decoding a value that is within some deeply nested JSON objects.\n" - "\n" - " This function will index into dictionaries with any key type, and if the key is\n" - " an int then it'll also index into Erlang tuples and JavaScript arrays, and\n" - " the first eight elements of Gleam lists.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let decoder = decode.optionally_at([\"one\", \"two\"], 100, decode.int)\n" - "\n" - " let data = dynamic.properties([\n" - " #(dynamic.string(\"one\"), dynamic.properties([])),\n" - " ])\n" - "\n" - " decode.run(data, decoder)\n" - " // -> Ok(100)\n" - " ```\n" -). --spec optionally_at(list(any()), BXQ, decoder(BXQ)) -> decoder(BXQ). -optionally_at(Path, Default, Inner) -> - {decoder, - fun(Data) -> - index( - Path, - [], - erlang:element(2, Inner), - Data, - fun(_, _) -> {Default, []} end - ) - end}. diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.cache deleted file mode 100644 index 0db76c1bcab4118c5ee5b68b8dba3c2d390cc7f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24078 zcmeHv33yx8mA~JUWyy+T`}x_iop^bXcUz04;~hfcgpkG!5GA1vX+kX7imgPJ97&Gj zlnjuTfv~kuV1NOJ0G(21Xn{gm23nx-75JLA6FRgkQ`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t_`UzCMBu=J zM^xAuR1YLwkJPRDkt2~``cf`LKrd1&(mJ&t<$j2I{dptm5tNTWygQQDq%T+)?Xz)R zqOb5xV2O@sU)1z^{A$P#-fW59s`cIs4@G~4 zjJJX^0v-1oO@Ed5n>=I(v~&3gR@T?D$gs$P*M~}U$ax`e!r7gNk{DuOz5eExxlur- z-R3Bw0cjP#JVc_uhi65foBj@>HO-Q&Zj>eUV@Q9^{|bkX01tp>@8$guQ0W6hvEbk zAKADz!P$A*-*RTFD`F9-w62n~nz}m9it0=G3~TiboE@wGA!jf0yF5T-8_s7wb}>gr zLj7v^E@#g-yu{fn{6aE`C)~&mxXqh1 z=x+$wXXrxCF6DcN*pAN0PJY;VA!nPrx3ZYNqdUNvy|<|snWNX!YtY>dcrDlQS9=ksMDG@8I)Vd&I=`=UW>_s))#6Q^M*9lw=$S39aRjA&pW@stG}r8 Y(oTaq>o;^}bA|uRdy}!(Vf9-7KX*+E3jhEB diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.cache_inline b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.cache_inline deleted file mode 100644 index 1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 KcmZQzfB*mh2mk>9 diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.cache_meta b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.cache_meta deleted file mode 100644 index 9385c76cd12292dedec86e5669a37890fb24d120..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2776 zcmXxleQ?ip902f-#i*tvvNR9bJe3ifYV?zo79t79`ZcvN@(@N=^gx$1dARDfQV8oo zPnwISYn!Qdm20W3#H~wZdT@laTT||Ob+VmX3d&j z&To27pFQoKIsNA5PMwx}dy5d}abnn};#)g?+O8<(|4||I@|w&@ZsR46GsJuo$Y3E4 zvYQKy&14qyD5ZgaXn#%!9ht!{S~d@1GS9PtV+8Np=kVkQr>ngZ7G1sAk3AE{)L#Wosgey+8NBZ00YGnPzp zm`NTlu$5wV5OZD#iA>;0RzL>&t@>$0Q-r#$VQ%@tYZ9^EuNX9XdIXuWpUS}tVIKw}jWzfZ9W(?z) z!h9ZO1y8Y)N^1CtpZS&F=-y5qNF%~XqRb?hMQoy&a;o@>8onmJy$L#Kwov znHx!G1S46>1~&2ob^OU+w767m8NeWhkj;9^DCaLyI*Of_DB@j8_?SOvc3BAL(wdHp zAj(u`u$lMygqQ^DaV_aAV>=~$KpEv6CZUr(Btjlbc#5^G=RGQ^;w!$Vf!NOO0NN5^ zESW6i0T#1_-PCf36PzY=aW3geKT;UVcyhRpTps0Fc2G(MRs6ykV!Dchi|Iv#;f!D{ zRUD=7<>sT5*lrtZGxtn<`WEq8QrI;P;;Q+^}r;)x%a?Ma~ zU_SS=oO}v-m7SEahdNI32d8P%-F-wNJxOIWcaqI?p5-mJ@eap0%fKFT&nQMShJ04D zo=v>XUJmjjM`+(u?U2eq7O{el_=bbj@*PRN^dXIWrFJac)Bm8{`KO4v&^`{~*zg#M)S1S?s^ zYIgGxHGE4QjhvsX&geiAX^dea89c`pcJVo1QcVq~sHacg5N0!vr995l6tSK6DPu1` zP)F;2AzVfxJxS#jCXz`Ot0>?(o~M)w8o1^vd&DSiBgz7nkp%%X$5+ zO@GpeFq`|y;{i6Zg@ar=AcRgN)1M(sAe&jt5O6$vv`>0c`I-Y9;S6!tIwQo>ok3)fMGgzd=S|+FgagE-Ij>DZ GQ~MX50;TT& diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.erl b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.erl deleted file mode 100644 index dd2d2e7..0000000 --- a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@float.erl +++ /dev/null @@ -1,764 +0,0 @@ --module(gleam@float). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/float.gleam"). --export([parse/1, to_string/1, compare/2, min/2, max/2, clamp/3, ceiling/1, floor/1, truncate/1, absolute_value/1, loosely_compare/3, loosely_equals/3, power/2, square_root/1, negate/1, round/1, to_precision/2, sum/1, product/1, random/0, modulo/2, divide/2, add/2, multiply/2, subtract/2, logarithm/1, exponential/1]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " Functions for working with floats.\n" - "\n" - " ## Float representation\n" - "\n" - " Floats are represented as 64 bit floating point numbers on both the Erlang\n" - " and JavaScript runtimes. The floating point behaviour is native to their\n" - " respective runtimes, so their exact behaviour will be slightly different on\n" - " the two runtimes.\n" - "\n" - " ### Infinity and NaN\n" - "\n" - " Under the JavaScript runtime, exceeding the maximum (or minimum)\n" - " representable value for a floating point value will result in Infinity (or\n" - " -Infinity). Should you try to divide two infinities you will get NaN as a\n" - " result.\n" - "\n" - " When running on BEAM, exceeding the maximum (or minimum) representable\n" - " value for a floating point value will raise an error.\n" - "\n" - " ## Division by zero\n" - "\n" - " Gleam runs on the Erlang virtual machine, which does not follow the IEEE\n" - " 754 standard for floating point arithmetic and does not have an `Infinity`\n" - " value. In Erlang division by zero results in a crash, however Gleam does\n" - " not have partial functions and operators in core so instead division by zero\n" - " returns zero, a behaviour taken from Pony, Coq, and Lean.\n" - "\n" - " This may seem unexpected at first, but it is no less mathematically valid\n" - " than crashing or returning a special value. Division by zero is undefined\n" - " in mathematics.\n" -). - --file("src/gleam/float.gleam", 51). -?DOC( - " Attempts to parse a string as a `Float`, returning `Error(Nil)` if it was\n" - " not possible.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " parse(\"2.3\")\n" - " // -> Ok(2.3)\n" - " ```\n" - "\n" - " ```gleam\n" - " parse(\"ABC\")\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec parse(binary()) -> {ok, float()} | {error, nil}. -parse(String) -> - gleam_stdlib:parse_float(String). - --file("src/gleam/float.gleam", 64). -?DOC( - " Returns the string representation of the provided `Float`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_string(2.3)\n" - " // -> \"2.3\"\n" - " ```\n" -). --spec to_string(float()) -> binary(). -to_string(X) -> - gleam_stdlib:float_to_string(X). - --file("src/gleam/float.gleam", 106). -?DOC( - " Compares two `Float`s, returning an `Order`:\n" - " `Lt` for lower than, `Eq` for equals, or `Gt` for greater than.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " compare(2.0, 2.3)\n" - " // -> Lt\n" - " ```\n" - "\n" - " To handle\n" - " [Floating Point Imprecision](https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems)\n" - " you may use [`loosely_compare`](#loosely_compare) instead.\n" -). --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. - --file("src/gleam/float.gleam", 187). -?DOC( - " Compares two `Float`s, returning the smaller of the two.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " min(2.0, 2.3)\n" - " // -> 2.0\n" - " ```\n" -). --spec min(float(), float()) -> float(). -min(A, B) -> - case A < B of - true -> - A; - - false -> - B - end. - --file("src/gleam/float.gleam", 203). -?DOC( - " Compares two `Float`s, returning the larger of the two.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " max(2.0, 2.3)\n" - " // -> 2.3\n" - " ```\n" -). --spec max(float(), float()) -> float(). -max(A, B) -> - case A > B of - true -> - A; - - false -> - B - end. - --file("src/gleam/float.gleam", 85). -?DOC( - " Restricts a float between two bounds.\n" - "\n" - " Note: If the `min` argument is larger than the `max` argument then they\n" - " will be swapped, so the minimum bound is always lower than the maximum\n" - " bound.\n" - "\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " clamp(1.2, min: 1.4, max: 1.6)\n" - " // -> 1.4\n" - " ```\n" - "\n" - " ```gleam\n" - " clamp(1.2, min: 1.4, max: 0.6)\n" - " // -> 1.2\n" - " ```\n" -). --spec clamp(float(), float(), float()) -> float(). -clamp(X, Min_bound, Max_bound) -> - case Min_bound >= Max_bound of - true -> - _pipe = X, - _pipe@1 = min(_pipe, Min_bound), - max(_pipe@1, Max_bound); - - false -> - _pipe@2 = X, - _pipe@3 = min(_pipe@2, Max_bound), - max(_pipe@3, Min_bound) - end. - --file("src/gleam/float.gleam", 221). -?DOC( - " Rounds the value to the next highest whole number as a `Float`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " ceiling(2.3)\n" - " // -> 3.0\n" - " ```\n" -). --spec ceiling(float()) -> float(). -ceiling(X) -> - math:ceil(X). - --file("src/gleam/float.gleam", 234). -?DOC( - " Rounds the value to the next lowest whole number as a `Float`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " floor(2.3)\n" - " // -> 2.0\n" - " ```\n" -). --spec floor(float()) -> float(). -floor(X) -> - math:floor(X). - --file("src/gleam/float.gleam", 272). -?DOC( - " Returns the value as an `Int`, truncating all decimal digits.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " truncate(2.4343434847383438)\n" - " // -> 2\n" - " ```\n" -). --spec truncate(float()) -> integer(). -truncate(X) -> - erlang:trunc(X). - --file("src/gleam/float.gleam", 322). -?DOC( - " Returns the absolute value of the input as a `Float`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " absolute_value(-12.5)\n" - " // -> 12.5\n" - " ```\n" - "\n" - " ```gleam\n" - " absolute_value(10.2)\n" - " // -> 10.2\n" - " ```\n" -). --spec absolute_value(float()) -> float(). -absolute_value(X) -> - case X >= +0.0 of - true -> - X; - - false -> - +0.0 - X - end. - --file("src/gleam/float.gleam", 136). -?DOC( - " Compares two `Float`s within a tolerance, returning an `Order`:\n" - " `Lt` for lower than, `Eq` for equals, or `Gt` for greater than.\n" - "\n" - " This function allows Float comparison while handling\n" - " [Floating Point Imprecision](https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems).\n" - "\n" - " Notice: For `Float`s the tolerance won't be exact:\n" - " `5.3 - 5.0` is not exactly `0.3`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " loosely_compare(5.0, with: 5.3, tolerating: 0.5)\n" - " // -> Eq\n" - " ```\n" - "\n" - " If you want to check only for equality you may use\n" - " [`loosely_equals`](#loosely_equals) instead.\n" -). --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. - --file("src/gleam/float.gleam", 169). -?DOC( - " Checks for equality of two `Float`s within a tolerance,\n" - " returning a `Bool`.\n" - "\n" - " This function allows Float comparison while handling\n" - " [Floating Point Imprecision](https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems).\n" - "\n" - " Notice: For `Float`s the tolerance won't be exact:\n" - " `5.3 - 5.0` is not exactly `0.3`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " loosely_equals(5.0, with: 5.3, tolerating: 0.5)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " loosely_equals(5.0, with: 5.1, tolerating: 0.1)\n" - " // -> False\n" - " ```\n" -). --spec loosely_equals(float(), float(), float()) -> boolean(). -loosely_equals(A, B, Tolerance) -> - Difference = absolute_value(A - B), - Difference =< Tolerance. - --file("src/gleam/float.gleam", 359). -?DOC( - " Returns the result of the base being raised to the power of the\n" - " exponent, as a `Float`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " power(2.0, -1.0)\n" - " // -> Ok(0.5)\n" - " ```\n" - "\n" - " ```gleam\n" - " power(2.0, 2.0)\n" - " // -> Ok(4.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " power(8.0, 1.5)\n" - " // -> Ok(22.627416997969522)\n" - " ```\n" - "\n" - " ```gleam\n" - " 4.0 |> power(of: 2.0)\n" - " // -> Ok(16.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " power(-1.0, 0.5)\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec power(float(), float()) -> {ok, float()} | {error, nil}. -power(Base, Exponent) -> - Fractional = (math:ceil(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. - --file("src/gleam/float.gleam", 391). -?DOC( - " Returns the square root of the input as a `Float`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " square_root(4.0)\n" - " // -> Ok(2.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " square_root(-16.0)\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec square_root(float()) -> {ok, float()} | {error, nil}. -square_root(X) -> - power(X, 0.5). - --file("src/gleam/float.gleam", 404). -?DOC( - " Returns the negative of the value provided.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " negate(1.0)\n" - " // -> -1.0\n" - " ```\n" -). --spec negate(float()) -> float(). -negate(X) -> - -1.0 * X. - --file("src/gleam/float.gleam", 251). -?DOC( - " Rounds the value to the nearest whole number as an `Int`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " round(2.3)\n" - " // -> 2\n" - " ```\n" - "\n" - " ```gleam\n" - " round(2.5)\n" - " // -> 3\n" - " ```\n" -). --spec round(float()) -> integer(). -round(X) -> - erlang:round(X). - --file("src/gleam/float.gleam", 291). -?DOC( - " Converts the value to a given precision as a `Float`.\n" - " The precision is the number of allowed decimal places.\n" - " Negative precisions are allowed and force rounding\n" - " to the nearest tenth, hundredth, thousandth etc.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_precision(2.43434348473, precision: 2)\n" - " // -> 2.43\n" - " ```\n" - "\n" - " ```gleam\n" - " to_precision(547890.453444, precision: -3)\n" - " // -> 548000.0\n" - " ```\n" -). --spec to_precision(float(), integer()) -> float(). -to_precision(X, Precision) -> - case Precision =< 0 of - true -> - Factor = math:pow(10.0, erlang:float(- Precision)), - erlang:float(erlang:round(case Factor of - +0.0 -> +0.0; - -0.0 -> -0.0; - Gleam@denominator -> X / Gleam@denominator - end)) * Factor; - - false -> - Factor@1 = math:pow(10.0, erlang:float(Precision)), - case Factor@1 of - +0.0 -> +0.0; - -0.0 -> -0.0; - Gleam@denominator@1 -> erlang:float(erlang:round(X * Factor@1)) - / Gleam@denominator@1 - end - end. - --file("src/gleam/float.gleam", 421). --spec sum_loop(list(float()), float()) -> float(). -sum_loop(Numbers, Initial) -> - case Numbers of - [First | Rest] -> - sum_loop(Rest, First + Initial); - - [] -> - Initial - end. - --file("src/gleam/float.gleam", 417). -?DOC( - " Sums a list of `Float`s.\n" - "\n" - " ## Example\n" - "\n" - " ```gleam\n" - " sum([1.0, 2.2, 3.3])\n" - " // -> 6.5\n" - " ```\n" -). --spec sum(list(float())) -> float(). -sum(Numbers) -> - sum_loop(Numbers, +0.0). - --file("src/gleam/float.gleam", 441). --spec product_loop(list(float()), float()) -> float(). -product_loop(Numbers, Initial) -> - case Numbers of - [First | Rest] -> - product_loop(Rest, First * Initial); - - [] -> - Initial - end. - --file("src/gleam/float.gleam", 437). -?DOC( - " Multiplies a list of `Float`s and returns the product.\n" - "\n" - " ## Example\n" - "\n" - " ```gleam\n" - " product([2.5, 3.2, 4.2])\n" - " // -> 33.6\n" - " ```\n" -). --spec product(list(float())) -> float(). -product(Numbers) -> - product_loop(Numbers, 1.0). - --file("src/gleam/float.gleam", 463). -?DOC( - " Generates a random float between the given zero (inclusive) and one\n" - " (exclusive).\n" - "\n" - " On Erlang this updates the random state in the process dictionary.\n" - " See: \n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " random()\n" - " // -> 0.646355926896028\n" - " ```\n" -). --spec random() -> float(). -random() -> - rand:uniform(). - --file("src/gleam/float.gleam", 494). -?DOC( - " Computes the modulo of a float division of inputs as a `Result`.\n" - "\n" - " Returns division of the inputs as a `Result`: If the given divisor equals\n" - " `0`, this function returns an `Error`.\n" - "\n" - " The computed value will always have the same sign as the `divisor`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " modulo(13.3, by: 3.3)\n" - " // -> Ok(0.1)\n" - " ```\n" - "\n" - " ```gleam\n" - " modulo(-13.3, by: 3.3)\n" - " // -> Ok(3.2)\n" - " ```\n" - "\n" - " ```gleam\n" - " modulo(13.3, by: -3.3)\n" - " // -> Ok(-3.2)\n" - " ```\n" - "\n" - " ```gleam\n" - " modulo(-13.3, by: -3.3)\n" - " // -> Ok(-0.1)\n" - " ```\n" -). --spec modulo(float(), float()) -> {ok, float()} | {error, nil}. -modulo(Dividend, Divisor) -> - case Divisor of - +0.0 -> - {error, nil}; - - _ -> - {ok, Dividend - (math:floor(case Divisor of - +0.0 -> +0.0; - -0.0 -> -0.0; - Gleam@denominator -> Dividend / Gleam@denominator - end) * Divisor)} - end. - --file("src/gleam/float.gleam", 515). -?DOC( - " Returns division of the inputs as a `Result`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " divide(0.0, 1.0)\n" - " // -> Ok(0.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " divide(1.0, 0.0)\n" - " // -> Error(Nil)\n" - " ```\n" -). --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; - -0.0 -> -0.0; - Gleam@denominator -> A / Gleam@denominator - end} - end. - --file("src/gleam/float.gleam", 546). -?DOC( - " Adds two floats together.\n" - "\n" - " It's the function equivalent of the `+.` operator.\n" - " This function is useful in higher order functions or pipes.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " add(1.0, 2.0)\n" - " // -> 3.0\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/list\n" - "\n" - " list.fold([1.0, 2.0, 3.0], 0.0, add)\n" - " // -> 6.0\n" - " ```\n" - "\n" - " ```gleam\n" - " 3.0 |> add(2.0)\n" - " // -> 5.0\n" - " ```\n" -). --spec add(float(), float()) -> float(). -add(A, B) -> - A + B. - --file("src/gleam/float.gleam", 574). -?DOC( - " Multiplies two floats together.\n" - "\n" - " It's the function equivalent of the `*.` operator.\n" - " This function is useful in higher order functions or pipes.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " multiply(2.0, 4.0)\n" - " // -> 8.0\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/list\n" - "\n" - " list.fold([2.0, 3.0, 4.0], 1.0, multiply)\n" - " // -> 24.0\n" - " ```\n" - "\n" - " ```gleam\n" - " 3.0 |> multiply(2.0)\n" - " // -> 6.0\n" - " ```\n" -). --spec multiply(float(), float()) -> float(). -multiply(A, B) -> - A * B. - --file("src/gleam/float.gleam", 607). -?DOC( - " Subtracts one float from another.\n" - "\n" - " It's the function equivalent of the `-.` operator.\n" - " This function is useful in higher order functions or pipes.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " subtract(3.0, 1.0)\n" - " // -> 2.0\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/list\n" - "\n" - " list.fold([1.0, 2.0, 3.0], 10.0, subtract)\n" - " // -> 4.0\n" - " ```\n" - "\n" - " ```gleam\n" - " 3.0 |> subtract(_, 2.0)\n" - " // -> 1.0\n" - " ```\n" - "\n" - " ```gleam\n" - " 3.0 |> subtract(2.0, _)\n" - " // -> -1.0\n" - " ```\n" -). --spec subtract(float(), float()) -> float(). -subtract(A, B) -> - A - B. - --file("src/gleam/float.gleam", 636). -?DOC( - " Returns the natural logarithm (base e) of the given `Float` as a `Result`. If the\n" - " input is less than or equal to 0, returns `Error(Nil)`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " logarithm(1.0)\n" - " // -> Ok(0.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " logarithm(2.718281828459045) // e\n" - " // -> Ok(1.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " logarithm(0.0)\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " logarithm(-1.0)\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec logarithm(float()) -> {ok, float()} | {error, nil}. -logarithm(X) -> - case X =< +0.0 of - true -> - {error, nil}; - - false -> - {ok, math:log(X)} - end. - --file("src/gleam/float.gleam", 674). -?DOC( - " Returns e (Euler's number) raised to the power of the given exponent, as\n" - " a `Float`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " exponential(0.0)\n" - " // -> Ok(1.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " exponential(1.0)\n" - " // -> Ok(2.718281828459045)\n" - " ```\n" - "\n" - " ```gleam\n" - " exponential(-1.0)\n" - " // -> Ok(0.36787944117144233)\n" - " ```\n" -). --spec exponential(float()) -> float(). -exponential(X) -> - math:exp(X). diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.cache deleted file mode 100644 index 2a1161f1d75388fb0fa468d198f225f5157e5fbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 674 zcmZWm&2G~`5Z;-M?ZmWdMkXrZ5~orxm0HuPs1ibo11*RkewOx#pxb1zOdKb8?LzZJ zJVbin1$YK{4K88rTq;G{(Trwhzi+;o=I{5g!5Hn&DRwB{_6l%l_pA2}PR@TK;9(cJ zw?OoMq2t}6{d|FZ86`?if-eQ@rNca)rmMtfowKb`5??KYYncU;G`|<9VG_@@3NkgD z>flP{iA8zmb^tta9>Al>eWg>irP#2>)k2c?T7Hv$?b1fB)huXAcWq;`kMrB_Gv zrbA~ge>Y~VU*n>VHto9RK`GnmoMqWGTQ4DVoVRgeV66@TH$SPdLz@m+?kXSht!L9| z)nIseMY>0ArzCA1t%9wKtWb=Fyz@dPx{4qo>)7BlLpqhDq9!)Y@9 diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.cache_meta b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.cache_meta deleted file mode 100644 index 5ed84a82c08afec011be5c9bd0699b66192cd8c3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 73 tcmX@QFFun23K(IGUq2Q-Z19@$l?^5Uq#c0R1&9-YI2DM~p%_Sk0RZeB3Nruz diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.erl b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.erl deleted file mode 100644 index fa5155d..0000000 --- a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@function.erl +++ /dev/null @@ -1,18 +0,0 @@ --module(gleam@function). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/function.gleam"). --export([identity/1]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --file("src/gleam/function.gleam", 3). -?DOC(" Takes a single argument and always returns its input value.\n"). --spec identity(CLU) -> CLU. -identity(X) -> - X. diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache deleted file mode 100644 index 255aa41b8de4e0f55205eb9f8c68897d356662cb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 27832 zcmeHw3wRsFwXk<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9iiR2@8Wbf@WqR=I-~;Pn>StfcHPpfHN?y<`pmg_+3bv0MpERmrtDH4d zRryxs#g*zR$vDysBWgCPigm5ct!XPVnuD3D7RUNd^`&niUF0lbR~$ZlExr zmB}F>st=WpXxOlH#fz$g+LC!1fK0k#Iz3d8oY)uH5m%q8{Cy=t_2$aEwGdIxGi$fz z1Q?q;1s%5m@5XU)8|HG`z1(&mxBV*K#`N=53<{>qT)q?YPR504IllwTI~Y_Xn5+0I zR6?p)2d1m|yRj^##U{*47BVul<-?6sLE5MsY+e493t*W5yzsnfiKvbEVK(4Okg4pP>a zGeE@euX*p}VRkt0W6JUi3W@kx3d$(^MZqsA`wF*%Na2#gx&Lt*aZ*8QknXaE@;1erDqC;kxiL$&h z3?^crpqxi00PmH5K-un!A7a!z?4t{&7&ylE1)`Bl=pGjwnQaGU7udc{*~N4fJOg_x zuOj++9Uc0|`BlC{*(a5Z9kWb3{@V)-+$r28V0J&<#>v2oj+cqpz2$h9vIz%Ev}Q-` z*NE2ati71BD{J>scDU~2I?S?Nc|?H9TsF$?ao_L8>`C{pDSO%dN6MBrbvI$Qx~Ye< z6X|wxZ0F7MV#a$*C@c5k^+))yIj@->HkVLV-i#NB;A~s2X~FFJmY-2}Ys)VvYim8G z6|+UHU6kF~c2^r__qRPr*<)=_P}b)g@L@LMJB_k2Uz{@I0{kbkaBUY9Qf66DM%fJ= SH+5ikTgM%g-Q96t$NvXYz__Xa diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache_inline b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache_inline deleted file mode 100644 index 1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 KcmZQzfB*mh2mk>9 diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache_meta b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@int.cache_meta deleted file mode 100644 index d934a3152be06bc8823180559a1e5210acb2172c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3355 zcmY+`eRN3Y836EGQIxjxtw<1ULWv|4U9x6vrfNkGYgJ4|r4wIELNe?as+jIznqhL( zM`so!WY!W=igigfN~aq0IgKrGqQ!hgNit)OC&LtSuA8JD_GAiKISlG)bfBa zw4pmO^rRQlSw;>U*-Q}!Im0==)FOmO87e$spb~-9|(dlqUlRK0~kXlGnmaH)>FivDd7lT zafb$tgP<`lkU1fQ zi#e=h3)?B;BhGT2I_}Wq;UI`4jzs$NB5BNJAxl`r4h~YraUS`Oc8p~fZ!nMf6mpBm zra{n!5sV^@Da>XGYse*!PpRTdzM@^TAm~6ey?C0TyvlffN;dgyp@4EKxXw*Nng>BE z9wUlaUSbt>p#n=}0OIDB=Q_xym&{+ZY3} z^d^y)7{dh8n89LJvW{Hdql6=zxr&tkG!$}$e|8E2{FDtBny*50Ny z@jOow1-gMUF_u`CppI@uF|qy5Ijmxp5a-ZV*o#ACX2~t4O`evF&}f33a(Sf z9XhtRRzwrSXkH_W>C9&->&T;kU6gWyvs4li>f1tdTF{RHB=HIpn9h6_lg(C&*u`#+ za)K%@aEr!a=8g_@W*{m2gt4rqfJ(lmmVa}bCpy^MJjXzi$Y3V(`4!ta%n?54!H()A zBbY=6Q^@393b{!gjXMRw!?dRxefd5=Ujk8?9(fBK=v; zK8h*hIF;O>erMyQDPcs@k3kG!6zR-n0Sn0?pARUZlqQeL8)6yGNJf!N9tG49@mLT% z&Q#{{CONEP6CZGhqnzLzH9Qm{F4_{wQw(MpBS__S-Xe!pY~nAJahh^2a(|@02qTK5JxhpjAsIGv5W&W>M2hMr4v1P zhQSPD1gXqq4jb6UZuW7Ae{hK#)DYfFF3_DQhBAyr9ON+NRB(lQPpB2NrX5{KAdv}7 zWfpI+g!OD?C%Y--ESI=J4dK0wf$l_+ObVN+CAyFQ3x>0dJ?!OQTqC}(n!rAasiO0f zzAN-+8Z#)S*>}}Z29i!5pHoIioPS@2@;m;= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " Functions for working with integers.\n" - "\n" - " ## Division by zero\n" - "\n" - " In Erlang division by zero results in a crash, however Gleam does not have\n" - " partial functions and operators in core so instead division by zero returns\n" - " zero, a behaviour taken from Pony, Coq, and Lean.\n" - "\n" - " This may seem unexpected at first, but it is no less mathematically valid\n" - " than crashing or returning a special value. Division by zero is undefined\n" - " in mathematics.\n" -). - --file("src/gleam/int.gleam", 30). -?DOC( - " Returns the absolute value of the input.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " absolute_value(-12)\n" - " // -> 12\n" - " ```\n" - "\n" - " ```gleam\n" - " absolute_value(10)\n" - " // -> 10\n" - " ```\n" -). --spec absolute_value(integer()) -> integer(). -absolute_value(X) -> - case X >= 0 of - true -> - X; - - false -> - X * -1 - end. - --file("src/gleam/int.gleam", 109). -?DOC( - " Parses a given string as an int if possible.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " parse(\"2\")\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " parse(\"ABC\")\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec parse(binary()) -> {ok, integer()} | {error, nil}. -parse(String) -> - gleam_stdlib:parse_int(String). - --file("src/gleam/int.gleam", 141). -?DOC( - " Parses a given string as an int in a given base if possible.\n" - " Supports only bases 2 to 36, for values outside of which this function returns an `Error(Nil)`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " base_parse(\"10\", 2)\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " base_parse(\"30\", 16)\n" - " // -> Ok(48)\n" - " ```\n" - "\n" - " ```gleam\n" - " base_parse(\"1C\", 36)\n" - " // -> Ok(48)\n" - " ```\n" - "\n" - " ```gleam\n" - " base_parse(\"48\", 1)\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " base_parse(\"48\", 37)\n" - " // -> Error(Nil)\n" - " ```\n" -). --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. - --file("src/gleam/int.gleam", 163). -?DOC( - " Prints a given int to a string.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_string(2)\n" - " // -> \"2\"\n" - " ```\n" -). --spec to_string(integer()) -> binary(). -to_string(X) -> - erlang:integer_to_binary(X). - --file("src/gleam/int.gleam", 196). -?DOC( - " Prints a given int to a string using the base number provided.\n" - " Supports only bases 2 to 36, for values outside of which this function returns an `Error(Nil)`.\n" - " For common bases (2, 8, 16, 36), use the `to_baseN` functions.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_base_string(2, 2)\n" - " // -> Ok(\"10\")\n" - " ```\n" - "\n" - " ```gleam\n" - " to_base_string(48, 16)\n" - " // -> Ok(\"30\")\n" - " ```\n" - "\n" - " ```gleam\n" - " to_base_string(48, 36)\n" - " // -> Ok(\"1C\")\n" - " ```\n" - "\n" - " ```gleam\n" - " to_base_string(48, 1)\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " to_base_string(48, 37)\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec to_base_string(integer(), integer()) -> {ok, binary()} | {error, nil}. -to_base_string(X, Base) -> - case (Base >= 2) andalso (Base =< 36) of - true -> - {ok, erlang:integer_to_binary(X, Base)}; - - false -> - {error, nil} - end. - --file("src/gleam/int.gleam", 216). -?DOC( - " Prints a given int to a string using base-2.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_base2(2)\n" - " // -> \"10\"\n" - " ```\n" -). --spec to_base2(integer()) -> binary(). -to_base2(X) -> - erlang:integer_to_binary(X, 2). - --file("src/gleam/int.gleam", 229). -?DOC( - " Prints a given int to a string using base-8.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_base8(15)\n" - " // -> \"17\"\n" - " ```\n" -). --spec to_base8(integer()) -> binary(). -to_base8(X) -> - erlang:integer_to_binary(X, 8). - --file("src/gleam/int.gleam", 242). -?DOC( - " Prints a given int to a string using base-16.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_base16(48)\n" - " // -> \"30\"\n" - " ```\n" -). --spec to_base16(integer()) -> binary(). -to_base16(X) -> - erlang:integer_to_binary(X, 16). - --file("src/gleam/int.gleam", 255). -?DOC( - " Prints a given int to a string using base-36.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_base36(48)\n" - " // -> \"1C\"\n" - " ```\n" -). --spec to_base36(integer()) -> binary(). -to_base36(X) -> - erlang:integer_to_binary(X, 36). - --file("src/gleam/int.gleam", 280). -?DOC( - " Takes an int and returns its value as a float.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_float(5)\n" - " // -> 5.0\n" - " ```\n" - "\n" - " ```gleam\n" - " to_float(0)\n" - " // -> 0.0\n" - " ```\n" - "\n" - " ```gleam\n" - " to_float(-3)\n" - " // -> -3.0\n" - " ```\n" -). --spec to_float(integer()) -> float(). -to_float(X) -> - erlang:float(X). - --file("src/gleam/int.gleam", 67). -?DOC( - " Returns the result of the base being raised to the power of the\n" - " exponent, as a `Float`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " power(2, -1.0)\n" - " // -> Ok(0.5)\n" - " ```\n" - "\n" - " ```gleam\n" - " power(2, 2.0)\n" - " // -> Ok(4.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " power(8, 1.5)\n" - " // -> Ok(22.627416997969522)\n" - " ```\n" - "\n" - " ```gleam\n" - " 4 |> power(of: 2.0)\n" - " // -> Ok(16.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " power(-1, 0.5)\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec power(integer(), float()) -> {ok, float()} | {error, nil}. -power(Base, Exponent) -> - _pipe = Base, - _pipe@1 = erlang:float(_pipe), - gleam@float:power(_pipe@1, Exponent). - --file("src/gleam/int.gleam", 87). -?DOC( - " Returns the square root of the input as a `Float`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " square_root(4)\n" - " // -> Ok(2.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " square_root(-16)\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec square_root(integer()) -> {ok, float()} | {error, nil}. -square_root(X) -> - _pipe = X, - _pipe@1 = erlang:float(_pipe), - gleam@float:square_root(_pipe@1). - --file("src/gleam/int.gleam", 326). -?DOC( - " Compares two ints, returning an order.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " compare(2, 3)\n" - " // -> Lt\n" - " ```\n" - "\n" - " ```gleam\n" - " compare(4, 3)\n" - " // -> Gt\n" - " ```\n" - "\n" - " ```gleam\n" - " compare(3, 3)\n" - " // -> Eq\n" - " ```\n" -). --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. - --file("src/gleam/int.gleam", 346). -?DOC( - " Compares two ints, returning the smaller of the two.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " min(2, 3)\n" - " // -> 2\n" - " ```\n" -). --spec min(integer(), integer()) -> integer(). -min(A, B) -> - case A < B of - true -> - A; - - false -> - B - end. - --file("src/gleam/int.gleam", 362). -?DOC( - " Compares two ints, returning the larger of the two.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " max(2, 3)\n" - " // -> 3\n" - " ```\n" -). --spec max(integer(), integer()) -> integer(). -max(A, B) -> - case A > B of - true -> - A; - - false -> - B - end. - --file("src/gleam/int.gleam", 300). -?DOC( - " Restricts an int between two bounds.\n" - "\n" - " Note: If the `min` argument is larger than the `max` argument then they\n" - " will be swapped, so the minimum bound is always lower than the maximum\n" - " bound.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " clamp(40, min: 50, max: 60)\n" - " // -> 50\n" - " ```\n" - "\n" - " ```gleam\n" - " clamp(40, min: 50, max: 30)\n" - " // -> 40\n" - " ```\n" -). --spec clamp(integer(), integer(), integer()) -> integer(). -clamp(X, Min_bound, Max_bound) -> - case Min_bound >= Max_bound of - true -> - _pipe = X, - _pipe@1 = min(_pipe, Min_bound), - max(_pipe@1, Max_bound); - - false -> - _pipe@2 = X, - _pipe@3 = min(_pipe@2, Max_bound), - max(_pipe@3, Min_bound) - end. - --file("src/gleam/int.gleam", 383). -?DOC( - " Returns whether the value provided is even.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_even(2)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " is_even(3)\n" - " // -> False\n" - " ```\n" -). --spec is_even(integer()) -> boolean(). -is_even(X) -> - (X rem 2) =:= 0. - --file("src/gleam/int.gleam", 401). -?DOC( - " Returns whether the value provided is odd.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_odd(3)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " is_odd(2)\n" - " // -> False\n" - " ```\n" -). --spec is_odd(integer()) -> boolean(). -is_odd(X) -> - (X rem 2) /= 0. - --file("src/gleam/int.gleam", 414). -?DOC( - " Returns the negative of the value provided.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " negate(1)\n" - " // -> -1\n" - " ```\n" -). --spec negate(integer()) -> integer(). -negate(X) -> - -1 * X. - --file("src/gleam/int.gleam", 431). --spec sum_loop(list(integer()), integer()) -> integer(). -sum_loop(Numbers, Initial) -> - case Numbers of - [First | Rest] -> - sum_loop(Rest, First + Initial); - - [] -> - Initial - end. - --file("src/gleam/int.gleam", 427). -?DOC( - " Sums a list of ints.\n" - "\n" - " ## Example\n" - "\n" - " ```gleam\n" - " sum([1, 2, 3])\n" - " // -> 6\n" - " ```\n" -). --spec sum(list(integer())) -> integer(). -sum(Numbers) -> - sum_loop(Numbers, 0). - --file("src/gleam/int.gleam", 451). --spec product_loop(list(integer()), integer()) -> integer(). -product_loop(Numbers, Initial) -> - case Numbers of - [First | Rest] -> - product_loop(Rest, First * Initial); - - [] -> - Initial - end. - --file("src/gleam/int.gleam", 447). -?DOC( - " Multiplies a list of ints and returns the product.\n" - "\n" - " ## Example\n" - "\n" - " ```gleam\n" - " product([2, 3, 4])\n" - " // -> 24\n" - " ```\n" -). --spec product(list(integer())) -> integer(). -product(Numbers) -> - product_loop(Numbers, 1). - --file("src/gleam/int.gleam", 479). -?DOC( - " Generates a random int between zero and the given maximum.\n" - "\n" - " The lower number is inclusive, the upper number is exclusive.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " random(10)\n" - " // -> 4\n" - " ```\n" - "\n" - " ```gleam\n" - " random(1)\n" - " // -> 0\n" - " ```\n" - "\n" - " ```gleam\n" - " random(-1)\n" - " // -> -1\n" - " ```\n" -). --spec random(integer()) -> integer(). -random(Max) -> - _pipe = (rand:uniform() * erlang:float(Max)), - _pipe@1 = math:floor(_pipe), - erlang:round(_pipe@1). - --file("src/gleam/int.gleam", 512). -?DOC( - " Performs a truncated integer division.\n" - "\n" - " Returns division of the inputs as a `Result`: If the given divisor equals\n" - " `0`, this function returns an `Error`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " divide(0, 1)\n" - " // -> Ok(0)\n" - " ```\n" - "\n" - " ```gleam\n" - " divide(1, 0)\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " divide(5, 2)\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " divide(-99, 2)\n" - " // -> Ok(-49)\n" - " ```\n" -). --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. - --file("src/gleam/int.gleam", 564). -?DOC( - " Computes the remainder of an integer division of inputs as a `Result`.\n" - "\n" - " Returns division of the inputs as a `Result`: If the given divisor equals\n" - " `0`, this function returns an `Error`.\n" - "\n" - " Most of the time you will want to use the `%` operator instead of this\n" - " function.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " remainder(3, 2)\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " remainder(1, 0)\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " remainder(10, -1)\n" - " // -> Ok(0)\n" - " ```\n" - "\n" - " ```gleam\n" - " remainder(13, by: 3)\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " remainder(-13, by: 3)\n" - " // -> Ok(-1)\n" - " ```\n" - "\n" - " ```gleam\n" - " remainder(13, by: -3)\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " remainder(-13, by: -3)\n" - " // -> Ok(-1)\n" - " ```\n" -). --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. - --file("src/gleam/int.gleam", 611). -?DOC( - " Computes the modulo of an integer division of inputs as a `Result`.\n" - "\n" - " Returns division of the inputs as a `Result`: If the given divisor equals\n" - " `0`, this function returns an `Error`.\n" - "\n" - " Note that this is different from `int.remainder` and `%` in that the\n" - " computed value will always have the same sign as the `divisor`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " modulo(3, 2)\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " modulo(1, 0)\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " modulo(10, -1)\n" - " // -> Ok(0)\n" - " ```\n" - "\n" - " ```gleam\n" - " modulo(13, by: 3)\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " modulo(-13, by: 3)\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " modulo(13, by: -3)\n" - " // -> Ok(-2)\n" - " ```\n" -). --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. - --file("src/gleam/int.gleam", 655). -?DOC( - " Performs a *floored* integer division, which means that the result will\n" - " always be rounded towards negative infinity.\n" - "\n" - " If you want to perform truncated integer division (rounding towards zero),\n" - " use `int.divide()` or the `/` operator instead.\n" - "\n" - " Returns division of the inputs as a `Result`: If the given divisor equals\n" - " `0`, this function returns an `Error`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " floor_divide(1, 0)\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " floor_divide(5, 2)\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " floor_divide(6, -4)\n" - " // -> Ok(-2)\n" - " ```\n" - "\n" - " ```gleam\n" - " floor_divide(-99, 2)\n" - " // -> Ok(-50)\n" - " ```\n" -). --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. - --file("src/gleam/int.gleam", 689). -?DOC( - " Adds two integers together.\n" - "\n" - " It's the function equivalent of the `+` operator.\n" - " This function is useful in higher order functions or pipes.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " add(1, 2)\n" - " // -> 3\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/list\n" - " list.fold([1, 2, 3], 0, add)\n" - " // -> 6\n" - " ```\n" - "\n" - " ```gleam\n" - " 3 |> add(2)\n" - " // -> 5\n" - " ```\n" -). --spec add(integer(), integer()) -> integer(). -add(A, B) -> - A + B. - --file("src/gleam/int.gleam", 717). -?DOC( - " Multiplies two integers together.\n" - "\n" - " It's the function equivalent of the `*` operator.\n" - " This function is useful in higher order functions or pipes.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " multiply(2, 4)\n" - " // -> 8\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/list\n" - "\n" - " list.fold([2, 3, 4], 1, multiply)\n" - " // -> 24\n" - " ```\n" - "\n" - " ```gleam\n" - " 3 |> multiply(2)\n" - " // -> 6\n" - " ```\n" -). --spec multiply(integer(), integer()) -> integer(). -multiply(A, B) -> - A * B. - --file("src/gleam/int.gleam", 750). -?DOC( - " Subtracts one int from another.\n" - "\n" - " It's the function equivalent of the `-` operator.\n" - " This function is useful in higher order functions or pipes.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " subtract(3, 1)\n" - " // -> 2\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/list\n" - "\n" - " list.fold([1, 2, 3], 10, subtract)\n" - " // -> 4\n" - " ```\n" - "\n" - " ```gleam\n" - " 3 |> subtract(2)\n" - " // -> 1\n" - " ```\n" - "\n" - " ```gleam\n" - " 3 |> subtract(2, _)\n" - " // -> -1\n" - " ```\n" -). --spec subtract(integer(), integer()) -> integer(). -subtract(A, B) -> - A - B. - --file("src/gleam/int.gleam", 762). -?DOC( - " Calculates the bitwise AND of its arguments.\n" - "\n" - " The exact behaviour of this function depends on the target platform.\n" - " On Erlang it is equivalent to bitwise operations on ints, on JavaScript it\n" - " is equivalent to bitwise operations on big-ints.\n" -). --spec bitwise_and(integer(), integer()) -> integer(). -bitwise_and(X, Y) -> - erlang:'band'(X, Y). - --file("src/gleam/int.gleam", 772). -?DOC( - " Calculates the bitwise NOT of its argument.\n" - "\n" - " The exact behaviour of this function depends on the target platform.\n" - " On Erlang it is equivalent to bitwise operations on ints, on JavaScript it\n" - " is equivalent to bitwise operations on big-ints.\n" -). --spec bitwise_not(integer()) -> integer(). -bitwise_not(X) -> - erlang:'bnot'(X). - --file("src/gleam/int.gleam", 782). -?DOC( - " Calculates the bitwise OR of its arguments.\n" - "\n" - " The exact behaviour of this function depends on the target platform.\n" - " On Erlang it is equivalent to bitwise operations on ints, on JavaScript it\n" - " is equivalent to bitwise operations on big-ints.\n" -). --spec bitwise_or(integer(), integer()) -> integer(). -bitwise_or(X, Y) -> - erlang:'bor'(X, Y). - --file("src/gleam/int.gleam", 792). -?DOC( - " Calculates the bitwise XOR of its arguments.\n" - "\n" - " The exact behaviour of this function depends on the target platform.\n" - " On Erlang it is equivalent to bitwise operations on ints, on JavaScript it\n" - " is equivalent to bitwise operations on big-ints.\n" -). --spec bitwise_exclusive_or(integer(), integer()) -> integer(). -bitwise_exclusive_or(X, Y) -> - erlang:'bxor'(X, Y). - --file("src/gleam/int.gleam", 802). -?DOC( - " Calculates the result of an arithmetic left bitshift.\n" - "\n" - " The exact behaviour of this function depends on the target platform.\n" - " On Erlang it is equivalent to bitwise operations on ints, on JavaScript it\n" - " is equivalent to bitwise operations on big-ints.\n" -). --spec bitwise_shift_left(integer(), integer()) -> integer(). -bitwise_shift_left(X, Y) -> - erlang:'bsl'(X, Y). - --file("src/gleam/int.gleam", 812). -?DOC( - " Calculates the result of an arithmetic right bitshift.\n" - "\n" - " The exact behaviour of this function depends on the target platform.\n" - " On Erlang it is equivalent to bitwise operations on ints, on JavaScript it\n" - " is equivalent to bitwise operations on big-ints.\n" -). --spec bitwise_shift_right(integer(), integer()) -> integer(). -bitwise_shift_right(X, Y) -> - erlang:'bsr'(X, Y). diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.cache deleted file mode 100644 index 85aa821c76e3ae092bf3a20130bd16aec8a1ea23..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2707 zcmc(hQD_`h6o%*Axs%xpt=;1qlZxryq!ioQX1Y5_u!zkj#54=G9b>2kYj!r7ZnvGC z+0M+`)(6{4i|w0&MM1<`@ImmwM}-#p5NH(ip&$rWXhlS;2o_%@o|)OSn`E(hCJg^8ovMhJT@@ItC2UGe|r@;bB{le?Zg3#*Je1gjK6MHvK4-O7S{0K^1J)Wpn@Ts;D(;{aZAl>tg%!f|e4S zi9dcz(y^0nD=m>Jm9mz~bq(#nsamm+jMXVp?Qv ziD--;5+}WeIBvONWcUk2iCNheaT#pF?22j_2=BNnVxoaUQrRtobQXlLbM96R`q-5-R0@r7w z1~{I_7qd93$$O7VQi026ign;7jXuDnRCY8vh?f09T~&>mA>~xE2r|8go&C60MMX>e zL-M*|&x-?SP&poQE3S`wE;ZlSSogBuuqA0o&c0wdL2Stvl$`Pl;7K)|!)M;ax8B8z zm+`CX`2A10+iRlDdI*dPybs2Qa0iUP;9oF+J;IEq*|W?TV|$q~!Ok)|jqWhx5B8jF z49Rg8)Dk;8P^sY6!9rS&E={>%%yna-h@)j3@5Tc~Jm{m8j|b-+E#IQYze&1Zm{Kn_jS+`I-?v@T0;|ww*-vCo&9 diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.cache_meta b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@io.cache_meta deleted file mode 100644 index cd791a098314caf2022ff23a7ca5338657563c72..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 289 zcmXxfu?hhJ9LMqhaTdwo0eAq58*WfHNG{_IH;akx5pGdLGAb8!8C-b?iwtBlD5GN2 zxx4}Srn_H#`v3Y5|N0+yZAaoLNr?(y$J84|BUvyt=;&jJ89W5o;)E-1cp%5MI=bj# z0UsgW_&`aC= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --file("src/gleam/io.gleam", 15). -?DOC( - " Writes a string to standard output (stdout).\n" - "\n" - " If you want your output to be printed on its own line see `println`.\n" - "\n" - " ## Example\n" - "\n" - " ```gleam\n" - " io.print(\"Hi mum\")\n" - " // -> Nil\n" - " // Hi mum\n" - " ```\n" -). --spec print(binary()) -> nil. -print(String) -> - gleam_stdlib:print(String). - --file("src/gleam/io.gleam", 31). -?DOC( - " Writes a string to standard error (stderr).\n" - "\n" - " If you want your output to be printed on its own line see `println_error`.\n" - "\n" - " ## Example\n" - "\n" - " ```gleam\n" - " io.print_error(\"Hi pop\")\n" - " // -> Nil\n" - " // Hi pop\n" - " ```\n" -). --spec print_error(binary()) -> nil. -print_error(String) -> - gleam_stdlib:print_error(String). - --file("src/gleam/io.gleam", 45). -?DOC( - " Writes a string to standard output (stdout), appending a newline to the end.\n" - "\n" - " ## Example\n" - "\n" - " ```gleam\n" - " io.println(\"Hi mum\")\n" - " // -> Nil\n" - " // Hi mum\n" - " ```\n" -). --spec println(binary()) -> nil. -println(String) -> - gleam_stdlib:println(String). - --file("src/gleam/io.gleam", 59). -?DOC( - " Writes a string to standard error (stderr), appending a newline to the end.\n" - "\n" - " ## Example\n" - "\n" - " ```gleam\n" - " io.println_error(\"Hi pop\")\n" - " // -> Nil\n" - " // Hi pop\n" - " ```\n" -). --spec println_error(binary()) -> nil. -println_error(String) -> - gleam_stdlib:println_error(String). diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.cache deleted file mode 100644 index 02326356d9e6d1c61f2ce6b7b5ae0107793fd3b9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 88132 zcmd4434B!5**`vak`Nfca2X;y8NwDqfMlMqg?%#;L6`&t5+Ru+6EbmEZqFJ=W z?M#le)yWfhPNaR(hEOJ+Ilre{=LZX%Dt^1RQghw^g)kD5^iE8xBQrIMwV0YIdbMCR5FBQU@u% zVTz(RlDr2i&;iBaz(4fwMpw|`SopT$bU&3=vhc~Yboa{{TNl2Xk?!{QJhL#=Gu?f? zt8C$3SGxQ5-U}Aq);rz(NZ+!Br~0P5hxAa~UL3W(757#gW&IR)C5|%#758U2&J4xB ze2i4w{c{!f6M2gJ6&$XKiaQsFs|f$%a81F#IQ}$4aXU+J&1}W}5sqilo$gm~9O>zF z--n|z%js^zQIhR+m*L1Cgzq>OjBvWkaV!{(e{noI&gp&z$GhX5?vHT1G6~;t>?(G; z58|kt;dF1s;hl}^alE_G>HZAI*2PZu9vr)t;5r7kj@;ZdcL|QRacS;dINqI*=Kc)FD@C{-NB^m5?tC0aW}r{Eee_8~TDHe;4|Nkqj01DwO*{70I52#&UY;%^*(`V8kj$9+n=yB5d0 zJ<{Eu;rLUpbhi`q?aWGd_s210K)TzD(KnN_XFfOkC`#s%7UM#25Qmb12aPPL!1EM!c%^%^q7)5(qPN?lD85&5 zyob|2R#;+fdq81S@oG}i{&JmCgUAQWg0@cCei$M4w?+!$!_2tMv| zc~&+CBc6timb&&}xW&`xk9gX{p7u8X#z0#n;Nf=oN1 z&%`;NLh-ZhMMcr8ijrJa;PFN;^t$Hq<6JJxlrqn$W|ZLnxq&tot=jxRt|%+`XH^+E zKOL70QPY*QaD&4^Lo?=QC_}q~E%kxT)y;m#+}7$)7*Z4TR*~n75*&*raTH}|Di!xC zg6#SUvg^oKJG|=lQuT6|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yM}ZDZe4E?61!66 z-QcoWVtUJbU_s(PoouDRCn=gK;s%S?FJBLIY`M7w*s{Z$Dz3skC3}F~fkA=5h2S!( zd3J{cg#ba#?@<&UHa?bj^vgQ%=Wkm7@62BlDeyZAcNL)0UA##Q{9|1=)yp&5XH%+d zXx~V9bo~h>PDoc6rOJt})ACg5=@pe*lYjm|52i_M8oUW>3_X=SarKfND|YmBFDWnb z^0SUpU<;@$Uo=)6LYf%9(P03bM;g(F_NXbB-c!xTdv^HSn^vIblxdyij0i=<9^lp=$}p zL!$|?q2~zMp?QR|&mM;Y`=Z zvVlOo*Jx1QT1SBvf=`hy2miBQT%XX8N|i}?<3XxLK5k4PtZH9F_vM|Ioj^-tJDvQd z@rTBqhg-JmgtfDRdVxqiQ}o~PivTVg;Xq#+b2MJl02;JgwSl=h3v~e1i5e3DgNYJC z*u;Z`)QQ=ILG#t-1G@9a61Ld-*aDO6%p)jPDN2RnqY^!YB62GFEMaVnBnAkK4W{@w S6tANAM39 diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.cache_meta b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.cache_meta deleted file mode 100644 index b68d2d725f8f77628522b4be127508e9c430d6f1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9786 zcmY+|cX*Cx+W_!Kt(vLoQeL8FsTEp#mMSeZLaf?*k5UvBF{6#5v=uX@_MSm%i>)@X zsadsmjQ7{?==aB)k#<&CrPq@|49As?{=NrwCGZ( zb%$189e5=WxJjD-d8cjXZY{pL<>e$v1A$ck^HzthU%leR*ZJSibnDr=P0x&84q?a6 zlJAyjROz+$|Nmk4s7ZUeu!5vX0)ZMdp#{-QXAucpBZLanCY*I_W;cKE&ourS z?>|HPXADItMmsvOjs(t7Ks3rwfm(#pg6<4pC?lD`ES3^W9J@HpHSX|$%*g|R$~5Ln znlhGY?B^^Oxx{5YN)ZT@B9gf*B#uq&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9a;w4)onh+zraIK@+55ZEjhl%y;*s7+G_GMzarAeNK7zC}F9N^^P=!FU$3h9jik zs#nvDRDb$xImEFpxp)=L`=>zg^Dwg-yh>o4xEKZM^-KU~*D~ zmW*Hw z{}Jnmn*72g?vmuFwMK3FGm2dVj_DDkCN1gs4+W`4U7FF0A*|#Ie{q8p$K{=(^kF@h z_={WI;V#)um;nFvF3RI*Ko#@MWmUEVu6gy?Sgc8jh Y)^dV}lsj$zVGzTK= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " Lists are an ordered sequence of elements and are one of the most common\n" - " data types in Gleam.\n" - "\n" - " New elements can be added and removed from the front of a list in\n" - " constant time, while adding and removing from the end requires traversing\n" - " and copying the whole list, so keep this in mind when designing your\n" - " programs.\n" - "\n" - " There is a dedicated syntax for prefixing to a list:\n" - "\n" - " ```gleam\n" - " let new_list = [1, 2, ..existing_list]\n" - " ```\n" - "\n" - " And a matching syntax for getting the first elements of a list:\n" - "\n" - " ```gleam\n" - " case list {\n" - " [first_element, ..rest] -> first_element\n" - " _ -> \"this pattern matches when the list is empty\"\n" - " }\n" - " ```\n" - "\n" -). - --type continue_or_stop(YZ) :: {continue, YZ} | {stop, YZ}. - --type sorting() :: ascending | descending. - --file("src/gleam/list.gleam", 60). --spec length_loop(list(any()), integer()) -> integer(). -length_loop(List, Count) -> - case List of - [_ | List@1] -> - length_loop(List@1, Count + 1); - - [] -> - Count - end. - --file("src/gleam/list.gleam", 56). -?DOC( - " Counts the number of elements in a given list.\n" - "\n" - " This function has to traverse the list to determine the number of elements,\n" - " so it runs in linear time.\n" - "\n" - " This function is natively implemented by the virtual machine and is highly\n" - " optimised.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " length([])\n" - " // -> 0\n" - " ```\n" - "\n" - " ```gleam\n" - " length([1])\n" - " // -> 1\n" - " ```\n" - "\n" - " ```gleam\n" - " length([1, 2])\n" - " // -> 2\n" - " ```\n" -). --spec length(list(any())) -> integer(). -length(List) -> - erlang:length(List). - --file("src/gleam/list.gleam", 93). --spec count_loop(list(AAG), fun((AAG) -> boolean()), integer()) -> integer(). -count_loop(List, Predicate, Acc) -> - case List of - [] -> - Acc; - - [First | Rest] -> - case Predicate(First) of - true -> - count_loop(Rest, Predicate, Acc + 1); - - false -> - count_loop(Rest, Predicate, Acc) - end - end. - --file("src/gleam/list.gleam", 89). -?DOC( - " Counts the number of elements in a given list satisfying a given predicate.\n" - "\n" - " This function has to traverse the list to determine the number of elements,\n" - " so it runs in linear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " count([], fn(a) { a > 0 })\n" - " // -> 0\n" - " ```\n" - "\n" - " ```gleam\n" - " count([1], fn(a) { a > 0 })\n" - " // -> 1\n" - " ```\n" - "\n" - " ```gleam\n" - " count([1, 2, 3], int.is_odd)\n" - " // -> 2\n" - " ```\n" -). --spec count(list(AAE), fun((AAE) -> boolean())) -> integer(). -count(List, Predicate) -> - count_loop(List, Predicate, 0). - --file("src/gleam/list.gleam", 131). -?DOC( - " Creates a new list from a given list containing the same elements but in the\n" - " opposite order.\n" - "\n" - " This function has to traverse the list to create the new reversed list, so\n" - " it runs in linear time.\n" - "\n" - " This function is natively implemented by the virtual machine and is highly\n" - " optimised.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " reverse([])\n" - " // -> []\n" - " ```\n" - "\n" - " ```gleam\n" - " reverse([1])\n" - " // -> [1]\n" - " ```\n" - "\n" - " ```gleam\n" - " reverse([1, 2])\n" - " // -> [2, 1]\n" - " ```\n" -). --spec reverse(list(AAI)) -> list(AAI). -reverse(List) -> - lists:reverse(List). - --file("src/gleam/list.gleam", 168). -?DOC( - " Determines whether or not the list is empty.\n" - "\n" - " This function runs in constant time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_empty([])\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " is_empty([1])\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " is_empty([1, 1])\n" - " // -> False\n" - " ```\n" -). --spec is_empty(list(any())) -> boolean(). -is_empty(List) -> - List =:= []. - --file("src/gleam/list.gleam", 204). -?DOC( - " Determines whether or not a given element exists within a given list.\n" - "\n" - " This function traverses the list to find the element, so it runs in linear\n" - " time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " [] |> contains(any: 0)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " [0] |> contains(any: 0)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " [1] |> contains(any: 0)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " [1, 1] |> contains(any: 0)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " [1, 0] |> contains(any: 0)\n" - " // -> True\n" - " ```\n" -). --spec contains(list(AAR), AAR) -> boolean(). -contains(List, Elem) -> - case List of - [] -> - false; - - [First | _] when First =:= Elem -> - true; - - [_ | Rest] -> - contains(Rest, Elem) - end. - --file("src/gleam/list.gleam", 231). -?DOC( - " Gets the first element from the start of the list, if there is one.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " first([])\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " first([0])\n" - " // -> Ok(0)\n" - " ```\n" - "\n" - " ```gleam\n" - " first([1, 2])\n" - " // -> Ok(1)\n" - " ```\n" -). --spec first(list(AAT)) -> {ok, AAT} | {error, nil}. -first(List) -> - case List of - [] -> - {error, nil}; - - [First | _] -> - {ok, First} - end. - --file("src/gleam/list.gleam", 260). -?DOC( - " Returns the list minus the first element. If the list is empty, `Error(Nil)` is\n" - " returned.\n" - "\n" - " This function runs in constant time and does not make a copy of the list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " rest([])\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " rest([0])\n" - " // -> Ok([])\n" - " ```\n" - "\n" - " ```gleam\n" - " rest([1, 2])\n" - " // -> Ok([2])\n" - " ```\n" -). --spec rest(list(AAX)) -> {ok, list(AAX)} | {error, nil}. -rest(List) -> - case List of - [] -> - {error, nil}; - - [_ | Rest] -> - {ok, Rest} - end. - --file("src/gleam/list.gleam", 298). -?DOC( - " Groups the elements from the given list by the given key function.\n" - "\n" - " Does not preserve the initial value order.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " import gleam/dict\n" - "\n" - " [Ok(3), Error(\"Wrong\"), Ok(200), Ok(73)]\n" - " |> group(by: fn(i) {\n" - " case i {\n" - " Ok(_) -> \"Successful\"\n" - " Error(_) -> \"Failed\"\n" - " }\n" - " })\n" - " |> dict.to_list\n" - " // -> [\n" - " // #(\"Failed\", [Error(\"Wrong\")]),\n" - " // #(\"Successful\", [Ok(73), Ok(200), Ok(3)])\n" - " // ]\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/dict\n" - "\n" - " group([1,2,3,4,5], by: fn(i) { i - i / 3 * 3 })\n" - " |> dict.to_list\n" - " // -> [#(0, [3]), #(1, [4, 1]), #(2, [5, 2])]\n" - " ```\n" -). --spec group(list(ABC), fun((ABC) -> ABE)) -> gleam@dict:dict(ABE, list(ABC)). -group(List, Key) -> - gleam@dict:group(Key, List). - --file("src/gleam/list.gleam", 321). --spec filter_loop(list(ABL), fun((ABL) -> boolean()), list(ABL)) -> list(ABL). -filter_loop(List, Fun, Acc) -> - case List of - [] -> - lists:reverse(Acc); - - [First | Rest] -> - New_acc = case Fun(First) of - true -> - [First | Acc]; - - false -> - Acc - end, - filter_loop(Rest, Fun, New_acc) - end. - --file("src/gleam/list.gleam", 317). -?DOC( - " Returns a new list containing only the elements from the first list for\n" - " which the given functions returns `True`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " filter([2, 4, 6, 1], fn(x) { x > 2 })\n" - " // -> [4, 6]\n" - " ```\n" - "\n" - " ```gleam\n" - " filter([2, 4, 6, 1], fn(x) { x > 6 })\n" - " // -> []\n" - " ```\n" -). --spec filter(list(ABI), fun((ABI) -> boolean())) -> list(ABI). -filter(List, Predicate) -> - filter_loop(List, Predicate, []). - --file("src/gleam/list.gleam", 353). --spec filter_map_loop( - list(ABW), - fun((ABW) -> {ok, ABY} | {error, any()}), - list(ABY) -) -> list(ABY). -filter_map_loop(List, Fun, Acc) -> - case List of - [] -> - lists:reverse(Acc); - - [First | Rest] -> - New_acc = case Fun(First) of - {ok, First@1} -> - [First@1 | Acc]; - - {error, _} -> - Acc - end, - filter_map_loop(Rest, Fun, New_acc) - end. - --file("src/gleam/list.gleam", 349). -?DOC( - " Returns a new list containing only the elements from the first list for\n" - " which the given functions returns `Ok(_)`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " filter_map([2, 4, 6, 1], Error)\n" - " // -> []\n" - " ```\n" - "\n" - " ```gleam\n" - " filter_map([2, 4, 6, 1], fn(x) { Ok(x + 1) })\n" - " // -> [3, 5, 7, 2]\n" - " ```\n" -). --spec filter_map(list(ABP), fun((ABP) -> {ok, ABR} | {error, any()})) -> list(ABR). -filter_map(List, Fun) -> - filter_map_loop(List, Fun, []). - --file("src/gleam/list.gleam", 383). --spec map_loop(list(ACI), fun((ACI) -> ACK), list(ACK)) -> list(ACK). -map_loop(List, Fun, Acc) -> - case List of - [] -> - lists:reverse(Acc); - - [First | Rest] -> - map_loop(Rest, Fun, [Fun(First) | Acc]) - end. - --file("src/gleam/list.gleam", 379). -?DOC( - " Returns a new list containing the results of applying the supplied function to each element.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " map([2, 4, 6], fn(x) { x * 2 })\n" - " // -> [4, 8, 12]\n" - " ```\n" -). --spec map(list(ACE), fun((ACE) -> ACG)) -> list(ACG). -map(List, Fun) -> - map_loop(List, Fun, []). - --file("src/gleam/list.gleam", 410). --spec map2_loop(list(ACT), list(ACV), fun((ACT, ACV) -> ACX), list(ACX)) -> list(ACX). -map2_loop(List1, List2, Fun, Acc) -> - case {List1, List2} of - {[], _} -> - lists:reverse(Acc); - - {_, []} -> - lists:reverse(Acc); - - {[A | As_], [B | Bs]} -> - map2_loop(As_, Bs, Fun, [Fun(A, B) | Acc]) - end. - --file("src/gleam/list.gleam", 406). -?DOC( - " Combines two lists into a single list using the given function.\n" - "\n" - " If a list is longer than the other, the extra elements are dropped.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " map2([1, 2, 3], [4, 5, 6], fn(x, y) { x + y })\n" - " // -> [5, 7, 9]\n" - " ```\n" - "\n" - " ```gleam\n" - " map2([1, 2], [\"a\", \"b\", \"c\"], fn(i, x) { #(i, x) })\n" - " // -> [#(1, \"a\"), #(2, \"b\")]\n" - " ```\n" -). --spec map2(list(ACN), list(ACP), fun((ACN, ACP) -> ACR)) -> list(ACR). -map2(List1, List2, Fun) -> - map2_loop(List1, List2, Fun, []). - --file("src/gleam/list.gleam", 443). --spec map_fold_loop(list(ADF), fun((ADH, ADF) -> {ADH, ADI}), ADH, list(ADI)) -> {ADH, - list(ADI)}. -map_fold_loop(List, Fun, Acc, List_acc) -> - case List of - [] -> - {Acc, lists:reverse(List_acc)}; - - [First | Rest] -> - {Acc@1, First@1} = Fun(Acc, First), - map_fold_loop(Rest, Fun, Acc@1, [First@1 | List_acc]) - end. - --file("src/gleam/list.gleam", 435). -?DOC( - " Similar to `map` but also lets you pass around an accumulated value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " map_fold(\n" - " over: [1, 2, 3],\n" - " from: 100,\n" - " with: fn(memo, i) { #(memo + i, i * 2) }\n" - " )\n" - " // -> #(106, [2, 4, 6])\n" - " ```\n" -). --spec map_fold(list(ADA), ADC, fun((ADC, ADA) -> {ADC, ADD})) -> {ADC, - list(ADD)}. -map_fold(List, Initial, Fun) -> - map_fold_loop(List, Fun, Initial, []). - --file("src/gleam/list.gleam", 475). --spec index_map_loop( - list(ADP), - fun((ADP, integer()) -> ADR), - integer(), - list(ADR) -) -> list(ADR). -index_map_loop(List, Fun, Index, Acc) -> - case List of - [] -> - lists:reverse(Acc); - - [First | Rest] -> - Acc@1 = [Fun(First, Index) | Acc], - index_map_loop(Rest, Fun, Index + 1, Acc@1) - end. - --file("src/gleam/list.gleam", 471). -?DOC( - " Similar to `map`, but the supplied function will also be passed the index\n" - " of the element being mapped as an additional argument.\n" - "\n" - " The index starts at 0, so the first element is 0, the second is 1, and so\n" - " on.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " index_map([\"a\", \"b\"], fn(x, i) { #(i, x) })\n" - " // -> [#(0, \"a\"), #(1, \"b\")]\n" - " ```\n" -). --spec index_map(list(ADL), fun((ADL, integer()) -> ADN)) -> list(ADN). -index_map(List, Fun) -> - index_map_loop(List, Fun, 0, []). - --file("src/gleam/list.gleam", 529). --spec try_map_loop(list(AED), fun((AED) -> {ok, AEF} | {error, AEG}), list(AEF)) -> {ok, - list(AEF)} | - {error, AEG}. -try_map_loop(List, Fun, Acc) -> - case List of - [] -> - {ok, lists:reverse(Acc)}; - - [First | Rest] -> - case Fun(First) of - {ok, First@1} -> - try_map_loop(Rest, Fun, [First@1 | Acc]); - - {error, Error} -> - {error, Error} - end - end. - --file("src/gleam/list.gleam", 522). -?DOC( - " Takes a function that returns a `Result` and applies it to each element in a\n" - " given list in turn.\n" - "\n" - " If the function returns `Ok(new_value)` for all elements in the list then a\n" - " list of the new values is returned.\n" - "\n" - " If the function returns `Error(reason)` for any of the elements then it is\n" - " returned immediately. None of the elements in the list are processed after\n" - " one returns an `Error`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " try_map([1, 2, 3], fn(x) { Ok(x + 2) })\n" - " // -> Ok([3, 4, 5])\n" - " ```\n" - "\n" - " ```gleam\n" - " try_map([1, 2, 3], fn(_) { Error(0) })\n" - " // -> Error(0)\n" - " ```\n" - "\n" - " ```gleam\n" - " try_map([[1], [2, 3]], first)\n" - " // -> Ok([1, 2])\n" - " ```\n" - "\n" - " ```gleam\n" - " try_map([[1], [], [2]], first)\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec try_map(list(ADU), fun((ADU) -> {ok, ADW} | {error, ADX})) -> {ok, - list(ADW)} | - {error, ADX}. -try_map(List, Fun) -> - try_map_loop(List, Fun, []). - --file("src/gleam/list.gleam", 564). -?DOC( - " Returns a list that is the given list with up to the given number of\n" - " elements removed from the front of the list.\n" - "\n" - " If the list has less than the number of elements an empty list is\n" - " returned.\n" - "\n" - " This function runs in linear time but does not copy the list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " drop([1, 2, 3, 4], 2)\n" - " // -> [3, 4]\n" - " ```\n" - "\n" - " ```gleam\n" - " drop([1, 2, 3, 4], 9)\n" - " // -> []\n" - " ```\n" -). --spec drop(list(AEN), integer()) -> list(AEN). -drop(List, N) -> - case N =< 0 of - true -> - List; - - false -> - case List of - [] -> - []; - - [_ | Rest] -> - drop(Rest, N - 1) - end - end. - --file("src/gleam/list.gleam", 599). --spec take_loop(list(AET), integer(), list(AET)) -> list(AET). -take_loop(List, N, Acc) -> - case N =< 0 of - true -> - lists:reverse(Acc); - - false -> - case List of - [] -> - lists:reverse(Acc); - - [First | Rest] -> - take_loop(Rest, N - 1, [First | Acc]) - end - end. - --file("src/gleam/list.gleam", 595). -?DOC( - " Returns a list containing the first given number of elements from the given\n" - " list.\n" - "\n" - " If the list has less than the number of elements then the full list is\n" - " returned.\n" - "\n" - " This function runs in linear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " take([1, 2, 3, 4], 2)\n" - " // -> [1, 2]\n" - " ```\n" - "\n" - " ```gleam\n" - " take([1, 2, 3, 4], 9)\n" - " // -> [1, 2, 3, 4]\n" - " ```\n" -). --spec take(list(AEQ), integer()) -> list(AEQ). -take(List, N) -> - take_loop(List, N, []). - --file("src/gleam/list.gleam", 619). -?DOC( - " Returns a new empty list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new()\n" - " // -> []\n" - " ```\n" -). --spec new() -> list(any()). -new() -> - []. - --file("src/gleam/list.gleam", 639). -?DOC( - " Returns the given item wrapped in a list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " wrap(1)\n" - " // -> [1]\n" - "\n" - " wrap([\"a\", \"b\", \"c\"])\n" - " // -> [[\"a\", \"b\", \"c\"]]\n" - "\n" - " wrap([[]])\n" - " // -> [[[]]]\n" - " ```\n" -). --spec wrap(AEZ) -> list(AEZ). -wrap(Item) -> - [Item]. - --file("src/gleam/list.gleam", 660). --spec append_loop(list(AFF), list(AFF)) -> list(AFF). -append_loop(First, Second) -> - case First of - [] -> - Second; - - [First@1 | Rest] -> - append_loop(Rest, [First@1 | Second]) - end. - --file("src/gleam/list.gleam", 656). -?DOC( - " Joins one list onto the end of another.\n" - "\n" - " This function runs in linear time, and it traverses and copies the first\n" - " list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " append([1, 2], [3])\n" - " // -> [1, 2, 3]\n" - " ```\n" -). --spec append(list(AFB), list(AFB)) -> list(AFB). -append(First, Second) -> - lists:append(First, Second). - --file("src/gleam/list.gleam", 680). -?DOC( - " Prefixes an item to a list. This can also be done using the dedicated\n" - " syntax instead.\n" - "\n" - " ```gleam\n" - " let existing_list = [2, 3, 4]\n" - "\n" - " [1, ..existing_list]\n" - " // -> [1, 2, 3, 4]\n" - "\n" - " prepend(to: existing_list, this: 1)\n" - " // -> [1, 2, 3, 4]\n" - " ```\n" -). --spec prepend(list(AFJ), AFJ) -> list(AFJ). -prepend(List, Item) -> - [Item | List]. - --file("src/gleam/list.gleam", 701). --spec flatten_loop(list(list(AFQ)), list(AFQ)) -> list(AFQ). -flatten_loop(Lists, Acc) -> - case Lists of - [] -> - lists:reverse(Acc); - - [List | Further_lists] -> - flatten_loop(Further_lists, lists:reverse(List, Acc)) - end. - --file("src/gleam/list.gleam", 697). -?DOC( - " Joins a list of lists into a single list.\n" - "\n" - " This function traverses all elements twice on the JavaScript target.\n" - " This function traverses all elements once on the Erlang target.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " flatten([[1], [2, 3], []])\n" - " // -> [1, 2, 3]\n" - " ```\n" -). --spec flatten(list(list(AFM))) -> list(AFM). -flatten(Lists) -> - lists:append(Lists). - --file("src/gleam/list.gleam", 718). -?DOC( - " Maps the list with the given function into a list of lists, and then flattens it.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " flat_map([2, 4, 6], fn(x) { [x, x + 1] })\n" - " // -> [2, 3, 4, 5, 6, 7]\n" - " ```\n" -). --spec flat_map(list(AFV), fun((AFV) -> list(AFX))) -> list(AFX). -flat_map(List, Fun) -> - lists:append(map(List, Fun)). - --file("src/gleam/list.gleam", 730). -?DOC( - " Reduces a list of elements into a single value by calling a given function\n" - " on each element, going from left to right.\n" - "\n" - " `fold([1, 2, 3], 0, add)` is the equivalent of\n" - " `add(add(add(0, 1), 2), 3)`.\n" - "\n" - " This function runs in linear time.\n" -). --spec fold(list(AGA), AGC, fun((AGC, AGA) -> AGC)) -> AGC. -fold(List, Initial, Fun) -> - case List of - [] -> - Initial; - - [First | Rest] -> - fold(Rest, Fun(Initial, First), Fun) - end. - --file("src/gleam/list.gleam", 752). -?DOC( - " Reduces a list of elements into a single value by calling a given function\n" - " on each element, going from right to left.\n" - "\n" - " `fold_right([1, 2, 3], 0, add)` is the equivalent of\n" - " `add(add(add(0, 3), 2), 1)`.\n" - "\n" - " This function runs in linear time.\n" - "\n" - " Unlike `fold` this function is not tail recursive. Where possible use\n" - " `fold` instead as it will use less memory.\n" -). --spec fold_right(list(AGD), AGF, fun((AGF, AGD) -> AGF)) -> AGF. -fold_right(List, Initial, Fun) -> - case List of - [] -> - Initial; - - [First | Rest] -> - Fun(fold_right(Rest, Initial, Fun), First) - end. - --file("src/gleam/list.gleam", 789). --spec index_fold_loop( - list(AGJ), - AGL, - fun((AGL, AGJ, integer()) -> AGL), - integer() -) -> AGL. -index_fold_loop(Over, Acc, With, Index) -> - case Over of - [] -> - Acc; - - [First | Rest] -> - index_fold_loop(Rest, With(Acc, First, Index), With, Index + 1) - end. - --file("src/gleam/list.gleam", 781). -?DOC( - " Like `fold` but the folding function also receives the index of the current element.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " [\"a\", \"b\", \"c\"]\n" - " |> index_fold(\"\", fn(acc, item, index) {\n" - " acc <> int.to_string(index) <> \":\" <> item <> \" \"\n" - " })\n" - " // -> \"0:a 1:b 2:c\"\n" - " ```\n" - "\n" - " ```gleam\n" - " [10, 20, 30]\n" - " |> index_fold(0, fn(acc, item, index) { acc + item * index })\n" - " // -> 80\n" - " ```\n" -). --spec index_fold(list(AGG), AGI, fun((AGI, AGG, integer()) -> AGI)) -> AGI. -index_fold(List, Initial, Fun) -> - index_fold_loop(List, Initial, Fun, 0). - --file("src/gleam/list.gleam", 821). -?DOC( - " A variant of fold that might fail.\n" - "\n" - " The folding function should return `Result(accumulator, error)`.\n" - " If the returned value is `Ok(accumulator)` try_fold will try the next value in the list.\n" - " If the returned value is `Error(error)` try_fold will stop and return that error.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " [1, 2, 3, 4]\n" - " |> try_fold(0, fn(acc, i) {\n" - " case i < 3 {\n" - " True -> Ok(acc + i)\n" - " False -> Error(Nil)\n" - " }\n" - " })\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec try_fold(list(AGM), AGO, fun((AGO, AGM) -> {ok, AGO} | {error, AGP})) -> {ok, - AGO} | - {error, AGP}. -try_fold(List, Initial, Fun) -> - case List of - [] -> - {ok, Initial}; - - [First | Rest] -> - case Fun(Initial, First) of - {ok, Result} -> - try_fold(Rest, Result, Fun); - - {error, _} = Error -> - Error - end - end. - --file("src/gleam/list.gleam", 860). -?DOC( - " A variant of fold that allows to stop folding earlier.\n" - "\n" - " The folding function should return `ContinueOrStop(accumulator)`.\n" - " If the returned value is `Continue(accumulator)` fold_until will try the next value in the list.\n" - " If the returned value is `Stop(accumulator)` fold_until will stop and return that accumulator.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " [1, 2, 3, 4]\n" - " |> fold_until(0, fn(acc, i) {\n" - " case i < 3 {\n" - " True -> Continue(acc + i)\n" - " False -> Stop(acc)\n" - " }\n" - " })\n" - " // -> 3\n" - " ```\n" -). --spec fold_until(list(AGU), AGW, fun((AGW, AGU) -> continue_or_stop(AGW))) -> AGW. -fold_until(List, Initial, Fun) -> - case List of - [] -> - Initial; - - [First | Rest] -> - case Fun(Initial, First) of - {continue, Next_accumulator} -> - fold_until(Rest, Next_accumulator, Fun); - - {stop, B} -> - B - end - end. - --file("src/gleam/list.gleam", 897). -?DOC( - " Finds the first element in a given list for which the given function returns\n" - " `True`.\n" - "\n" - " Returns `Error(Nil)` if no such element is found.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " find([1, 2, 3], fn(x) { x > 2 })\n" - " // -> Ok(3)\n" - " ```\n" - "\n" - " ```gleam\n" - " find([1, 2, 3], fn(x) { x > 4 })\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " find([], fn(_) { True })\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec find(list(AGY), fun((AGY) -> boolean())) -> {ok, AGY} | {error, nil}. -find(List, Is_desired) -> - case List of - [] -> - {error, nil}; - - [First | Rest] -> - case Is_desired(First) of - true -> - {ok, First}; - - false -> - find(Rest, Is_desired) - end - end. - --file("src/gleam/list.gleam", 933). -?DOC( - " Finds the first element in a given list for which the given function returns\n" - " `Ok(new_value)`, then returns the wrapped `new_value`.\n" - "\n" - " Returns `Error(Nil)` if no such element is found.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " find_map([[], [2], [3]], first)\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " find_map([[], []], first)\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " find_map([], first)\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec find_map(list(AHC), fun((AHC) -> {ok, AHE} | {error, any()})) -> {ok, AHE} | - {error, nil}. -find_map(List, Fun) -> - case List of - [] -> - {error, nil}; - - [First | Rest] -> - case Fun(First) of - {ok, First@1} -> - {ok, First@1}; - - {error, _} -> - find_map(Rest, Fun) - end - end. - --file("src/gleam/list.gleam", 968). -?DOC( - " Returns `True` if the given function returns `True` for all the elements in\n" - " the given list. If the function returns `False` for any of the elements it\n" - " immediately returns `False` without checking the rest of the list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " all([], fn(x) { x > 3 })\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " all([4, 5], fn(x) { x > 3 })\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " all([4, 3], fn(x) { x > 3 })\n" - " // -> False\n" - " ```\n" -). --spec all(list(AHK), fun((AHK) -> boolean())) -> boolean(). -all(List, Predicate) -> - case List of - [] -> - true; - - [First | Rest] -> - case Predicate(First) of - true -> - all(Rest, Predicate); - - false -> - false - end - end. - --file("src/gleam/list.gleam", 1005). -?DOC( - " Returns `True` if the given function returns `True` for any the elements in\n" - " the given list. If the function returns `True` for any of the elements it\n" - " immediately returns `True` without checking the rest of the list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " any([], fn(x) { x > 3 })\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " any([4, 5], fn(x) { x > 3 })\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " any([4, 3], fn(x) { x > 4 })\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " any([3, 4], fn(x) { x > 3 })\n" - " // -> True\n" - " ```\n" -). --spec any(list(AHM), fun((AHM) -> boolean())) -> boolean(). -any(List, Predicate) -> - case List of - [] -> - false; - - [First | Rest] -> - case Predicate(First) of - true -> - true; - - false -> - any(Rest, Predicate) - end - end. - --file("src/gleam/list.gleam", 1047). --spec zip_loop(list(AHT), list(AHV), list({AHT, AHV})) -> list({AHT, AHV}). -zip_loop(One, Other, Acc) -> - case {One, Other} of - {[First_one | Rest_one], [First_other | Rest_other]} -> - zip_loop(Rest_one, Rest_other, [{First_one, First_other} | Acc]); - - {_, _} -> - lists:reverse(Acc) - end. - --file("src/gleam/list.gleam", 1043). -?DOC( - " Takes two lists and returns a single list of 2-element tuples.\n" - "\n" - " If one of the lists is longer than the other, the remaining elements from\n" - " the longer list are not used.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " zip([], [])\n" - " // -> []\n" - " ```\n" - "\n" - " ```gleam\n" - " zip([1, 2], [3])\n" - " // -> [#(1, 3)]\n" - " ```\n" - "\n" - " ```gleam\n" - " zip([1], [3, 4])\n" - " // -> [#(1, 3)]\n" - " ```\n" - "\n" - " ```gleam\n" - " zip([1, 2], [3, 4])\n" - " // -> [#(1, 3), #(2, 4)]\n" - " ```\n" -). --spec zip(list(AHO), list(AHQ)) -> list({AHO, AHQ}). -zip(List, Other) -> - zip_loop(List, Other, []). - --file("src/gleam/list.gleam", 1088). --spec strict_zip_loop(list(AIG), list(AII), list({AIG, AII})) -> {ok, - list({AIG, AII})} | - {error, nil}. -strict_zip_loop(One, Other, Acc) -> - case {One, Other} of - {[], []} -> - {ok, lists:reverse(Acc)}; - - {[], _} -> - {error, nil}; - - {_, []} -> - {error, nil}; - - {[First_one | Rest_one], [First_other | Rest_other]} -> - strict_zip_loop( - Rest_one, - Rest_other, - [{First_one, First_other} | Acc] - ) - end. - --file("src/gleam/list.gleam", 1081). -?DOC( - " Takes two lists and returns a single list of 2-element tuples.\n" - "\n" - " If one of the lists is longer than the other, an `Error` is returned.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " strict_zip([], [])\n" - " // -> Ok([])\n" - " ```\n" - "\n" - " ```gleam\n" - " strict_zip([1, 2], [3])\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " strict_zip([1], [3, 4])\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " strict_zip([1, 2], [3, 4])\n" - " // -> Ok([#(1, 3), #(2, 4)])\n" - " ```\n" -). --spec strict_zip(list(AHZ), list(AIB)) -> {ok, list({AHZ, AIB})} | {error, nil}. -strict_zip(List, Other) -> - strict_zip_loop(List, Other, []). - --file("src/gleam/list.gleam", 1119). --spec unzip_loop(list({AIT, AIU}), list(AIT), list(AIU)) -> {list(AIT), - list(AIU)}. -unzip_loop(Input, One, Other) -> - case Input of - [] -> - {lists:reverse(One), lists:reverse(Other)}; - - [{First_one, First_other} | Rest] -> - unzip_loop(Rest, [First_one | One], [First_other | Other]) - end. - --file("src/gleam/list.gleam", 1115). -?DOC( - " Takes a single list of 2-element tuples and returns two lists.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " unzip([#(1, 2), #(3, 4)])\n" - " // -> #([1, 3], [2, 4])\n" - " ```\n" - "\n" - " ```gleam\n" - " unzip([])\n" - " // -> #([], [])\n" - " ```\n" -). --spec unzip(list({AIO, AIP})) -> {list(AIO), list(AIP)}. -unzip(Input) -> - unzip_loop(Input, [], []). - --file("src/gleam/list.gleam", 1154). --spec intersperse_loop(list(AJD), AJD, list(AJD)) -> list(AJD). -intersperse_loop(List, Separator, Acc) -> - case List of - [] -> - lists:reverse(Acc); - - [First | Rest] -> - intersperse_loop(Rest, Separator, [First, Separator | Acc]) - end. - --file("src/gleam/list.gleam", 1147). -?DOC( - " Inserts a given value between each existing element in a given list.\n" - "\n" - " This function runs in linear time and copies the list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " intersperse([1, 1, 1], 2)\n" - " // -> [1, 2, 1, 2, 1]\n" - " ```\n" - "\n" - " ```gleam\n" - " intersperse([], 2)\n" - " // -> []\n" - " ```\n" -). --spec intersperse(list(AJA), AJA) -> list(AJA). -intersperse(List, Elem) -> - case List of - [] -> - List; - - [_] -> - List; - - [First | Rest] -> - intersperse_loop(Rest, Elem, [First]) - end. - --file("src/gleam/list.gleam", 1177). --spec unique_loop(list(AJK), gleam@dict:dict(AJK, nil), list(AJK)) -> list(AJK). -unique_loop(List, Seen, Acc) -> - case List of - [] -> - lists:reverse(Acc); - - [First | Rest] -> - case gleam@dict:has_key(Seen, First) of - true -> - unique_loop(Rest, Seen, Acc); - - false -> - unique_loop( - Rest, - gleam@dict:insert(Seen, First, nil), - [First | Acc] - ) - end - end. - --file("src/gleam/list.gleam", 1173). -?DOC( - " Removes any duplicate elements from a given list.\n" - "\n" - " This function returns in loglinear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " unique([1, 1, 1, 4, 7, 3, 3, 4])\n" - " // -> [1, 4, 7, 3]\n" - " ```\n" -). --spec unique(list(AJH)) -> list(AJH). -unique(List) -> - unique_loop(List, maps:new(), []). - --file("src/gleam/list.gleam", 1263). -?DOC( - " Given a list it returns slices of it that are locally sorted in ascending\n" - " order.\n" - "\n" - " Imagine you have this list:\n" - "\n" - " ```\n" - " [1, 2, 3, 2, 1, 0]\n" - " ^^^^^^^ ^^^^^^^ This is a slice in descending order\n" - " |\n" - " | This is a slice that is sorted in ascending order\n" - " ```\n" - "\n" - " So the produced result will contain these two slices, each one sorted in\n" - " ascending order: `[[1, 2, 3], [0, 1, 2]]`.\n" - "\n" - " - `growing` is an accumulator with the current slice being grown\n" - " - `direction` is the growing direction of the slice being grown, it could\n" - " either be ascending or strictly descending\n" - " - `prev` is the previous element that needs to be added to the growing slice\n" - " it is carried around to check whether we have to keep growing the current\n" - " slice or not\n" - " - `acc` is the accumulator containing the slices sorted in ascending order\n" -). --spec sequences( - list(AJT), - fun((AJT, AJT) -> gleam@order:order()), - list(AJT), - sorting(), - AJT, - list(list(AJT)) -) -> list(list(AJT)). -sequences(List, Compare, Growing, Direction, Prev, Acc) -> - Growing@1 = [Prev | Growing], - case List of - [] -> - case Direction of - ascending -> - [lists:reverse(Growing@1) | Acc]; - - descending -> - [Growing@1 | Acc] - end; - - [New | Rest] -> - case {Compare(Prev, New), Direction} of - {gt, descending} -> - sequences(Rest, Compare, Growing@1, Direction, New, Acc); - - {lt, ascending} -> - sequences(Rest, Compare, Growing@1, Direction, New, Acc); - - {eq, ascending} -> - sequences(Rest, Compare, Growing@1, Direction, New, Acc); - - {gt, ascending} -> - Acc@1 = case Direction of - ascending -> - [lists:reverse(Growing@1) | Acc]; - - descending -> - [Growing@1 | Acc] - end, - case Rest of - [] -> - [[New] | Acc@1]; - - [Next | Rest@1] -> - Direction@1 = case Compare(New, Next) of - lt -> - ascending; - - eq -> - ascending; - - gt -> - descending - end, - sequences( - Rest@1, - Compare, - [New], - Direction@1, - Next, - Acc@1 - ) - end; - - {lt, descending} -> - Acc@1 = case Direction of - ascending -> - [lists:reverse(Growing@1) | Acc]; - - descending -> - [Growing@1 | Acc] - end, - case Rest of - [] -> - [[New] | Acc@1]; - - [Next | Rest@1] -> - Direction@1 = case Compare(New, Next) of - lt -> - ascending; - - eq -> - ascending; - - gt -> - descending - end, - sequences( - Rest@1, - Compare, - [New], - Direction@1, - Next, - Acc@1 - ) - end; - - {eq, descending} -> - Acc@1 = case Direction of - ascending -> - [lists:reverse(Growing@1) | Acc]; - - descending -> - [Growing@1 | Acc] - end, - case Rest of - [] -> - [[New] | Acc@1]; - - [Next | Rest@1] -> - Direction@1 = case Compare(New, Next) of - lt -> - ascending; - - eq -> - ascending; - - gt -> - descending - end, - sequences( - Rest@1, - Compare, - [New], - Direction@1, - Next, - Acc@1 - ) - end - end - end. - --file("src/gleam/list.gleam", 1411). -?DOC( - " Merges two lists sorted in ascending order into a single list sorted in\n" - " descending order according to the given comparator function.\n" - "\n" - " This reversing of the sort order is not avoidable if we want to implement\n" - " merge as a tail recursive function. We could reverse the accumulator before\n" - " returning it but that would end up being less efficient; so the merging\n" - " algorithm has to play around this.\n" -). --spec merge_ascendings( - list(AKQ), - list(AKQ), - fun((AKQ, AKQ) -> gleam@order:order()), - list(AKQ) -) -> list(AKQ). -merge_ascendings(List1, List2, Compare, Acc) -> - case {List1, List2} of - {[], List} -> - lists:reverse(List, Acc); - - {List, []} -> - lists:reverse(List, Acc); - - {[First1 | Rest1], [First2 | Rest2]} -> - case Compare(First1, First2) of - lt -> - merge_ascendings(Rest1, List2, Compare, [First1 | Acc]); - - gt -> - merge_ascendings(List1, Rest2, Compare, [First2 | Acc]); - - eq -> - merge_ascendings(List1, Rest2, Compare, [First2 | Acc]) - end - end. - --file("src/gleam/list.gleam", 1364). -?DOC( - " Given a list of ascending lists, it merges adjacent pairs into a single\n" - " descending list, halving their number.\n" - " It returns a list of the remaining descending lists.\n" -). --spec merge_ascending_pairs( - list(list(AKE)), - fun((AKE, AKE) -> gleam@order:order()), - list(list(AKE)) -) -> list(list(AKE)). -merge_ascending_pairs(Sequences, Compare, Acc) -> - case Sequences of - [] -> - lists:reverse(Acc); - - [Sequence] -> - lists:reverse([lists:reverse(Sequence) | Acc]); - - [Ascending1, Ascending2 | Rest] -> - Descending = merge_ascendings(Ascending1, Ascending2, Compare, []), - merge_ascending_pairs(Rest, Compare, [Descending | Acc]) - end. - --file("src/gleam/list.gleam", 1438). -?DOC( - " This is exactly the same as merge_ascendings but mirrored: it merges two\n" - " lists sorted in descending order into a single list sorted in ascending\n" - " order according to the given comparator function.\n" - "\n" - " This reversing of the sort order is not avoidable if we want to implement\n" - " merge as a tail recursive function. We could reverse the accumulator before\n" - " returning it but that would end up being less efficient; so the merging\n" - " algorithm has to play around this.\n" -). --spec merge_descendings( - list(AKV), - list(AKV), - fun((AKV, AKV) -> gleam@order:order()), - list(AKV) -) -> list(AKV). -merge_descendings(List1, List2, Compare, Acc) -> - case {List1, List2} of - {[], List} -> - lists:reverse(List, Acc); - - {List, []} -> - lists:reverse(List, Acc); - - {[First1 | Rest1], [First2 | Rest2]} -> - case Compare(First1, First2) of - lt -> - merge_descendings(List1, Rest2, Compare, [First2 | Acc]); - - gt -> - merge_descendings(Rest1, List2, Compare, [First1 | Acc]); - - eq -> - merge_descendings(Rest1, List2, Compare, [First1 | Acc]) - end - end. - --file("src/gleam/list.gleam", 1386). -?DOC(" This is the same as merge_ascending_pairs but flipped for descending lists.\n"). --spec merge_descending_pairs( - list(list(AKK)), - fun((AKK, AKK) -> gleam@order:order()), - list(list(AKK)) -) -> list(list(AKK)). -merge_descending_pairs(Sequences, Compare, Acc) -> - case Sequences of - [] -> - lists:reverse(Acc); - - [Sequence] -> - lists:reverse([lists:reverse(Sequence) | Acc]); - - [Descending1, Descending2 | Rest] -> - Ascending = merge_descendings(Descending1, Descending2, Compare, []), - merge_descending_pairs(Rest, Compare, [Ascending | Acc]) - end. - --file("src/gleam/list.gleam", 1330). -?DOC( - " Given some some sorted sequences (assumed to be sorted in `direction`) it\n" - " merges them all together until we're left with just a list sorted in\n" - " ascending order.\n" -). --spec merge_all( - list(list(AKA)), - sorting(), - fun((AKA, AKA) -> gleam@order:order()) -) -> list(AKA). -merge_all(Sequences, Direction, Compare) -> - case {Sequences, Direction} of - {[], _} -> - []; - - {[Sequence], ascending} -> - Sequence; - - {[Sequence@1], descending} -> - lists:reverse(Sequence@1); - - {_, ascending} -> - Sequences@1 = merge_ascending_pairs(Sequences, Compare, []), - merge_all(Sequences@1, descending, Compare); - - {_, descending} -> - Sequences@2 = merge_descending_pairs(Sequences, Compare, []), - merge_all(Sequences@2, ascending, Compare) - end. - --file("src/gleam/list.gleam", 1201). -?DOC( - " Sorts from smallest to largest based upon the ordering specified by a given\n" - " function.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - "\n" - " sort([4, 3, 6, 5, 4, 1, 2], by: int.compare)\n" - " // -> [1, 2, 3, 4, 4, 5, 6]\n" - " ```\n" -). --spec sort(list(AJQ), fun((AJQ, AJQ) -> gleam@order:order())) -> list(AJQ). -sort(List, Compare) -> - case List of - [] -> - []; - - [X] -> - [X]; - - [X@1, Y | Rest] -> - Direction = case Compare(X@1, Y) of - lt -> - ascending; - - eq -> - ascending; - - gt -> - descending - end, - Sequences = sequences(Rest, Compare, [X@1], Direction, Y, []), - merge_all(Sequences, ascending, Compare) - end. - --file("src/gleam/list.gleam", 1478). --spec range_loop(integer(), integer(), list(integer())) -> list(integer()). -range_loop(Start, Stop, Acc) -> - case gleam@int:compare(Start, Stop) of - eq -> - [Stop | Acc]; - - gt -> - range_loop(Start, Stop + 1, [Stop | Acc]); - - lt -> - range_loop(Start, Stop - 1, [Stop | Acc]) - end. - --file("src/gleam/list.gleam", 1474). -?DOC( - " Creates a list of ints ranging from a given start and finish.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " range(0, 0)\n" - " // -> [0]\n" - " ```\n" - "\n" - " ```gleam\n" - " range(0, 5)\n" - " // -> [0, 1, 2, 3, 4, 5]\n" - " ```\n" - "\n" - " ```gleam\n" - " range(1, -5)\n" - " // -> [1, 0, -1, -2, -3, -4, -5]\n" - " ```\n" -). --spec range(integer(), integer()) -> list(integer()). -range(Start, Stop) -> - range_loop(Start, Stop, []). - --file("src/gleam/list.gleam", 1504). --spec repeat_loop(ALF, integer(), list(ALF)) -> list(ALF). -repeat_loop(Item, Times, Acc) -> - case Times =< 0 of - true -> - Acc; - - false -> - repeat_loop(Item, Times - 1, [Item | Acc]) - end. - --file("src/gleam/list.gleam", 1500). -?DOC( - " Builds a list of a given value a given number of times.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " repeat(\"a\", times: 0)\n" - " // -> []\n" - " ```\n" - "\n" - " ```gleam\n" - " repeat(\"a\", times: 5)\n" - " // -> [\"a\", \"a\", \"a\", \"a\", \"a\"]\n" - " ```\n" -). --spec repeat(ALD, integer()) -> list(ALD). -repeat(A, Times) -> - repeat_loop(A, Times, []). - --file("src/gleam/list.gleam", 1537). --spec split_loop(list(ALM), integer(), list(ALM)) -> {list(ALM), list(ALM)}. -split_loop(List, N, Taken) -> - case N =< 0 of - true -> - {lists:reverse(Taken), List}; - - false -> - case List of - [] -> - {lists:reverse(Taken), []}; - - [First | Rest] -> - split_loop(Rest, N - 1, [First | Taken]) - end - end. - --file("src/gleam/list.gleam", 1533). -?DOC( - " Splits a list in two before the given index.\n" - "\n" - " If the list is not long enough to have the given index the before list will\n" - " be the input list, and the after list will be empty.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " split([6, 7, 8, 9], 0)\n" - " // -> #([], [6, 7, 8, 9])\n" - " ```\n" - "\n" - " ```gleam\n" - " split([6, 7, 8, 9], 2)\n" - " // -> #([6, 7], [8, 9])\n" - " ```\n" - "\n" - " ```gleam\n" - " split([6, 7, 8, 9], 4)\n" - " // -> #([6, 7, 8, 9], [])\n" - " ```\n" -). --spec split(list(ALI), integer()) -> {list(ALI), list(ALI)}. -split(List, Index) -> - split_loop(List, Index, []). - --file("src/gleam/list.gleam", 1573). --spec split_while_loop(list(ALV), fun((ALV) -> boolean()), list(ALV)) -> {list(ALV), - list(ALV)}. -split_while_loop(List, F, Acc) -> - case List of - [] -> - {lists:reverse(Acc), []}; - - [First | Rest] -> - case F(First) of - true -> - split_while_loop(Rest, F, [First | Acc]); - - false -> - {lists:reverse(Acc), List} - end - end. - --file("src/gleam/list.gleam", 1566). -?DOC( - " Splits a list in two before the first element that a given function returns\n" - " `False` for.\n" - "\n" - " If the function returns `True` for all elements the first list will be the\n" - " input list, and the second list will be empty.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " split_while([1, 2, 3, 4, 5], fn(x) { x <= 3 })\n" - " // -> #([1, 2, 3], [4, 5])\n" - " ```\n" - "\n" - " ```gleam\n" - " split_while([1, 2, 3, 4, 5], fn(x) { x <= 5 })\n" - " // -> #([1, 2, 3, 4, 5], [])\n" - " ```\n" -). --spec split_while(list(ALR), fun((ALR) -> boolean())) -> {list(ALR), list(ALR)}. -split_while(List, Predicate) -> - split_while_loop(List, Predicate, []). - --file("src/gleam/list.gleam", 1613). -?DOC( - " Given a list of 2-element tuples, finds the first tuple that has a given\n" - " key as the first element and returns the second element.\n" - "\n" - " If no tuple is found with the given key then `Error(Nil)` is returned.\n" - "\n" - " This function may be useful for interacting with Erlang code where lists of\n" - " tuples are common.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " key_find([#(\"a\", 0), #(\"b\", 1)], \"a\")\n" - " // -> Ok(0)\n" - " ```\n" - "\n" - " ```gleam\n" - " key_find([#(\"a\", 0), #(\"b\", 1)], \"b\")\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " key_find([#(\"a\", 0), #(\"b\", 1)], \"c\")\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec key_find(list({AMA, AMB}), AMA) -> {ok, AMB} | {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 - ). - --file("src/gleam/list.gleam", 1644). -?DOC( - " Given a list of 2-element tuples, finds all tuples that have a given\n" - " key as the first element and returns the second element.\n" - "\n" - " This function may be useful for interacting with Erlang code where lists of\n" - " tuples are common.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " key_filter([#(\"a\", 0), #(\"b\", 1), #(\"a\", 2)], \"a\")\n" - " // -> [0, 2]\n" - " ```\n" - "\n" - " ```gleam\n" - " key_filter([#(\"a\", 0), #(\"b\", 1)], \"c\")\n" - " // -> []\n" - " ```\n" -). --spec key_filter(list({AMF, AMG}), AMF) -> list(AMG). -key_filter(Keyword_list, Desired_key) -> - filter_map( - Keyword_list, - fun(Keyword) -> - {Key, Value} = Keyword, - case Key =:= Desired_key of - true -> - {ok, Value}; - - false -> - {error, nil} - end - end - ). - --file("src/gleam/list.gleam", 1684). --spec key_pop_loop(list({AMP, AMQ}), AMP, list({AMP, AMQ})) -> {ok, - {AMQ, list({AMP, AMQ})}} | - {error, nil}. -key_pop_loop(List, Key, Checked) -> - case List of - [] -> - {error, nil}; - - [{K, V} | Rest] when K =:= Key -> - {ok, {V, lists:reverse(Checked, Rest)}}; - - [First | Rest@1] -> - key_pop_loop(Rest@1, Key, [First | Checked]) - end. - --file("src/gleam/list.gleam", 1680). -?DOC( - " Given a list of 2-element tuples, finds the first tuple that has a given\n" - " key as the first element. This function will return the second element\n" - " of the found tuple and list with tuple removed.\n" - "\n" - " If no tuple is found with the given key then `Error(Nil)` is returned.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " key_pop([#(\"a\", 0), #(\"b\", 1)], \"a\")\n" - " // -> Ok(#(0, [#(\"b\", 1)]))\n" - " ```\n" - "\n" - " ```gleam\n" - " key_pop([#(\"a\", 0), #(\"b\", 1)], \"b\")\n" - " // -> Ok(#(1, [#(\"a\", 0)]))\n" - " ```\n" - "\n" - " ```gleam\n" - " key_pop([#(\"a\", 0), #(\"b\", 1)], \"c\")\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec key_pop(list({AMJ, AMK}), AMJ) -> {ok, {AMK, list({AMJ, AMK})}} | - {error, nil}. -key_pop(List, Key) -> - key_pop_loop(List, Key, []). - --file("src/gleam/list.gleam", 1718). --spec key_set_loop(list({ANA, ANB}), ANA, ANB, list({ANA, ANB})) -> list({ANA, - ANB}). -key_set_loop(List, Key, Value, Inspected) -> - case List of - [{K, _} | Rest] when K =:= Key -> - lists:reverse(Inspected, [{K, Value} | Rest]); - - [First | Rest@1] -> - key_set_loop(Rest@1, Key, Value, [First | Inspected]); - - [] -> - lists:reverse([{Key, Value} | Inspected]) - end. - --file("src/gleam/list.gleam", 1714). -?DOC( - " Given a list of 2-element tuples, inserts a key and value into the list.\n" - "\n" - " If there was already a tuple with the key then it is replaced, otherwise it\n" - " is added to the end of the list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " key_set([#(5, 0), #(4, 1)], 4, 100)\n" - " // -> [#(5, 0), #(4, 100)]\n" - " ```\n" - "\n" - " ```gleam\n" - " key_set([#(5, 0), #(4, 1)], 1, 100)\n" - " // -> [#(5, 0), #(4, 1), #(1, 100)]\n" - " ```\n" -). --spec key_set(list({AMW, AMX}), AMW, AMX) -> list({AMW, AMX}). -key_set(List, Key, Value) -> - key_set_loop(List, Key, Value, []). - --file("src/gleam/list.gleam", 1746). -?DOC( - " Calls a function for each element in a list, discarding the return value.\n" - "\n" - " Useful for calling a side effect for every item of a list.\n" - "\n" - " ```gleam\n" - " import gleam/io\n" - "\n" - " each([\"1\", \"2\", \"3\"], io.println)\n" - " // -> Nil\n" - " // 1\n" - " // 2\n" - " // 3\n" - " ```\n" -). --spec each(list(ANF), fun((ANF) -> any())) -> nil. -each(List, F) -> - case List of - [] -> - nil; - - [First | Rest] -> - F(First), - each(Rest, F) - end. - --file("src/gleam/list.gleam", 1772). -?DOC( - " Calls a `Result` returning function for each element in a list, discarding\n" - " the return value. If the function returns `Error` then the iteration is\n" - " stopped and the error is returned.\n" - "\n" - " Useful for calling a side effect for every item of a list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " try_each(\n" - " over: [1, 2, 3],\n" - " with: function_that_might_fail,\n" - " )\n" - " // -> Ok(Nil)\n" - " ```\n" -). --spec try_each(list(ANI), fun((ANI) -> {ok, any()} | {error, ANL})) -> {ok, nil} | - {error, ANL}. -try_each(List, Fun) -> - case List of - [] -> - {ok, nil}; - - [First | Rest] -> - case Fun(First) of - {ok, _} -> - try_each(Rest, Fun); - - {error, E} -> - {error, E} - end - end. - --file("src/gleam/list.gleam", 1805). --spec partition_loop(list(BGL), fun((BGL) -> boolean()), list(BGL), list(BGL)) -> {list(BGL), - list(BGL)}. -partition_loop(List, Categorise, Trues, Falses) -> - case List of - [] -> - {lists:reverse(Trues), lists:reverse(Falses)}; - - [First | Rest] -> - case Categorise(First) of - true -> - partition_loop(Rest, Categorise, [First | Trues], Falses); - - false -> - partition_loop(Rest, Categorise, Trues, [First | Falses]) - end - end. - --file("src/gleam/list.gleam", 1798). -?DOC( - " Partitions a list into a tuple/pair of lists\n" - " by a given categorisation function.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - "\n" - " [1, 2, 3, 4, 5] |> partition(int.is_odd)\n" - " // -> #([1, 3, 5], [2, 4])\n" - " ```\n" -). --spec partition(list(ANQ), fun((ANQ) -> boolean())) -> {list(ANQ), list(ANQ)}. -partition(List, Categorise) -> - partition_loop(List, Categorise, [], []). - --file("src/gleam/list.gleam", 1885). --spec window_loop(list(list(AOX)), list(AOX), integer()) -> list(list(AOX)). -window_loop(Acc, List, N) -> - Window = take(List, N), - case erlang:length(Window) =:= N of - true -> - window_loop([Window | Acc], drop(List, 1), N); - - false -> - lists:reverse(Acc) - end. - --file("src/gleam/list.gleam", 1878). -?DOC( - " Returns a list of sliding windows.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " window([1,2,3,4,5], 3)\n" - " // -> [[1, 2, 3], [2, 3, 4], [3, 4, 5]]\n" - " ```\n" - "\n" - " ```gleam\n" - " window([1, 2], 4)\n" - " // -> []\n" - " ```\n" -). --spec window(list(AOT), integer()) -> list(list(AOT)). -window(List, N) -> - case N =< 0 of - true -> - []; - - false -> - window_loop([], List, N) - end. - --file("src/gleam/list.gleam", 1908). -?DOC( - " Returns a list of tuples containing two contiguous elements.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " window_by_2([1,2,3,4])\n" - " // -> [#(1, 2), #(2, 3), #(3, 4)]\n" - " ```\n" - "\n" - " ```gleam\n" - " window_by_2([1])\n" - " // -> []\n" - " ```\n" -). --spec window_by_2(list(APD)) -> list({APD, APD}). -window_by_2(List) -> - zip(List, drop(List, 1)). - --file("src/gleam/list.gleam", 1921). -?DOC( - " Drops the first elements in a given list for which the predicate function returns `True`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " drop_while([1, 2, 3, 4], fn (x) { x < 3 })\n" - " // -> [3, 4]\n" - " ```\n" -). --spec drop_while(list(APG), fun((APG) -> boolean())) -> list(APG). -drop_while(List, Predicate) -> - case List of - [] -> - []; - - [First | Rest] -> - case Predicate(First) of - true -> - drop_while(Rest, Predicate); - - false -> - [First | Rest] - end - end. - --file("src/gleam/list.gleam", 1951). --spec take_while_loop(list(APM), fun((APM) -> boolean()), list(APM)) -> list(APM). -take_while_loop(List, Predicate, Acc) -> - case List of - [] -> - lists:reverse(Acc); - - [First | Rest] -> - case Predicate(First) of - true -> - take_while_loop(Rest, Predicate, [First | Acc]); - - false -> - lists:reverse(Acc) - end - end. - --file("src/gleam/list.gleam", 1944). -?DOC( - " Takes the first elements in a given list for which the predicate function returns `True`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " take_while([1, 2, 3, 2, 4], fn (x) { x < 3 })\n" - " // -> [1, 2]\n" - " ```\n" -). --spec take_while(list(APJ), fun((APJ) -> boolean())) -> list(APJ). -take_while(List, Predicate) -> - take_while_loop(List, Predicate, []). - --file("src/gleam/list.gleam", 1983). --spec chunk_loop(list(APV), fun((APV) -> APX), APX, list(APV), list(list(APV))) -> list(list(APV)). -chunk_loop(List, F, Previous_key, Current_chunk, Acc) -> - case List of - [First | Rest] -> - Key = F(First), - case Key =:= Previous_key of - true -> - chunk_loop(Rest, F, Key, [First | Current_chunk], Acc); - - false -> - New_acc = [lists:reverse(Current_chunk) | Acc], - chunk_loop(Rest, F, Key, [First], New_acc) - end; - - [] -> - lists:reverse([lists:reverse(Current_chunk) | Acc]) - end. - --file("src/gleam/list.gleam", 1976). -?DOC( - " Returns a list of chunks in which\n" - " the return value of calling `f` on each element is the same.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " [1, 2, 2, 3, 4, 4, 6, 7, 7] |> chunk(by: fn(n) { n % 2 })\n" - " // -> [[1], [2, 2], [3], [4, 4, 6], [7, 7]]\n" - " ```\n" -). --spec chunk(list(APQ), fun((APQ) -> any())) -> list(list(APQ)). -chunk(List, F) -> - case List of - [] -> - []; - - [First | Rest] -> - chunk_loop(Rest, F, F(First), [First], []) - end. - --file("src/gleam/list.gleam", 2028). --spec sized_chunk_loop( - list(AQH), - integer(), - integer(), - list(AQH), - list(list(AQH)) -) -> list(list(AQH)). -sized_chunk_loop(List, Count, Left, Current_chunk, Acc) -> - case List of - [] -> - case Current_chunk of - [] -> - lists:reverse(Acc); - - Remaining -> - lists:reverse([lists:reverse(Remaining) | Acc]) - end; - - [First | Rest] -> - Chunk = [First | Current_chunk], - case Left > 1 of - true -> - sized_chunk_loop(Rest, Count, Left - 1, Chunk, Acc); - - false -> - sized_chunk_loop( - Rest, - Count, - Count, - [], - [lists:reverse(Chunk) | Acc] - ) - end - end. - --file("src/gleam/list.gleam", 2024). -?DOC( - " Returns a list of chunks containing `count` elements each.\n" - "\n" - " If the last chunk does not have `count` elements, it is instead\n" - " a partial chunk, with less than `count` elements.\n" - "\n" - " For any `count` less than 1 this function behaves as if it was set to 1.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " [1, 2, 3, 4, 5, 6] |> sized_chunk(into: 2)\n" - " // -> [[1, 2], [3, 4], [5, 6]]\n" - " ```\n" - "\n" - " ```gleam\n" - " [1, 2, 3, 4, 5, 6, 7, 8] |> sized_chunk(into: 3)\n" - " // -> [[1, 2, 3], [4, 5, 6], [7, 8]]\n" - " ```\n" -). --spec sized_chunk(list(AQD), integer()) -> list(list(AQD)). -sized_chunk(List, Count) -> - sized_chunk_loop(List, Count, Count, [], []). - --file("src/gleam/list.gleam", 2072). -?DOC( - " This function acts similar to fold, but does not take an initial state.\n" - " Instead, it starts from the first element in the list\n" - " and combines it with each subsequent element in turn using the given\n" - " function. The function is called as `fun(accumulator, current_element)`.\n" - "\n" - " Returns `Ok` to indicate a successful run, and `Error` if called on an\n" - " empty list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " [] |> reduce(fn(acc, x) { acc + x })\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " [1, 2, 3, 4, 5] |> reduce(fn(acc, x) { acc + x })\n" - " // -> Ok(15)\n" - " ```\n" -). --spec reduce(list(AQO), fun((AQO, AQO) -> AQO)) -> {ok, AQO} | {error, nil}. -reduce(List, Fun) -> - case List of - [] -> - {error, nil}; - - [First | Rest] -> - {ok, fold(Rest, First, Fun)} - end. - --file("src/gleam/list.gleam", 2096). --spec scan_loop(list(AQW), AQY, list(AQY), fun((AQY, AQW) -> AQY)) -> list(AQY). -scan_loop(List, Accumulator, Accumulated, Fun) -> - case List of - [] -> - lists:reverse(Accumulated); - - [First | Rest] -> - Next = Fun(Accumulator, First), - scan_loop(Rest, Next, [Next | Accumulated], Fun) - end. - --file("src/gleam/list.gleam", 2088). -?DOC( - " Similar to `fold`, but yields the state of the accumulator at each stage.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " scan(over: [1, 2, 3], from: 100, with: fn(acc, i) { acc + i })\n" - " // -> [101, 103, 106]\n" - " ```\n" -). --spec scan(list(AQS), AQU, fun((AQU, AQS) -> AQU)) -> list(AQU). -scan(List, Initial, Fun) -> - scan_loop(List, Initial, [], Fun). - --file("src/gleam/list.gleam", 2129). -?DOC( - " Returns the last element in the given list.\n" - "\n" - " Returns `Error(Nil)` if the list is empty.\n" - "\n" - " This function runs in linear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " last([])\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " last([1, 2, 3, 4, 5])\n" - " // -> Ok(5)\n" - " ```\n" -). --spec last(list(ARB)) -> {ok, ARB} | {error, nil}. -last(List) -> - case List of - [] -> - {error, nil}; - - [Last] -> - {ok, Last}; - - [_ | Rest] -> - last(Rest) - end. - --file("src/gleam/list.gleam", 2151). -?DOC( - " Return unique combinations of elements in the list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " combinations([1, 2, 3], 2)\n" - " // -> [[1, 2], [1, 3], [2, 3]]\n" - " ```\n" - "\n" - " ```gleam\n" - " combinations([1, 2, 3, 4], 3)\n" - " // -> [[1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4]]\n" - " ```\n" -). --spec combinations(list(ARF), integer()) -> list(list(ARF)). -combinations(Items, N) -> - case {N, Items} of - {0, _} -> - [[]]; - - {_, []} -> - []; - - {_, [First | Rest]} -> - _pipe = Rest, - _pipe@1 = combinations(_pipe, N - 1), - _pipe@2 = map( - _pipe@1, - fun(Combination) -> [First | Combination] end - ), - _pipe@3 = lists:reverse(_pipe@2), - fold(_pipe@3, combinations(Rest, N), fun(Acc, C) -> [C | Acc] end) - end. - --file("src/gleam/list.gleam", 2177). --spec combination_pairs_loop(list(ARM), list({ARM, ARM})) -> list({ARM, ARM}). -combination_pairs_loop(Items, Acc) -> - case Items of - [] -> - lists:reverse(Acc); - - [First | Rest] -> - First_combinations = map(Rest, fun(Other) -> {First, Other} end), - Acc@1 = lists:reverse(First_combinations, Acc), - combination_pairs_loop(Rest, Acc@1) - end. - --file("src/gleam/list.gleam", 2173). -?DOC( - " Return unique pair combinations of elements in the list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " combination_pairs([1, 2, 3])\n" - " // -> [#(1, 2), #(1, 3), #(2, 3)]\n" - " ```\n" -). --spec combination_pairs(list(ARJ)) -> list({ARJ, ARJ}). -combination_pairs(Items) -> - combination_pairs_loop(Items, []). - --file("src/gleam/list.gleam", 2233). --spec take_firsts(list(list(ASG)), list(ASG), list(list(ASG))) -> {list(ASG), - list(list(ASG))}. -take_firsts(Rows, Column, Remaining_rows) -> - case Rows of - [] -> - {lists:reverse(Column), lists:reverse(Remaining_rows)}; - - [[] | Rest] -> - take_firsts(Rest, Column, Remaining_rows); - - [[First | Remaining_row] | Rest_rows] -> - Remaining_rows@1 = [Remaining_row | Remaining_rows], - take_firsts(Rest_rows, [First | Column], Remaining_rows@1) - end. - --file("src/gleam/list.gleam", 2220). --spec transpose_loop(list(list(ARZ)), list(list(ARZ))) -> list(list(ARZ)). -transpose_loop(Rows, Columns) -> - case Rows of - [] -> - lists:reverse(Columns); - - _ -> - {Column, Rest} = take_firsts(Rows, [], []), - case Column of - [_ | _] -> - transpose_loop(Rest, [Column | Columns]); - - [] -> - transpose_loop(Rest, Columns) - end - end. - --file("src/gleam/list.gleam", 2216). -?DOC( - " Transpose rows and columns of the list of lists.\n" - "\n" - " Notice: This function is not tail recursive,\n" - " and thus may exceed stack size if called,\n" - " with large lists (on the JavaScript target).\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " transpose([[1, 2, 3], [101, 102, 103]])\n" - " // -> [[1, 101], [2, 102], [3, 103]]\n" - " ```\n" -). --spec transpose(list(list(ARU))) -> list(list(ARU)). -transpose(List_of_lists) -> - transpose_loop(List_of_lists, []). - --file("src/gleam/list.gleam", 2197). -?DOC( - " Make a list alternating the elements from the given lists\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " interleave([[1, 2], [101, 102], [201, 202]])\n" - " // -> [1, 101, 201, 2, 102, 202]\n" - " ```\n" -). --spec interleave(list(list(ARQ))) -> list(ARQ). -interleave(List) -> - _pipe = List, - _pipe@1 = transpose(_pipe), - lists:append(_pipe@1). - --file("src/gleam/list.gleam", 2266). --spec shuffle_pair_unwrap_loop(list({float(), ASS}), list(ASS)) -> list(ASS). -shuffle_pair_unwrap_loop(List, Acc) -> - case List of - [] -> - Acc; - - [Elem_pair | Enumerable] -> - shuffle_pair_unwrap_loop( - Enumerable, - [erlang:element(2, Elem_pair) | Acc] - ) - end. - --file("src/gleam/list.gleam", 2274). --spec do_shuffle_by_pair_indexes(list({float(), ASW})) -> list({float(), ASW}). -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 - ). - --file("src/gleam/list.gleam", 2259). -?DOC( - " Takes a list, randomly sorts all items and returns the shuffled list.\n" - "\n" - " This function uses `float.random` to decide the order of the elements.\n" - "\n" - " ## Example\n" - "\n" - " ```gleam\n" - " range(1, 10) |> shuffle()\n" - " // -> [1, 6, 9, 10, 3, 8, 4, 2, 7, 5]\n" - " ```\n" -). --spec shuffle(list(ASP)) -> list(ASP). -shuffle(List) -> - _pipe = List, - _pipe@1 = fold(_pipe, [], fun(Acc, A) -> [{rand:uniform(), A} | Acc] end), - _pipe@2 = do_shuffle_by_pair_indexes(_pipe@1), - shuffle_pair_unwrap_loop(_pipe@2, []). - --file("src/gleam/list.gleam", 2306). --spec max_loop(list(ATG), fun((ATG, ATG) -> gleam@order:order()), ATG) -> ATG. -max_loop(List, Compare, Max) -> - case List of - [] -> - Max; - - [First | Rest] -> - case Compare(First, Max) of - gt -> - max_loop(Rest, Compare, First); - - lt -> - max_loop(Rest, Compare, Max); - - eq -> - max_loop(Rest, Compare, Max) - end - end. - --file("src/gleam/list.gleam", 2296). -?DOC( - " Takes a list and a comparator, and returns the maximum element in the list\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " range(1, 10) |> list.max(int.compare)\n" - " // -> Ok(10)\n" - " ```\n" - "\n" - " ```gleam\n" - " [\"a\", \"c\", \"b\"] |> list.max(string.compare)\n" - " // -> Ok(\"c\")\n" - " ```\n" -). --spec max(list(ASZ), fun((ASZ, ASZ) -> gleam@order:order())) -> {ok, ASZ} | - {error, nil}. -max(List, Compare) -> - case List of - [] -> - {error, nil}; - - [First | Rest] -> - {ok, max_loop(Rest, Compare, First)} - end. - --file("src/gleam/list.gleam", 2387). --spec build_reservoir_loop( - list(ATV), - integer(), - gleam@dict:dict(integer(), ATV) -) -> {gleam@dict:dict(integer(), ATV), list(ATV)}. -build_reservoir_loop(List, Size, Reservoir) -> - Reservoir_size = maps:size(Reservoir), - case Reservoir_size >= Size of - true -> - {Reservoir, List}; - - false -> - case List of - [] -> - {Reservoir, []}; - - [First | Rest] -> - Reservoir@1 = gleam@dict:insert( - Reservoir, - Reservoir_size, - First - ), - build_reservoir_loop(Rest, Size, Reservoir@1) - end - end. - --file("src/gleam/list.gleam", 2383). -?DOC( - " Builds the initial reservoir used by Algorithm L.\n" - " This is a dictionary with keys ranging from `0` up to `n - 1` where each\n" - " value is the corresponding element at that position in `list`.\n" - "\n" - " This also returns the remaining elements of `list` that didn't end up in\n" - " the reservoir.\n" -). --spec build_reservoir(list(ATQ), integer()) -> {gleam@dict:dict(integer(), ATQ), - list(ATQ)}. -build_reservoir(List, N) -> - build_reservoir_loop(List, N, maps:new()). - --file("src/gleam/list.gleam", 2371). --spec log_random() -> float(). -log_random() -> - Random@1 = case gleam@float:logarithm( - rand:uniform() + 2.2250738585072014e-308 - ) of - {ok, Random} -> Random; - _assert_fail -> - erlang:error(#{gleam_error => let_assert, - message => <<"Pattern match failed, no pattern matched the value."/utf8>>, - file => <>, - module => <<"gleam/list"/utf8>>, - function => <<"log_random"/utf8>>, - line => 2372, - value => _assert_fail, - start => 55613, - 'end' => 55684, - pattern_start => 55624, - pattern_end => 55634}) - end, - Random@1. - --file("src/gleam/list.gleam", 2348). --spec sample_loop( - list(ATK), - gleam@dict:dict(integer(), ATK), - integer(), - float() -) -> gleam@dict:dict(integer(), ATK). -sample_loop(List, Reservoir, N, W) -> - Skip = begin - Log@1 = case gleam@float:logarithm(1.0 - W) of - {ok, Log} -> Log; - _assert_fail -> - erlang:error(#{gleam_error => let_assert, - message => <<"Pattern match failed, no pattern matched the value."/utf8>>, - file => <>, - module => <<"gleam/list"/utf8>>, - function => <<"sample_loop"/utf8>>, - line => 2355, - value => _assert_fail, - start => 55174, - 'end' => 55220, - pattern_start => 55185, - pattern_end => 55192}) - end, - erlang:round(math:floor(case Log@1 of - +0.0 -> +0.0; - -0.0 -> -0.0; - Gleam@denominator -> log_random() / Gleam@denominator - end)) - end, - case drop(List, Skip) of - [] -> - Reservoir; - - [First | Rest] -> - Reservoir@1 = gleam@dict:insert( - Reservoir, - gleam@int:random(N), - First - ), - W@1 = W * math:exp(case erlang:float(N) of - +0.0 -> +0.0; - -0.0 -> -0.0; - Gleam@denominator@1 -> log_random() / Gleam@denominator@1 - end), - sample_loop(Rest, Reservoir@1, N, W@1) - end. - --file("src/gleam/list.gleam", 2330). -?DOC( - " Returns a random sample of up to n elements from a list using reservoir\n" - " sampling via [Algorithm L](https://en.wikipedia.org/wiki/Reservoir_sampling#Optimal:_Algorithm_L).\n" - " Returns an empty list if the sample size is less than or equal to 0.\n" - "\n" - " Order is not random, only selection is.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " reservoir_sample([1, 2, 3, 4, 5], 3)\n" - " // -> [2, 4, 5] // A random sample of 3 items\n" - " ```\n" -). --spec sample(list(ATH), integer()) -> list(ATH). -sample(List, N) -> - {Reservoir, Rest} = build_reservoir(List, N), - case gleam@dict:is_empty(Reservoir) of - true -> - []; - - false -> - W = math:exp(case erlang:float(N) of - +0.0 -> +0.0; - -0.0 -> -0.0; - Gleam@denominator -> log_random() / Gleam@denominator - end), - maps:values(sample_loop(Rest, Reservoir, N, W)) - end. - --file("src/gleam/list.gleam", 1832). --spec permutation_zip(list(AOD), list(AOD), list(list(AOD))) -> list(list(AOD)). -permutation_zip(List, Rest, Acc) -> - case List of - [] -> - lists:reverse(Acc); - - [Head | Tail] -> - permutation_prepend( - Head, - permutations(lists:reverse(Rest, Tail)), - Tail, - [Head | Rest], - Acc - ) - end. - --file("src/gleam/list.gleam", 1825). -?DOC( - " Returns all the permutations of a list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " permutations([1, 2])\n" - " // -> [[1, 2], [2, 1]]\n" - " ```\n" -). --spec permutations(list(ANZ)) -> list(list(ANZ)). -permutations(List) -> - case List of - [] -> - [[]]; - - L -> - permutation_zip(L, [], []) - end. - --file("src/gleam/list.gleam", 1850). --spec permutation_prepend( - AOK, - list(list(AOK)), - list(AOK), - list(AOK), - list(list(AOK)) -) -> list(list(AOK)). -permutation_prepend(El, Permutations, List_1, List_2, Acc) -> - case Permutations of - [] -> - permutation_zip(List_1, List_2, Acc); - - [Head | Tail] -> - permutation_prepend(El, Tail, List_1, List_2, [[El | Head] | Acc]) - end. diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.cache deleted file mode 100644 index 12b247d5a702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$nFRvnT|!Kz8i@$e>5Cr(P%8nz8vk3vcc%~ zDEoT!+99r9X%3dLTqx3)yI?=i^tM2c4h3xG4?_14>4GNUIG5cbSXgw1A?$p z0k&c{wtLNZCb^|ezRo4k*{yVTqYPE)tX4X!jn0~Zq_m__{(uSw&zprFIWKg|_rvo;@cb~mKO(dm*9`eRc>li82-kng&zT417tIZD z1?69xTj7epHA5CHgR;ZY2v<-J!}DZI8(cwoHaxe$a|=AT!}B6b2V6nW%xP7qzM_eG< z{{Okdfbi@c4Cq<$7ZC8XW8xcF9I`)chvF&6GY%-GI%hbcxZJhV1;xL*pLIjA+HN zv=c9Zv0ZQfp1q>h*n=%-#}y22s_*cTn__o>_s@>TUW-9zQ)6@RmnG(@{PI|5xa|8; z*J;KI&<%R^QaRl@7e$kIZFf}+lpEXjvjhmjz~4T#cbLt!=5L|e9uR+u`udIdUs%*R zeK?wgYX}wf&+dOgMJ@6yK}8MFBq}OPw_2da8tiNw>0&l7Znsh1?A9xUA9^_t)H&mGmS~ zS)~`EuSP2>6}Dl@YVD8Q8mXvNexm9`YxmEh)e16SC-$L~7l>aGD>^B}i?us2v!7X? zutLj&;^WxCNbIso0T+(*l#TTU$1RSE&x}2VT~_z^b)$6^b>ZA-S%rA0H&jufkm@O` z^+Vr1zKUA7SzA^^rU6<}qx{@RSRLsCvdSn9 diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.cache_meta b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.cache_meta deleted file mode 100644 index 038606b6581d3f3999e2e4306b4717b10c5c1615..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1485 zcmX}sdq@{n6ae6>m6p}g(#o{imOW_wv$Y;n&~u}OD-d%!exockZFA1ZK|xQ-s5Iur zdaW7+GZKPrQW3M5g%c$!dPw9jbTAf9tihtfqL0zK@WJKY!#Rh`;Wl1eSsY%jsQ))p z4;Owg{OIaIYhRs&knM5@72M!4eI$z+O9AJIjTXxfbkN0=ej$9p2KMj`M>xtc+L+c~ z4vN{xX7*CU1sZ9ljb5G;Ga!UG7LZL2xqQ!QTIghKObBl6wv?VGrCMtX0V8lSi`53Qo~uAXy+cCbg}rg5SEZb zgktt{gcHfPY-VoGcROP#Akd?DUDp`7H`GNPX-ZIQNnke<_zcgjfaE;@4*nV z$Y&eXe9J)&(ZW?a=%San;UT1w&Sa+ZArbN^qMY3v;5a8}r<*>8j?e-lNMs%L{Kela zObp=@^7x6UBr{JE$xLK9c@$H^CQi~oGp*dEkHI6=Vif5tC6_!3_?b)G;XXa|@_+@S zLU@lA{?I%M)V8m{;bqm?f;>OLkF3HNVqMNb$BLlR_$UC}bU**up-3q=9ByiB9!r Vk;XXkD5Zir{^1diUsCPA^#Z{M$jATy diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.erl b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.erl deleted file mode 100644 index 5cee861..0000000 --- a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@option.erl +++ /dev/null @@ -1,413 +0,0 @@ --module(gleam@option). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/option.gleam"). --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]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --type option(EG) :: {some, EG} | none. - --file("src/gleam/option.gleam", 59). --spec reverse_and_prepend(list(EV), list(EV)) -> list(EV). -reverse_and_prepend(Prefix, Suffix) -> - case Prefix of - [] -> - Suffix; - - [First | Rest] -> - reverse_and_prepend(Rest, [First | Suffix]) - end. - --file("src/gleam/option.gleam", 44). --spec all_loop(list(option(EM)), list(EM)) -> option(list(EM)). -all_loop(List, Acc) -> - case List of - [] -> - {some, lists:reverse(Acc)}; - - [none | _] -> - none; - - [{some, First} | Rest] -> - all_loop(Rest, [First | Acc]) - end. - --file("src/gleam/option.gleam", 40). -?DOC( - " Combines a list of `Option`s into a single `Option`.\n" - " If all elements in the list are `Some` then returns a `Some` holding the list of values.\n" - " If any element is `None` then returns `None`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " all([Some(1), Some(2)])\n" - " // -> Some([1, 2])\n" - " ```\n" - "\n" - " ```gleam\n" - " all([Some(1), None])\n" - " // -> None\n" - " ```\n" -). --spec all(list(option(EH))) -> option(list(EH)). -all(List) -> - all_loop(List, []). - --file("src/gleam/option.gleam", 80). -?DOC( - " Checks whether the `Option` is a `Some` value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_some(Some(1))\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " is_some(None)\n" - " // -> False\n" - " ```\n" -). --spec is_some(option(any())) -> boolean(). -is_some(Option) -> - Option /= none. - --file("src/gleam/option.gleam", 98). -?DOC( - " Checks whether the `Option` is a `None` value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_none(Some(1))\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " is_none(None)\n" - " // -> True\n" - " ```\n" -). --spec is_none(option(any())) -> boolean(). -is_none(Option) -> - Option =:= none. - --file("src/gleam/option.gleam", 116). -?DOC( - " Converts an `Option` type to a `Result` type.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_result(Some(1), \"some_error\")\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " to_result(None, \"some_error\")\n" - " // -> Error(\"some_error\")\n" - " ```\n" -). --spec to_result(option(FD), FG) -> {ok, FD} | {error, FG}. -to_result(Option, E) -> - case Option of - {some, A} -> - {ok, A}; - - none -> - {error, E} - end. - --file("src/gleam/option.gleam", 137). -?DOC( - " Converts a `Result` type to an `Option` type.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_result(Ok(1))\n" - " // -> Some(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " from_result(Error(\"some_error\"))\n" - " // -> None\n" - " ```\n" -). --spec from_result({ok, FJ} | {error, any()}) -> option(FJ). -from_result(Result) -> - case Result of - {ok, A} -> - {some, A}; - - {error, _} -> - none - end. - --file("src/gleam/option.gleam", 158). -?DOC( - " Extracts the value from an `Option`, returning a default value if there is none.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " unwrap(Some(1), 0)\n" - " // -> 1\n" - " ```\n" - "\n" - " ```gleam\n" - " unwrap(None, 0)\n" - " // -> 0\n" - " ```\n" -). --spec unwrap(option(FO), FO) -> FO. -unwrap(Option, Default) -> - case Option of - {some, X} -> - X; - - none -> - Default - end. - --file("src/gleam/option.gleam", 179). -?DOC( - " Extracts the value from an `Option`, evaluating the default function if the option is `None`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " lazy_unwrap(Some(1), fn() { 0 })\n" - " // -> 1\n" - " ```\n" - "\n" - " ```gleam\n" - " lazy_unwrap(None, fn() { 0 })\n" - " // -> 0\n" - " ```\n" -). --spec lazy_unwrap(option(FQ), fun(() -> FQ)) -> FQ. -lazy_unwrap(Option, Default) -> - case Option of - {some, X} -> - X; - - none -> - Default() - end. - --file("src/gleam/option.gleam", 204). -?DOC( - " Updates a value held within the `Some` of an `Option` by calling a given function\n" - " on it.\n" - "\n" - " If the `Option` is a `None` rather than `Some`, the function is not called and the\n" - " `Option` stays the same.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " map(over: Some(1), with: fn(x) { x + 1 })\n" - " // -> Some(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " map(over: None, with: fn(x) { x + 1 })\n" - " // -> None\n" - " ```\n" -). --spec map(option(FS), fun((FS) -> FU)) -> option(FU). -map(Option, Fun) -> - case Option of - {some, X} -> - {some, Fun(X)}; - - none -> - none - end. - --file("src/gleam/option.gleam", 230). -?DOC( - " Merges a nested `Option` into a single layer.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " flatten(Some(Some(1)))\n" - " // -> Some(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " flatten(Some(None))\n" - " // -> None\n" - " ```\n" - "\n" - " ```gleam\n" - " flatten(None)\n" - " // -> None\n" - " ```\n" -). --spec flatten(option(option(FW))) -> option(FW). -flatten(Option) -> - case Option of - {some, X} -> - X; - - none -> - none - end. - --file("src/gleam/option.gleam", 269). -?DOC( - " Updates a value held within the `Some` of an `Option` by calling a given function\n" - " on it, where the given function also returns an `Option`. The two options are\n" - " then merged together into one `Option`.\n" - "\n" - " If the `Option` is a `None` rather than `Some` the function is not called and the\n" - " option stays the same.\n" - "\n" - " This function is the equivalent of calling `map` followed by `flatten`, and\n" - " it is useful for chaining together multiple functions that return `Option`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " then(Some(1), fn(x) { Some(x + 1) })\n" - " // -> Some(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " then(Some(1), fn(x) { Some(#(\"a\", x)) })\n" - " // -> Some(#(\"a\", 1))\n" - " ```\n" - "\n" - " ```gleam\n" - " then(Some(1), fn(_) { None })\n" - " // -> None\n" - " ```\n" - "\n" - " ```gleam\n" - " then(None, fn(x) { Some(x + 1) })\n" - " // -> None\n" - " ```\n" -). --spec then(option(GA), fun((GA) -> option(GC))) -> option(GC). -then(Option, Fun) -> - case Option of - {some, X} -> - Fun(X); - - none -> - none - end. - --file("src/gleam/option.gleam", 300). -?DOC( - " Returns the first value if it is `Some`, otherwise returns the second value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " or(Some(1), Some(2))\n" - " // -> Some(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " or(Some(1), None)\n" - " // -> Some(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " or(None, Some(2))\n" - " // -> Some(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " or(None, None)\n" - " // -> None\n" - " ```\n" -). --spec 'or'(option(GF), option(GF)) -> option(GF). -'or'(First, Second) -> - case First of - {some, _} -> - First; - - none -> - Second - end. - --file("src/gleam/option.gleam", 331). -?DOC( - " Returns the first value if it is `Some`, otherwise evaluates the given function for a fallback value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " lazy_or(Some(1), fn() { Some(2) })\n" - " // -> Some(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " lazy_or(Some(1), fn() { None })\n" - " // -> Some(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " lazy_or(None, fn() { Some(2) })\n" - " // -> Some(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " lazy_or(None, fn() { None })\n" - " // -> None\n" - " ```\n" -). --spec lazy_or(option(GJ), fun(() -> option(GJ))) -> option(GJ). -lazy_or(First, Second) -> - case First of - {some, _} -> - First; - - none -> - Second() - end. - --file("src/gleam/option.gleam", 352). --spec values_loop(list(option(GR)), list(GR)) -> list(GR). -values_loop(List, Acc) -> - case List of - [] -> - lists:reverse(Acc); - - [none | Rest] -> - values_loop(Rest, Acc); - - [{some, First} | Rest@1] -> - values_loop(Rest@1, [First | Acc]) - end. - --file("src/gleam/option.gleam", 348). -?DOC( - " Given a list of `Option`s,\n" - " returns only the values inside `Some`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " values([Some(1), None, Some(3)])\n" - " // -> [1, 3]\n" - " ```\n" -). --spec values(list(option(GN))) -> list(GN). -values(Options) -> - values_loop(Options, []). diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache deleted file mode 100644 index c9de6acea09048fd7ce9372452212ba0a3caa835..0000000000000000000000000000000000000000 GIT binary pat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HzG{dq#$|@M-T0v)o-m#_#EZsDhWMS)oDk`RNQnK3 zhZ5q^#Ip(UeBzaa_*3Gq39&l)rKIRh_9w;Gq?;7^N$LV6`x;2nb%Ne8_A|@GMI8m-CXi2 zF`9Jk1S|re;*an~)gfLf)v1tarRl0uwDLJZh0w3H7qq#`5R(~BST|s?eEN5wctC?i zT`j3YuN1B1i?Ru55hIYeSv`nJinv?7M>an-9yG9NH`8X7=7CSB`R0Q-UJXG)0+A*i zviUl_N^0J(eoLzSo_d>X?l+D}%`N7tD$V6Wy23E4)DCs-^ybw*71F;+zLK0Pjeh>g z%y{QfoZ?clT&|*-tdPwZb>(8F)vM(yZcuNM&2i&txtI&g4ONS&Oo}R|_zh#sh&T>| zFXq;GLY!r-oviimjZsc5v+EgY5E;xh=PoFYCztzHa{vGU diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache_inline b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache_inline deleted file mode 100644 index 1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 KcmZQzfB*mh2mk>9 diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache_meta b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@order.cache_meta deleted file mode 100644 index ee7fbaf2209fa37bfcea8a7a18500d83ec95863c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 677 zcmXxiKS&f{6aet={L|$*IF$}!cG@Nx2BL&64uUOWa*Ym3YAMoGaD<#73N96*OQI$T zTDk}dUg{tsaf2x+EfFXV1w{_ENYi8oI zAUE-d$0QlyC9gQ^d&>;Vq*-H~sHr8ysiK+&T43}QQk1c0w4LrF8iF4pA|w8 zx2U3;8fxj~DJced%`}TFv&uFH9P)!-{3Dhf!gWfB(@27L`bg4GiUBh0@QovW6Uzyq zkQ= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --type order() :: lt | eq | gt. - --file("src/gleam/order.gleam", 35). -?DOC( - " Inverts an order, so less-than becomes greater-than and greater-than\n" - " becomes less-than.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " negate(Lt)\n" - " // -> Gt\n" - " ```\n" - "\n" - " ```gleam\n" - " negate(Eq)\n" - " // -> Eq\n" - " ```\n" - "\n" - " ```gleam\n" - " negate(Gt)\n" - " // -> Lt\n" - " ```\n" -). --spec negate(order()) -> order(). -negate(Order) -> - case Order of - lt -> - gt; - - eq -> - eq; - - gt -> - lt - end. - --file("src/gleam/order.gleam", 62). -?DOC( - " Produces a numeric representation of the order.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_int(Lt)\n" - " // -> -1\n" - " ```\n" - "\n" - " ```gleam\n" - " to_int(Eq)\n" - " // -> 0\n" - " ```\n" - "\n" - " ```gleam\n" - " to_int(Gt)\n" - " // -> 1\n" - " ```\n" -). --spec to_int(order()) -> integer(). -to_int(Order) -> - case Order of - lt -> - -1; - - eq -> - 0; - - gt -> - 1 - end. - --file("src/gleam/order.gleam", 79). -?DOC( - " Compares two `Order` values to one another, producing a new `Order`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " compare(Eq, with: Lt)\n" - " // -> Gt\n" - " ```\n" -). --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. - --file("src/gleam/order.gleam", 100). -?DOC( - " Inverts an ordering function, so less-than becomes greater-than and greater-than\n" - " becomes less-than.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - " import gleam/list\n" - "\n" - " list.sort([1, 5, 4], by: reverse(int.compare))\n" - " // -> [5, 4, 1]\n" - " ```\n" -). --spec reverse(fun((I, I) -> order())) -> fun((I, I) -> order()). -reverse(Orderer) -> - fun(A, B) -> Orderer(B, A) end. - --file("src/gleam/order.gleam", 122). -?DOC( - " Return a fallback `Order` in case the first argument is `Eq`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - "\n" - " break_tie(in: int.compare(1, 1), with: Lt)\n" - " // -> Lt\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - "\n" - " break_tie(in: int.compare(1, 0), with: Eq)\n" - " // -> Gt\n" - " ```\n" -). --spec break_tie(order(), order()) -> order(). -break_tie(Order, Other) -> - case Order of - lt -> - Order; - - gt -> - Order; - - eq -> - Other - end. - --file("src/gleam/order.gleam", 151). -?DOC( - " Invokes a fallback function returning an `Order` in case the first argument\n" - " is `Eq`.\n" - "\n" - " This can be useful when the fallback comparison might be expensive and it\n" - " needs to be delayed until strictly necessary.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - "\n" - " lazy_break_tie(in: int.compare(1, 1), with: fn() { Lt })\n" - " // -> Lt\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - "\n" - " lazy_break_tie(in: int.compare(1, 0), with: fn() { Eq })\n" - " // -> Gt\n" - " ```\n" -). --spec lazy_break_tie(order(), fun(() -> order())) -> order(). -lazy_break_tie(Order, Comparison) -> - case Order of - lt -> - Order; - - gt -> - Order; - - eq -> - Comparison() - end. diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.cache deleted file mode 100644 index cce116a7a49358bd330ed7363332f31351747faf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2770 zcmb_eQEU`N7~X$o_wKswas54NISlEv4QYE)&byIds?Z*#A_kEyHOeJ~TY5{ou-!Xu z_h?a!#)J@_crig@F=E1lF~*QcL{bub@IfDaGr>f8;K2tUiK!1bJ9{lX@6t##Y4>L5 z|7ZUBzW@9G+2=0PL(ripI9xzGiuO!0)gHyICzD<6I}ab|0Fv#!Po9dCq!y1RAs*Qi zr;lbF%bd$pOoiIj@a352D~Xb0AAgiNV^%YBuCHgTX~(X3R;FrI%3kKUUui!XDudA!7Rs`vs|CqE;E_LrR%J}pG_>7a}~$(#9OgglsxF+lEMDL>^7Dg z8q!%N!-jXWtUem}=z4HEJbMLFqn}00aVUm3Lus6=FLg~brPN+o1jXNns_#*8GHYj;vZ+D=gzg1Y7|6#6#?#mV7~d?OiQp&zw0uHQI9KOYNJT~dWeMJE(&YtXYBdi8 z+9bPrGrOw>$!?#q7)o(bNbx5PKLTSxuzOBSIuHbFP3qGvNu9CJSnf(udfVC5tnIOB zQ*z+52lE?0z*|#u2uEs zR;sR_uQmUzMcvr_|3^*Bjn|R1=pVU2(#0YbH^#q~v`Y6;NQv9FgJ9Q)u~F2(oj!4Y z68tS~{0d}r((-DKFM3MbPK2bkA(4+!?AnZ}9z-4Y=kT>2oY3j(rxYcx(%?$Pt-AOV zL~l@{JrmVxx!P<>DADLa+Y#GpJqT2+#I`<+M^V$m`7xTVV2KDp&d2>LrzbqJFCKYwBMr zAJCrF_>0=8#t&!(jXRpJiTb#%@mtz$t&?<$PnR)*Z4uNiC%Yh;-$Zeu5RksV8;=z5 zXdfQ!#<>EXp2S)=o-g3VG+yk+D+Rn-z-!%jqkuO@@Md>|g2PXkyh<U<}6S E-?U3(^#A|> diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_inline b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_inline deleted file mode 100644 index 1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 KcmZQzfB*mh2mk>9 diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_meta b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_meta deleted file mode 100644 index cebabcfe01fa8d7de8735493e222a933f19d7312..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 393 zcmXxeF-rnq6a~<)GTMbEhoD6w#KEB52EeO#KPO|{H~J6E3*t zfk&ErGGNGvIbUMLNs?lZ0%Z<4qQMOr$bmF!#W$(IpdsL?s#Ir4`C*R z2wUVRQKmwNE-&=>;EVZ)z9dO;N}WrtxaODmYzWJ&l4hGM1*+6&(4;-4(SQB`E=e-9 diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.erl b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.erl deleted file mode 100644 index 96de923..0000000 --- a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@pair.erl +++ /dev/null @@ -1,110 +0,0 @@ --module(gleam@pair). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/pair.gleam"). --export([first/1, second/1, swap/1, map_first/2, map_second/2, new/2]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --file("src/gleam/pair.gleam", 10). -?DOC( - " Returns the first element in a pair.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " first(#(1, 2))\n" - " // -> 1\n" - " ```\n" -). --spec first({CLX, any()}) -> CLX. -first(Pair) -> - {A, _} = Pair, - A. - --file("src/gleam/pair.gleam", 24). -?DOC( - " Returns the second element in a pair.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " second(#(1, 2))\n" - " // -> 2\n" - " ```\n" -). --spec second({any(), CMA}) -> CMA. -second(Pair) -> - {_, A} = Pair, - A. - --file("src/gleam/pair.gleam", 38). -?DOC( - " Returns a new pair with the elements swapped.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " swap(#(1, 2))\n" - " // -> #(2, 1)\n" - " ```\n" -). --spec swap({CMB, CMC}) -> {CMC, CMB}. -swap(Pair) -> - {A, B} = Pair, - {B, A}. - --file("src/gleam/pair.gleam", 53). -?DOC( - " Returns a new pair with the first element having had `with` applied to\n" - " it.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " #(1, 2) |> map_first(fn(n) { n * 2 })\n" - " // -> #(2, 2)\n" - " ```\n" -). --spec map_first({CMD, CME}, fun((CMD) -> CMF)) -> {CMF, CME}. -map_first(Pair, Fun) -> - {A, B} = Pair, - {Fun(A), B}. - --file("src/gleam/pair.gleam", 68). -?DOC( - " Returns a new pair with the second element having had `with` applied to\n" - " it.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " #(1, 2) |> map_second(fn(n) { n * 2 })\n" - " // -> #(1, 4)\n" - " ```\n" -). --spec map_second({CMG, CMH}, fun((CMH) -> CMI)) -> {CMG, CMI}. -map_second(Pair, Fun) -> - {A, B} = Pair, - {A, Fun(B)}. - --file("src/gleam/pair.gleam", 83). -?DOC( - " Returns a new pair with the given elements. This can also be done using the dedicated\n" - " syntax instead: `new(1, 2) == #(1, 2)`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new(1, 2)\n" - " // -> #(1, 2)\n" - " ```\n" -). --spec new(CMJ, CMK) -> {CMJ, CMK}. -new(First, Second) -> - {First, Second}. diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.cache deleted file mode 100644 index 470a8cfba026f9114eb82913de2d362f293221c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 liter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zHwNGP1~LBRi?#7^gT(1Ah@6A3_`>naH!OWG(C2$}t*g<}&T{8xcY>vspkU z8`#8VUZa+%kQ z2E_3K+t@)Nja=mpa}zwHh+;}OLM^BHoNu{KHz85~8O}5wC6%Yx!y!JQi54z#nTWA6 zM?9mML@LY3CYMc=QO$=OrHg_0TElD}CWS{Rq=YgKP{VnC;2Jj>m!y|0CW9k%lRVBl zu!V9exXy_2{#C4HJv%67FHKydgWL3ylI+a0m`rl0<03!u6J5ki2;o5%kU>6sDWkkk H=o|k6O@{(r diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.erl b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.erl deleted file mode 100644 index 76e5dc8..0000000 --- a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@result.erl +++ /dev/null @@ -1,532 +0,0 @@ --module(gleam@result). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/result.gleam"). --export([is_ok/1, is_error/1, map/2, map_error/2, flatten/1, 'try'/2, unwrap/2, lazy_unwrap/2, unwrap_error/2, 'or'/2, lazy_or/2, all/1, partition/1, replace/2, replace_error/2, values/1, try_recover/2]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " Result represents the result of something that may succeed or not.\n" - " `Ok` means it was successful, `Error` means it was not successful.\n" -). - --file("src/gleam/result.gleam", 20). -?DOC( - " Checks whether the result is an `Ok` value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_ok(Ok(1))\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " is_ok(Error(Nil))\n" - " // -> False\n" - " ```\n" -). --spec is_ok({ok, any()} | {error, any()}) -> boolean(). -is_ok(Result) -> - case Result of - {error, _} -> - false; - - {ok, _} -> - true - end. - --file("src/gleam/result.gleam", 41). -?DOC( - " Checks whether the result is an `Error` value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_error(Ok(1))\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " is_error(Error(Nil))\n" - " // -> True\n" - " ```\n" -). --spec is_error({ok, any()} | {error, any()}) -> boolean(). -is_error(Result) -> - case Result of - {ok, _} -> - false; - - {error, _} -> - true - end. - --file("src/gleam/result.gleam", 66). -?DOC( - " Updates a value held within the `Ok` of a result by calling a given function\n" - " on it.\n" - "\n" - " If the result is an `Error` rather than `Ok` the function is not called and the\n" - " result stays the same.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " map(over: Ok(1), with: fn(x) { x + 1 })\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " map(over: Error(1), with: fn(x) { x + 1 })\n" - " // -> Error(1)\n" - " ```\n" -). --spec map({ok, CMU} | {error, CMV}, fun((CMU) -> CMY)) -> {ok, CMY} | - {error, CMV}. -map(Result, Fun) -> - case Result of - {ok, X} -> - {ok, Fun(X)}; - - {error, E} -> - {error, E} - end. - --file("src/gleam/result.gleam", 91). -?DOC( - " Updates a value held within the `Error` of a result by calling a given function\n" - " on it.\n" - "\n" - " If the result is `Ok` rather than `Error` the function is not called and the\n" - " result stays the same.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " map_error(over: Error(1), with: fn(x) { x + 1 })\n" - " // -> Error(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " map_error(over: Ok(1), with: fn(x) { x + 1 })\n" - " // -> Ok(1)\n" - " ```\n" -). --spec map_error({ok, CNB} | {error, CNC}, fun((CNC) -> CNF)) -> {ok, CNB} | - {error, CNF}. -map_error(Result, Fun) -> - case Result of - {ok, X} -> - {ok, X}; - - {error, Error} -> - {error, Fun(Error)} - end. - --file("src/gleam/result.gleam", 120). -?DOC( - " Merges a nested `Result` into a single layer.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " flatten(Ok(Ok(1)))\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " flatten(Ok(Error(\"\")))\n" - " // -> Error(\"\")\n" - " ```\n" - "\n" - " ```gleam\n" - " flatten(Error(Nil))\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec flatten({ok, {ok, CNI} | {error, CNJ}} | {error, CNJ}) -> {ok, CNI} | - {error, CNJ}. -flatten(Result) -> - case Result of - {ok, X} -> - X; - - {error, Error} -> - {error, Error} - end. - --file("src/gleam/result.gleam", 158). -?DOC( - " \"Updates\" an `Ok` result by passing its value to a function that yields a result,\n" - " and returning the yielded result. (This may \"replace\" the `Ok` with an `Error`.)\n" - "\n" - " If the input is an `Error` rather than an `Ok`, the function is not called and\n" - " the original `Error` is returned.\n" - "\n" - " This function is the equivalent of calling `map` followed by `flatten`, and\n" - " it is useful for chaining together multiple functions that may fail.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " try(Ok(1), fn(x) { Ok(x + 1) })\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " try(Ok(1), fn(x) { Ok(#(\"a\", x)) })\n" - " // -> Ok(#(\"a\", 1))\n" - " ```\n" - "\n" - " ```gleam\n" - " try(Ok(1), fn(_) { Error(\"Oh no\") })\n" - " // -> Error(\"Oh no\")\n" - " ```\n" - "\n" - " ```gleam\n" - " try(Error(Nil), fn(x) { Ok(x + 1) })\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec 'try'({ok, CNQ} | {error, CNR}, fun((CNQ) -> {ok, CNU} | {error, CNR})) -> {ok, - CNU} | - {error, CNR}. -'try'(Result, Fun) -> - case Result of - {ok, X} -> - Fun(X); - - {error, E} -> - {error, E} - end. - --file("src/gleam/result.gleam", 183). -?DOC( - " Extracts the `Ok` value from a result, returning a default value if the result\n" - " is an `Error`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " unwrap(Ok(1), 0)\n" - " // -> 1\n" - " ```\n" - "\n" - " ```gleam\n" - " unwrap(Error(\"\"), 0)\n" - " // -> 0\n" - " ```\n" -). --spec unwrap({ok, CNZ} | {error, any()}, CNZ) -> CNZ. -unwrap(Result, Default) -> - case Result of - {ok, V} -> - V; - - {error, _} -> - Default - end. - --file("src/gleam/result.gleam", 205). -?DOC( - " Extracts the `Ok` value from a result, evaluating the default function if the result\n" - " is an `Error`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " lazy_unwrap(Ok(1), fn() { 0 })\n" - " // -> 1\n" - " ```\n" - "\n" - " ```gleam\n" - " lazy_unwrap(Error(\"\"), fn() { 0 })\n" - " // -> 0\n" - " ```\n" -). --spec lazy_unwrap({ok, COD} | {error, any()}, fun(() -> COD)) -> COD. -lazy_unwrap(Result, Default) -> - case Result of - {ok, V} -> - V; - - {error, _} -> - Default() - end. - --file("src/gleam/result.gleam", 227). -?DOC( - " Extracts the `Error` value from a result, returning a default value if the result\n" - " is an `Ok`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " unwrap_error(Error(1), 0)\n" - " // -> 1\n" - " ```\n" - "\n" - " ```gleam\n" - " unwrap_error(Ok(\"\"), 0)\n" - " // -> 0\n" - " ```\n" -). --spec unwrap_error({ok, any()} | {error, COI}, COI) -> COI. -unwrap_error(Result, Default) -> - case Result of - {ok, _} -> - Default; - - {error, E} -> - E - end. - --file("src/gleam/result.gleam", 258). -?DOC( - " Returns the first value if it is `Ok`, otherwise returns the second value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " or(Ok(1), Ok(2))\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " or(Ok(1), Error(\"Error 2\"))\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " or(Error(\"Error 1\"), Ok(2))\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " or(Error(\"Error 1\"), Error(\"Error 2\"))\n" - " // -> Error(\"Error 2\")\n" - " ```\n" -). --spec 'or'({ok, COL} | {error, COM}, {ok, COL} | {error, COM}) -> {ok, COL} | - {error, COM}. -'or'(First, Second) -> - case First of - {ok, _} -> - First; - - {error, _} -> - Second - end. - --file("src/gleam/result.gleam", 291). -?DOC( - " Returns the first value if it is `Ok`, otherwise evaluates the given function for a fallback value.\n" - "\n" - " If you need access to the initial error value, use `result.try_recover`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " lazy_or(Ok(1), fn() { Ok(2) })\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " lazy_or(Ok(1), fn() { Error(\"Error 2\") })\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " lazy_or(Error(\"Error 1\"), fn() { Ok(2) })\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " lazy_or(Error(\"Error 1\"), fn() { Error(\"Error 2\") })\n" - " // -> Error(\"Error 2\")\n" - " ```\n" -). --spec lazy_or({ok, COT} | {error, COU}, fun(() -> {ok, COT} | {error, COU})) -> {ok, - COT} | - {error, COU}. -lazy_or(First, Second) -> - case First of - {ok, _} -> - First; - - {error, _} -> - Second() - end. - --file("src/gleam/result.gleam", 317). -?DOC( - " Combines a list of results into a single result.\n" - " If all elements in the list are `Ok` then returns an `Ok` holding the list of values.\n" - " If any element is `Error` then returns the first error.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " all([Ok(1), Ok(2)])\n" - " // -> Ok([1, 2])\n" - " ```\n" - "\n" - " ```gleam\n" - " all([Ok(1), Error(\"e\")])\n" - " // -> Error(\"e\")\n" - " ```\n" -). --spec all(list({ok, CPB} | {error, CPC})) -> {ok, list(CPB)} | {error, CPC}. -all(Results) -> - gleam@list:try_map(Results, fun(Result) -> Result end). - --file("src/gleam/result.gleam", 337). --spec partition_loop(list({ok, CPQ} | {error, CPR}), list(CPQ), list(CPR)) -> {list(CPQ), - list(CPR)}. -partition_loop(Results, Oks, Errors) -> - case Results of - [] -> - {Oks, Errors}; - - [{ok, A} | Rest] -> - partition_loop(Rest, [A | Oks], Errors); - - [{error, E} | Rest@1] -> - partition_loop(Rest@1, Oks, [E | Errors]) - end. - --file("src/gleam/result.gleam", 333). -?DOC( - " Given a list of results, returns a pair where the first element is a list\n" - " of all the values inside `Ok` and the second element is a list with all the\n" - " values inside `Error`. The values in both lists appear in reverse order with\n" - " respect to their position in the original list of results.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " partition([Ok(1), Error(\"a\"), Error(\"b\"), Ok(2)])\n" - " // -> #([2, 1], [\"b\", \"a\"])\n" - " ```\n" -). --spec partition(list({ok, CPJ} | {error, CPK})) -> {list(CPJ), list(CPK)}. -partition(Results) -> - partition_loop(Results, [], []). - --file("src/gleam/result.gleam", 359). -?DOC( - " Replace the value within a result\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " replace(Ok(1), Nil)\n" - " // -> Ok(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " replace(Error(1), Nil)\n" - " // -> Error(1)\n" - " ```\n" -). --spec replace({ok, any()} | {error, CPZ}, CQC) -> {ok, CQC} | {error, CPZ}. -replace(Result, Value) -> - case Result of - {ok, _} -> - {ok, Value}; - - {error, Error} -> - {error, Error} - end. - --file("src/gleam/result.gleam", 380). -?DOC( - " Replace the error within a result\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " replace_error(Error(1), Nil)\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " replace_error(Ok(1), Nil)\n" - " // -> Ok(1)\n" - " ```\n" -). --spec replace_error({ok, CQF} | {error, any()}, CQJ) -> {ok, CQF} | {error, CQJ}. -replace_error(Result, Error) -> - case Result of - {ok, X} -> - {ok, X}; - - {error, _} -> - {error, Error} - end. - --file("src/gleam/result.gleam", 396). -?DOC( - " Given a list of results, returns only the values inside `Ok`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " values([Ok(1), Error(\"a\"), Ok(3)])\n" - " // -> [1, 3]\n" - " ```\n" -). --spec values(list({ok, CQM} | {error, any()})) -> list(CQM). -values(Results) -> - gleam@list:filter_map(Results, fun(Result) -> Result end). - --file("src/gleam/result.gleam", 429). -?DOC( - " Updates a value held within the `Error` of a result by calling a given function\n" - " on it, where the given function also returns a result. The two results are\n" - " then merged together into one result.\n" - "\n" - " If the result is an `Ok` rather than `Error` the function is not called and the\n" - " result stays the same.\n" - "\n" - " This function is useful for chaining together computations that may fail\n" - " and trying to recover from possible errors.\n" - "\n" - " If you do not need access to the initial error value, use `result.lazy_or`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " Ok(1) |> try_recover(with: fn(_) { Error(\"failed to recover\") })\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " Error(1) |> try_recover(with: fn(error) { Ok(error + 1) })\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " Error(1) |> try_recover(with: fn(error) { Error(\"failed to recover\") })\n" - " // -> Error(\"failed to recover\")\n" - " ```\n" -). --spec try_recover( - {ok, CQS} | {error, CQT}, - fun((CQT) -> {ok, CQS} | {error, CQW}) -) -> {ok, CQS} | {error, CQW}. -try_recover(Result, Fun) -> - case Result of - {ok, Value} -> - {ok, Value}; - - {error, Error} -> - Fun(Error) - end. diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache deleted file mode 100644 index cf594498af1af907f444ae247b016ecd94c42cd8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17215 zcmeHO3wRsFo!9KH9$r7B(OQ;m+16Si#0ZCAO+vs2Nt}>6$pIHRaBV_zM7GzC99c4w zOk$ceX@No;pp**-q0l3|KA^lpp#@r6_)0&@5nB4<<0vhJE7w9_P$=cu+;3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GR^HJ6m=)tfj+!g8f`mWQY^GWsk-D=GPuyi)vX_x4l`` z?wXkodqi~6D~_xvnVHzo3A_Jq(jE!Dd#en4K=J+?Hxj#=B)m~bk0mqt#2TW~TuzTm zq|10kD{3oHz3cl6u+5$fJjIdul=H`&Bd)Ky$$pwGFT+S1WHuMg|4Z)c>>V+eXky;t z7EJl+z_Wp3N>7mwu!qD1zZU+FaPb{xG^1>j(eItQgLRnY(fYAAgvFkihjpf4cKYY{ zaLZfH_xbuRue#D+pZTV;ofAQLplCklD;F!p^C>dgJA=6Cm4-j?wXP2)%Jysg{m{Y$Wp;nlBTd#KEuiuP-*yK8^-nc# z*OYb;@^~_(f!=%MYh_f<`igo~&GoJI=EiVu&>j?%+ZDOg-dalnl&TZltH3Sos+Z~V z7+oHr%jZx7uLMUrl2=OF+prbhhYj&QY=veyh7v^?)V8C&9qsM%$F(QXeiC~9NjX?F zgHizk8|-Jlz--2F*4J9%xcInH(pDf4vIOP->%-ay$fQQ8nM>8}(oSA&lXu|k3%gvo zf~&qSIls)M&cn{{@M@`hIgX&P=RD7I1w|?pE{1ojS8}chS4FB&?Wwtji-)^?U*)p- zH@@HVYPEk2ml8Yu=ke-Q?RBpF!?lrGRF?+6$i??Vfroje2CF%n%nBaKD;7MCS6>T0 zz^f;M-{;lOgD>#vmEiAqwY%X;&QNzX+{3F!8Xo1L*WylGkG->8s^pGP5YZr z9ccO`ug+}w7cOQ-TekA*neflTs9q1h$t$Ps!C?%xCi2fV@+|J-N94+7I_xt(-hAnJ z$;7gFv$m^V;@YiE=(wpr0rIDx#oafmx9~lzsq*tZtf}?$ow+@5cYr9YOZu2SGJglV zt5)K}!fKh~6L((E6WN3f@@OJqFZh1RiSQbK>6ow!@IIl%bU1WV#P%2CSjztZNqHp; diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache_inline b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache_inline deleted file mode 100644 index 1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 KcmZQzfB*mh2mk>9 diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache_meta b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@set.cache_meta deleted file mode 100644 index 12084ea737c25aa725f6d693206f5c24b6a20203..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1785 zcmY+^YfRQv7y$4C7NrK18W@^}rE@x_q|kCoqPWn^tz2798@agbO{nyJODIe#T^CGS z>C%>^A}?1M~2bLohQm$bQ7R%$aZb16wC*|Hy#FFo6D|MNe$ojrTb*}JnK61pR< zM|Y!F_qU|9Xl~i4!pKvxu8uqT|43;h8XKf{6t~b7*Vim4iauW&8|{BGGmk#Jz4P$C z{Ey?BLv7MheNz#oW^kE3Y7{df+P{2GEvY6L6KuC};dXUBa6cM3=DS<9LxZtYb3` zG!ha+=t&}T*uWXi^A91(7{e$bMkQ6eO�$mEXxp4q+m>ETe%f9OF0_=^*Y_wL}_| zDd7dGd5`z0qnY36BMoy%XlWToV}dnG-o+ScHa3zF8U?5pcXEvq8C}$u45>n)XDNH5GLSCnu z)g0k87q~=js&i69Ep>E~+238Fl;>DLls$aIA6zEk4sQaf%%X&6iSh>P*}*}sF)Gd8 z+)EX!`H;= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --opaque set(CVJ) :: {set, gleam@dict:dict(CVJ, list(nil))}. - --file("src/gleam/set.gleam", 32). -?DOC(" Creates a new empty set.\n"). --spec new() -> set(any()). -new() -> - {set, maps:new()}. - --file("src/gleam/set.gleam", 50). -?DOC( - " Gets the number of members in a set.\n" - "\n" - " This function runs in constant time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new()\n" - " |> insert(1)\n" - " |> insert(2)\n" - " |> size\n" - " // -> 2\n" - " ```\n" -). --spec size(set(any())) -> integer(). -size(Set) -> - maps:size(erlang:element(2, Set)). - --file("src/gleam/set.gleam", 68). -?DOC( - " Determines whether or not the set is empty.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new() |> is_empty\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " new() |> insert(1) |> is_empty\n" - " // -> False\n" - " ```\n" -). --spec is_empty(set(any())) -> boolean(). -is_empty(Set) -> - Set =:= new(). - --file("src/gleam/set.gleam", 110). -?DOC( - " Checks whether a set contains a given member.\n" - "\n" - " This function runs in logarithmic time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new()\n" - " |> insert(2)\n" - " |> contains(2)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " new()\n" - " |> insert(2)\n" - " |> contains(1)\n" - " // -> False\n" - " ```\n" -). --spec contains(set(CVU), CVU) -> boolean(). -contains(Set, Member) -> - _pipe = erlang:element(2, Set), - _pipe@1 = gleam_stdlib:map_get(_pipe, Member), - gleam@result:is_ok(_pipe@1). - --file("src/gleam/set.gleam", 131). -?DOC( - " Removes a member from a set. If the set does not contain the member then\n" - " the set is returned unchanged.\n" - "\n" - " This function runs in logarithmic time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new()\n" - " |> insert(2)\n" - " |> delete(2)\n" - " |> contains(1)\n" - " // -> False\n" - " ```\n" -). --spec delete(set(CVW), CVW) -> set(CVW). -delete(Set, Member) -> - {set, gleam@dict:delete(erlang:element(2, Set), Member)}. - --file("src/gleam/set.gleam", 149). -?DOC( - " Converts the set into a list of the contained members.\n" - "\n" - " The list has no specific ordering, any unintentional ordering may change in\n" - " future versions of Gleam or Erlang.\n" - "\n" - " This function runs in linear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new() |> insert(2) |> to_list\n" - " // -> [2]\n" - " ```\n" -). --spec to_list(set(CVZ)) -> list(CVZ). -to_list(Set) -> - maps:keys(erlang:element(2, Set)). - --file("src/gleam/set.gleam", 190). -?DOC( - " Combines all entries into a single value by calling a given function on each\n" - " one.\n" - "\n" - " Sets are not ordered so the values are not returned in any specific order.\n" - " Do not write code that relies on the order entries are used by this\n" - " function as it may change in later versions of Gleam or Erlang.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([1, 3, 9])\n" - " |> fold(0, fn(accumulator, member) { accumulator + member })\n" - " // -> 13\n" - " ```\n" -). --spec fold(set(CWF), CWH, fun((CWH, CWF) -> CWH)) -> CWH. -fold(Set, Initial, Reducer) -> - gleam@dict:fold( - erlang:element(2, Set), - Initial, - fun(A, K, _) -> Reducer(A, K) end - ). - --file("src/gleam/set.gleam", 214). -?DOC( - " Creates a new set from an existing set, minus any members that a given\n" - " function returns `False` for.\n" - "\n" - " This function runs in loglinear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - "\n" - " from_list([1, 4, 6, 3, 675, 44, 67])\n" - " |> filter(keeping: int.is_even)\n" - " |> to_list\n" - " // -> [4, 6, 44]\n" - " ```\n" -). --spec filter(set(CWI), fun((CWI) -> boolean())) -> set(CWI). -filter(Set, Predicate) -> - {set, - gleam@dict:filter(erlang:element(2, Set), fun(M, _) -> Predicate(M) end)}. - --file("src/gleam/set.gleam", 251). -?DOC( - " Creates a new set from a given set with all the same entries except any\n" - " entry found on the given list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([1, 2, 3, 4])\n" - " |> drop([1, 3])\n" - " |> to_list\n" - " // -> [2, 4]\n" - " ```\n" -). --spec drop(set(CWP), list(CWP)) -> set(CWP). -drop(Set, Disallowed) -> - gleam@list:fold(Disallowed, Set, fun delete/2). - --file("src/gleam/set.gleam", 269). -?DOC( - " Creates a new set from a given set, only including any members which are in\n" - " a given list.\n" - "\n" - " This function runs in loglinear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([1, 2, 3])\n" - " |> take([1, 3, 5])\n" - " |> to_list\n" - " // -> [1, 3]\n" - " ```\n" -). --spec take(set(CWT), list(CWT)) -> set(CWT). -take(Set, Desired) -> - {set, gleam@dict:take(erlang:element(2, Set), Desired)}. - --file("src/gleam/set.gleam", 289). --spec order(set(CXB), set(CXB)) -> {set(CXB), set(CXB)}. -order(First, Second) -> - case maps:size(erlang:element(2, First)) > maps:size( - erlang:element(2, Second) - ) of - true -> - {First, Second}; - - false -> - {Second, First} - end. - --file("src/gleam/set.gleam", 307). -?DOC( - " Creates a new set that contains members that are present in both given sets.\n" - "\n" - " This function runs in loglinear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " intersection(from_list([1, 2]), from_list([2, 3])) |> to_list\n" - " // -> [2]\n" - " ```\n" -). --spec intersection(set(CXG), set(CXG)) -> set(CXG). -intersection(First, Second) -> - {Larger, Smaller} = order(First, Second), - take(Larger, to_list(Smaller)). - --file("src/gleam/set.gleam", 325). -?DOC( - " Creates a new set that contains members that are present in the first set\n" - " but not the second.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " difference(from_list([1, 2]), from_list([2, 3, 4])) |> to_list\n" - " // -> [1]\n" - " ```\n" -). --spec difference(set(CXK), set(CXK)) -> set(CXK). -difference(First, Second) -> - drop(First, to_list(Second)). - --file("src/gleam/set.gleam", 346). -?DOC( - " Determines if a set is fully contained by another.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_subset(from_list([1]), from_list([1, 2]))\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " is_subset(from_list([1, 2, 3]), from_list([3, 4, 5]))\n" - " // -> False\n" - " ```\n" -). --spec is_subset(set(CXO), set(CXO)) -> boolean(). -is_subset(First, Second) -> - intersection(First, Second) =:= First. - --file("src/gleam/set.gleam", 364). -?DOC( - " Determines if two sets contain no common members\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_disjoint(from_list([1, 2, 3]), from_list([4, 5, 6]))\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " is_disjoint(from_list([1, 2, 3]), from_list([3, 4, 5]))\n" - " // -> False\n" - " ```\n" -). --spec is_disjoint(set(CXR), set(CXR)) -> boolean(). -is_disjoint(First, Second) -> - intersection(First, Second) =:= new(). - --file("src/gleam/set.gleam", 408). -?DOC( - " Calls a function for each member in a set, discarding the return\n" - " value.\n" - "\n" - " Useful for producing a side effect for every item of a set.\n" - "\n" - " The order of elements in the iteration is an implementation detail that\n" - " should not be relied upon.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let set = from_list([\"apple\", \"banana\", \"cherry\"])\n" - "\n" - " each(set, io.println)\n" - " // -> Nil\n" - " // apple\n" - " // banana\n" - " // cherry\n" - " ```\n" -). --spec each(set(CXY), fun((CXY) -> any())) -> nil. -each(Set, Fun) -> - fold( - Set, - nil, - fun(Nil, Member) -> - Fun(Member), - Nil - end - ). - --file("src/gleam/set.gleam", 86). -?DOC( - " Inserts a member into the set.\n" - "\n" - " This function runs in logarithmic time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new()\n" - " |> insert(1)\n" - " |> insert(2)\n" - " |> size\n" - " // -> 2\n" - " ```\n" -). --spec insert(set(CVR), CVR) -> set(CVR). -insert(Set, Member) -> - {set, gleam@dict:insert(erlang:element(2, Set), Member, [])}. - --file("src/gleam/set.gleam", 167). -?DOC( - " Creates a new set of the members in a given list.\n" - "\n" - " This function runs in loglinear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - " import gleam/list\n" - "\n" - " [1, 1, 2, 4, 3, 2] |> from_list |> to_list |> list.sort(by: int.compare)\n" - " // -> [1, 2, 3, 4]\n" - " ```\n" -). --spec from_list(list(CWC)) -> set(CWC). -from_list(Members) -> - Dict = gleam@list:fold( - Members, - maps:new(), - fun(M, K) -> gleam@dict:insert(M, K, []) end - ), - {set, Dict}. - --file("src/gleam/set.gleam", 233). -?DOC( - " Creates a new set from a given set with the result of applying the given\n" - " function to each member.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([1, 2, 3, 4])\n" - " |> map(with: fn(x) { x * 2 })\n" - " |> to_list\n" - " // -> [2, 4, 6, 8]\n" - " ```\n" -). --spec map(set(CWL), fun((CWL) -> CWN)) -> set(CWN). -map(Set, Fun) -> - fold(Set, new(), fun(Acc, Member) -> insert(Acc, Fun(Member)) end). - --file("src/gleam/set.gleam", 284). -?DOC( - " Creates a new set that contains all members of both given sets.\n" - "\n" - " This function runs in loglinear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " union(from_list([1, 2]), from_list([2, 3])) |> to_list\n" - " // -> [1, 2, 3]\n" - " ```\n" -). --spec union(set(CWX), set(CWX)) -> set(CWX). -union(First, Second) -> - {Larger, Smaller} = order(First, Second), - fold(Smaller, Larger, fun insert/2). - --file("src/gleam/set.gleam", 378). -?DOC( - " Creates a new set that contains members that are present in either set, but\n" - " not both.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " symmetric_difference(from_list([1, 2, 3]), from_list([3, 4])) |> to_list\n" - " // -> [1, 2, 4]\n" - " ```\n" -). --spec symmetric_difference(set(CXU), set(CXU)) -> set(CXU). -symmetric_difference(First, Second) -> - difference(union(First, Second), intersection(First, Second)). diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.cache deleted file mode 100644 index 676af3f94abbb05a82ed795c34e922b3829d5ee0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 38471 zcmeHw34B!5y?^dZk_kgXax(;yK*-HN_I2hYEE6CLBq2MK1hi0_Op+m)kj#Xc30t*N z>PodwdA7B5(Nf%~RUf6T54RR;MQg2((rTqzrL|hCeTrSIPtE`PJNMpMZ$d=7y#ME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MAM#YKtCrNU7w*3VvF6sPC zCyJ}+{kHI(=vm!^;!7KE+9+=Yv~`|aM#77|&6zZTIkqL#?PZO&Miib_FFo)~`%CSL z9z#6{g*w{N8{k9EP!PC|Rz5)3`cmb=%5eQhcBdB!b?RbuFmaHh8p}z{OAIs}VyFmv zuWsZ6bmD7&LG$nS#BWdr+3fb$tFb=c$$daUf4tAZ7=H~`h2+JM?{f7wVWhU zJh}4cBo1XZX3=cyS@)TBC=PABO_^K8Iddk{`(BQorq^IgqUkj^7EptIty^e%f7bp> zb$ZpKwes?TXvE)oCvNz1^VgeY#787_sgraRC%Rmi`6rrtcIEGAls~R{n%2Rp+Gbh@ zPt-m`#Y?qsQqkM6l~zSzV-+XMb)Q@(Kc72^&SdTgnUZ}t6D{HW$}LeTQsm4uQ8k8xiclqnQUI!(P ORu>v7e7E+&+W!X}BCHeu diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.cache_inline b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.cache_inline deleted file mode 100644 index 1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 KcmZQzfB*mh2mk>9 diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.cache_meta b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.cache_meta deleted file mode 100644 index 9be6bb1b82e6b9cb6d05da5b4bebf697be9fe2eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4057 zcmY+`36#&(9suy)EM*%MWl8qzyG+*5BFl^!q#-&aCQH^aDYBLkrA|qtC=xSXGGu!6 z$mro2C3&_{lcg9-=w+seEblX?IsbFI=X}opo_p`_{_g+Y@4ff8W6QwdL17AuEX))y z{2e+nanPtHBZrSqo}}beqW)GhW^D5CF{9@y`uRpXPBhL0XP z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*pRwBEydrJ{u7>E!4~Np|XadUVaTd z`%|d)4e?u$BE!#y`r8@G<%Ie>5PJ4#D3=q;<%Zhr36)(h%teNe3%%{@P;GXoHa}FB Q8!BsDIOd43A46sT2NDOClK=n! diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.erl b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.erl deleted file mode 100644 index d6465db..0000000 --- a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string.erl +++ /dev/null @@ -1,1012 +0,0 @@ --module(gleam@string). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/string.gleam"). --export([is_empty/1, length/1, reverse/1, replace/3, lowercase/1, uppercase/1, compare/2, slice/3, crop/2, drop_end/2, contains/2, starts_with/2, ends_with/2, split_once/2, append/2, concat/1, repeat/2, join/2, pad_start/3, pad_end/3, trim_start/1, trim_end/1, trim/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, drop_start/2]). --export_type([direction/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " Strings in Gleam are UTF-8 binaries. They can be written in your code as\n" - " text surrounded by `\"double quotes\"`.\n" -). - --type direction() :: leading | trailing. - --file("src/gleam/string.gleam", 23). -?DOC( - " Determines if a `String` is empty.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_empty(\"\")\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " is_empty(\"the world\")\n" - " // -> False\n" - " ```\n" -). --spec is_empty(binary()) -> boolean(). -is_empty(Str) -> - Str =:= <<""/utf8>>. - --file("src/gleam/string.gleam", 51). -?DOC( - " Gets the number of grapheme clusters in a given `String`.\n" - "\n" - " This function has to iterate across the whole string to count the number of\n" - " graphemes, so it runs in linear time. Avoid using this in a loop.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " length(\"Gleam\")\n" - " // -> 5\n" - " ```\n" - "\n" - " ```gleam\n" - " length(\"ß↑e̊\")\n" - " // -> 3\n" - " ```\n" - "\n" - " ```gleam\n" - " length(\"\")\n" - " // -> 0\n" - " ```\n" -). --spec length(binary()) -> integer(). -length(String) -> - string:length(String). - --file("src/gleam/string.gleam", 65). -?DOC( - " Reverses a `String`.\n" - "\n" - " This function has to iterate across the whole `String` so it runs in linear\n" - " time. Avoid using this in a loop.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " reverse(\"stressed\")\n" - " // -> \"desserts\"\n" - " ```\n" -). --spec reverse(binary()) -> binary(). -reverse(String) -> - _pipe = String, - _pipe@1 = gleam_stdlib:identity(_pipe), - _pipe@2 = string:reverse(_pipe@1), - unicode:characters_to_binary(_pipe@2). - --file("src/gleam/string.gleam", 86). -?DOC( - " Creates a new `String` by replacing all occurrences of a given substring.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " replace(\"www.example.com\", each: \".\", with: \"-\")\n" - " // -> \"www-example-com\"\n" - " ```\n" - "\n" - " ```gleam\n" - " replace(\"a,b,c,d,e\", each: \",\", with: \"/\")\n" - " // -> \"a/b/c/d/e\"\n" - " ```\n" -). --spec replace(binary(), binary(), binary()) -> binary(). -replace(String, Pattern, Substitute) -> - _pipe = String, - _pipe@1 = gleam_stdlib:identity(_pipe), - _pipe@2 = gleam_stdlib:string_replace(_pipe@1, Pattern, Substitute), - unicode:characters_to_binary(_pipe@2). - --file("src/gleam/string.gleam", 111). -?DOC( - " Creates a new `String` with all the graphemes in the input `String` converted to\n" - " lowercase.\n" - "\n" - " Useful for case-insensitive comparisons.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " lowercase(\"X-FILES\")\n" - " // -> \"x-files\"\n" - " ```\n" -). --spec lowercase(binary()) -> binary(). -lowercase(String) -> - string:lowercase(String). - --file("src/gleam/string.gleam", 127). -?DOC( - " Creates a new `String` with all the graphemes in the input `String` converted to\n" - " uppercase.\n" - "\n" - " Useful for case-insensitive comparisons and VIRTUAL YELLING.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " uppercase(\"skinner\")\n" - " // -> \"SKINNER\"\n" - " ```\n" -). --spec uppercase(binary()) -> binary(). -uppercase(String) -> - string:uppercase(String). - --file("src/gleam/string.gleam", 145). -?DOC( - " Compares two `String`s to see which is \"larger\" by comparing their graphemes.\n" - "\n" - " This does not compare the size or length of the given `String`s.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " compare(\"Anthony\", \"Anthony\")\n" - " // -> order.Eq\n" - " ```\n" - "\n" - " ```gleam\n" - " compare(\"A\", \"B\")\n" - " // -> order.Lt\n" - " ```\n" -). --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; - - false -> - gt - end - end. - --file("src/gleam/string.gleam", 194). -?DOC( - " Takes a substring given a start grapheme index and a length. Negative indexes\n" - " are taken starting from the *end* of the string.\n" - "\n" - " This function runs in linear time with the size of the index and the\n" - " length. Negative indexes are linear with the size of the input string in\n" - " addition to the other costs.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " slice(from: \"gleam\", at_index: 1, length: 2)\n" - " // -> \"le\"\n" - " ```\n" - "\n" - " ```gleam\n" - " slice(from: \"gleam\", at_index: 1, length: 10)\n" - " // -> \"leam\"\n" - " ```\n" - "\n" - " ```gleam\n" - " slice(from: \"gleam\", at_index: 10, length: 3)\n" - " // -> \"\"\n" - " ```\n" - "\n" - " ```gleam\n" - " slice(from: \"gleam\", at_index: -2, length: 2)\n" - " // -> \"am\"\n" - " ```\n" - "\n" - " ```gleam\n" - " slice(from: \"gleam\", at_index: -12, length: 2)\n" - " // -> \"\"\n" - " ```\n" -). --spec slice(binary(), integer(), integer()) -> binary(). -slice(String, Idx, Len) -> - case Len =< 0 of - true -> - <<""/utf8>>; - - false -> - case Idx < 0 of - true -> - Translated_idx = string:length(String) + Idx, - case Translated_idx < 0 of - true -> - <<""/utf8>>; - - false -> - gleam_stdlib:slice(String, Translated_idx, Len) - end; - - false -> - gleam_stdlib:slice(String, Idx, Len) - end - end. - --file("src/gleam/string.gleam", 232). -?DOC( - " Drops contents of the first `String` that occur before the second `String`.\n" - " If the `from` string does not contain the `before` string, `from` is\n" - " returned unchanged.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " crop(from: \"The Lone Gunmen\", before: \"Lone\")\n" - " // -> \"Lone Gunmen\"\n" - " ```\n" -). --spec crop(binary(), binary()) -> binary(). -crop(String, Substring) -> - gleam_stdlib:crop_string(String, Substring). - --file("src/gleam/string.gleam", 268). -?DOC( - " Drops *n* graphemes from the end of a `String`.\n" - "\n" - " This function traverses the full string, so it runs in linear time with the\n" - " size of the string. Avoid using this in a loop.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " drop_end(from: \"Cigarette Smoking Man\", up_to: 2)\n" - " // -> \"Cigarette Smoking M\"\n" - " ```\n" -). --spec drop_end(binary(), integer()) -> binary(). -drop_end(String, Num_graphemes) -> - case Num_graphemes =< 0 of - true -> - String; - - false -> - slice(String, 0, string:length(String) - Num_graphemes) - end. - --file("src/gleam/string.gleam", 296). -?DOC( - " Checks if the first `String` contains the second.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " contains(does: \"theory\", contain: \"ory\")\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " contains(does: \"theory\", contain: \"the\")\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " contains(does: \"theory\", contain: \"THE\")\n" - " // -> False\n" - " ```\n" -). --spec contains(binary(), binary()) -> boolean(). -contains(Haystack, Needle) -> - gleam_stdlib:contains_string(Haystack, Needle). - --file("src/gleam/string.gleam", 309). -?DOC( - " Checks whether the first `String` starts with the second one.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " starts_with(\"theory\", \"ory\")\n" - " // -> False\n" - " ```\n" -). --spec starts_with(binary(), binary()) -> boolean(). -starts_with(String, Prefix) -> - gleam_stdlib:string_starts_with(String, Prefix). - --file("src/gleam/string.gleam", 322). -?DOC( - " Checks whether the first `String` ends with the second one.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " ends_with(\"theory\", \"ory\")\n" - " // -> True\n" - " ```\n" -). --spec ends_with(binary(), binary()) -> boolean(). -ends_with(String, Suffix) -> - gleam_stdlib:string_ends_with(String, Suffix). - --file("src/gleam/string.gleam", 361). -?DOC( - " Splits a `String` a single time on the given substring.\n" - "\n" - " Returns an `Error` if substring not present.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " split_once(\"home/gleam/desktop/\", on: \"/\")\n" - " // -> Ok(#(\"home\", \"gleam/desktop/\"))\n" - " ```\n" - "\n" - " ```gleam\n" - " split_once(\"home/gleam/desktop/\", on: \"?\")\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec split_once(binary(), binary()) -> {ok, {binary(), binary()}} | - {error, nil}. -split_once(String, Substring) -> - case string:split(String, Substring) of - [First, Rest] -> - {ok, {First, Rest}}; - - _ -> - {error, nil} - end. - --file("src/gleam/string.gleam", 392). -?DOC( - " Creates a new `String` by joining two `String`s together.\n" - "\n" - " This function typically copies both `String`s and runs in linear time, but\n" - " the exact behaviour will depend on how the runtime you are using optimises\n" - " your code. Benchmark and profile your code if you need to understand its\n" - " performance better.\n" - "\n" - " If you are joining together large string and want to avoid copying any data\n" - " you may want to investigate using the [`string_tree`](../gleam/string_tree.html)\n" - " module.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " append(to: \"butter\", suffix: \"fly\")\n" - " // -> \"butterfly\"\n" - " ```\n" -). --spec append(binary(), binary()) -> binary(). -append(First, Second) -> - <>. - --file("src/gleam/string.gleam", 412). --spec concat_loop(list(binary()), binary()) -> binary(). -concat_loop(Strings, Accumulator) -> - case Strings of - [String | Strings@1] -> - concat_loop(Strings@1, <>); - - [] -> - Accumulator - end. - --file("src/gleam/string.gleam", 408). -?DOC( - " Creates a new `String` by joining many `String`s together.\n" - "\n" - " This function copies all the `String`s and runs in linear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " concat([\"never\", \"the\", \"less\"])\n" - " // -> \"nevertheless\"\n" - " ```\n" -). --spec concat(list(binary())) -> binary(). -concat(Strings) -> - erlang:list_to_binary(Strings). - --file("src/gleam/string.gleam", 437). --spec repeat_loop(integer(), binary(), binary()) -> binary(). -repeat_loop(Times, Doubling_acc, Acc) -> - Acc@1 = case Times rem 2 of - 0 -> - Acc; - - _ -> - <> - end, - Times@1 = Times div 2, - case Times@1 =< 0 of - true -> - Acc@1; - - false -> - repeat_loop( - Times@1, - <>, - Acc@1 - ) - end. - --file("src/gleam/string.gleam", 430). -?DOC( - " Creates a new `String` by repeating a `String` a given number of times.\n" - "\n" - " This function runs in loglinear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " repeat(\"ha\", times: 3)\n" - " // -> \"hahaha\"\n" - " ```\n" -). --spec repeat(binary(), integer()) -> binary(). -repeat(String, Times) -> - case Times =< 0 of - true -> - <<""/utf8>>; - - false -> - repeat_loop(Times, String, <<""/utf8>>) - end. - --file("src/gleam/string.gleam", 467). --spec join_loop(list(binary()), binary(), binary()) -> binary(). -join_loop(Strings, Separator, Accumulator) -> - case Strings of - [] -> - Accumulator; - - [String | Strings@1] -> - join_loop( - Strings@1, - Separator, - <<<>/binary, - String/binary>> - ) - end. - --file("src/gleam/string.gleam", 460). -?DOC( - " Joins many `String`s together with a given separator.\n" - "\n" - " This function runs in linear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " join([\"home\",\"evan\",\"Desktop\"], with: \"/\")\n" - " // -> \"home/evan/Desktop\"\n" - " ```\n" -). --spec join(list(binary()), binary()) -> binary(). -join(Strings, Separator) -> - case Strings of - [] -> - <<""/utf8>>; - - [First | Rest] -> - join_loop(Rest, Separator, First) - end. - --file("src/gleam/string.gleam", 545). --spec padding(integer(), binary()) -> binary(). -padding(Size, Pad_string) -> - Pad_string_length = string:length(Pad_string), - Num_pads = case Pad_string_length of - 0 -> 0; - Gleam@denominator -> Size div Gleam@denominator - end, - Extra = case Pad_string_length of - 0 -> 0; - Gleam@denominator@1 -> Size rem Gleam@denominator@1 - end, - <<(repeat(Pad_string, Num_pads))/binary, - (slice(Pad_string, 0, Extra))/binary>>. - --file("src/gleam/string.gleam", 498). -?DOC( - " Pads the start of a `String` until it has a given length.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " pad_start(\"121\", to: 5, with: \".\")\n" - " // -> \"..121\"\n" - " ```\n" - "\n" - " ```gleam\n" - " pad_start(\"121\", to: 3, with: \".\")\n" - " // -> \"121\"\n" - " ```\n" - "\n" - " ```gleam\n" - " pad_start(\"121\", to: 2, with: \".\")\n" - " // -> \"121\"\n" - " ```\n" -). --spec pad_start(binary(), integer(), binary()) -> binary(). -pad_start(String, Desired_length, Pad_string) -> - Current_length = string:length(String), - To_pad_length = Desired_length - Current_length, - case To_pad_length =< 0 of - true -> - String; - - false -> - <<(padding(To_pad_length, Pad_string))/binary, String/binary>> - end. - --file("src/gleam/string.gleam", 531). -?DOC( - " Pads the end of a `String` until it has a given length.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " pad_end(\"123\", to: 5, with: \".\")\n" - " // -> \"123..\"\n" - " ```\n" - "\n" - " ```gleam\n" - " pad_end(\"123\", to: 3, with: \".\")\n" - " // -> \"123\"\n" - " ```\n" - "\n" - " ```gleam\n" - " pad_end(\"123\", to: 2, with: \".\")\n" - " // -> \"123\"\n" - " ```\n" -). --spec pad_end(binary(), integer(), binary()) -> binary(). -pad_end(String, Desired_length, Pad_string) -> - Current_length = string:length(String), - To_pad_length = Desired_length - Current_length, - case To_pad_length =< 0 of - true -> - String; - - false -> - <> - end. - --file("src/gleam/string.gleam", 589). -?DOC( - " Removes whitespace at the start of a `String`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " trim_start(\" hats \\n\")\n" - " // -> \"hats \\n\"\n" - " ```\n" -). --spec trim_start(binary()) -> binary(). -trim_start(String) -> - string:trim(String, leading). - --file("src/gleam/string.gleam", 603). -?DOC( - " Removes whitespace at the end of a `String`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " trim_end(\" hats \\n\")\n" - " // -> \" hats\"\n" - " ```\n" -). --spec trim_end(binary()) -> binary(). -trim_end(String) -> - string:trim(String, trailing). - --file("src/gleam/string.gleam", 567). -?DOC( - " Removes whitespace on both sides of a `String`.\n" - "\n" - " Whitespace in this function is the set of nonbreakable whitespace\n" - " codepoints, defined as Pattern_White_Space in [Unicode Standard Annex #31][1].\n" - "\n" - " [1]: https://unicode.org/reports/tr31/\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " trim(\" hats \\n\")\n" - " // -> \"hats\"\n" - " ```\n" -). --spec trim(binary()) -> binary(). -trim(String) -> - _pipe = String, - _pipe@1 = trim_start(_pipe), - trim_end(_pipe@1). - --file("src/gleam/string.gleam", 630). -?DOC( - " Splits a non-empty `String` into its first element (head) and rest (tail).\n" - " This lets you pattern match on `String`s exactly as you would with lists.\n" - "\n" - " ## Performance\n" - "\n" - " There is a notable overhead to using this function, so you may not want to\n" - " use it in a tight loop. If you wish to efficiently parse a string you may\n" - " want to use alternatives such as the [splitter package](https://hex.pm/packages/splitter).\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " pop_grapheme(\"gleam\")\n" - " // -> Ok(#(\"g\", \"leam\"))\n" - " ```\n" - "\n" - " ```gleam\n" - " pop_grapheme(\"\")\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec pop_grapheme(binary()) -> {ok, {binary(), binary()}} | {error, nil}. -pop_grapheme(String) -> - gleam_stdlib:string_pop_grapheme(String). - --file("src/gleam/string.gleam", 647). --spec to_graphemes_loop(binary(), list(binary())) -> list(binary()). -to_graphemes_loop(String, Acc) -> - case gleam_stdlib:string_pop_grapheme(String) of - {ok, {Grapheme, Rest}} -> - to_graphemes_loop(Rest, [Grapheme | Acc]); - - {error, _} -> - Acc - end. - --file("src/gleam/string.gleam", 641). -?DOC( - " Converts a `String` to a list of\n" - " [graphemes](https://en.wikipedia.org/wiki/Grapheme).\n" - "\n" - " ```gleam\n" - " to_graphemes(\"abc\")\n" - " // -> [\"a\", \"b\", \"c\"]\n" - " ```\n" -). --spec to_graphemes(binary()) -> list(binary()). -to_graphemes(String) -> - _pipe = String, - _pipe@1 = to_graphemes_loop(_pipe, []), - lists:reverse(_pipe@1). - --file("src/gleam/string.gleam", 333). -?DOC( - " Creates a list of `String`s by splitting a given string on a given substring.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " split(\"home/gleam/desktop/\", on: \"/\")\n" - " // -> [\"home\", \"gleam\", \"desktop\", \"\"]\n" - " ```\n" -). --spec split(binary(), binary()) -> list(binary()). -split(X, Substring) -> - case Substring of - <<""/utf8>> -> - to_graphemes(X); - - _ -> - _pipe = X, - _pipe@1 = gleam_stdlib:identity(_pipe), - _pipe@2 = gleam@string_tree:split(_pipe@1, Substring), - gleam@list:map(_pipe@2, fun unicode:characters_to_binary/1) - end. - --file("src/gleam/string.gleam", 694). --spec to_utf_codepoints_loop(bitstring(), list(integer())) -> list(integer()). -to_utf_codepoints_loop(Bit_array, Acc) -> - case Bit_array of - <> -> - to_utf_codepoints_loop(Rest, [First | Acc]); - - _ -> - lists:reverse(Acc) - end. - --file("src/gleam/string.gleam", 689). --spec do_to_utf_codepoints(binary()) -> list(integer()). -do_to_utf_codepoints(String) -> - to_utf_codepoints_loop(<>, []). - --file("src/gleam/string.gleam", 684). -?DOC( - " Converts a `String` to a `List` of `UtfCodepoint`.\n" - "\n" - " See and\n" - " for an\n" - " explanation on code points.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " \"a\" |> to_utf_codepoints\n" - " // -> [UtfCodepoint(97)]\n" - " ```\n" - "\n" - " ```gleam\n" - " // Semantically the same as:\n" - " // [\"🏳\", \"️\", \"‍\", \"🌈\"] or:\n" - " // [waving_white_flag, variant_selector_16, zero_width_joiner, rainbow]\n" - " \"🏳️‍🌈\" |> to_utf_codepoints\n" - " // -> [\n" - " // UtfCodepoint(127987),\n" - " // UtfCodepoint(65039),\n" - " // UtfCodepoint(8205),\n" - " // UtfCodepoint(127752),\n" - " // ]\n" - " ```\n" -). --spec to_utf_codepoints(binary()) -> list(integer()). -to_utf_codepoints(String) -> - do_to_utf_codepoints(String). - --file("src/gleam/string.gleam", 734). -?DOC( - " Converts a `List` of `UtfCodepoint`s to a `String`.\n" - "\n" - " See and\n" - " for an\n" - " explanation on code points.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let assert Ok(a) = utf_codepoint(97)\n" - " let assert Ok(b) = utf_codepoint(98)\n" - " let assert Ok(c) = utf_codepoint(99)\n" - " from_utf_codepoints([a, b, c])\n" - " // -> \"abc\"\n" - " ```\n" -). --spec from_utf_codepoints(list(integer())) -> binary(). -from_utf_codepoints(Utf_codepoints) -> - gleam_stdlib:utf_codepoint_list_to_string(Utf_codepoints). - --file("src/gleam/string.gleam", 740). -?DOC( - " Converts an integer to a `UtfCodepoint`.\n" - "\n" - " Returns an `Error` if the integer does not represent a valid UTF codepoint.\n" -). --spec utf_codepoint(integer()) -> {ok, integer()} | {error, nil}. -utf_codepoint(Value) -> - case Value of - I when I > 1114111 -> - {error, nil}; - - I@1 when (I@1 >= 55296) andalso (I@1 =< 57343) -> - {error, nil}; - - I@2 when I@2 < 0 -> - {error, nil}; - - I@3 -> - {ok, gleam_stdlib:identity(I@3)} - end. - --file("src/gleam/string.gleam", 761). -?DOC( - " Converts a `UtfCodepoint` to its ordinal code point value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let assert [utf_codepoint, ..] = to_utf_codepoints(\"💜\")\n" - " utf_codepoint_to_int(utf_codepoint)\n" - " // -> 128156\n" - " ```\n" -). --spec utf_codepoint_to_int(integer()) -> integer(). -utf_codepoint_to_int(Cp) -> - gleam_stdlib:identity(Cp). - --file("src/gleam/string.gleam", 778). -?DOC( - " Converts a `String` into `Option(String)` where an empty `String` becomes\n" - " `None`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_option(\"\")\n" - " // -> None\n" - " ```\n" - "\n" - " ```gleam\n" - " to_option(\"hats\")\n" - " // -> Some(\"hats\")\n" - " ```\n" -). --spec to_option(binary()) -> gleam@option:option(binary()). -to_option(String) -> - case String of - <<""/utf8>> -> - none; - - _ -> - {some, String} - end. - --file("src/gleam/string.gleam", 801). -?DOC( - " Returns the first grapheme cluster in a given `String` and wraps it in a\n" - " `Result(String, Nil)`. If the `String` is empty, it returns `Error(Nil)`.\n" - " Otherwise, it returns `Ok(String)`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " first(\"\")\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " first(\"icecream\")\n" - " // -> Ok(\"i\")\n" - " ```\n" -). --spec first(binary()) -> {ok, binary()} | {error, nil}. -first(String) -> - case gleam_stdlib:string_pop_grapheme(String) of - {ok, {First, _}} -> - {ok, First}; - - {error, E} -> - {error, E} - end. - --file("src/gleam/string.gleam", 827). -?DOC( - " Returns the last grapheme cluster in a given `String` and wraps it in a\n" - " `Result(String, Nil)`. If the `String` is empty, it returns `Error(Nil)`.\n" - " Otherwise, it returns `Ok(String)`.\n" - "\n" - " This function traverses the full string, so it runs in linear time with the\n" - " length of the string. Avoid using this in a loop.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " last(\"\")\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " last(\"icecream\")\n" - " // -> Ok(\"m\")\n" - " ```\n" -). --spec last(binary()) -> {ok, binary()} | {error, nil}. -last(String) -> - case gleam_stdlib:string_pop_grapheme(String) of - {ok, {First, <<""/utf8>>}} -> - {ok, First}; - - {ok, {_, Rest}} -> - {ok, slice(Rest, -1, 1)}; - - {error, E} -> - {error, E} - end. - --file("src/gleam/string.gleam", 845). -?DOC( - " Creates a new `String` with the first grapheme in the input `String`\n" - " converted to uppercase and the remaining graphemes to lowercase.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " capitalise(\"mamouna\")\n" - " // -> \"Mamouna\"\n" - " ```\n" -). --spec capitalise(binary()) -> binary(). -capitalise(String) -> - case gleam_stdlib:string_pop_grapheme(String) of - {ok, {First, Rest}} -> - append(string:uppercase(First), string:lowercase(Rest)); - - {error, _} -> - <<""/utf8>> - end. - --file("src/gleam/string.gleam", 876). -?DOC( - " Returns a `String` representation of a term in Gleam syntax.\n" - "\n" - " This may be occasionally useful for quick-and-dirty printing of values in\n" - " scripts. For error reporting and other uses prefer constructing strings by\n" - " pattern matching on the values.\n" - "\n" - " ## Limitations\n" - "\n" - " The output format of this function is not stable and could change at any\n" - " time. The output is not suitable for parsing.\n" - "\n" - " This function works using runtime reflection, so the output may not be\n" - " perfectly accurate for data structures where the runtime structure doesn't\n" - " hold enough information to determine the original syntax. For example,\n" - " tuples with an Erlang atom in the first position will be mistaken for Gleam\n" - " records.\n" - "\n" - " ## Security and safety\n" - "\n" - " There is no limit to how large the strings that this function can produce.\n" - " Be careful not to call this function with large data structures or you\n" - " could use very large amounts of memory, potentially causing runtime\n" - " problems.\n" -). --spec inspect(any()) -> binary(). -inspect(Term) -> - _pipe = Term, - _pipe@1 = gleam_stdlib:inspect(_pipe), - unicode:characters_to_binary(_pipe@1). - --file("src/gleam/string.gleam", 900). -?DOC( - " Returns the number of bytes in a `String`.\n" - "\n" - " This function runs in constant time on Erlang and in linear time on\n" - " JavaScript.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " byte_size(\"🏳️‍⚧️🏳️‍🌈👩🏾‍❤️‍👨🏻\")\n" - " // -> 58\n" - " ```\n" -). --spec byte_size(binary()) -> integer(). -byte_size(String) -> - erlang:byte_size(String). - --file("src/gleam/string.gleam", 245). -?DOC( - " Drops *n* graphemes from the start of a `String`.\n" - "\n" - " This function runs in linear time with the number of graphemes to drop.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " drop_start(from: \"The Lone Gunmen\", up_to: 2)\n" - " // -> \"e Lone Gunmen\"\n" - " ```\n" -). --spec drop_start(binary(), integer()) -> binary(). -drop_start(String, Num_graphemes) -> - case Num_graphemes =< 0 of - true -> - String; - - false -> - Prefix = gleam_stdlib:slice(String, 0, Num_graphemes), - Prefix_size = erlang:byte_size(Prefix), - binary:part( - String, - Prefix_size, - erlang:byte_size(String) - Prefix_size - ) - end. diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache deleted file mode 100644 index 24afb0fc4fd7d33f8c004c7a2d6e355966d0f31d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14588 zcmeHO4R9RQeZRN&v3Dn(?w(dB*^WVLf$NXh64Eo6DlyX87zbh3-m@si*p*h&N;>&; zC*PfHi$VbxN+Hlv;h7R@r{IK?@Rbz8K!cN*k79IAjJg1oiiS zyC>brd*C=qI!qe!?yYv;=l}cvd(Vp$Ut91)wuM!DJbdLO-@Qca^j^ZW7h4%$Hlo$8 zV%pl(tab4Mul8U&)1F0nE*j8YZD&(MY0DgK$ro5Il^NYHlW zW9C{$Gli-at3RC@%UdluYb={@>9Y!HGc(kZ&X3XaN?DJm(gQ7HX8$g8$jZ0K(J>N@ z(~{5i+b=L(aW<&!TlvC{F}I?md%$FoHVU?{4@Jf5ko za?Ra2kJqx?mee}B|5I*5dwe{;{e<DJ(2sy}6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R%Deu%2~xwjV8AJm>jRYYq* z;4cjAGOBKkABv+o9KVmM4Gl&^qr?myWIAz{g8PU7zJK#y4F7ZA`$WE{{r^G)dolPj zk>M-h`)K1otojLU{L_(E+Uni02S|AzjeVP{Kj$~lK7zG1w1H(>3$6TotxL1lN_T*# zoh$lQ-&<{ekQv16Z~>&ITM8g2ZZo@ikJ1!kc4x168vkw%oweG9waz5;k4h5r6x_Y# oQ2CGiMaSoYFVL9 diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_meta b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_meta deleted file mode 100644 index 8cddb439ae762317273eccca72c9a1c7f5d91fd7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 911 zcmXZbU1$za7y#h&jc>pHnN2M%xv<)3$Z9JT`PrsvF1E6@Nm{FswTVTI6&IwGU9HH} zlo-p@l+k9JkqAZev&9u7E|^SBd8Y5Jr}uPzJE!*y-LI+*v4})sjpSIasoS?_|Ejv$ zhQ{fR`8jtilj3Obphct!|q+~5`u876gR z2wCJ%NF`NNbAfhx=_4f?!dljmM?Hr)M=N6_#D|bXGMm}PUTQeTdAfMO7$5jZdO`>p zgWL4d W$5X!ZmuQ+gB$rAK(-h;&{EvSY%zEem diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_tree.erl b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_tree.erl deleted file mode 100644 index ec26f26..0000000 --- a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@string_tree.erl +++ /dev/null @@ -1,207 +0,0 @@ --module(gleam@string_tree). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/string_tree.gleam"). --export([append_tree/2, prepend_tree/2, from_strings/1, new/0, 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_tree/0, direction/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --type string_tree() :: any(). - --type direction() :: all. - --file("src/gleam/string_tree.gleam", 61). -?DOC( - " Appends some `StringTree` onto the end of another.\n" - "\n" - " Runs in constant time.\n" -). --spec append_tree(string_tree(), string_tree()) -> string_tree(). -append_tree(Tree, Suffix) -> - gleam_stdlib:iodata_append(Tree, Suffix). - --file("src/gleam/string_tree.gleam", 48). -?DOC( - " Prepends some `StringTree` onto the start of another.\n" - "\n" - " Runs in constant time.\n" -). --spec prepend_tree(string_tree(), string_tree()) -> string_tree(). -prepend_tree(Tree, Prefix) -> - gleam_stdlib:iodata_append(Prefix, Tree). - --file("src/gleam/string_tree.gleam", 69). -?DOC( - " Converts a list of strings into a `StringTree`.\n" - "\n" - " Runs in constant time.\n" -). --spec from_strings(list(binary())) -> string_tree(). -from_strings(Strings) -> - gleam_stdlib:identity(Strings). - --file("src/gleam/string_tree.gleam", 24). -?DOC( - " Create an empty `StringTree`. Useful as the start of a pipe chaining many\n" - " trees together.\n" -). --spec new() -> string_tree(). -new() -> - gleam_stdlib:identity([]). - --file("src/gleam/string_tree.gleam", 77). -?DOC( - " Joins a list of trees into a single tree.\n" - "\n" - " Runs in constant time.\n" -). --spec concat(list(string_tree())) -> string_tree(). -concat(Trees) -> - gleam_stdlib:identity(Trees). - --file("src/gleam/string_tree.gleam", 85). -?DOC( - " Converts a string into a `StringTree`.\n" - "\n" - " Runs in constant time.\n" -). --spec from_string(binary()) -> string_tree(). -from_string(String) -> - gleam_stdlib:identity(String). - --file("src/gleam/string_tree.gleam", 32). -?DOC( - " Prepends a `String` onto the start of some `StringTree`.\n" - "\n" - " Runs in constant time.\n" -). --spec prepend(string_tree(), binary()) -> string_tree(). -prepend(Tree, Prefix) -> - gleam_stdlib:iodata_append(gleam_stdlib:identity(Prefix), Tree). - --file("src/gleam/string_tree.gleam", 40). -?DOC( - " Appends a `String` onto the end of some `StringTree`.\n" - "\n" - " Runs in constant time.\n" -). --spec append(string_tree(), binary()) -> string_tree(). -append(Tree, Second) -> - gleam_stdlib:iodata_append(Tree, gleam_stdlib:identity(Second)). - --file("src/gleam/string_tree.gleam", 94). -?DOC( - " Turns a `StringTree` into a `String`.\n" - "\n" - " This function is implemented natively by the virtual machine and is highly\n" - " optimised.\n" -). --spec to_string(string_tree()) -> binary(). -to_string(Tree) -> - unicode:characters_to_binary(Tree). - --file("src/gleam/string_tree.gleam", 100). -?DOC(" Returns the size of the `StringTree` in bytes.\n"). --spec byte_size(string_tree()) -> integer(). -byte_size(Tree) -> - erlang:iolist_size(Tree). - --file("src/gleam/string_tree.gleam", 104). -?DOC(" Joins the given trees into a new tree separated with the given string.\n"). --spec join(list(string_tree()), binary()) -> string_tree(). -join(Trees, Sep) -> - _pipe = Trees, - _pipe@1 = gleam@list:intersperse(_pipe, gleam_stdlib:identity(Sep)), - gleam_stdlib:identity(_pipe@1). - --file("src/gleam/string_tree.gleam", 115). -?DOC( - " Converts a `StringTree` to a new one where the contents have been\n" - " lowercased.\n" -). --spec lowercase(string_tree()) -> string_tree(). -lowercase(Tree) -> - string:lowercase(Tree). - --file("src/gleam/string_tree.gleam", 122). -?DOC( - " Converts a `StringTree` to a new one where the contents have been\n" - " uppercased.\n" -). --spec uppercase(string_tree()) -> string_tree(). -uppercase(Tree) -> - string:uppercase(Tree). - --file("src/gleam/string_tree.gleam", 127). -?DOC(" Converts a `StringTree` to a new one with the contents reversed.\n"). --spec reverse(string_tree()) -> string_tree(). -reverse(Tree) -> - string:reverse(Tree). - --file("src/gleam/string_tree.gleam", 145). -?DOC(" Splits a `StringTree` on a given pattern into a list of trees.\n"). --spec split(string_tree(), binary()) -> list(string_tree()). -split(Tree, Pattern) -> - string:split(Tree, Pattern, all). - --file("src/gleam/string_tree.gleam", 156). -?DOC(" Replaces all instances of a pattern with a given string substitute.\n"). --spec replace(string_tree(), binary(), binary()) -> string_tree(). -replace(Tree, Pattern, Substitute) -> - gleam_stdlib:string_replace(Tree, Pattern, Substitute). - --file("src/gleam/string_tree.gleam", 182). -?DOC( - " Compares two string trees to determine if they have the same textual\n" - " content.\n" - "\n" - " Comparing two string trees using the `==` operator may return `False` even\n" - " if they have the same content as they may have been build in different ways,\n" - " so using this function is often preferred.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_strings([\"a\", \"b\"]) == from_string(\"ab\")\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " is_equal(from_strings([\"a\", \"b\"]), from_string(\"ab\"))\n" - " // -> True\n" - " ```\n" -). --spec is_equal(string_tree(), string_tree()) -> boolean(). -is_equal(A, B) -> - string:equal(A, B). - --file("src/gleam/string_tree.gleam", 206). -?DOC( - " Inspects a `StringTree` to determine if it is equivalent to an empty string.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_string(\"ok\") |> is_empty\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " from_string(\"\") |> is_empty\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " from_strings([]) |> is_empty\n" - " // -> True\n" - " ```\n" -). --spec is_empty(string_tree()) -> boolean(). -is_empty(Tree) -> - string:is_empty(Tree). diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.cache b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.cache deleted file mode 100644 index 2d4d17166bbe05ca83d129e443b3660394066ccf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33212 zcmeHw30z#&_5a-W1_p)@csxh~fiO(MzRsMmL)Zd@EieOwC1Dw02t$A&Geb7_)VRdd z)>Io!ZPhewqt&|9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 index 1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 KcmZQzfB*mh2mk>9 diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_meta b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_meta deleted file mode 100644 index 154351bee75d1f2ee4faec9f4130ce08e594297c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3297 zcmZYBd2m(L836DD6lo-~ix3vs3>G9H3I;V0Kt+VG#zK&N4_g!>1B4M}D+G*VJ7Wq` zMHGm#BM~qpAZ=_S#X%cv8;T{M2_h2&0U<4=zqI_r^v?X|zIV^N=bZbU?|k>==Z#4Y zw~i{+Z+(ckb)GU~(zux&lV_!7RS97qciz@8BY95hepf#u^0ts3Rjd)s~gYa5d~d(x!4G(N)I(x{J9PcM#-sCMg@PWRD{1stW0&hDlk zo2i^`<-{r{P&rU#U$J!KdA6{FJn|{wCXJ2JiC&B%jYYh|Vh(VKV-!(B%+ErIV-#~) z%MK3nS1wXPRl&W3W^|wj2|ULX=CXoxR&kh!JItNOiDwXrjN@&#k;6%@(Y!_okCDg% z*0Y5@9N-Wai2iv96Uby8WyD(a1eUOj<*Z{TpK_ejR8UJEjOH~?a)GWj#fpzOKrXdp z#W3Due`SW;6+&MYvX~`&Ny}OxbS8zR9HBvN>rWird6oT?aFw_^=Ez=h$)kpB8p2B~ zqJT#ALYT^0HgcTW_2mnVX+l%t7|M7SkU=r68i+e9*+n*c*+=!eJvXs*V=$9QBb`ik z@O$bt452*}na^Qv(DWW-(3+X-qnPMMAv{DH3pqj=muS^k{F%s9rZJtJ6myvnC58+q zlizZND?~T3R~XC?*0Y^rPEf6>{G>Ne@)VOuBb^PD@g3)=)y$lTr4NbB;AM_+nug6o zxQEeXvXv{`f3JH;U;y*j!>812VeOefGSm2gpNMQ}{w!rLx#aO9om!bU>Ev>XQp#xD zI)pY1V>4H2(nep5V;kE!NaTHDNEFR!K}$w5h2^}?hvZShS*~%D+R+Le_2@!BMlhQk za>=8V3hJ~C;a(o#35Ju-D)v%Ht@}gh$z*0QlT6;HoR+_^Ui2q{SJ^-rQSDq~D2c4( zEzZ!ey&R?o@$@5&KXQ~W_%lT`en1UlJemB7Djno+!>=k;>lne1r!p|(esf+ z21ogvYqaeY!lU$OKCiQewQOfMd&s7ce^AapssEt+nZ_nciS8_3Y@(FthkR!frIgY3 zVRe=iHju^pe9ezUcTu|-$RHN5nuC19IliY`SGmDd_VE?xDCY+*()AH>VkWa#%o}Va zhXPJn6S|Wfw&hbAtAd$~BhrEB->{WA-3@Si~|`vWnI0AfF=6 z)8%nBm{`V=N;+%UL>^yKBTl}O#M>0{6F2xb1G~GI&17+%m>yz9GTG#CkWV;F_4p7v z@*tfV&u$8++0%0~k8Hl-TOxWHi}k$2S?c%p%=BjvW0}YctR|aWKH(BEPw1EVe8k6m z&joH$?MeHTcoG@OSl(p|`CO;&Q}!`2bYwCgP{3y#;RX%*=!;(TW)VyH4Vk=0KBqX# zd0IRj!Wc4mjcoQ)$We-^)>loY9WjjO9ZvE!t)7w7Oy>ZHI7SgA+@w)IW6_2rR*=pr z3c0{VE>XL`{^-pxCX>!a{zgbp>*+xXS?uIAXE{$f7l<05-qM!@Mlp_AMiV3{PAue*An>75TxX_elBr=>VPSA9i zwPF<0S<6m}_>OABts{Mz$}9YuLQYaaha~S7#_%#3Y-9&{R1iPH`-6A+J6EXtoEkwA z>)1*@XNVjr|9O@Pq_BcD?4f`XDyTO~-J(Auc!4yQkjb0;j<+~M#AvmENP04vskg|u H{~rGV*Ec|< diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.erl b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.erl deleted file mode 100644 index c27d1d2..0000000 --- a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@uri.erl +++ /dev/null @@ -1,1049 +0,0 @@ --module(gleam@uri). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/uri.gleam"). --export([parse_query/1, percent_encode/1, query_to_string/1, percent_decode/1, path_segments/1, to_string/1, origin/1, merge/2, parse/1]). --export_type([uri/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " Utilities for working with URIs\n" - "\n" - " This module provides functions for working with URIs (for example, parsing\n" - " URIs or encoding query strings). The functions in this module are implemented\n" - " according to [RFC 3986](https://tools.ietf.org/html/rfc3986).\n" - "\n" - " Query encoding (Form encoding) is defined in the\n" - " [W3C specification](https://www.w3.org/TR/html52/sec-forms.html#urlencoded-form-data).\n" -). - --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())}. - --file("src/gleam/uri.gleam", 289). --spec is_valid_host_within_brackets_char(integer()) -> boolean(). -is_valid_host_within_brackets_char(Char) -> - (((((48 >= Char) andalso (Char =< 57)) orelse ((65 >= Char) andalso (Char =< 90))) - orelse ((97 >= Char) andalso (Char =< 122))) - orelse (Char =:= 58)) - orelse (Char =:= 46). - --file("src/gleam/uri.gleam", 506). --spec parse_fragment(binary(), uri()) -> {ok, uri()} | {error, nil}. -parse_fragment(Rest, Pieces) -> - {ok, - {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - {some, Rest}}}. - --file("src/gleam/uri.gleam", 478). --spec parse_query_with_question_mark_loop(binary(), binary(), uri(), integer()) -> {ok, - uri()} | - {error, nil}. -parse_query_with_question_mark_loop(Original, Uri_string, Pieces, Size) -> - case Uri_string of - <<"#"/utf8, Rest/binary>> when Size =:= 0 -> - parse_fragment(Rest, Pieces); - - <<"#"/utf8, Rest@1/binary>> -> - Query = binary:part(Original, 0, Size), - Pieces@1 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - erlang:element(6, Pieces), - {some, Query}, - erlang:element(8, Pieces)}, - parse_fragment(Rest@1, Pieces@1); - - <<""/utf8>> -> - {ok, - {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - erlang:element(6, Pieces), - {some, Original}, - erlang:element(8, Pieces)}}; - - _ -> - {_, Rest@2} = gleam_stdlib:string_pop_codeunit(Uri_string), - parse_query_with_question_mark_loop( - Original, - Rest@2, - Pieces, - Size + 1 - ) - end. - --file("src/gleam/uri.gleam", 471). --spec parse_query_with_question_mark(binary(), uri()) -> {ok, uri()} | - {error, nil}. -parse_query_with_question_mark(Uri_string, Pieces) -> - parse_query_with_question_mark_loop(Uri_string, Uri_string, Pieces, 0). - --file("src/gleam/uri.gleam", 437). --spec parse_path_loop(binary(), binary(), uri(), integer()) -> {ok, uri()} | - {error, nil}. -parse_path_loop(Original, Uri_string, Pieces, Size) -> - case Uri_string of - <<"?"/utf8, Rest/binary>> -> - Path = binary:part(Original, 0, Size), - Pieces@1 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - Path, - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_query_with_question_mark(Rest, Pieces@1); - - <<"#"/utf8, Rest@1/binary>> -> - Path@1 = binary:part(Original, 0, Size), - Pieces@2 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - Path@1, - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_fragment(Rest@1, Pieces@2); - - <<""/utf8>> -> - {ok, - {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - Original, - erlang:element(7, Pieces), - erlang:element(8, Pieces)}}; - - _ -> - {_, Rest@2} = gleam_stdlib:string_pop_codeunit(Uri_string), - parse_path_loop(Original, Rest@2, Pieces, Size + 1) - end. - --file("src/gleam/uri.gleam", 433). --spec parse_path(binary(), uri()) -> {ok, uri()} | {error, nil}. -parse_path(Uri_string, Pieces) -> - parse_path_loop(Uri_string, Uri_string, Pieces, 0). - --file("src/gleam/uri.gleam", 388). --spec parse_port_loop(binary(), uri(), integer()) -> {ok, uri()} | {error, nil}. -parse_port_loop(Uri_string, Pieces, Port) -> - case Uri_string of - <<"0"/utf8, Rest/binary>> -> - parse_port_loop(Rest, Pieces, Port * 10); - - <<"1"/utf8, Rest@1/binary>> -> - parse_port_loop(Rest@1, Pieces, (Port * 10) + 1); - - <<"2"/utf8, Rest@2/binary>> -> - parse_port_loop(Rest@2, Pieces, (Port * 10) + 2); - - <<"3"/utf8, Rest@3/binary>> -> - parse_port_loop(Rest@3, Pieces, (Port * 10) + 3); - - <<"4"/utf8, Rest@4/binary>> -> - parse_port_loop(Rest@4, Pieces, (Port * 10) + 4); - - <<"5"/utf8, Rest@5/binary>> -> - parse_port_loop(Rest@5, Pieces, (Port * 10) + 5); - - <<"6"/utf8, Rest@6/binary>> -> - parse_port_loop(Rest@6, Pieces, (Port * 10) + 6); - - <<"7"/utf8, Rest@7/binary>> -> - parse_port_loop(Rest@7, Pieces, (Port * 10) + 7); - - <<"8"/utf8, Rest@8/binary>> -> - parse_port_loop(Rest@8, Pieces, (Port * 10) + 8); - - <<"9"/utf8, Rest@9/binary>> -> - parse_port_loop(Rest@9, Pieces, (Port * 10) + 9); - - <<"?"/utf8, Rest@10/binary>> -> - Pieces@1 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - {some, Port}, - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_query_with_question_mark(Rest@10, Pieces@1); - - <<"#"/utf8, Rest@11/binary>> -> - Pieces@2 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - {some, Port}, - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_fragment(Rest@11, Pieces@2); - - <<"/"/utf8, _/binary>> -> - Pieces@3 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - {some, Port}, - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_path(Uri_string, Pieces@3); - - <<""/utf8>> -> - {ok, - {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - {some, Port}, - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}}; - - _ -> - {error, nil} - end. - --file("src/gleam/uri.gleam", 353). --spec parse_port(binary(), uri()) -> {ok, uri()} | {error, nil}. -parse_port(Uri_string, Pieces) -> - case Uri_string of - <<":0"/utf8, Rest/binary>> -> - parse_port_loop(Rest, Pieces, 0); - - <<":1"/utf8, Rest@1/binary>> -> - parse_port_loop(Rest@1, Pieces, 1); - - <<":2"/utf8, Rest@2/binary>> -> - parse_port_loop(Rest@2, Pieces, 2); - - <<":3"/utf8, Rest@3/binary>> -> - parse_port_loop(Rest@3, Pieces, 3); - - <<":4"/utf8, Rest@4/binary>> -> - parse_port_loop(Rest@4, Pieces, 4); - - <<":5"/utf8, Rest@5/binary>> -> - parse_port_loop(Rest@5, Pieces, 5); - - <<":6"/utf8, Rest@6/binary>> -> - parse_port_loop(Rest@6, Pieces, 6); - - <<":7"/utf8, Rest@7/binary>> -> - parse_port_loop(Rest@7, Pieces, 7); - - <<":8"/utf8, Rest@8/binary>> -> - parse_port_loop(Rest@8, Pieces, 8); - - <<":9"/utf8, Rest@9/binary>> -> - parse_port_loop(Rest@9, Pieces, 9); - - <<":"/utf8>> -> - {ok, Pieces}; - - <<""/utf8>> -> - {ok, Pieces}; - - <<"?"/utf8, Rest@10/binary>> -> - parse_query_with_question_mark(Rest@10, Pieces); - - <<":?"/utf8, Rest@10/binary>> -> - parse_query_with_question_mark(Rest@10, Pieces); - - <<"#"/utf8, Rest@11/binary>> -> - parse_fragment(Rest@11, Pieces); - - <<":#"/utf8, Rest@11/binary>> -> - parse_fragment(Rest@11, Pieces); - - <<"/"/utf8, _/binary>> -> - parse_path(Uri_string, Pieces); - - <<":"/utf8, Rest@12/binary>> -> - case Rest@12 of - <<"/"/utf8, _/binary>> -> - parse_path(Rest@12, Pieces); - - _ -> - {error, nil} - end; - - _ -> - {error, nil} - end. - --file("src/gleam/uri.gleam", 309). --spec parse_host_outside_of_brackets_loop(binary(), binary(), uri(), integer()) -> {ok, - uri()} | - {error, nil}. -parse_host_outside_of_brackets_loop(Original, Uri_string, Pieces, Size) -> - case Uri_string of - <<""/utf8>> -> - {ok, - {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Original}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}}; - - <<":"/utf8, _/binary>> -> - Host = binary:part(Original, 0, Size), - Pieces@1 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Host}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_port(Uri_string, Pieces@1); - - <<"/"/utf8, _/binary>> -> - Host@1 = binary:part(Original, 0, Size), - Pieces@2 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Host@1}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_path(Uri_string, Pieces@2); - - <<"?"/utf8, Rest/binary>> -> - Host@2 = binary:part(Original, 0, Size), - Pieces@3 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Host@2}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_query_with_question_mark(Rest, Pieces@3); - - <<"#"/utf8, Rest@1/binary>> -> - Host@3 = binary:part(Original, 0, Size), - Pieces@4 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Host@3}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_fragment(Rest@1, Pieces@4); - - _ -> - {_, Rest@2} = gleam_stdlib:string_pop_codeunit(Uri_string), - parse_host_outside_of_brackets_loop( - Original, - Rest@2, - Pieces, - Size + 1 - ) - end. - --file("src/gleam/uri.gleam", 229). --spec parse_host_within_brackets_loop(binary(), binary(), uri(), integer()) -> {ok, - uri()} | - {error, nil}. -parse_host_within_brackets_loop(Original, Uri_string, Pieces, Size) -> - case Uri_string of - <<""/utf8>> -> - {ok, - {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Uri_string}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}}; - - <<"]"/utf8, Rest/binary>> when Size =:= 0 -> - parse_port(Rest, Pieces); - - <<"]"/utf8, Rest@1/binary>> -> - Host = binary:part(Original, 0, Size + 1), - Pieces@1 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Host}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_port(Rest@1, Pieces@1); - - <<"/"/utf8, _/binary>> when Size =:= 0 -> - parse_path(Uri_string, Pieces); - - <<"/"/utf8, _/binary>> -> - Host@1 = binary:part(Original, 0, Size), - Pieces@2 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Host@1}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_path(Uri_string, Pieces@2); - - <<"?"/utf8, Rest@2/binary>> when Size =:= 0 -> - parse_query_with_question_mark(Rest@2, Pieces); - - <<"?"/utf8, Rest@3/binary>> -> - Host@2 = binary:part(Original, 0, Size), - Pieces@3 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Host@2}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_query_with_question_mark(Rest@3, Pieces@3); - - <<"#"/utf8, Rest@4/binary>> when Size =:= 0 -> - parse_fragment(Rest@4, Pieces); - - <<"#"/utf8, Rest@5/binary>> -> - Host@3 = binary:part(Original, 0, Size), - Pieces@4 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Host@3}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_fragment(Rest@5, Pieces@4); - - _ -> - {Char, Rest@6} = gleam_stdlib:string_pop_codeunit(Uri_string), - case is_valid_host_within_brackets_char(Char) of - true -> - parse_host_within_brackets_loop( - Original, - Rest@6, - Pieces, - Size + 1 - ); - - false -> - parse_host_outside_of_brackets_loop( - Original, - Original, - Pieces, - 0 - ) - end - end. - --file("src/gleam/uri.gleam", 222). --spec parse_host_within_brackets(binary(), uri()) -> {ok, uri()} | {error, nil}. -parse_host_within_brackets(Uri_string, Pieces) -> - parse_host_within_brackets_loop(Uri_string, Uri_string, Pieces, 0). - --file("src/gleam/uri.gleam", 302). --spec parse_host_outside_of_brackets(binary(), uri()) -> {ok, uri()} | - {error, nil}. -parse_host_outside_of_brackets(Uri_string, Pieces) -> - parse_host_outside_of_brackets_loop(Uri_string, Uri_string, Pieces, 0). - --file("src/gleam/uri.gleam", 199). --spec parse_host(binary(), uri()) -> {ok, uri()} | {error, nil}. -parse_host(Uri_string, Pieces) -> - case Uri_string of - <<"["/utf8, _/binary>> -> - parse_host_within_brackets(Uri_string, Pieces); - - <<":"/utf8, _/binary>> -> - Pieces@1 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, <<""/utf8>>}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_port(Uri_string, Pieces@1); - - <<""/utf8>> -> - {ok, - {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, <<""/utf8>>}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}}; - - _ -> - parse_host_outside_of_brackets(Uri_string, Pieces) - end. - --file("src/gleam/uri.gleam", 167). --spec parse_userinfo_loop(binary(), binary(), uri(), integer()) -> {ok, uri()} | - {error, nil}. -parse_userinfo_loop(Original, Uri_string, Pieces, Size) -> - case Uri_string of - <<"@"/utf8, Rest/binary>> when Size =:= 0 -> - parse_host(Rest, Pieces); - - <<"@"/utf8, Rest@1/binary>> -> - Userinfo = binary:part(Original, 0, Size), - Pieces@1 = {uri, - erlang:element(2, Pieces), - {some, Userinfo}, - erlang:element(4, Pieces), - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_host(Rest@1, Pieces@1); - - <<""/utf8>> -> - parse_host(Original, Pieces); - - <<"/"/utf8, _/binary>> -> - parse_host(Original, Pieces); - - <<"?"/utf8, _/binary>> -> - parse_host(Original, Pieces); - - <<"#"/utf8, _/binary>> -> - parse_host(Original, Pieces); - - _ -> - {_, Rest@2} = gleam_stdlib:string_pop_codeunit(Uri_string), - parse_userinfo_loop(Original, Rest@2, Pieces, Size + 1) - end. - --file("src/gleam/uri.gleam", 163). --spec parse_authority_pieces(binary(), uri()) -> {ok, uri()} | {error, nil}. -parse_authority_pieces(String, Pieces) -> - parse_userinfo_loop(String, String, Pieces, 0). - --file("src/gleam/uri.gleam", 150). --spec parse_authority_with_slashes(binary(), uri()) -> {ok, uri()} | - {error, nil}. -parse_authority_with_slashes(Uri_string, Pieces) -> - case Uri_string of - <<"//"/utf8>> -> - {ok, - {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, <<""/utf8>>}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}}; - - <<"//"/utf8, Rest/binary>> -> - parse_authority_pieces(Rest, Pieces); - - _ -> - parse_path(Uri_string, Pieces) - end. - --file("src/gleam/uri.gleam", 91). --spec parse_scheme_loop(binary(), binary(), uri(), integer()) -> {ok, uri()} | - {error, nil}. -parse_scheme_loop(Original, Uri_string, Pieces, Size) -> - case Uri_string of - <<"/"/utf8, _/binary>> when Size =:= 0 -> - parse_authority_with_slashes(Uri_string, Pieces); - - <<"/"/utf8, _/binary>> -> - Scheme = binary:part(Original, 0, Size), - Pieces@1 = {uri, - {some, string:lowercase(Scheme)}, - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_authority_with_slashes(Uri_string, Pieces@1); - - <<"?"/utf8, Rest/binary>> when Size =:= 0 -> - parse_query_with_question_mark(Rest, Pieces); - - <<"?"/utf8, Rest@1/binary>> -> - Scheme@1 = binary:part(Original, 0, Size), - Pieces@2 = {uri, - {some, string:lowercase(Scheme@1)}, - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_query_with_question_mark(Rest@1, Pieces@2); - - <<"#"/utf8, Rest@2/binary>> when Size =:= 0 -> - parse_fragment(Rest@2, Pieces); - - <<"#"/utf8, Rest@3/binary>> -> - Scheme@2 = binary:part(Original, 0, Size), - Pieces@3 = {uri, - {some, string:lowercase(Scheme@2)}, - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_fragment(Rest@3, Pieces@3); - - <<":"/utf8, _/binary>> when Size =:= 0 -> - {error, nil}; - - <<":"/utf8, Rest@4/binary>> -> - Scheme@3 = binary:part(Original, 0, Size), - Pieces@4 = {uri, - {some, string:lowercase(Scheme@3)}, - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_authority_with_slashes(Rest@4, Pieces@4); - - <<""/utf8>> -> - {ok, - {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - Original, - erlang:element(7, Pieces), - erlang:element(8, Pieces)}}; - - _ -> - {_, Rest@5} = gleam_stdlib:string_pop_codeunit(Uri_string), - parse_scheme_loop(Original, Rest@5, Pieces, Size + 1) - end. - --file("src/gleam/uri.gleam", 537). -?DOC( - " Parses an URL-encoded query string into a list of key value pairs.\n" - " Returns an error for invalid encoding.\n" - "\n" - " The opposite operation is `uri.query_to_string`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " parse_query(\"a=1&b=2\")\n" - " // -> Ok([#(\"a\", \"1\"), #(\"b\", \"2\")])\n" - " ```\n" -). --spec parse_query(binary()) -> {ok, list({binary(), binary()})} | {error, nil}. -parse_query(Query) -> - gleam_stdlib:parse_query(Query). - --file("src/gleam/uri.gleam", 579). -?DOC( - " Encodes a string into a percent encoded representation.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " percent_encode(\"100% great\")\n" - " // -> \"100%25%20great\"\n" - " ```\n" -). --spec percent_encode(binary()) -> binary(). -percent_encode(Value) -> - gleam_stdlib:percent_encode(Value). - --file("src/gleam/uri.gleam", 563). --spec percent_encode_query(binary()) -> binary(). -percent_encode_query(Part) -> - _pipe = gleam_stdlib:percent_encode(Part), - gleam@string:replace(_pipe, <<"+"/utf8>>, <<"%2B"/utf8>>). - --file("src/gleam/uri.gleam", 558). --spec query_pair({binary(), binary()}) -> gleam@string_tree:string_tree(). -query_pair(Pair) -> - _pipe = [percent_encode_query(erlang:element(1, Pair)), - <<"="/utf8>>, - percent_encode_query(erlang:element(2, Pair))], - gleam_stdlib:identity(_pipe). - --file("src/gleam/uri.gleam", 550). -?DOC( - " Encodes a list of key value pairs as a URI query string.\n" - "\n" - " The opposite operation is `uri.parse_query`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " query_to_string([#(\"a\", \"1\"), #(\"b\", \"2\")])\n" - " // -> \"a=1&b=2\"\n" - " ```\n" -). --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_stdlib:identity(<<"&"/utf8>>) - ), - _pipe@3 = gleam_stdlib:identity(_pipe@2), - unicode:characters_to_binary(_pipe@3). - --file("src/gleam/uri.gleam", 592). -?DOC( - " Decodes a percent encoded string.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " percent_decode(\"100%25%20great+fun\")\n" - " // -> Ok(\"100% great+fun\")\n" - " ```\n" -). --spec percent_decode(binary()) -> {ok, binary()} | {error, nil}. -percent_decode(Value) -> - gleam_stdlib:percent_decode(Value). - --file("src/gleam/uri.gleam", 614). --spec remove_dot_segments_loop(list(binary()), list(binary())) -> list(binary()). -remove_dot_segments_loop(Input, Accumulator) -> - case Input of - [] -> - lists: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, - remove_dot_segments_loop(Rest, Accumulator@5) - end. - --file("src/gleam/uri.gleam", 610). --spec remove_dot_segments(list(binary())) -> list(binary()). -remove_dot_segments(Input) -> - remove_dot_segments_loop(Input, []). - --file("src/gleam/uri.gleam", 606). -?DOC( - " Splits the path section of a URI into its constituent segments.\n" - "\n" - " Removes empty segments and resolves dot-segments as specified in\n" - " [section 5.2](https://www.ietf.org/rfc/rfc3986.html#section-5.2) of the RFC.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " path_segments(\"/users/1\")\n" - " // -> [\"users\" ,\"1\"]\n" - " ```\n" -). --spec path_segments(binary()) -> list(binary()). -path_segments(Path) -> - remove_dot_segments(gleam@string:split(Path, <<"/"/utf8>>)). - --file("src/gleam/uri.gleam", 645). -?DOC( - " Encodes a `Uri` value as a URI string.\n" - "\n" - " The opposite operation is `uri.parse`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let uri = Uri(..empty, scheme: Some(\"https\"), host: Some(\"example.com\"))\n" - " to_string(uri)\n" - " // -> \"https://example.com\"\n" - " ```\n" -). --spec to_string(uri()) -> binary(). -to_string(Uri) -> - Parts = case erlang:element(8, Uri) of - {some, Fragment} -> - [<<"#"/utf8>>, Fragment]; - - none -> - [] - end, - Parts@1 = case erlang:element(7, Uri) of - {some, Query} -> - [<<"?"/utf8>>, Query | Parts]; - - none -> - Parts - end, - Parts@2 = [erlang:element(6, Uri) | Parts@1], - Parts@3 = case {erlang:element(4, Uri), - gleam_stdlib: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>>, erlang:integer_to_binary(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]; - - {_, _, _} -> - Parts@4 - end, - erlang:list_to_binary(Parts@5). - --file("src/gleam/uri.gleam", 689). -?DOC( - " Fetches the origin of a URI.\n" - "\n" - " Returns the origin of a uri as defined in\n" - " [RFC 6454](https://tools.ietf.org/html/rfc6454)\n" - "\n" - " The supported URI schemes are `http` and `https`.\n" - " URLs without a scheme will return `Error`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let assert Ok(uri) = parse(\"https://example.com/path?foo#bar\")\n" - " origin(uri)\n" - " // -> Ok(\"https://example.com\")\n" - " ```\n" -). --spec origin(uri()) -> {ok, binary()} | {error, nil}. -origin(Uri) -> - {uri, Scheme, _, Host, Port, _, _, _} = Uri, - case {Host, Scheme} of - {{some, H}, {some, <<"https"/utf8>>}} when Port =:= {some, 443} -> - {ok, erlang:list_to_binary([<<"https://"/utf8>>, H])}; - - {{some, H@1}, {some, <<"http"/utf8>>}} when Port =:= {some, 80} -> - {ok, erlang:list_to_binary([<<"http://"/utf8>>, H@1])}; - - {{some, H@2}, {some, S}} when (S =:= <<"http"/utf8>>) orelse (S =:= <<"https"/utf8>>) -> - case Port of - {some, P} -> - {ok, - erlang:list_to_binary( - [S, - <<"://"/utf8>>, - H@2, - <<":"/utf8>>, - erlang:integer_to_binary(P)] - )}; - - none -> - {ok, erlang:list_to_binary([S, <<"://"/utf8>>, H@2])} - end; - - {_, _} -> - {error, nil} - end. - --file("src/gleam/uri.gleam", 770). --spec drop_last(list(DDM)) -> list(DDM). -drop_last(Elements) -> - gleam@list:take(Elements, erlang:length(Elements) - 1). - --file("src/gleam/uri.gleam", 774). --spec join_segments(list(binary())) -> binary(). -join_segments(Segments) -> - gleam@string:join([<<""/utf8>> | Segments], <<"/"/utf8>>). - --file("src/gleam/uri.gleam", 712). -?DOC( - " Resolves a URI with respect to the given base URI.\n" - "\n" - " The base URI must be an absolute URI or this function will return an error.\n" - " The algorithm for merging URIs is described in\n" - " [RFC 3986](https://tools.ietf.org/html/rfc3986#section-5.2).\n" -). --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 = erlang:element(6, Relative), - _pipe@1 = gleam@string:split(_pipe, <<"/"/utf8>>), - _pipe@2 = remove_dot_segments(_pipe@1), - join_segments(_pipe@2) - 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}; - - _ -> - {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_stdlib:string_starts_with( - erlang:element(6, Relative), - <<"/"/utf8>> - ) of - true -> - gleam@string:split( - erlang:element(6, Relative), - <<"/"/utf8>> - ); - - false -> - _pipe@3 = erlang:element(6, Base), - _pipe@4 = gleam@string:split( - _pipe@3, - <<"/"/utf8>> - ), - _pipe@5 = drop_last(_pipe@4), - lists:append( - _pipe@5, - gleam@string:split( - erlang:element(6, Relative), - <<"/"/utf8>> - ) - ) - end, - Path@1 = begin - _pipe@6 = Path_segments, - _pipe@7 = remove_dot_segments(_pipe@6), - join_segments(_pipe@7) - 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. - --file("src/gleam/uri.gleam", 81). -?DOC( - " Parses a compliant URI string into the `Uri` type.\n" - " If the string is not a valid URI string then an error is returned.\n" - "\n" - " The opposite operation is `uri.to_string`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " parse(\"https://example.com:1234/a/b?query=true#fragment\")\n" - " // -> Ok(\n" - " // Uri(\n" - " // scheme: Some(\"https\"),\n" - " // userinfo: None,\n" - " // host: Some(\"example.com\"),\n" - " // port: Some(1234),\n" - " // path: \"/a/b\",\n" - " // query: Some(\"query=true\"),\n" - " // fragment: Some(\"fragment\")\n" - " // )\n" - " // )\n" - " ```\n" -). --spec parse(binary()) -> {ok, uri()} | {error, nil}. -parse(Uri_string) -> - gleam_stdlib:uri_parse(Uri_string). diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam_stdlib.erl b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam_stdlib.erl deleted file mode 100644 index 2c416f4..0000000 --- a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam_stdlib.erl +++ /dev/null @@ -1,534 +0,0 @@ --module(gleam_stdlib). - --export([ - map_get/2, iodata_append/2, identity/1, parse_int/1, parse_float/1, - less_than/2, string_pop_grapheme/1, string_pop_codeunit/1, - string_starts_with/2, wrap_list/1, string_ends_with/2, string_pad/4, - uri_parse/1, bit_array_slice/3, percent_encode/1, percent_decode/1, - base64_decode/1, parse_query/1, bit_array_concat/1, - base64_encode/2, 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, utf_codepoint_list_to_string/1, contains_string/2, - crop_string/2, base16_encode/1, base16_decode/1, string_replace/3, slice/3, - bit_array_to_int_and_size/1, bit_array_pad_to_bytes/1, index/2, list/5, - dict/1, int/1, float/1, bit_array/1, is_null/1 -]). - -%% 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)). --define(is_ascii_character(X), - (erlang:is_integer(X) andalso X >= 32 andalso X =< 126)). - -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. - -classify_dynamic(nil) -> <<"Nil">>; -classify_dynamic(null) -> <<"Nil">>; -classify_dynamic(undefined) -> <<"Nil">>; -classify_dynamic(X) when is_boolean(X) -> <<"Bool">>; -classify_dynamic(X) when is_atom(X) -> <<"Atom">>; -classify_dynamic(X) when is_binary(X) -> <<"String">>; -classify_dynamic(X) when is_bitstring(X) -> <<"BitArray">>; -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_map(X) -> <<"Dict">>; -classify_dynamic(X) when is_tuple(X) -> <<"Array">>; -classify_dynamic(X) when is_reference(X) -> <<"Reference">>; -classify_dynamic(X) when is_pid(X) -> <<"Pid">>; -classify_dynamic(X) when is_port(X) -> <<"Port">>; -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(_) -> <<"Unknown">>. - -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)}. - -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 ] when is_binary(Rest) -> - {ok, {unicode:characters_to_binary([Next]), Rest}}; - - [ Next | Rest ] -> - {ok, {unicode:characters_to_binary([Next]), unicode:characters_to_binary(Rest)}}; - - _ -> {error, nil} - end. - -string_pop_codeunit(<>) -> {Cp, Rest}; -string_pop_codeunit(Binary) -> {0, Binary}. - -bit_array_pad_to_bytes(Bin) -> - case erlang:bit_size(Bin) rem 8 of - 0 -> Bin; - TrailingBits -> - PaddingBits = 8 - TrailingBits, - <> - end. - -bit_array_concat(BitArrays) -> - list_to_bitstring(BitArrays). - --if(?OTP_RELEASE >= 26). -base64_encode(Bin, Padding) -> - PaddedBin = bit_array_pad_to_bytes(Bin), - base64:encode(PaddedBin, #{padding => Padding}). --else. -base64_encode(_Bin, _Padding) -> - erlang:error(<<"Erlang OTP/26 or higher is required to use base64:encode">>). --endif. - -bit_array_slice(Bin, Pos, Len) -> - try {ok, binary:part(Bin, Pos, Len)} - catch error:badarg -> {error, nil} - end. - -base64_decode(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 -> - Port = - try maps:get(port, Uri) of - undefined -> none; - Value -> {some, Value} - catch _:_ -> none - end, - {ok, {uri, - maps_get_optional(Uri, scheme), - maps_get_optional(Uri, userinfo), - maps_get_optional(Uri, host), - 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(Data) when is_map(Data) -> - Fields = [ - [<<"#(">>, inspect(Key), <<", ">>, inspect(Value), <<")">>] - || {Key, Value} <- maps:to_list(Data) - ], - ["dict.from_list([", lists:join(", ", Fields), "])"]; -inspect(Atom) when is_atom(Atom) -> - erlang:element(2, inspect_atom(Atom)); -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(Bits) when is_bitstring(Bits) -> - inspect_bit_array(Bits); -inspect(List) when is_list(List) -> - case inspect_list(List, true) of - {charlist, _} -> ["charlist.from_string(\"", list_to_binary(List), "\")"]; - {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), - InspectedArgs = lists:map(fun inspect/1, ArgsList), - case inspect_atom(Atom) of - {gleam_atom, GleamAtom} -> - Args = lists:join(<<", ">>, InspectedArgs), - [GleamAtom, "(", Args, ")"]; - {erlang_atom, ErlangAtom} -> - Args = lists:join(<<", ">>, [ErlangAtom | InspectedArgs]), - ["#(", Args, ")"] - end; -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_atom(Atom) -> - Binary = erlang:atom_to_binary(Atom), - case inspect_maybe_gleam_atom(Binary, none, <<>>) of - {ok, Inspected} -> {gleam_atom, Inspected}; - {error, _} -> {erlang_atom, ["atom.create(\"", Binary, "\")"]} - end. - -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], true) when ?is_ascii_character(First) -> - {charlist, nil}; -inspect_list([First], _) -> - {proper, [inspect(First)]}; -inspect_list([First | Rest], ValidCharlist) when is_list(Rest) -> - StillValidCharlist = ValidCharlist andalso ?is_ascii_character(First), - {Kind, Inspected} = inspect_list(Rest, StillValidCharlist), - {Kind, [inspect(First), <<", ">> | Inspected]}; -inspect_list([First | ImproperTail], _) -> - {improper, [inspect(First), <<" | ">>, inspect(ImproperTail)]}. - -inspect_bit_array(Bits) -> - Text = inspect_bit_array(Bits, <<"<<">>), - <>">>. - -inspect_bit_array(<<>>, Acc) -> - Acc; -inspect_bit_array(<>, Acc) -> - inspect_bit_array(Rest, append_segment(Acc, erlang:integer_to_binary(X))); -inspect_bit_array(Rest, Acc) -> - Size = bit_size(Rest), - <> = Rest, - X1 = erlang:integer_to_binary(X), - Size1 = erlang:integer_to_binary(Size), - Segment = <>, - inspect_bit_array(<<>>, append_segment(Acc, Segment)). - -bit_array_to_int_and_size(A) -> - Size = bit_size(A), - <> = A, - {A1, Size}. - -append_segment(<<"<<">>, Segment) -> - <<"<<", Segment/binary>>; -append_segment(Acc, Segment) -> - <>. - - -inspect_maybe_utf8_string(Binary, Acc) -> - case Binary of - <<>> -> {ok, <<$", Acc/binary, $">>}; - <> -> - Escaped = case First of - $" -> <<$\\, $">>; - $\\ -> <<$\\, $\\>>; - $\r -> <<$\\, $r>>; - $\n -> <<$\\, $n>>; - $\t -> <<$\\, $t>>; - $\f -> <<$\\, $f>>; - X when X > 126, X < 160 -> convert_to_u(X); - X when X < 32 -> convert_to_u(X); - Other -> <> - end, - inspect_maybe_utf8_string(Rest, <>); - _ -> {error, not_a_utf8_string} - end. - -convert_to_u(Code) -> - list_to_binary(io_lib:format("\\u{~4.16.0B}", [Code])). - -float_to_string(Float) when is_float(Float) -> - erlang:iolist_to_binary(io_lib_format:fwrite_g(Float)). - -utf_codepoint_list_to_string(List) -> - case unicode:characters_to_binary(List) of - {error, _} -> erlang:error({gleam_error, {string_invalid_utf8, List}}); - Binary -> Binary - end. - -crop_string(String, Prefix) -> - case string:find(String, Prefix) of - nomatch -> String; - New -> New - end. - -contains_string(String, Substring) -> - is_bitstring(string:find(String, Substring)). - -base16_encode(Bin) -> - PaddedBin = bit_array_pad_to_bytes(Bin), - binary:encode_hex(PaddedBin). - -base16_decode(String) -> - try - {ok, binary:decode_hex(String)} - catch - _:_ -> {error, nil} - end. - -string_replace(String, Pattern, Replacement) -> - string:replace(String, Pattern, Replacement, all). - -slice(String, Index, Length) -> - case string:slice(String, Index, Length) of - X when is_binary(X) -> X; - X when is_list(X) -> unicode:characters_to_binary(X) - end. - -index([X | _], 0) -> - {ok, {some, X}}; -index([_, X | _], 1) -> - {ok, {some, X}}; -index([_, _, X | _], 2) -> - {ok, {some, X}}; -index([_, _, _, X | _], 3) -> - {ok, {some, X}}; -index([_, _, _, _, X | _], 4) -> - {ok, {some, X}}; -index([_, _, _, _, _, X | _], 5) -> - {ok, {some, X}}; -index([_, _, _, _, _, _, X | _], 6) -> - {ok, {some, X}}; -index([_, _, _, _, _, _, _, X | _], 7) -> - {ok, {some, X}}; -index(Tuple, Index) when is_tuple(Tuple) andalso is_integer(Index) -> - {ok, try - {some, element(Index + 1, Tuple)} - catch _:_ -> - none - end}; -index(Map, Key) when is_map(Map) -> - {ok, try - {some, maps:get(Key, Map)} - catch _:_ -> - none - end}; -index(_, Index) when is_integer(Index) -> - {error, <<"Indexable">>}; -index(_, _) -> - {error, <<"Dict">>}. - -list(T, A, B, C, D) when is_tuple(T) -> - list(tuple_to_list(T), A, B, C, D); -list([], _, _, _, Acc) -> - {lists:reverse(Acc), []}; -list([X | Xs], Decode, PushPath, Index, Acc) -> - {Out, Errors} = Decode(X), - case Errors of - [] -> list(Xs, Decode, PushPath, Index + 1, [Out | Acc]); - _ -> PushPath({[], Errors}, integer_to_binary(Index)) - end; -list(Unexpected, _, _, _, []) -> - Found = gleam@dynamic:classify(Unexpected), - Error = {decode_error, <<"List"/utf8>>, Found, []}, - {[], [Error]}; -list(_, _, _, _, Acc) -> - {lists:reverse(Acc), []}. - -dict(#{} = Data) -> {ok, Data}; -dict(_) -> {error, nil}. - -int(I) when is_integer(I) -> {ok, I}; -int(_) -> {error, 0}. - -float(F) when is_float(F) -> {ok, F}; -float(_) -> {error, 0.0}. - -bit_array(B) when is_bitstring(B) -> {ok, B}; -bit_array(_) -> {error, <<>>}. - -is_null(X) -> - X =:= undefined orelse X =:= null orelse X =:= nil. diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam_stdlib.mjs b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam_stdlib.mjs deleted file mode 100644 index 490443f..0000000 --- a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam_stdlib.mjs +++ /dev/null @@ -1,1026 +0,0 @@ -import { - BitArray, - Error, - List, - Ok, - Result, - UtfCodepoint, - stringBits, - toBitArray, - bitArraySlice, - NonEmpty, - Empty, - CustomType, -} from "./gleam.mjs"; -import { Some, None } from "./gleam/option.mjs"; -import { default as Dict, fold as dict_fold, get as dict_get, from as dict_from_iterable } from "./dict.mjs"; -import { classify } from "./gleam/dynamic.mjs"; -import { DecodeError } from "./gleam/dynamic/decode.mjs"; - -const Nil = undefined; - -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+)([eE][-+]?\d+)?$/.test(value)) { - return new Ok(parseFloat(value)); - } else { - return new Error(Nil); - } -} - -export function to_string(term) { - return term.toString(); -} - -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) { - return string.replaceAll(target, 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) { - const iterator = graphemes_iterator(string); - if (iterator) { - return List.fromArray(Array.from(iterator).map((item) => item.segment)); - } else { - return List.fromArray(string.match(/./gsu)); - } -} - -let segmenter = undefined; - -function graphemes_iterator(string) { - if (globalThis.Intl && Intl.Segmenter) { - segmenter ||= new Intl.Segmenter(); - return 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 pop_codeunit(str) { - return [str.charCodeAt(0) | 0, str.slice(1)]; -} - -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 split(xs, pattern) { - return List.fromArray(xs.split(pattern)); -} - -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 string_byte_slice(string, index, length) { - return string.slice(index, index + length); -} - -export function string_grapheme_slice(string, idx, len) { - if (len <= 0 || idx >= string.length) { - return ""; - } - - const iterator = graphemes_iterator(string); - if (iterator) { - while (idx-- > 0) { - iterator.next(); - } - - let result = ""; - - while (len-- > 0) { - const v = iterator.next().value; - if (v === undefined) { - break; - } - - result += v.segment; - } - - return result; - } else { - return string - .match(/./gsu) - .slice(idx, idx + len) - .join(""); - } -} - -export function string_codeunit_slice(str, from, length) { - return str.slice(from, from + length); -} -export function crop_string(string, substring) { - return string.substring(string.indexOf(substring)); -} - -export function contains_string(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); - } -} - -const unicode_whitespaces = [ - "\u0020", // Space - "\u0009", // Horizontal tab - "\u000A", // Line feed - "\u000B", // Vertical tab - "\u000C", // Form feed - "\u000D", // Carriage return - "\u0085", // Next line - "\u2028", // Line separator - "\u2029", // Paragraph separator -].join(""); - -const trim_start_regex = /* @__PURE__ */ new RegExp( - `^[${unicode_whitespaces}]*`, -); -const trim_end_regex = /* @__PURE__ */ new RegExp(`[${unicode_whitespaces}]*$`); - -export function trim_start(string) { - return string.replace(trim_start_regex, ""); -} - -export function trim_end(string) { - return string.replace(trim_end_regex, ""); -} - -export function bit_array_from_string(string) { - return toBitArray([stringBits(string)]); -} - -export function bit_array_bit_size(bit_array) { - return bit_array.bitSize; -} - -export function bit_array_byte_size(bit_array) { - return bit_array.byteSize; -} - -export function bit_array_pad_to_bytes(bit_array) { - const trailingBitsCount = bit_array.bitSize % 8; - - // If the bit array is a whole number of bytes it can be returned unchanged - if (trailingBitsCount === 0) { - return bit_array; - } - - const finalByte = bit_array.byteAt(bit_array.byteSize - 1); - - // The required final byte has its unused trailing bits set to zero - const unusedBitsCount = 8 - trailingBitsCount; - const correctFinalByte = (finalByte >> unusedBitsCount) << unusedBitsCount; - - // If the unused bits in the final byte are already set to zero then the - // existing buffer can be re-used, avoiding a copy - if (finalByte === correctFinalByte) { - return new BitArray( - bit_array.rawBuffer, - bit_array.byteSize * 8, - bit_array.bitOffset, - ); - } - - // Copy the bit array into a new aligned buffer and set the correct final byte - const buffer = new Uint8Array(bit_array.byteSize); - for (let i = 0; i < buffer.length - 1; i++) { - buffer[i] = bit_array.byteAt(i); - } - buffer[buffer.length - 1] = correctFinalByte; - - return new BitArray(buffer); -} - -export function bit_array_concat(bit_arrays) { - return toBitArray(bit_arrays.toArray()); -} - -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_array_to_string(bit_array) { - // If the bit array isn't a whole number of bytes then return an error - if (bit_array.bitSize % 8 !== 0) { - return new Error(Nil); - } - - try { - const decoder = new TextDecoder("utf-8", { fatal: true }); - - if (bit_array.bitOffset === 0) { - return new Ok(decoder.decode(bit_array.rawBuffer)); - } else { - // The input data isn't aligned, so copy it into a new aligned buffer so - // that TextDecoder can be used - const buffer = new Uint8Array(bit_array.byteSize); - for (let i = 0; i < buffer.length; i++) { - buffer[i] = bit_array.byteAt(i); - } - return new Ok(decoder.decode(buffer)); - } - } catch { - return new Error(Nil); - } -} - -export function print(string) { - if (typeof process === "object" && process.stdout?.write) { - 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_array_slice(bits, position, length) { - const start = Math.min(position, position + length); - const end = Math.max(position, position + length); - - if (start < 0 || end * 8 > bits.bitSize) { - return new Error(Nil); - } - - return new Ok(bitArraySlice(bits, start * 8, end * 8)); -} - -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; -} - -function unsafe_percent_decode(string) { - return decodeURIComponent(string || ""); -} - -function unsafe_percent_decode_query(string) { - return decodeURIComponent((string || "").replace("+", " ")); -} - -export function percent_decode(string) { - try { - return new Ok(unsafe_percent_decode(string)); - } catch { - return new Error(Nil); - } -} - -export function percent_encode(string) { - return encodeURIComponent(string).replace("%2B", "+"); -} - -export function parse_query(query) { - try { - const pairs = []; - for (const section of query.split("&")) { - const [key, value] = section.split("="); - if (!key) continue; - - const decodedKey = unsafe_percent_decode_query(key); - const decodedValue = unsafe_percent_decode_query(value); - pairs.push([decodedKey, decodedValue]); - } - return new Ok(List.fromArray(pairs)); - } catch { - return new Error(Nil); - } -} - -const b64EncodeLookup = [ - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47, -]; - -let b64TextDecoder; - -// Implementation based on https://github.com/mitschabaude/fast-base64/blob/main/js.js -export function base64_encode(bit_array, padding) { - b64TextDecoder ??= new TextDecoder(); - - bit_array = bit_array_pad_to_bytes(bit_array); - - const m = bit_array.byteSize; - const k = m % 3; - const n = Math.floor(m / 3) * 4 + (k && k + 1); - const N = Math.ceil(m / 3) * 4; - const encoded = new Uint8Array(N); - - for (let i = 0, j = 0; j < m; i += 4, j += 3) { - const y = - (bit_array.byteAt(j) << 16) + - (bit_array.byteAt(j + 1) << 8) + - (bit_array.byteAt(j + 2) | 0); - - encoded[i] = b64EncodeLookup[y >> 18]; - encoded[i + 1] = b64EncodeLookup[(y >> 12) & 0x3f]; - encoded[i + 2] = b64EncodeLookup[(y >> 6) & 0x3f]; - encoded[i + 3] = b64EncodeLookup[y & 0x3f]; - } - - let base64 = b64TextDecoder.decode(new Uint8Array(encoded.buffer, 0, n)); - - if (padding) { - if (k === 1) { - base64 += "=="; - } else if (k === 2) { - base64 += "="; - } - } - - return base64; -} - -// From https://developer.mozilla.org/en-US/docs/Glossary/Base64 -export function base64_decode(sBase64) { - try { - const binString = atob(sBase64); - const length = binString.length; - const array = new Uint8Array(length); - for (let i = 0; i < length; i++) { - array[i] = binString.charCodeAt(i); - } - return new Ok(new BitArray(array)); - } catch { - return new Error(Nil); - } -} - -export function classify_dynamic(data) { - if (typeof data === "string") { - return "String"; - } else if (typeof data === "boolean") { - return "Bool"; - } else if (data instanceof Result) { - return "Result"; - } else if (data instanceof List) { - return "List"; - } else if (data instanceof BitArray) { - return "BitArray"; - } else if (data instanceof Dict) { - return "Dict"; - } else if (Number.isInteger(data)) { - return "Int"; - } else if (Array.isArray(data)) { - return `Array`; - } else if (typeof data === "number") { - return "Float"; - } else if (data === null) { - return "Nil"; - } else if (data === undefined) { - return "Nil"; - } else { - const type = typeof data; - return type.charAt(0).toUpperCase() + type.slice(1); - } -} - -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)); -} - -export function inspect(v) { - return new Inspector().inspect(v); -} - -export function float_to_string(float) { - const string = float.toString().replace("+", ""); - if (string.indexOf(".") >= 0) { - return string; - } else { - const index = string.indexOf("e"); - if (index >= 0) { - return string.slice(0, index) + ".0" + string.slice(index); - } else { - return string + ".0"; - } - } -} - -class Inspector { - #references = new Set(); - - inspect(v) { - const 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 this.#string(v); - if (t === "bigint" || Number.isInteger(v)) return v.toString(); - if (t === "number") return float_to_string(v); - if (v instanceof UtfCodepoint) return this.#utfCodepoint(v); - if (v instanceof BitArray) return this.#bit_array(v); - if (v instanceof RegExp) return `//js(${v})`; - if (v instanceof Date) return `//js(Date("${v.toISOString()}"))`; - if (v instanceof globalThis.Error) return `//js(${v.toString()})`; - if (v instanceof Function) { - const args = []; - for (const i of Array(v.length).keys()) - args.push(String.fromCharCode(i + 97)); - return `//fn(${args.join(", ")}) { ... }`; - } - - if (this.#references.size === this.#references.add(v).size) { - return "//js(circular reference)"; - } - - let printed; - if (Array.isArray(v)) { - printed = `#(${v.map((v) => this.inspect(v)).join(", ")})`; - } else if (v instanceof List) { - printed = this.#list(v); - } else if (v instanceof CustomType) { - printed = this.#customType(v); - } else if (v instanceof Dict) { - printed = this.#dict(v); - } else if (v instanceof Set) { - return `//js(Set(${[...v].map((v) => this.inspect(v)).join(", ")}))`; - } else { - printed = this.#object(v); - } - this.#references.delete(v); - return printed; - } - - #object(v) { - const name = Object.getPrototypeOf(v)?.constructor?.name || "Object"; - const props = []; - for (const k of Object.keys(v)) { - props.push(`${this.inspect(k)}: ${this.inspect(v[k])}`); - } - const body = props.length ? " " + props.join(", ") + " " : ""; - const head = name === "Object" ? "" : name + " "; - return `//js(${head}{${body}})`; - } - - #dict(map) { - let body = "dict.from_list(["; - let first = true; - - body = dict_fold(map, body, (body, key, value) => { - if (!first) body = body + ", "; - first = false; - return body + "#(" + this.inspect(key) + ", " + this.inspect(value) + ")"; - }); - - return body + "])"; - } - - #customType(record) { - const props = Object.keys(record) - .map((label) => { - const value = this.inspect(record[label]); - return isNaN(parseInt(label)) ? `${label}: ${value}` : value; - }) - .join(", "); - return props - ? `${record.constructor.name}(${props})` - : record.constructor.name; - } - - #list(list) { - if (list instanceof Empty) { - return "[]"; - } - - let char_out = 'charlist.from_string("'; - let list_out = "["; - - let current = list; - while (current instanceof NonEmpty) { - let element = current.head; - current = current.tail; - - if (list_out !== "[") { - list_out += ", "; - } - list_out += this.inspect(element); - - if (char_out) { - if (Number.isInteger(element) && element >= 32 && element <= 126) { - char_out += String.fromCharCode(element); - } else { - char_out = null; - } - } - } - - if (char_out) { - return char_out + '")'; - } else { - return list_out + "]"; - } - } - - #string(str) { - let new_str = '"'; - for (let i = 0; i < str.length; i++) { - const char = str[i]; - switch (char) { - case "\n": - new_str += "\\n"; - break; - case "\r": - new_str += "\\r"; - break; - case "\t": - new_str += "\\t"; - break; - case "\f": - new_str += "\\f"; - break; - case "\\": - new_str += "\\\\"; - break; - case '"': - new_str += '\\"'; - break; - default: - if (char < " " || (char > "~" && char < "\u{00A0}")) { - new_str += - "\\u{" + - char.charCodeAt(0).toString(16).toUpperCase().padStart(4, "0") + - "}"; - } else { - new_str += char; - } - } - } - new_str += '"'; - return new_str; - } - - #utfCodepoint(codepoint) { - return `//utfcodepoint(${String.fromCodePoint(codepoint.value)})`; - } - - #bit_array(bits) { - if (bits.bitSize === 0) { - return "<<>>"; - } - - let acc = "<<"; - - for (let i = 0; i < bits.byteSize - 1; i++) { - acc += bits.byteAt(i).toString(); - acc += ", "; - } - - if (bits.byteSize * 8 === bits.bitSize) { - acc += bits.byteAt(bits.byteSize - 1).toString(); - } else { - const trailingBitsCount = bits.bitSize % 8; - acc += bits.byteAt(bits.byteSize - 1) >> (8 - trailingBitsCount); - acc += `:size(${trailingBitsCount})`; - } - - acc += ">>"; - return acc; - } -} - -export function base16_encode(bit_array) { - const trailingBitsCount = bit_array.bitSize % 8; - - let result = ""; - - for (let i = 0; i < bit_array.byteSize; i++) { - let byte = bit_array.byteAt(i); - - if (i === bit_array.byteSize - 1 && trailingBitsCount !== 0) { - const unusedBitsCount = 8 - trailingBitsCount; - byte = (byte >> unusedBitsCount) << unusedBitsCount; - } - - result += byte.toString(16).padStart(2, "0").toUpperCase(); - } - - return result; -} - -export function base16_decode(string) { - const bytes = new Uint8Array(string.length / 2); - for (let i = 0; i < string.length; i += 2) { - const a = parseInt(string[i], 16); - const b = parseInt(string[i + 1], 16); - if (isNaN(a) || isNaN(b)) return new Error(Nil); - bytes[i / 2] = a * 16 + b; - } - return new Ok(new BitArray(bytes)); -} - -export function bit_array_to_int_and_size(bits) { - const trailingBitsCount = bits.bitSize % 8; - const unusedBitsCount = trailingBitsCount === 0 ? 0 : 8 - trailingBitsCount; - - return [bits.byteAt(0) >> unusedBitsCount, bits.bitSize]; -} - -export function bit_array_starts_with(bits, prefix) { - if (prefix.bitSize > bits.bitSize) { - return false; - } - - // Check any whole bytes - const byteCount = Math.trunc(prefix.bitSize / 8); - for (let i = 0; i < byteCount; i++) { - if (bits.byteAt(i) !== prefix.byteAt(i)) { - return false; - } - } - - // Check any trailing bits at the end of the prefix - if (prefix.bitSize % 8 !== 0) { - const unusedBitsCount = 8 - (prefix.bitSize % 8); - if ( - bits.byteAt(byteCount) >> unusedBitsCount !== - prefix.byteAt(byteCount) >> unusedBitsCount - ) { - return false; - } - } - - return true; -} - -export function log(x) { - // It is checked in Gleam that: - // - The input is strictly positive (x > 0) - // - This ensures that Math.log will never return NaN or -Infinity - // The function can thus safely pass the input to Math.log - // and a valid finite float will always be produced. - return Math.log(x); -} - -export function exp(x) { - return Math.exp(x); -} - -export function list_to_array(list) { - let current = list; - let array = []; - while (current instanceof NonEmpty) { - array.push(current.head); - current = current.tail; - } - return array; -} - -export function index(data, key) { - // Dictionaries and dictionary-like objects can be indexed - if (data instanceof Dict) { - const result = dict_get(data, key); - return new Ok(result.isOk() ? new Some(result[0]) : new None()); - } - - if (data instanceof WeakMap || data instanceof Map) { - const token = {}; - const entry = data.get(key, token); - if (entry === token) return new Ok(new None()); - return new Ok(new Some(entry)); - } - - const key_is_int = Number.isInteger(key); - - // Only elements 0-7 of lists can be indexed, negative indices are not allowed - if (key_is_int && key >= 0 && key < 8 && data instanceof List) { - let i = 0; - for (const value of data) { - if (i === key) return new Ok(new Some(value)); - i++; - } - return new Error("Indexable"); - } - - // Arrays and objects can be indexed - if ( - (key_is_int && Array.isArray(data)) || - (data && typeof data === "object") || - (data && Object.getPrototypeOf(data) === Object.prototype) - ) { - if (key in data) return new Ok(new Some(data[key])); - return new Ok(new None()); - } - - return new Error(key_is_int ? "Indexable" : "Dict"); -} - -export function list(data, decode, pushPath, index, emptyList) { - if (!(data instanceof List || Array.isArray(data))) { - const error = new DecodeError("List", classify(data), emptyList); - return [emptyList, List.fromArray([error])]; - } - - const decoded = []; - - for (const element of data) { - const layer = decode(element); - const [out, errors] = layer; - - if (errors instanceof NonEmpty) { - const [_, errors] = pushPath(layer, index.toString()); - return [emptyList, errors]; - } - decoded.push(out); - index++; - } - - return [List.fromArray(decoded), emptyList]; -} - -export function dict(data) { - if (data instanceof Dict) { - return new Ok(data); - } - if (data instanceof Map || data instanceof WeakMap) { - return new Ok(dict_from_iterable(data)); - } - if (data == null) { - return new Error("Dict"); - } - if (typeof data !== "object") { - return new Error("Dict"); - } - const proto = Object.getPrototypeOf(data); - if (proto === Object.prototype || proto === null) { - return new Ok(dict_from_iterable(Object.entries(data))); - } - return new Error("Dict"); -} - -export function bit_array(data) { - if (data instanceof BitArray) return new Ok(data); - if (data instanceof Uint8Array) return new Ok(new BitArray(data)); - return new Error(new BitArray(new Uint8Array())); -} - -export function float(data) { - if (typeof data === "number") return new Ok(data); - return new Error(0.0); -} - -export function int(data) { - if (Number.isInteger(data)) return new Ok(data); - return new Error(0); -} - -export function string(data) { - if (typeof data === "string") return new Ok(data); - return new Error(""); -} - -export function is_null(data) { - return data === null || data === undefined; -} diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@bit_array.beam b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@bit_array.beam deleted file mode 100644 index a25ef1c3e4d540bd9986268e44c25ac0299e40bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10328 zcmbVyc|26#|No4!%wRIczGWEuI+h|?#!mLKloW%JVJw*;B-xWBLJYDc`zwC#z0T`-UgvesJ@?+ZV`Oz$2?CL_)-%+#(52d` zLm+e_TU%S*i>Js$f)C!6M0F+v1Q0@MJp%lEoGH`*lJBXuZ5z;VCzD(wNbW>mDv25r z0rsVkLWwTK05ZY%RI+ObmAI{F^C!4FQ~jJl1qIIi52y3rdTR=qdE3+9&Ckc55I~GLMWi}Y2_!OxcpA?4 z?{tA|0Bp_#U-#|PgE>XTkg2s4Dj|SMaXv$$dg8P+v}%3)+ylu(pr?o5B1rUC8v=po z1KEH;m|g-91qgUF0%8LQHxxxf(V<0APz()YiGo0JG#nlJFbayN;lmhEC>V?bYE84I zLkFOsE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64wdxMQ5Y)U9Hz+t7RL*wSYeBlZ6BRi&rKCWTQsE2l#TU#&iWM2v=gJwzcy z&sI5ve>ng1ULHhxgUmM%tslhJVDQBvlGl-RreOcs-k2XG3neDAto(L;uAT zLOpxDa!^HXux`e+V?%1$uFb)85yqt^Gy20^ z8y_UjOVN`uXu@}W@e4oK#aCyN%0`iI7mPACEyV-`bba({zci10Rk^Hx%Y4~~N|n7m zS@%PbbN~EU>X_Jy-y+?SGlLN-v>s#oI`wLs9-=KgG!=?A#eF`rx``c6iLK7N=5;sF zDni>ZkH6OibT-+_WfOYwffw&1hixF0x6L~N;NN2hkZkQ~#o>lE Lx?s^w5a|B^Sn_+n diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@bytes_tree.beam b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@bytes_tree.beam deleted file mode 100644 index dcb297f53e3936fdcd3451940ff9b88e539baef5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5652 zcmZvA2UHW=_jN)|sG&+1l_pXJ5h((JAYdrc1QC)z0tP}7NN55Ih(V-^hz4oWBy_OQ zM5-tPQY|#4h&&5|6s0Nu3F`a3^{sDK_S`+^>{I4Wax?3i+uCb_K%zWwgo(8Y)kzlw z0z2;P?94%6J_H=b-`F#Zild;YfjC?>hD^p0vAeu=*NLJ~u>`#50G@=!P%)_A{#J4z z?q40+i$wIoP^0iz9FdBrhG`ISA=Tc2B!3_@5Kr_;4GF}MQ3O1NI`uc~w`1T>vENq^ z*neVn8<^TPc;cxjOkf};3?lk3MUgQ;k0jJ?hg{AOS=4fe0|YyE*aHKYcT^qbT_ExN1CU*SpL8N!TC)4uvOrla_pNRMda2 zO-WcBFt?Q;5C{f!CF~xD-TT8 zn3c^~h?U;T2~aj6h%8WVfIh$?*e(m6`k#A>>1Gu&W@Ft|EYX)(1czW?2#gMaF*8C0 z=nw%G!5P3L$O8hbf}Ai7Iz$Kp1KNWK(ILVtf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9ttm+(hy9y@@>RKZ<^oTueFzdJ#*275=Y5WqcY!oPbjg9BF0b+8_>Q|6=nu9P*Anf z+o$H#d&iv{s&hL%N9?&$b})_85BnKyTbuc^ud2SK6>=K0JHF~%eiLmC)i^^`N$5dH zHCd6S{3V9;mlNzFzw?vcc{UB{H@~ujMaF4!9iIs3C7DsRH{|w>yQg+uT6#P<;WZ!+ zORa6#8#{Wgxg$|-R#o0IFYY(4@L6X1oM(xhy8R^=Ex4WT8-?rU;#EUTuM$E@`~zINfL_7;3~uu2<*@d~hL+UpH0e!RUrU3=Gb<+A3yMQG(jv%2#F z>(0%Vl759#`ikYoYb$+CbmH zz(B`9%Rt>g!{9vX*nk_vh!1r6=ND)x(m($s|NJ-&vJAnIa^nO*`rVz3?o=8H*gqEp J__HAC`ai==y66A^ diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@dynamic.beam b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@dynamic.beam deleted file mode 100644 index d1c37fdc2beb7db3379400e198fce4ef9fadccd7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3312 zcmZ8k2{=^i8=o0j#yVz13DIU9!?je1K?oU3mJwzQ&M=IbF*6vI?6jFgbsJez6uMa= z(SnMkLJ8%6ZAEeGGPV|6|8u1ObD#hBJiq7ty}$Q;zwdnK%y;HJ_O2d=Fqrfw8#`+k zYp&NG7z}oQb#?V~cPJg8MB+o@7?em_aAGi>!r{=Uam{NonZpgC(}E;Wzhv@y9zKZ4 zq$kos00x)FjSJ*(*)&F|8ko_UVtZ{P;fVa8v@Nn!2<<> zkjoOV5a?tSJW-GcxmkiN1Uef9FA@|%Zk3=4fxd!*Hw&5}w_DJSK-Zw)BZ3jgoe|6+ z(5)!A1WF)*BB0da67m8Gc?5bEl+e;JP(_QQ3?xwCMMz)-5*P$p5)D!Xyd+vgAfW(F zA+b>a17!>-E8@{21QZ@Fq4ZM%gPZUo7)Vuj6M?}F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#WQ7-!3=3IV|MW?MM>W`D^$0S%=@+NTh(BS*5Hw8UF_~P5r^5`xlzphCY+i z660*a9*o9-`gCs)zXsGtuJxa2q#hEB)I@3_jgZDj6Qn899BF~HM%o}9kOz=nNN*$w pNk&qUp)e&5JNRd}gIoU!(O>I@U@*@(7BoN9Q$l?(Ty7Nx`!CO;H)H?+ diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@dynamic@decode.beam b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@dynamic@decode.beam deleted file mode 100644 index 0597f3be7bb4ca7fcf6e5603eff401819a080b4f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24728 zcmaHT2|Sct)Hr4^meDYF(b%((C0R4JWKH&c-?NUL7KKV7OO~-ELiU}Al0Af^tVu*6 ziHaokzmN33dcW`c&+m8U-sjwN&vwr__davg$g(+3?B(nopzn;w``|G?XMOzx z9UYzh{e6Fv;%9%iw)-5gUiQAZ0BrZ@{c!YoS z`vA9nDhR3X?(O6pg7f$Ba>jWBFY7}{e_yaL%n+9_8grF0#4-k_$Fa$XN4;)~}Eb_;)|LXC7jDR^TBL6t> zFA);|_mH@V-R~8$b8z>z$A@C=Jw5+VK0pL5h%IMVXS^*~=-)FC^diuTh>8Dg)Bl16 z)9FQ^#r{h|+g}!7MSR`; zZM_5cyzx&`|Az#@DDpe)|I3tK1S$~!#j=Y0TS5LihK9!ei(~>ZuveA-BbP`OR5KzX z+LJ^?L?{5zrv^Yh09j%b0YyT`g(1ceFjS;OoM<#P5k?y&YYdY!hGA4-D74HmGzyEk z3uD3MDY1)e}K656!5i4jbMVG_DI3^9WFfM&SAHDe*nlF)6Sh!Lz1&A!|8 z54sJ(M)*WRM~MP7hY!%${YAr0K%f8-EfB^*jl$qyz$6#}K}(K8p?o24<0xt2FcNhb z35*T}6g@&f&;fdSU=M~Gi!Eb9{qX@ent(vpP%@xQ(ZCnnz!%(*FNn|}DB$vFBsUYz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z=t*TsW=U*Glu4CInn|%q%SrBOtBD4QNJ)Q5fJuT$dTBjrK50N{LTNN<5-GVUx+%da z(J9a=nkk|wrzxr_t|_o7o++Oxn<-&QE=fp9Zb@=UbV*7{Oi4~jS4mn)TuEIisVS`~ zuPL@EV<~4TWGQngbSY^mYAJ9j(kav_)hX5~!zsim#VN}v%4vydifI&S7ikq~7-=QHcj>t!b`ldTD=&UWs3cU}@cH-f6LEvT3tvv}v_zi)oB0_5dDpa$_%N zY-M3>FJyUcVQpz+FJxt7Z)9aIXKZC*Z2(kxaAg1h01*HH00RI300a;J01yZOKmrE< F0064sPZ0nB diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@float.beam b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@float.beam deleted file mode 100644 index 12c710680eef3decfde0b866aab84faf16c87c4f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12012 zcmaKS2Ut_f)^PePl_DLa zsz?z5DWZb>JIFcrJoldO-_Nr$@2pw#&O2*nlAUDhm|BQ~Kq4PCwAGE(L#*XMAaL>V z@o`VBrym;Sujb*0MTM9Jpn`(YttTGm;1G8|Z`axrm-9(;MhF)026L?G8i5W(_=O-mL&W^OF=GCxFf%tllz%{g8`|3s=%(h63h`1SRLlSZY*1WC5Dw#p z3PHP|gZxk!PqUNy0?IWQ>xT}Ns@(V_&D4PXf zFQJ3rN@@TBS`4Tlu)ejyKx+`%IS7jlalxQHfnm&ousDo+DlFFs}YI-9LC!N8|3fe55)OlUEIAxz1`7b zD0g?bV4OeBFT^{*FB~oakh+Ehq1-|;{IH&=Any<_e=z{nqQe5P7&Iot8|5bk;Mx-w zw6izH1H0vk4srfR9RvbtV%^ao5V<4(;eZjYI>5XDV+X_Wa3UH`I2eIPn7~0`F}xTN zjRhR6hF3Fz!@*{FGa{NG1lUCoM@*}hKuik`;7bNjCV=A9?g6hEco!m?Is~|gub!Be z7F?@F3piWx0Yo(I2=EZ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U?6oi2LJ=^UB#T#pwoGG40vKr_uplC@vTtflW^w+dyNa(>shOWGdkl=PE~d0 z-~99Up|IIk&Us!cXp@^{j&W-WhgcJB4xLhH>NyR>60+H@;6 zb4>2=jJ#YN7$+darx2`jalLbyk>vY%VZL9laWBsMq!qp7bzH#`qlA)ab+dYpZe2fZ z-8t?PC%KK!+Nu0{V&hn#v|A>ylhtX-`RX_EpF(#(Jm)`Q$+B}6*)n~{SDnogs9*o{ z`l6|6C5BwFMlU5-+19EWoPF`GjgMI+g;yi=6JK{76ut3dS3|o*ilk`0C?9wyjV~by?3c!)CocEhZFWSSFft;d(3F(y!+s+z}~tGJbD45LU;Gqz5mGX z-}spin222RlZ%0Iq78}@#$6S2Vka2-A2twZl{LT6)iw8`GS8KyG{>aW7Ry~$*Kc$d z_q{3h`ETpBsw`nw^?T3zbLZWimMiU(^~`+5DO)%GE4@w~?#JS&;e~;P`Ki%a`#kn<;#gH$=fz{00 zqy6sZ=hx4dK3}araoWd!yv%B>T9&VDv^rwtCPpxB<*I2c4idC<_c~P=)VJ(R7Tf%f z8#etjui_8=&#rTAk}HExW*(?)G5}&20F@P>@_fIc^y-ci diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@int.beam b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@int.beam deleted file mode 100644 index 1cafd930c6f398647b48bdbcf9892ff610a04d0a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12276 zcmZ8{2UHW?^L9cg8*1nvEp$RJ(pzZKdzIdT1PCRBs?wXHh@e0~k&Yk=C`CY|2_gt0 z(nL`}Kt!b|N)hDSDE`j-|8mY`p8GsAcV_S2O|m(A%F;#-0+IQmYoKGUL$FtYK*&sv zj*dFA&jew-aA<5WVcyF-JR~TBfbod*3W~sZV(>v;!DkTSR-s<_a7_1~IFE3GZxGfy z`w!&-CY5-5g=0Ma3;`B!?BRzG!Fl{4!wGn7@R@8v2$)1d03)bl&S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adaX$F zoIGg^4YC1iLP0$`doc5HSf=&-9DhaI?zvl@b?0~N56V{ybO$w#&f=uss8XxT) zQV+||%MFhd_goLC!aY*%_A-jdZ4%m&6~!HWqT4yg1C&hH@}?iGB2T{Q@NNIDYV`GK z)>b-y1Q<)Yxl~r(>nbmj8{RAK1?3|e4sB86P9lIwpPr#iYtr(*?I+hHI7cp@8SZpQ z_XirE>NkYd%rCiC{nV(8F#C9;d%2r5nItci8(s_Q$qJCGo``De$eMJ|Pik7kHYLWH zoz31uZUUY8AJ2^9-NN)6XYqpfap>gm=t3f6c^rY8KFmx~HAF1Bvb>8?Y^;ZjBiTswzS85L< zo)~+m8I>Q-jp7BpxX9#;>J*xvZu#{;U;KE9fp_~&*>DBZVkgZs55Li70d;vkXXVmt zid73egS>w}XB&3=)b+)Tx2?i8vD9pb(>N((YH@Sjc%)Z&}xJ2kb zS?XIh@u}TGo%k-`qD8Le)e(<=&u!02V=l##1IsdcLv{t340i2K++x&ktRvN-T`+Ib zYutAt>p`=gr@besZP>C~QE=Qk?Cp4hTSstrvh@5-Y+Bw|J!;=nHr(+C{`UB1vFkuC z9UJs*$8-l^qiSL+T?*Nn-(Z@c`QpXg8(lrQ*&y@lGPjb0?)x6JiepWBbrbCdoHnLW0dE*`EAKCoVl!Tn`F+7t*c30jRC3q-2ienO6F#z{=zpCnD KWoWGx6zWgM`vivo diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@list.beam b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@list.beam deleted file mode 100644 index b68012374b03624fd704260e8598bb24beb42366..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 50888 zcmagF2|Sct^f+z|^(0fnSfiR6F~wwR27}btiKHk|vW|VrjIB~idlZs-qS9uGkV^X^ zNtPBxURtzDg`%iP{m*@7THg2j{r>(wpF8I~=Q;PBbI(2Z+;guPoB0c8NJ-tiW?^kU z&s?;KCnYuF^Ut3@-EsrN1U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o1&Rzsf+9zmK^#yPC@YjL$_^EQ zibtiQ5>Q2`3RDfM6jhAsMGc@vQIn`X)F5gMHH7*D0$_pw_^7|Ad(3hU5Fi2(j)*`wBAn2ke{{Fvv2(PsaN==< ze)Qn}kJRyX{m=4#TF01A4Ug!NnBl4aPtZU9SD_K3g`=?%v;8;cW%#eceEk3Me{<2% G0RIC4eO0Ca diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@option.beam b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@option.beam deleted file mode 100644 index b107856ada5468efbcaf9948c542894adfdbd416..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6244 zcmZu#2{hDS8=l27gUJ|swy`gR8T*>-Nn*;D5QD)m#uz&-l%*_D5+h5bMAjBdT99Om zqD1yBk|eTJ;`@#Kzw`gj`R2?s@B4f2^Stl9@40hl&Na6=t^xuHxEPxm9W@HE*9L(= zeLFilvrRr^A|b#qkQzb?q{I-&WH)kPAk{E9Fo0-C38WD5WKwWQFqK9OBhrG2IDkMU z1-mhZ-H9|Zf#QQZfIYwnG03plQ|09;@s9SK26puuQuGpG?%QcXugvcTR^ z5{Xttq798Dkx(-zH@Bf0lm#sf#$oIwjSY>V++ag>dngA8ZO9F!qgjz4Bo0{&Imiv|!B<%9sKUX$(a|8M&tb$pmH%YK+988P6-++~8$;3{VM%q^CnrY)B*+ z#-)Scf$9Q48$&_ddfW&ee!~?6_Y?vJhN1qIOch853{=z+^BOgyKI%yMTDAU0Yc;d?nZgos$C}T^)M6Hn^Fie9E6Jw;-q{GlaYC)h`TD!ZELDr^&fY^S3relbLS|f2_ znC{;YK+`jXax!S$765(#jNHlq`1X7S!1C_-GJxd)z~D;&;0D0p zivmFH`HVVTdp;uv<1AqC88HL^2A^Ts0WjhW3)}M<>to&XS&tG!2!OA2fy{{bLc)U|4JKk~L~39# z)`J+rIMcD@U@F5`+O?r1vKQ8i7>50O;A3}xG2DVfyvQUE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E@&PM5G+38H`4Y|(R zygyKYR-ejwX?Y;yBfID$<68UKQM&f%cWjf+qm@}9@-0g?bAKKgj8Y$5xNH{UGV_R* z(xCppcsb0pd1-M4Ti4y(`$x<9d93)tcR(OuO9s5zTzH=bxWV{(Xuw1r27-Xq#_C{= zv74|q*lk!>EEP+^(y)Qp0Bi)HB@{3}{|~Jc`$tRVuM#!|CG!>i6#EzD-a=yq0R9g> C?;=3} diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@result.beam b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@result.beam deleted file mode 100644 index 46521f9b637adfcb5c5fec61c19a6b341e82b3dc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8412 zcmZ8{2Uru`^L0Wf2@(uJdJVnz7K(&`^xlzP0@5K6iqZ*+fQS?^Qlv;%Kok{0q)D{{ zqI9H+(v+ft@ZTt}&+q&4JZER_+&O1vcW-hN7F{z-SrCYK1baryL@V4z1q1?19vvOc zb@&9}+ygOqTo@rB+}tWO=EZ2tg9~^4pD>hJ@~?!ntfYHTa8Pt$Fd z2{ics1wkN?cCZ%?1ft9YTm%5}>mC3{0L)+n2|p709oW8S%gd$#=?cbP@!Y8Fwh3TCqWsFK!4g0 zAwf@(Wkg9(CJN*yKt>D=mjq-a|H(*_WhAh0aWGW;Z*7TVHAxbbnM{@cm{ySM+a^*8vxDFVqgOK65Aaz4zCIdm1n`ai z@r}rQLoD0?3^f2KhQ}ImWDO${RDjGkCP4)OJ}c0d$^Tp^#GeZ#WXcP~O-WE;AcY+$ zVTOiV0wpZ}m9Qk2u)xC2!BBHR)#ASe4HY?F(Uv5rD7lUm2?S_x0N33bgM^rpZ?4VX z5KzGu17Rdbd1b&*I}%g~$m9mX_JE=TaJzsZ4=_B-2myht!tvJR4jPju_O$`a1c02Q1%Tn$M+27p`ANZ!mj*2Tu`dQ#_^~etSh{1M7qBOeeR7Yq z0Lc2}nlJ!lO>!OR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ojZ_UdYe diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@set.beam b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@set.beam deleted file mode 100644 index 05a4840b16f508d2328dbc0827bd9ac105770914..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8944 zcmaia2{=@3*#C?nGuE+Z9|jrgAWI69oeyLd*Y!KkeeUOX-_N}~!($HJlc(e$5aC5lo#V#G$(AY*2z2Q8 z@84r-oI|0b|(^CNg&q~Pu^4F{P6*SM6xMh=X=)K9q>oS7w)a+PH-b* zfkjDVUne3VfQ$nS18`^Yp#eA#U!uFS2Z2b&`{UgGeM$QkyDYNHS-h#QzdPQ)i{Jwg z0`P8Rg0D}ZJHf*P?~nI!!>0j@1q8YRuIm8Foe*%w7hvM>E^b~}9|F-Ch#2orPV?~h z_1;|=3oL9J=mR)`vj>EFd*jLe1UJC$kH0!^U-v*F-ihGj;rj*1%;~RZIEVDErL4TP zi;u5QsJCxmfHYPb&L#~w{jZW+`kysr<^IiQmj=W8uK}m@UJ?GQXO{*mB&+Z*9}q2H zcRU0_eGdYGAOV0^1At=y_@PJ&l8RLr0!88UATTy4mV%;Ul}AEx6f8XrLvgHkZ4g@N+cYKgFw?LX;iFpC}<(2 z@Sk~FlqnL6EQWER=#Vg02phDHQb)x~$AW}*QM&e6CP-)K2xSD&vSXn$l$kv(QW*(Zh*;2 zfphIL(cv^$BpOYD9|RxS6aalV4GyWGaEOu1S^;T|Mk28&uo5sfHYl8H|A7rCHT)n2 z&JDQZ0o-vjAW>CZNNNh4hZ@DmsR@HnYr>E)5R@)jq_ZY9k_`ws0SN&jq(%KVFdhn= z7x2Ujc;ekFFdG}-5eK8jvB3cIf09S;CXb^AlZRu|kWe@u1_1%a|5Jcn0=5_qXn{>dCjfAS{zpGil~|ykY&beW zw!NOhg(+|$fQ|y_K=p+GDLak|O^dDjPvu1@a5O*`0s_ddP`CsIE)E!q0EUtbC=`y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Jt)sImYg|$nWo@X4elwexZ8atjimF#?Ljg@VHl(36LMy{3sS7c+kJO_cuuj? zOl9a*h24IbHEZt4I_?)_(BE?UZe4X^tYe?s3xRi;!&7|1S{(*U$2;$h-17^1wWIty zEHW|6wfcg2ZiEM2i=ZV#9M$z{w-UO%&8bJCoA2!_x6co^yhVrW<`v%9G_PuEk)*er zJaji{PDtZSTAex1%a{Z8rm+^En^?bIetR%Fz#zBFnz`frg^ z;0|YJ2C07(8blsBl5X)tX}~g=i)X8(ib0NNS~sT z)(?}4Wf3D%Oh#N}w!XN)zIi zi+>mWUzVw diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@string.beam b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam@string.beam deleted file mode 100644 index 714fd54be2f231f9c23768a6515c00d234d0f0bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18068 zcmZ|12RxPG`v>ee#$z9QgpLu8dF)j-IriS-;NaMMgpd_k$vP+_l#!4MxxdeKU-z}{>%O1SIcXW1h!YTKrK)MF>Z=Bs%MlPjZBI^4 zs(anMFlcX;z@PxEk6R2j&;jG^7ZmP@3GhPuxFIhoTypfn__zhRJN}jM3&4b60s=9A zhdBfWxp-lnVz4e4pCD{dxL>dj*4ftu128zdqXW>+L7=EZkgtOi)(0IB4vzKnLOWyL z{Z-{~cADws8;S{VMh9XtgZ=#eB0pzeZ$ESZ29EL1^uh#!O5D*tMy_bDK#WRIKrjaG z6$Ez+G79v+6RMz<9s&3&4h;gD?(f<6W>Jj(qeM>0N;S#|K=OvV+sUl|GRh`f&ws@lD`~$H_{vJ2QY!7 zf`eQg@Kxal1_34=)j;7XS5$S2o37R_<=R! zhj9+dbP5M2ClGrTQ*v5Wr380q=p!5(V4o*mC0)wdFkOnXq#0aNCNEZNuI8qY8 za7LssIL?t2hQ#>+FckubA1;QFt`7-`p@btBa3B!2BTNH~@5n90rHH6Z#INS0SebUD=@| zfa3sKQh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ib.app deleted file mode 100644 index a93f395..0000000 --- a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam_stdlib.app +++ /dev/null @@ -1,26 +0,0 @@ -{application, gleam_stdlib, [ - {vsn, "0.68.1"}, - {applications, []}, - {description, "A standard library for the Gleam programming language"}, - {modules, [gleam@bit_array, - gleam@bool, - gleam@bytes_tree, - gleam@dict, - gleam@dynamic, - gleam@dynamic@decode, - gleam@float, - gleam@function, - gleam@int, - gleam@io, - gleam@list, - gleam@option, - gleam@order, - gleam@pair, - gleam@result, - gleam@set, - gleam@string, - gleam@string_tree, - gleam@uri, - gleam_stdlib]}, - {registered, []} -]}. diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam_stdlib.beam b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/ebin/gleam_stdlib.beam deleted file mode 100644 index 760ea4666c82f6a3ec55f8f2ac2480b6d95f6db7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 27968 zcmb4pc|4R+7qBsd$M7(WJ!R~Zb?jTq*h5N^t%bqZ_ZdprC1nX^o2W=a5mKa8MXO3G zEmB%&(WcVAeCL^&miK+X?~l*VanC*X+;h%7=iKGFuG3;qBLRUJOFKtfcU$%{O9259 ziC@2dt?CVnW-?*|SnQDKh@g_B_;_YwFoVSmWF|&4V#7%K@iC0}fG{ST4ke2o8W9`f z!AwkyOB{@d3t_Ms0SxF78^!2uX=$#6$#pgfgO8Oj>M2 zG(9#cI-1T-Ok$QK#fC6J7Bi%TofIF<#1z!>FjmA`CP_D*8O@9ViIlh~L?$AZ9T1ur z7ZVT!hJmGt5wT&2R8T}LBQYg_9Tx!Y%rItRNjxJF+M(9Y!$PCu80@!y`MC9xXeNsl zzz%1`lI9@NJYgV{k;rBRtd3xZmjtD-K?zvV&hH7r*tEIUa}g4s8^+7yt>qKq86jhT z)kH_I*nzwj8nnbG#YP0jg)kAB;BZDFBbd!h1pRRVybcJNFC!v0nGqck5|G3Ww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leam_stdlib/include/gleam@set_Set.hrl deleted file mode 100644 index 51fb778..0000000 --- a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/include/gleam@set_Set.hrl +++ /dev/null @@ -1 +0,0 @@ --record(set, {dict :: gleam@dict:dict(any(), list(nil))}). diff --git a/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/include/gleam@uri_Uri.hrl b/lsp/bet-lsp/build/dev/erlang/gleam_stdlib/include/gleam@uri_Uri.hrl deleted file mode 100644 index 50150f4..0000000 --- a/lsp/bet-lsp/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/lsp/bet-lsp/build/dev/erlang/gleam_version b/lsp/bet-lsp/build/dev/erlang/gleam_version deleted file mode 100644 index cd99d38..0000000 --- a/lsp/bet-lsp/build/dev/erlang/gleam_version +++ /dev/null @@ -1 +0,0 @@ -1.14.0 \ No newline at end of file diff --git a/lsp/bet-lsp/build/gleam-dev-erlang.lock b/lsp/bet-lsp/build/gleam-dev-erlang.lock deleted file mode 100644 index e69de29..0000000 diff --git a/lsp/bet-lsp/build/gleam-dev-javascript.lock b/lsp/bet-lsp/build/gleam-dev-javascript.lock deleted file mode 100644 index e69de29..0000000 diff --git a/lsp/bet-lsp/build/gleam-lsp-erlang.lock b/lsp/bet-lsp/build/gleam-lsp-erlang.lock deleted file mode 100644 index e69de29..0000000 diff --git a/lsp/bet-lsp/build/gleam-lsp-javascript.lock b/lsp/bet-lsp/build/gleam-lsp-javascript.lock deleted file mode 100644 index e69de29..0000000 diff --git a/lsp/bet-lsp/build/gleam-prod-erlang.lock b/lsp/bet-lsp/build/gleam-prod-erlang.lock deleted file mode 100644 index e69de29..0000000 diff --git a/lsp/bet-lsp/build/gleam-prod-javascript.lock b/lsp/bet-lsp/build/gleam-prod-javascript.lock deleted file mode 100644 index e69de29..0000000 diff --git a/lsp/bet-lsp/build/packages/gleam.lock b/lsp/bet-lsp/build/packages/gleam.lock deleted file mode 100644 index e69de29..0000000 diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/LICENSE b/lsp/bet-lsp/build/packages/gleam_erlang/LICENSE deleted file mode 100644 index 59e1345..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/LICENSE +++ /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 {{copyright_year}}, {{author_name}} <{{author_email}}>. - - 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/lsp/bet-lsp/build/packages/gleam_erlang/README.md b/lsp/bet-lsp/build/packages/gleam_erlang/README.md deleted file mode 100644 index 7a4389f..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# Gleam Erlang 🐙 - -A library for making use of Erlang specific code! - -## Features - -- Typed Erlang processes and message sending. -- Erlang binary format (de)serialisation. -- Functions for working with Erlang's charlists. -- Basic distributed Erlang support and working with nodes. -- Reading and writing of environment variables. -- Functions for working with atoms. - -## Usage - -Add this library to your Gleam project - -```shell -gleam add gleam_erlang -``` - -And then use it in your code - -```gleam -import gleam/io -import gleam/erlang/process - -pub fn main() { - let fun = fn() { - io.println("Hello from another process running concurrently!") - } - process.start(fun, True) -} -``` - -Documentation can be found at . - -This library requires OTP 23.0 or higher. diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/gleam.toml b/lsp/bet-lsp/build/packages/gleam_erlang/gleam.toml deleted file mode 100644 index 1ac21a2..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/gleam.toml +++ /dev/null @@ -1,18 +0,0 @@ -name = "gleam_erlang" - -version = "0.34.0" -licences = ["Apache-2.0"] -description = "A Gleam library for working with Erlang" - -repository = { type = "github", user = "gleam-lang", repo = "erlang" } -links = [ - { title = "Website", href = "https://gleam.run" }, - { title = "Sponsor", href = "https://github.com/sponsors/lpil" }, -] -gleam = ">= 0.32.0" - -[dependencies] -gleam_stdlib = ">= 0.53.0 and < 2.0.0" - -[dev-dependencies] -gleeunit = ">= 1.3.0 and < 2.0.0" diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_Abnormal.hrl b/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_Abnormal.hrl deleted file mode 100644 index 4cd0452..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_Abnormal.hrl +++ /dev/null @@ -1 +0,0 @@ --record(abnormal, {reason :: binary()}). diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_CalleeDown.hrl b/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_CalleeDown.hrl deleted file mode 100644 index 5dd5047..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_CalleeDown.hrl +++ /dev/null @@ -1 +0,0 @@ --record(callee_down, {reason :: gleam@dynamic:dynamic_()}). diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_Cancelled.hrl b/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_Cancelled.hrl deleted file mode 100644 index b82b49f..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_Cancelled.hrl +++ /dev/null @@ -1 +0,0 @@ --record(cancelled, {time_remaining :: integer()}). diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_ExitMessage.hrl b/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_ExitMessage.hrl deleted file mode 100644 index c476308..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_ExitMessage.hrl +++ /dev/null @@ -1,4 +0,0 @@ --record(exit_message, { - pid :: gleam@erlang@process:pid_(), - reason :: gleam@erlang@process:exit_reason() -}). diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_ProcessDown.hrl b/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_ProcessDown.hrl deleted file mode 100644 index df0b6b7..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_ProcessDown.hrl +++ /dev/null @@ -1,4 +0,0 @@ --record(process_down, { - pid :: gleam@erlang@process:pid_(), - reason :: gleam@dynamic:dynamic_() -}). diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_ProcessMonitor.hrl b/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_ProcessMonitor.hrl deleted file mode 100644 index ce552e2..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_ProcessMonitor.hrl +++ /dev/null @@ -1 +0,0 @@ --record(process_monitor, {tag :: gleam@erlang:reference_()}). diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_Subject.hrl b/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_Subject.hrl deleted file mode 100644 index abc46b2..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang@process_Subject.hrl +++ /dev/null @@ -1,4 +0,0 @@ --record(subject, { - owner :: gleam@erlang@process:pid_(), - tag :: gleam@erlang:reference_() -}). diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang_ApplicationFailedToStart.hrl b/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang_ApplicationFailedToStart.hrl deleted file mode 100644 index 52c9896..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang_ApplicationFailedToStart.hrl +++ /dev/null @@ -1,4 +0,0 @@ --record(application_failed_to_start, { - name :: gleam@erlang@atom:atom_(), - reason :: gleam@dynamic:dynamic_() -}). diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang_UnknownApplication.hrl b/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang_UnknownApplication.hrl deleted file mode 100644 index fde3c61..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/include/gleam@erlang_UnknownApplication.hrl +++ /dev/null @@ -1 +0,0 @@ --record(unknown_application, {name :: gleam@erlang@atom:atom_()}). diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang.gleam b/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang.gleam deleted file mode 100644 index c98ba04..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang.gleam +++ /dev/null @@ -1,224 +0,0 @@ -import gleam/dynamic.{type Dynamic} -import gleam/dynamic/decode.{type DecodeError} -import gleam/erlang/atom.{type Atom} -import gleam/erlang/charlist.{type Charlist} -import gleam/list - -@external(erlang, "io_lib", "format") -fn erl_format(a: String, b: List(a)) -> Charlist - -/// Return a string representation of any term -/// -/// # Example -/// -/// ```gleam -/// erlang.format(input) -/// // -> {ok,<<"Gleam\n">>}% -/// ``` -pub fn format(term: any) -> String { - charlist.to_string(erl_format("~p", [term])) -} - -/// Returns a `BitArray` representing given value as an [Erlang external term][1]. -/// -/// -/// -/// [1]: https://www.erlang.org/doc/apps/erts/erl_ext_dist -@external(erlang, "erlang", "term_to_binary") -pub fn term_to_binary(a: a) -> BitArray - -type Safe { - Safe -} - -@external(erlang, "erlang", "binary_to_term") -fn erl_binary_to_term(a: BitArray, b: List(Safe)) -> Dynamic - -/// Decodes a value from a `BitArray` representing an [Erlang external term][1]. -/// -/// -/// -/// [1]: https://www.erlang.org/doc/apps/erts/erl_ext_dist -pub fn binary_to_term(binary: BitArray) -> Result(Dynamic, Nil) { - case rescue(fn() { erl_binary_to_term(binary, [Safe]) }) { - Ok(term) -> Ok(term) - Error(_) -> Error(Nil) - } -} - -/// Decodes a value from a trusted `BitArray` representing an -/// [Erlang external term][1]. -/// -/// *Warning*: Do not use this function with untrusted input, this can lead to -/// Denial-of-Service. More information in the [Erlang documentation][2]. -/// -/// [1]: https://www.erlang.org/doc/apps/erts/erl_ext_dist -/// [2]: https://www.erlang.org/doc/apps/erts/erlang.html#binary_to_term/1 -pub fn unsafe_binary_to_term(binary: BitArray) -> Result(Dynamic, Nil) { - case rescue(fn() { erl_binary_to_term(binary, []) }) { - Ok(term) -> Ok(term) - Error(_) -> Error(Nil) - } -} - -/// Error value returned by `get_line` function -/// -pub type GetLineError { - Eof - NoData -} - -/// Reads a line from standard input with the given prompt. -/// -/// # Example -/// -/// ```gleam -/// get_line("Language: ") -/// // > Language: <- Gleam -/// // -> Ok("Gleam\n") -/// ``` -@external(erlang, "gleam_erlang_ffi", "get_line") -pub fn get_line(prompt prompt: String) -> Result(String, GetLineError) - -pub type TimeUnit { - Second - Millisecond - Microsecond - Nanosecond -} - -/// Returns the current OS system time. -/// -/// -@external(erlang, "os", "system_time") -pub fn system_time(a: TimeUnit) -> Int - -/// Returns the current OS system time as a tuple of Ints -/// -/// -@external(erlang, "os", "timestamp") -pub fn erlang_timestamp() -> #(Int, Int, Int) - -/// Gleam doesn't offer any way to raise exceptions, but they may still occur -/// due to bugs when working with unsafe code, such as when calling Erlang -/// function. -/// -/// This function will catch any error thrown and convert it into a result -/// rather than crashing the process. -/// -@external(erlang, "gleam_erlang_ffi", "rescue") -pub fn rescue(a: fn() -> a) -> Result(a, Crash) - -pub type Crash { - Exited(Dynamic) - Thrown(Dynamic) - Errored(Dynamic) -} - -@external(erlang, "init", "get_plain_arguments") -fn get_start_arguments() -> List(Charlist) - -/// Get the arguments given to the program when it was started. -/// -/// This is sometimes called `argv` in other languages. -@deprecated("Please use the argv package instead") -pub fn start_arguments() -> List(String) { - get_start_arguments() - |> list.map(charlist.to_string) -} - -/// Starts an OTP application's process tree in the background, as well as -/// the trees of any applications that the given application depends upon. An -/// OTP application typically maps onto a Gleam or Hex package. -/// -/// Returns a list of the applications that were started. Calling this function -/// for application that have already been started is a no-op so you do not need -/// to check the application state beforehand. -/// -/// In Gleam we prefer to not use these implicit background process trees, but -/// you will likely still need to start the trees of OTP applications written in -/// other BEAM languages such as Erlang or Elixir, including those included by -/// default with Erlang/OTP. -/// -/// For more information see the OTP documentation. -/// - -/// - -/// -@external(erlang, "gleam_erlang_ffi", "ensure_all_started") -pub fn ensure_all_started( - application application: Atom, -) -> Result(List(Atom), EnsureAllStartedError) - -pub type EnsureAllStartedError { - UnknownApplication(name: Atom) - ApplicationFailedToStart(name: Atom, reason: Dynamic) -} - -/// A unique reference value. -/// -/// It holds no particular meaning or value, but unique values are often useful -/// in programs are used heavily within both Gleam and Erlang's OTP frameworks. -/// -/// More can be read about references in the [Erlang documentation][1]. -/// -/// [1]: https://www.erlang.org/doc/efficiency_guide/advanced.html#unique_references -/// -pub type Reference - -/// Create a new unique reference. -/// -@external(erlang, "erlang", "make_ref") -pub fn make_reference() -> Reference - -/// Checks to see whether a `Dynamic` value is a Reference, and return the Reference if -/// it is. -/// -/// ## Examples -/// -/// ```gleam -/// import gleam/dynamic -/// -/// reference_from_dynamic(dynamic.from(make_reference())) -/// // -> Ok(Reference) -/// ``` -/// -/// ```gleam -/// import gleam/dynamic -/// -/// reference_from_dynamic(dynamic.from(123)) -/// // -> Error([DecodeError(expected: "Reference", found: "Int", path: [])]) -/// ``` -@external(erlang, "gleam_erlang_ffi", "reference_from_dynamic") -pub fn reference_from_dynamic( - from from: Dynamic, -) -> Result(Reference, List(DecodeError)) - -/// Returns the path of a package's `priv` directory, where extra non-Gleam -/// or Erlang files are typically kept. -/// -/// Returns an error if no package was found with the given name. -/// -/// # Example -/// -/// ```gleam -/// erlang.priv_directory("my_app") -/// // -> Ok("/some/location/my_app/priv") -/// ``` -/// -@external(erlang, "gleam_erlang_ffi", "priv_directory") -pub fn priv_directory(name: String) -> Result(String, Nil) - -/// Portable hash function that gives the same hash for the -/// same Gleam/Erlang term regardless of machine architecture and -/// ERTS version. -/// -/// The function returns a hash value for Term within the range 0..limit-1. -/// The maximum value for limit is 2^32. -/// -/// -@external(erlang, "erlang", "phash2") -pub fn bounded_phash2(term: anything, limit limit: Int) -> Int - -/// Equivalent to `bounded_phash2`, with a upper limit of 2^27-1 -@external(erlang, "erlang", "phash2") -pub fn phash2(term: anything) -> Int diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/atom.gleam b/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/atom.gleam deleted file mode 100644 index 33931ac..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/atom.gleam +++ /dev/null @@ -1,85 +0,0 @@ -import gleam/dynamic.{type Dynamic} -import gleam/dynamic/decode.{type DecodeError} - -/// Atom is a special string-like data-type that is most commonly used for -/// interfacing with code written in other BEAM languages such as Erlang and -/// Elixir. It is preferable to define your own custom types to use instead of -/// atoms where possible. -/// -/// Atoms are not used much in typical Gleam code! -/// -/// ## Creating atoms -/// -/// We can create atoms with the the [`create_from_string`](#create_from_string) -/// function, though we must be careful when doing so as atoms are never -/// garbage collected. If we create too many atoms (for example, if we convert -/// user input into atoms) we may hit the max limit of atoms and cause the -/// virtual machine to crash. -/// -pub type Atom - -/// An error returned when no atom is found in the virtual machine's atom table -/// for a given string when calling the [`from_string`](#from_string) function. -pub type FromStringError { - AtomNotLoaded -} - -/// Finds an existing Atom for the given String. -/// -/// If no atom is found in the virtual machine's atom table for the String then -/// an error is returned. -/// -/// ## Examples -/// ```gleam -/// from_string("ok") -/// // -> Ok(create_from_string("ok")) -/// ``` -/// ```gleam -/// from_string("some_new_atom") -/// // -> Error(AtomNotLoaded) -/// ``` -/// -@external(erlang, "gleam_erlang_ffi", "atom_from_string") -pub fn from_string(a: String) -> Result(Atom, FromStringError) - -/// Creates an atom from a string, inserting a new value into the virtual -/// machine's atom table if an atom does not already exist for the given -/// string. -/// -/// We must be careful when using this function as there is a limit to the -/// number of atom that can fit in the virtual machine's atom table. Never -/// convert user input into atoms as filling the atom table will cause the -/// virtual machine to crash! -/// -@external(erlang, "erlang", "binary_to_atom") -pub fn create_from_string(a: String) -> Atom - -/// Returns a `String` corresponding to the text representation of the given -/// `Atom`. -/// -/// ## Examples -/// ```gleam -/// let ok_atom = create_from_string("ok") -/// to_string(ok_atom) -/// // -> "ok" -/// ``` -/// -@external(erlang, "erlang", "atom_to_binary") -pub fn to_string(a: Atom) -> String - -/// Checks to see whether a `Dynamic` value is an atom, and return the atom if -/// it is. -/// -/// ## Examples -/// ```gleam -/// import gleam/dynamic -/// from_dynamic(dynamic.from(create_from_string("hello"))) -/// // -> Ok(create_from_string("hello")) -/// ``` -/// ```gleam -/// from_dynamic(dynamic.from(123)) -/// // -> Error([DecodeError(expected: "Atom", found: "Int", path: [])]) -/// ``` -/// -@external(erlang, "gleam_erlang_ffi", "atom_from_dynamic") -pub fn from_dynamic(from from: Dynamic) -> Result(Atom, List(DecodeError)) diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/charlist.gleam b/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/charlist.gleam deleted file mode 100644 index e5b6d65..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/charlist.gleam +++ /dev/null @@ -1,25 +0,0 @@ -//// A charlist is a list of integers where all the integers are valid code -//// points. -//// -//// In practice, you will not come across them often, except perhaps when -//// interfacing with Erlang, in particular when using older libraries that do -//// not accept binaries as arguments. - -/// A list of characters represented as ints. Commonly used by older Erlang -/// modules. -pub type Charlist - -/// Transform a charlist to a string -@external(erlang, "unicode", "characters_to_binary") -pub fn to_string(a: Charlist) -> String - -// Calls `unicode:characters_to_binary(Data, unicode, unicode)` -// Note: `unicode is an alias for utf8` -// See - -/// Transform a string to a charlist -@external(erlang, "unicode", "characters_to_list") -pub fn from_string(a: String) -> Charlist -// Calls `unicode:characters_to_list(Data, unicode)` -// Note: `unicode is an alias for utf8` -// See diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/node.gleam b/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/node.gleam deleted file mode 100644 index 339415c..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/node.gleam +++ /dev/null @@ -1,62 +0,0 @@ -import gleam/erlang/atom.{type Atom} - -pub type Node - -type DoNotLeak - -/// Return the current node. -/// -@external(erlang, "erlang", "node") -pub fn self() -> Node - -/// Return a list of all visible nodes in the cluster, not including the current -/// node. -/// -/// The current node can be included by calling `self()` and prepending the -/// result. -/// -/// ```gleam -/// let all_nodes = [node.self(), ..node.visible()] -/// ``` -/// -@external(erlang, "erlang", "nodes") -pub fn visible() -> List(Node) - -pub type ConnectError { - /// Was unable to connect to the node. - FailedToConnect - /// The local node is not alive, so it is not possible to connect to the other - /// node. - LocalNodeIsNotAlive -} - -// TODO: test unknown node -// TODO: test successfully connecting -/// Establish a connection to a node, so the nodes can send messages to each -/// other and any other connected nodes. -/// -/// Returns `Error(FailedToConnect)` if the node is not reachable. -/// -/// Returns `Error(LocalNodeIsNotAlive)` if the local node is not alive, meaning -/// it is not running in distributed mode. -/// -@external(erlang, "gleam_erlang_ffi", "connect_node") -pub fn connect(node: Atom) -> Result(Node, ConnectError) - -// TODO: test -/// Send a message to a named process on a given node. -/// -/// These messages are untyped, like regular Erlang messages. -/// -pub fn send(node: Node, name: Atom, message: message) -> Nil { - raw_send(#(name, node), message) - Nil -} - -@external(erlang, "erlang", "send") -fn raw_send(receiver: #(Atom, Node), message: message) -> DoNotLeak - -/// Convert a node to the atom of its name. -/// -@external(erlang, "gleam_erlang_ffi", "identity") -pub fn to_atom(node: Node) -> Atom diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/os.gleam b/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/os.gleam deleted file mode 100644 index feb61b0..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/os.gleam +++ /dev/null @@ -1,36 +0,0 @@ -/// Represents operating system kernels -pub type OsFamily { - // The family which includes modern versions of the Windows operating system. - WindowsNt - // The family of operating systems based on the open source Linux kernel. - Linux - // The family of Apple operating systems such as macOS and iOS. - Darwin - // The family of operating systems based on the FreeBSD kernel. - FreeBsd - // An operating system kernel other than Linux, Darwin, FreeBSD, or NT. - Other(String) -} - -/// Returns the kernel of the host operating system. -/// -/// Unknown kernels are reported as `Other(String)`; e.g. `Other("sunos")`. -/// -/// ## Examples -/// ```gleam -/// family() -/// // -> Linux -/// ``` -/// -/// ```gleam -/// family() -/// // -> Darwin -/// ``` -/// -/// ```gleam -/// family() -/// // -> Other("sunos") -/// ``` -/// -@external(erlang, "gleam_erlang_ffi", "os_family") -pub fn family() -> OsFamily diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/port.gleam b/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/port.gleam deleted file mode 100644 index 4264e55..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/port.gleam +++ /dev/null @@ -1,27 +0,0 @@ -import gleam/dynamic.{type Dynamic} -import gleam/dynamic/decode.{type DecodeError} - -/// Ports are how code running on the Erlang virtual machine interacts with -/// the outside world. Bytes of data can be sent to and read from ports, -/// providing a form of message passing to an external program or resource. -/// -/// For more information on ports see the [Erlang ports documentation][1]. -/// -/// [1]: https://erlang.org/doc/reference_manual/ports.html -/// -pub type Port - -/// Checks to see whether a `Dynamic` value is a port, and return the port if -/// it is. -/// -/// ## Examples -/// -/// > import gleam/dynamic -/// > port_from_dynamic(dynamic.from(process.self())) -/// Ok(process.self()) -/// -/// > port_from_dynamic(dynamic.from(123)) -/// Error([DecodeError(expected: "Port", found: "Int", path: [])]) -/// -@external(erlang, "gleam_erlang_ffi", "port_from_dynamic") -pub fn port_from_dynamic(from from: Dynamic) -> Result(Port, List(DecodeError)) diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/process.gleam b/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/process.gleam deleted file mode 100644 index 88d5e61..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam/erlang/process.gleam +++ /dev/null @@ -1,860 +0,0 @@ -import gleam/dynamic.{type Dynamic} -import gleam/dynamic/decode.{type DecodeError} -import gleam/erlang.{type Reference} -import gleam/erlang/atom.{type Atom} -import gleam/string - -/// A `Pid` (or Process identifier) is a reference to an Erlang process. Each -/// process has a `Pid` and it is one of the lowest level building blocks of -/// inter-process communication in the Erlang and Gleam OTP frameworks. -/// -pub type Pid - -/// Get the `Pid` for the current process. -@external(erlang, "erlang", "self") -pub fn self() -> Pid - -/// Create a new Erlang process that runs concurrently to the creator. In other -/// languages this might be called a fibre, a green thread, or a coroutine. -/// -/// If `linked` is `True` then the created process is linked to the creator -/// process. When a process terminates an exit signal is sent to all other -/// processes that are linked to it, causing the process to either terminate or -/// have to handle the signal. -/// -/// More can be read about processes and links in the [Erlang documentation][1]. -/// -/// [1]: https://www.erlang.org/doc/reference_manual/processes.html -/// -pub fn start(running implementation: fn() -> anything, linked link: Bool) -> Pid { - case link { - True -> spawn_link(implementation) - False -> spawn(implementation) - } -} - -@external(erlang, "erlang", "spawn") -fn spawn(a: fn() -> anything) -> Pid - -@external(erlang, "erlang", "spawn_link") -fn spawn_link(a: fn() -> anything) -> Pid - -/// A `Subject` is a value that processes can use to send and receive messages -/// to and from each other in a well typed way. -/// -/// Each subject is "owned" by the process that created it. Any process can use -/// the `send` function to sent a message of the correct type to the process -/// that owns the subject, and the owner can use the `receive` function or the -/// `Selector` type to receive these messages. -/// -/// The `Subject` type is similar to the "channel" types found in other -/// languages and the "topic" concept found in some pub-sub systems. -/// -/// # Examples -/// -/// ```gleam -/// let subject = new_subject() -/// -/// // Send a message with the subject -/// send(subject, "Hello, Joe!") -/// -/// // Receive the message -/// receive(subject, within: 10) -/// ``` -/// -pub opaque type Subject(message) { - Subject(owner: Pid, tag: Reference) -} - -/// Create a new `Subject` owned by the current process. -/// -pub fn new_subject() -> Subject(message) { - Subject(owner: self(), tag: erlang.make_reference()) -} - -/// Get the owner process for a `Subject`. This is the process that created the -/// `Subject` and will receive messages sent with it. -/// -pub fn subject_owner(subject: Subject(message)) -> Pid { - subject.owner -} - -type DoNotLeak - -@external(erlang, "erlang", "send") -fn raw_send(a: Pid, b: message) -> DoNotLeak - -/// Send a message to a process using a `Subject`. The message must be of the -/// type that the `Subject` accepts. -/// -/// This function does not wait for the `Subject` owner process to call the -/// `receive` function, instead it returns once the message has been placed in -/// the process' mailbox. -/// -/// # Ordering -/// -/// If process P1 sends two messages to process P2 it is guaranteed that process -/// P1 will receive the messages in the order they were sent. -/// -/// If you wish to receive the messages in a different order you can send them -/// on two different subjects and the receiver function can call the `receive` -/// function for each subject in the desired order, or you can write some Erlang -/// code to perform a selective receive. -/// -/// # Examples -/// -/// ```gleam -/// let subject = new_subject() -/// send(subject, "Hello, Joe!") -/// ``` -/// -pub fn send(subject: Subject(message), message: message) -> Nil { - raw_send(subject.owner, #(subject.tag, message)) - Nil -} - -/// Receive a message that has been sent to current process using the `Subject`. -/// -/// If there is not an existing message for the `Subject` in the process' -/// mailbox or one does not arrive `within` the permitted timeout then the -/// `Error(Nil)` is returned. -/// -/// Only the process that is owner of the `Subject` can receive a message using -/// it. If a process that does not own the `Subject` attempts to receive with it -/// then it will not receive a message. -/// -/// To wait for messages from multiple `Subject`s at the same time see the -/// `Selector` type. -/// -/// The `within` parameter specifies the timeout duration in milliseconds. -/// -@external(erlang, "gleam_erlang_ffi", "receive") -pub fn receive( - from subject: Subject(message), - within timeout: Int, -) -> Result(message, Nil) - -/// Receive a message that has been sent to current process using the `Subject`. -/// -/// Same as `receive` but waits forever and returns the message as is. -@external(erlang, "gleam_erlang_ffi", "receive") -pub fn receive_forever(from subject: Subject(message)) -> message - -/// A type that enables a process to wait for messages from multiple `Subject`s -/// at the same time, returning whichever message arrives first. -/// -/// Used with the `new_selector`, `selecting`, and `select` functions. -/// -/// # Examples -/// -/// ```gleam -/// let int_subject = new_subject() -/// let float_subject = new_subject() -/// send(int_subject, 1) -/// -/// let selector = -/// new_selector() -/// |> selecting(int_subject, int.to_string) -/// |> selecting(float_subject, float.to_string) -/// -/// select(selector, 10) -/// // -> Ok("1") -/// ``` -/// -pub type Selector(payload) - -/// Create a new `Selector` which can be used to receive messages on multiple -/// `Subject`s at once. -/// -@external(erlang, "gleam_erlang_ffi", "new_selector") -pub fn new_selector() -> Selector(payload) - -/// Receive a message that has been sent to current process using any of the -/// `Subject`s that have been added to the `Selector` with the `selecting` -/// function. -/// -/// If there is not an existing message for the `Selector` in the process' -/// mailbox or one does not arrive `within` the permitted timeout then the -/// `Error(Nil)` is returned. -/// -/// Only the process that is owner of the `Subject`s can receive a message using -/// them. If a process that does not own the a `Subject` attempts to receive -/// with it then it will not receive a message. -/// -/// To wait forever for the next message rather than for a limited amount of -/// time see the `select_forever` function. -/// -/// The `within` parameter specifies the timeout duration in milliseconds. -/// -@external(erlang, "gleam_erlang_ffi", "select") -pub fn select( - from from: Selector(payload), - within within: Int, -) -> Result(payload, Nil) - -/// Similar to the `select` function but will wait forever for a message to -/// arrive rather than timing out after a specified amount of time. -/// -@external(erlang, "gleam_erlang_ffi", "select") -pub fn select_forever(from from: Selector(payload)) -> payload - -/// Add a transformation function to a selector. When a message is received -/// using this selector the transformation function is applied to the message. -/// -/// This function can be used to change the type of messages received and may -/// be useful when combined with the `merge_selector` function. -/// -@external(erlang, "gleam_erlang_ffi", "map_selector") -pub fn map_selector(a: Selector(a), b: fn(a) -> b) -> Selector(b) - -/// Merge one selector into another, producing a selector that contains the -/// message handlers of both. -/// -/// If a subject is handled by both selectors the handler function of the -/// second selector is used. -/// -@external(erlang, "gleam_erlang_ffi", "merge_selector") -pub fn merge_selector(a: Selector(a), b: Selector(a)) -> Selector(a) - -pub type ExitMessage { - ExitMessage(pid: Pid, reason: ExitReason) -} - -pub type ExitReason { - Normal - Killed - Abnormal(reason: String) -} - -/// Add a handler for trapped exit messages. In order for these messages to be -/// sent to the process when a linked process exits the process must call the -/// `trap_exit` beforehand. -/// -pub fn selecting_trapped_exits( - selector: Selector(a), - handler: fn(ExitMessage) -> a, -) -> Selector(a) { - let tag = atom.create_from_string("EXIT") - let handler = fn(message: #(Atom, Pid, Dynamic)) -> a { - let reason = message.2 - let normal = dynamic.from(Normal) - let killed = dynamic.from(Killed) - let reason = case decode.run(reason, decode.string) { - _ if reason == normal -> Normal - _ if reason == killed -> Killed - Ok(reason) -> Abnormal(reason) - Error(_) -> Abnormal(string.inspect(reason)) - } - handler(ExitMessage(message.1, reason)) - } - insert_selector_handler(selector, #(tag, 3), handler) -} - -// TODO: implement in Gleam -/// Discard all messages in the current process' mailbox. -/// -/// Warning: This function may cause other processes to crash if they sent a -/// message to the current process and are waiting for a response, so use with -/// caution. -/// -@external(erlang, "gleam_erlang_ffi", "flush_messages") -pub fn flush_messages() -> Nil - -/// Add a new `Subject` to the `Selector` so that its messages can be selected -/// from the receiver process inbox. -/// -/// The `mapping` function provided with the `Subject` can be used to convert -/// the type of messages received using this `Subject`. This is useful for when -/// you wish to add multiple `Subject`s to a `Selector` when they have differing -/// message types. If you do not wish to transform the incoming messages in any -/// way then the `identity` function can be given. -/// -/// See `deselecting` to remove a subject from a selector. -/// -pub fn selecting( - selector: Selector(payload), - for subject: Subject(message), - mapping transform: fn(message) -> payload, -) -> Selector(payload) { - let handler = fn(message: #(Reference, message)) { transform(message.1) } - insert_selector_handler(selector, #(subject.tag, 2), handler) -} - -/// Remove a new `Subject` from the `Selector` so that its messages will not be -/// selected from the receiver process inbox. -/// -pub fn deselecting( - selector: Selector(payload), - for subject: Subject(message), -) -> Selector(payload) { - remove_selector_handler(selector, #(subject.tag, 2)) -} - -/// Add a handler to a selector for 2 element tuple messages with a given tag -/// element in the first position. -/// -/// Typically you want to use the `selecting` function with a `Subject` instead, -/// but this function may be useful if you need to receive messages sent from -/// other BEAM languages that do not use the `Subject` type. -/// -pub fn selecting_record2( - selector: Selector(payload), - tag: tag, - mapping transform: fn(Dynamic) -> payload, -) -> Selector(payload) { - let handler = fn(message: #(tag, Dynamic)) { transform(message.1) } - insert_selector_handler(selector, #(tag, 2), handler) -} - -/// Add a handler to a selector for 3 element tuple messages with a given tag -/// element in the first position. -/// -/// Typically you want to use the `selecting` function with a `Subject` instead, -/// but this function may be useful if you need to receive messages sent from -/// other BEAM languages that do not use the `Subject` type. -/// -pub fn selecting_record3( - selector: Selector(payload), - tag: tag, - mapping transform: fn(Dynamic, Dynamic) -> payload, -) -> Selector(payload) { - let handler = fn(message: #(tag, Dynamic, Dynamic)) { - transform(message.1, message.2) - } - insert_selector_handler(selector, #(tag, 3), handler) -} - -/// Add a handler to a selector for 4 element tuple messages with a given tag -/// element in the first position. -/// -/// Typically you want to use the `selecting` function with a `Subject` instead, -/// but this function may be useful if you need to receive messages sent from -/// other BEAM languages that do not use the `Subject` type. -/// -pub fn selecting_record4( - selector: Selector(payload), - tag: tag, - mapping transform: fn(Dynamic, Dynamic, Dynamic) -> payload, -) -> Selector(payload) { - let handler = fn(message: #(tag, Dynamic, Dynamic, Dynamic)) { - transform(message.1, message.2, message.3) - } - insert_selector_handler(selector, #(tag, 4), handler) -} - -/// Add a handler to a selector for 5 element tuple messages with a given tag -/// element in the first position. -/// -/// Typically you want to use the `selecting` function with a `Subject` instead, -/// but this function may be useful if you need to receive messages sent from -/// other BEAM languages that do not use the `Subject` type. -/// -pub fn selecting_record5( - selector: Selector(payload), - tag: tag, - mapping transform: fn(Dynamic, Dynamic, Dynamic, Dynamic) -> payload, -) -> Selector(payload) { - let handler = fn(message: #(tag, Dynamic, Dynamic, Dynamic, Dynamic)) { - transform(message.1, message.2, message.3, message.4) - } - insert_selector_handler(selector, #(tag, 5), handler) -} - -/// Add a handler to a selector for 6 element tuple messages with a given tag -/// element in the first position. -/// -/// Typically you want to use the `selecting` function with a `Subject` instead, -/// but this function may be useful if you need to receive messages sent from -/// other BEAM languages that do not use the `Subject` type. -/// -pub fn selecting_record6( - selector: Selector(payload), - tag: tag, - mapping transform: fn(Dynamic, Dynamic, Dynamic, Dynamic, Dynamic) -> payload, -) -> Selector(payload) { - let handler = fn(message: #(tag, Dynamic, Dynamic, Dynamic, Dynamic, Dynamic)) { - transform(message.1, message.2, message.3, message.4, message.5) - } - insert_selector_handler(selector, #(tag, 6), handler) -} - -/// Add a handler to a selector for 7 element tuple messages with a given tag -/// element in the first position. -/// -/// Typically you want to use the `selecting` function with a `Subject` instead, -/// but this function may be useful if you need to receive messages sent from -/// other BEAM languages that do not use the `Subject` type. -/// -pub fn selecting_record7( - selector: Selector(payload), - tag: tag, - mapping transform: fn(Dynamic, Dynamic, Dynamic, Dynamic, Dynamic, Dynamic) -> - payload, -) -> Selector(payload) { - let handler = fn( - message: #(tag, Dynamic, Dynamic, Dynamic, Dynamic, Dynamic, Dynamic), - ) { - transform(message.1, message.2, message.3, message.4, message.5, message.6) - } - insert_selector_handler(selector, #(tag, 7), handler) -} - -/// Add a handler to a selector for 8 element tuple messages with a given tag -/// element in the first position. -/// -/// Typically you want to use the `selecting` function with a `Subject` instead, -/// but this function may be useful if you need to receive messages sent from -/// other BEAM languages that do not use the `Subject` type. -/// -pub fn selecting_record8( - selector: Selector(payload), - tag: tag, - mapping transform: fn( - Dynamic, - Dynamic, - Dynamic, - Dynamic, - Dynamic, - Dynamic, - Dynamic, - ) -> - payload, -) -> Selector(payload) { - let handler = fn( - message: #( - tag, - Dynamic, - Dynamic, - Dynamic, - Dynamic, - Dynamic, - Dynamic, - Dynamic, - ), - ) { - transform( - message.1, - message.2, - message.3, - message.4, - message.5, - message.6, - message.7, - ) - } - insert_selector_handler(selector, #(tag, 8), handler) -} - -type AnythingSelectorTag { - Anything -} - -/// Add a catch-all handler to a selector that will be used when no other -/// handler in a selector is suitable for a given message. -/// -/// This may be useful for when you want to ensure that any message in the inbox -/// is handled, or when you need to handle messages from other BEAM languages -/// which do not use subjects or record format messages. -/// -pub fn selecting_anything( - selector: Selector(payload), - mapping handler: fn(Dynamic) -> payload, -) -> Selector(payload) { - insert_selector_handler(selector, Anything, handler) -} - -@external(erlang, "gleam_erlang_ffi", "insert_selector_handler") -fn insert_selector_handler( - a: Selector(payload), - for for: tag, - mapping mapping: fn(message) -> payload, -) -> Selector(payload) - -@external(erlang, "gleam_erlang_ffi", "remove_selector_handler") -fn remove_selector_handler( - a: Selector(payload), - for for: tag, -) -> Selector(payload) - -/// Suspends the process calling this function for the specified number of -/// milliseconds. -/// -@external(erlang, "gleam_erlang_ffi", "sleep") -pub fn sleep(a: Int) -> Nil - -/// Suspends the process forever! This may be useful for suspending the main -/// process in a Gleam program when it has no more work to do but we want other -/// processes to continue to work. -/// -@external(erlang, "gleam_erlang_ffi", "sleep_forever") -pub fn sleep_forever() -> Nil - -/// Check to see whether the process for a given `Pid` is alive. -/// -/// See the [Erlang documentation][1] for more information. -/// -/// [1]: http://erlang.org/doc/man/erlang.html#is_process_alive-1 -/// -@external(erlang, "erlang", "is_process_alive") -pub fn is_alive(a: Pid) -> Bool - -type ProcessMonitorFlag { - Process -} - -@external(erlang, "erlang", "monitor") -fn erlang_monitor_process(a: ProcessMonitorFlag, b: Pid) -> Reference - -pub opaque type ProcessMonitor { - ProcessMonitor(tag: Reference) -} - -/// A message received when a monitored process exits. -/// -pub type ProcessDown { - ProcessDown(pid: Pid, reason: Dynamic) -} - -/// Start monitoring a process so that when the monitored process exits a -/// message is sent to the monitoring process. -/// -/// The message is only sent once, when the target process exits. If the -/// process was not alive when this function is called the message will never -/// be received. -/// -/// The down message can be received with a `Selector` and the -/// `selecting_process_down` function. -/// -/// The process can be demonitored with the `demonitor_process` function. -/// -pub fn monitor_process(pid: Pid) -> ProcessMonitor { - Process - |> erlang_monitor_process(pid) - |> ProcessMonitor -} - -/// Add a `ProcessMonitor` to a `Selector` so that the `ProcessDown` message can -/// be received using the `Selector` and the `select` function. The -/// `ProcessMonitor` can be removed later with -/// [`deselecting_process_down`](#deselecting_process_down). -/// -pub fn selecting_process_down( - selector: Selector(payload), - monitor: ProcessMonitor, - mapping: fn(ProcessDown) -> payload, -) -> Selector(payload) { - insert_selector_handler(selector, monitor.tag, mapping) -} - -/// Remove the monitor for a process so that when the monitor process exits a -/// `ProcessDown` message is not sent to the monitoring process. -/// -/// If the message has already been sent it is removed from the monitoring -/// process' mailbox. -/// -pub fn demonitor_process(monitor monitor: ProcessMonitor) -> Nil { - erlang_demonitor_process(monitor) - Nil -} - -@external(erlang, "gleam_erlang_ffi", "demonitor") -fn erlang_demonitor_process(monitor: ProcessMonitor) -> DoNotLeak - -/// An error returned when making a call to a process. -/// -pub type CallError(msg) { - /// The process being called exited before it sent a response. - /// - CalleeDown(reason: Dynamic) - - /// The process being called did not response within the permitted amount of - /// time. - /// - CallTimeout -} - -/// Remove a `ProcessMonitor` from a `Selector` prevoiusly added by -/// [`selecting_process_down`](#selecting_process_down). If the `ProcessMonitor` is not in the -/// `Selector` it will be returned unchanged. -/// -pub fn deselecting_process_down( - selector: Selector(payload), - monitor: ProcessMonitor, -) -> Selector(payload) { - remove_selector_handler(selector, monitor.tag) -} - -// This function is based off of Erlang's gen:do_call/4. -/// Send a message to a process and wait for a reply. -/// -/// If the receiving process exits or does not reply within the allowed amount -/// of time then an error is returned. -/// -/// The `within` parameter specifies the timeout duration in milliseconds. -/// -pub fn try_call( - subject: Subject(request), - make_request: fn(Subject(response)) -> request, - within timeout: Int, -) -> Result(response, CallError(response)) { - let reply_subject = new_subject() - - // Monitor the callee process so we can tell if it goes down (meaning we - // won't get a reply) - let monitor = monitor_process(subject_owner(subject)) - - // Send the request to the process over the channel - send(subject, make_request(reply_subject)) - - // Await a reply or handle failure modes (timeout, process down, etc) - let result = - new_selector() - |> selecting(reply_subject, Ok) - |> selecting_process_down(monitor, fn(down: ProcessDown) { - Error(CalleeDown(reason: down.reason)) - }) - |> select(timeout) - - // Demonitor the process and close the channels as we're done - demonitor_process(monitor) - - // Prepare an appropriate error (if present) for the caller - case result { - Error(Nil) -> Error(CallTimeout) - Ok(res) -> res - } -} - -/// Send a message to a process and wait for a reply. -/// -/// If the receiving process exits or does not reply within the allowed amount -/// of time the calling process crashes. If you wish an error to be returned -/// instead see the `try_call` function. -/// -/// The `within` parameter specifies the timeout duration in milliseconds. -/// -pub fn call( - subject: Subject(request), - make_request: fn(Subject(response)) -> request, - within timeout: Int, -) -> response { - let assert Ok(resp) = try_call(subject, make_request, timeout) - resp -} - -/// Similar to the `call` function but will wait forever for a message to -/// arrive rather than timing out after a specified amount of time. -/// -/// If the receiving process exits, the calling process crashes. -/// If you wish an error to be returned instead see the `try_call_forever` -/// function. -/// -pub fn call_forever( - subject: Subject(request), - make_request: fn(Subject(response)) -> request, -) -> response { - let assert Ok(response) = try_call_forever(subject, make_request) - response -} - -/// Similar to the `try_call` function but will wait forever for a message -/// to arrive rather than timing out after a specified amount of time. -/// -/// If the receiving process exits then an error is returned. -/// -pub fn try_call_forever( - subject: Subject(request), - make_request: fn(Subject(response)) -> request, -) -> Result(response, CallError(c)) { - let reply_subject = new_subject() - - // Monitor the callee process so we can tell if it goes down (meaning we - // won't get a reply) - let monitor = monitor_process(subject_owner(subject)) - - // Send the request to the process over the channel - send(subject, make_request(reply_subject)) - - // Await a reply or handle failure modes (timeout, process down, etc) - let result = - new_selector() - |> selecting(reply_subject, Ok) - |> selecting_process_down(monitor, fn(down) { - Error(CalleeDown(reason: down.reason)) - }) - |> select_forever - - // Demonitor the process and close the channels as we're done - demonitor_process(monitor) - - result -} - -/// Creates a link between the calling process and another process. -/// -/// When a process crashes any linked processes will also crash. This is useful -/// to ensure that groups of processes that depend on each other all either -/// succeed or fail together. -/// -/// Returns `True` if the link was created successfully, returns `False` if the -/// process was not alive and as such could not be linked. -/// -@external(erlang, "gleam_erlang_ffi", "link") -pub fn link(pid pid: Pid) -> Bool - -@external(erlang, "erlang", "unlink") -fn erlang_unlink(pid pid: Pid) -> Bool - -/// Removes any existing link between the caller process and the target process. -/// -pub fn unlink(pid: Pid) -> Nil { - erlang_unlink(pid) - Nil -} - -pub type Timer - -@external(erlang, "erlang", "send_after") -fn erlang_send_after(a: Int, b: Pid, c: msg) -> Timer - -/// Send a message over a channel after a specified number of milliseconds. -/// -pub fn send_after(subject: Subject(msg), delay: Int, message: msg) -> Timer { - erlang_send_after(delay, subject.owner, #(subject.tag, message)) -} - -@external(erlang, "erlang", "cancel_timer") -fn erlang_cancel_timer(a: Timer) -> Dynamic - -/// Values returned when a timer is cancelled. -/// -pub type Cancelled { - /// The timer could not be found. It likely has already triggered. - /// - TimerNotFound - - /// The timer was found and cancelled before it triggered. - /// - /// The amount of remaining time before the timer was due to be triggered is - /// returned in milliseconds. - /// - Cancelled(time_remaining: Int) -} - -/// Cancel a given timer, causing it not to trigger if it has not done already. -/// -pub fn cancel_timer(timer: Timer) -> Cancelled { - case decode.run(erlang_cancel_timer(timer), decode.int) { - Ok(i) -> Cancelled(i) - Error(_) -> TimerNotFound - } -} - -type KillFlag { - Kill -} - -@external(erlang, "erlang", "exit") -fn erlang_kill(to to: Pid, because because: KillFlag) -> Bool - -// Go, my pretties. Kill! Kill! -// - Bart Simpson -// -/// Send an untrappable `kill` exit signal to the target process. -/// -/// See the documentation for the Erlang [`erlang:exit`][1] function for more -/// information. -/// -/// [1]: https://erlang.org/doc/man/erlang.html#exit-1 -/// -pub fn kill(pid: Pid) -> Nil { - erlang_kill(pid, Kill) - Nil -} - -@external(erlang, "erlang", "exit") -fn erlang_send_exit(to to: Pid, because because: whatever) -> Bool - -// TODO: test -/// Sends an exit signal to a process, indicating that the process is to shut -/// down. -/// -/// See the [Erlang documentation][1] for more information. -/// -/// [1]: http://erlang.org/doc/man/erlang.html#exit-2 -/// -pub fn send_exit(to pid: Pid) -> Nil { - erlang_send_exit(pid, Normal) - Nil -} - -/// Sends an exit signal to a process, indicating that the process is to shut -/// down due to an abnormal reason such as a failure. -/// -/// See the [Erlang documentation][1] for more information. -/// -/// [1]: http://erlang.org/doc/man/erlang.html#exit-2 -/// -pub fn send_abnormal_exit(pid: Pid, reason: String) -> Nil { - erlang_send_exit(pid, Abnormal(reason)) - Nil -} - -/// Set whether the current process is to trap exit signals or not. -/// -/// When not trapping exits if a linked process crashes the exit signal -/// propagates to the process which will also crash. -/// This is the normal behaviour before this function is called. -/// -/// When trapping exits (after this function is called) if a linked process -/// crashes an exit message is sent to the process instead. These messages can -/// be handled with the `selecting_trapped_exits` function. -/// -@external(erlang, "gleam_erlang_ffi", "trap_exits") -pub fn trap_exits(a: Bool) -> Nil - -/// Register a process under a given name, allowing it to be looked up using -/// the `named` function. -/// -/// This function will return an error under the following conditions: -/// - The process for the pid no longer exists. -/// - The name has already been registered. -/// - The process already has a name. -/// - The name is the atom `undefined`, which is reserved by Erlang. -/// -@external(erlang, "gleam_erlang_ffi", "register_process") -pub fn register(pid: Pid, name: Atom) -> Result(Nil, Nil) - -/// Un-register a process name, after which the process can no longer be looked -/// up by that name, and both the name and the process can be re-used in other -/// registrations. -/// -/// It is possible to un-register process that are not from your application, -/// including those from Erlang/OTP itself. This is not recommended and will -/// likely result in undesirable behaviour and crashes. -/// -@external(erlang, "gleam_erlang_ffi", "unregister_process") -pub fn unregister(name: Atom) -> Result(Nil, Nil) - -/// Look up a process by name, returning the pid if it exists. -/// -@external(erlang, "gleam_erlang_ffi", "process_named") -pub fn named(name: Atom) -> Result(Pid, Nil) - -/// Checks to see whether a `Dynamic` value is a pid, and return the pid if -/// it is. -/// -/// ## Examples -/// -/// ```gleam -/// import gleam/dynamic -/// pid_from_dynamic(dynamic.from(process.self())) -/// // -> Ok(process.self()) -/// ``` -/// -/// ```gleam -/// pid_from_dynamic(dynamic.from(123)) -/// // -> Error([DecodeError(expected: "Pid", found: "Int", path: [])]) -/// ``` -@external(erlang, "gleam_erlang_ffi", "pid_from_dynamic") -pub fn pid_from_dynamic(from from: Dynamic) -> Result(Pid, List(DecodeError)) diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang.erl b/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang.erl deleted file mode 100644 index 5a838be..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang.erl +++ /dev/null @@ -1,257 +0,0 @@ --module(gleam@erlang). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([format/1, term_to_binary/1, get_line/1, system_time/1, erlang_timestamp/0, rescue/1, binary_to_term/1, unsafe_binary_to_term/1, start_arguments/0, ensure_all_started/1, make_reference/0, reference_from_dynamic/1, priv_directory/1, bounded_phash2/2, phash2/1]). --export_type([safe/0, get_line_error/0, time_unit/0, crash/0, ensure_all_started_error/0, reference_/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --type safe() :: safe. - --type get_line_error() :: eof | no_data. - --type time_unit() :: second | millisecond | microsecond | nanosecond. - --type crash() :: {exited, gleam@dynamic:dynamic_()} | - {thrown, gleam@dynamic:dynamic_()} | - {errored, gleam@dynamic:dynamic_()}. - --type ensure_all_started_error() :: {unknown_application, - gleam@erlang@atom:atom_()} | - {application_failed_to_start, - gleam@erlang@atom:atom_(), - gleam@dynamic:dynamic_()}. - --type reference_() :: any(). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang.gleam", 18). -?DOC( - " Return a string representation of any term\n" - "\n" - " # Example\n" - "\n" - " ```gleam\n" - " erlang.format(input)\n" - " // -> {ok,<<\"Gleam\\n\">>}%\n" - " ```\n" -). --spec format(any()) -> binary(). -format(Term) -> - unicode:characters_to_binary(io_lib:format(<<"~p"/utf8>>, [Term])). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang.gleam", 28). -?DOC( - " Returns a `BitArray` representing given value as an [Erlang external term][1].\n" - "\n" - " \n" - "\n" - " [1]: https://www.erlang.org/doc/apps/erts/erl_ext_dist\n" -). --spec term_to_binary(any()) -> bitstring(). -term_to_binary(A) -> - erlang:term_to_binary(A). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang.gleam", 81). -?DOC( - " Reads a line from standard input with the given prompt.\n" - "\n" - " # Example\n" - "\n" - " ```gleam\n" - " get_line(\"Language: \")\n" - " // > Language: <- Gleam\n" - " // -> Ok(\"Gleam\\n\")\n" - " ```\n" -). --spec get_line(binary()) -> {ok, binary()} | {error, get_line_error()}. -get_line(Prompt) -> - gleam_erlang_ffi:get_line(Prompt). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang.gleam", 94). -?DOC( - " Returns the current OS system time.\n" - "\n" - " \n" -). --spec system_time(time_unit()) -> integer(). -system_time(A) -> - os:system_time(A). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang.gleam", 100). -?DOC( - " Returns the current OS system time as a tuple of Ints\n" - "\n" - " \n" -). --spec erlang_timestamp() -> {integer(), integer(), integer()}. -erlang_timestamp() -> - os:timestamp(). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang.gleam", 110). -?DOC( - " Gleam doesn't offer any way to raise exceptions, but they may still occur\n" - " due to bugs when working with unsafe code, such as when calling Erlang\n" - " function.\n" - "\n" - " This function will catch any error thrown and convert it into a result\n" - " rather than crashing the process.\n" -). --spec rescue(fun(() -> EZC)) -> {ok, EZC} | {error, crash()}. -rescue(A) -> - gleam_erlang_ffi:rescue(A). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang.gleam", 42). -?DOC( - " Decodes a value from a `BitArray` representing an [Erlang external term][1].\n" - "\n" - " \n" - "\n" - " [1]: https://www.erlang.org/doc/apps/erts/erl_ext_dist\n" -). --spec binary_to_term(bitstring()) -> {ok, gleam@dynamic:dynamic_()} | - {error, nil}. -binary_to_term(Binary) -> - case gleam_erlang_ffi:rescue( - fun() -> erlang:binary_to_term(Binary, [safe]) end - ) of - {ok, Term} -> - {ok, Term}; - - {error, _} -> - {error, nil} - end. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang.gleam", 57). -?DOC( - " Decodes a value from a trusted `BitArray` representing an\n" - " [Erlang external term][1].\n" - "\n" - " *Warning*: Do not use this function with untrusted input, this can lead to\n" - " Denial-of-Service. More information in the [Erlang documentation][2].\n" - "\n" - " [1]: https://www.erlang.org/doc/apps/erts/erl_ext_dist\n" - " [2]: https://www.erlang.org/doc/apps/erts/erlang.html#binary_to_term/1\n" -). --spec unsafe_binary_to_term(bitstring()) -> {ok, gleam@dynamic:dynamic_()} | - {error, nil}. -unsafe_binary_to_term(Binary) -> - case gleam_erlang_ffi:rescue(fun() -> erlang:binary_to_term(Binary, []) end) of - {ok, Term} -> - {ok, Term}; - - {error, _} -> - {error, nil} - end. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang.gleam", 125). -?DOC( - " Get the arguments given to the program when it was started.\n" - "\n" - " This is sometimes called `argv` in other languages.\n" -). --spec start_arguments() -> list(binary()). -start_arguments() -> - _pipe = init:get_plain_arguments(), - gleam@list:map(_pipe, fun unicode:characters_to_binary/1). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang.gleam", 148). -?DOC( - " Starts an OTP application's process tree in the background, as well as\n" - " the trees of any applications that the given application depends upon. An\n" - " OTP application typically maps onto a Gleam or Hex package.\n" - "\n" - " Returns a list of the applications that were started. Calling this function\n" - " for application that have already been started is a no-op so you do not need\n" - " to check the application state beforehand.\n" - "\n" - " In Gleam we prefer to not use these implicit background process trees, but\n" - " you will likely still need to start the trees of OTP applications written in\n" - " other BEAM languages such as Erlang or Elixir, including those included by\n" - " default with Erlang/OTP.\n" - "\n" - " For more information see the OTP documentation.\n" - " - \n" - " - \n" -). --spec ensure_all_started(gleam@erlang@atom:atom_()) -> {ok, - list(gleam@erlang@atom:atom_())} | - {error, ensure_all_started_error()}. -ensure_all_started(Application) -> - gleam_erlang_ffi:ensure_all_started(Application). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang.gleam", 171). -?DOC(" Create a new unique reference.\n"). --spec make_reference() -> reference_(). -make_reference() -> - erlang:make_ref(). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang.gleam", 192). -?DOC( - " Checks to see whether a `Dynamic` value is a Reference, and return the Reference if\n" - " it is.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " import gleam/dynamic\n" - "\n" - " reference_from_dynamic(dynamic.from(make_reference()))\n" - " // -> Ok(Reference)\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/dynamic\n" - "\n" - " reference_from_dynamic(dynamic.from(123))\n" - " // -> Error([DecodeError(expected: \"Reference\", found: \"Int\", path: [])])\n" - " ```\n" -). --spec reference_from_dynamic(gleam@dynamic:dynamic_()) -> {ok, reference_()} | - {error, list(gleam@dynamic@decode:decode_error())}. -reference_from_dynamic(From) -> - gleam_erlang_ffi:reference_from_dynamic(From). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang.gleam", 209). -?DOC( - " Returns the path of a package's `priv` directory, where extra non-Gleam\n" - " or Erlang files are typically kept.\n" - "\n" - " Returns an error if no package was found with the given name.\n" - "\n" - " # Example\n" - "\n" - " ```gleam\n" - " erlang.priv_directory(\"my_app\")\n" - " // -> Ok(\"/some/location/my_app/priv\")\n" - " ```\n" -). --spec priv_directory(binary()) -> {ok, binary()} | {error, nil}. -priv_directory(Name) -> - gleam_erlang_ffi:priv_directory(Name). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang.gleam", 220). -?DOC( - " Portable hash function that gives the same hash for the\n" - " same Gleam/Erlang term regardless of machine architecture and\n" - " ERTS version.\n" - "\n" - " The function returns a hash value for Term within the range 0..limit-1.\n" - " The maximum value for limit is 2^32.\n" - "\n" - " \n" -). --spec bounded_phash2(any(), integer()) -> integer(). -bounded_phash2(Term, Limit) -> - erlang:phash2(Term, Limit). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang.gleam", 224). -?DOC(" Equivalent to `bounded_phash2`, with a upper limit of 2^27-1\n"). --spec phash2(any()) -> integer(). -phash2(Term) -> - erlang:phash2(Term). diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@atom.erl b/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@atom.erl deleted file mode 100644 index c809438..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@atom.erl +++ /dev/null @@ -1,90 +0,0 @@ --module(gleam@erlang@atom). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([from_string/1, create_from_string/1, to_string/1, from_dynamic/1]). --export_type([atom_/0, from_string_error/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --type atom_() :: any(). - --type from_string_error() :: atom_not_loaded. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/atom.gleam", 43). -?DOC( - " Finds an existing Atom for the given String.\n" - "\n" - " If no atom is found in the virtual machine's atom table for the String then\n" - " an error is returned.\n" - "\n" - " ## Examples\n" - " ```gleam\n" - " from_string(\"ok\")\n" - " // -> Ok(create_from_string(\"ok\"))\n" - " ```\n" - " ```gleam\n" - " from_string(\"some_new_atom\")\n" - " // -> Error(AtomNotLoaded)\n" - " ```\n" -). --spec from_string(binary()) -> {ok, atom_()} | {error, from_string_error()}. -from_string(A) -> - gleam_erlang_ffi:atom_from_string(A). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/atom.gleam", 55). -?DOC( - " Creates an atom from a string, inserting a new value into the virtual\n" - " machine's atom table if an atom does not already exist for the given\n" - " string.\n" - "\n" - " We must be careful when using this function as there is a limit to the\n" - " number of atom that can fit in the virtual machine's atom table. Never\n" - " convert user input into atoms as filling the atom table will cause the\n" - " virtual machine to crash!\n" -). --spec create_from_string(binary()) -> atom_(). -create_from_string(A) -> - erlang:binary_to_atom(A). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/atom.gleam", 68). -?DOC( - " Returns a `String` corresponding to the text representation of the given\n" - " `Atom`.\n" - "\n" - " ## Examples\n" - " ```gleam\n" - " let ok_atom = create_from_string(\"ok\")\n" - " to_string(ok_atom)\n" - " // -> \"ok\"\n" - " ```\n" -). --spec to_string(atom_()) -> binary(). -to_string(A) -> - erlang:atom_to_binary(A). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/atom.gleam", 85). -?DOC( - " Checks to see whether a `Dynamic` value is an atom, and return the atom if\n" - " it is.\n" - "\n" - " ## Examples\n" - " ```gleam\n" - " import gleam/dynamic\n" - " from_dynamic(dynamic.from(create_from_string(\"hello\")))\n" - " // -> Ok(create_from_string(\"hello\"))\n" - " ```\n" - " ```gleam\n" - " from_dynamic(dynamic.from(123))\n" - " // -> Error([DecodeError(expected: \"Atom\", found: \"Int\", path: [])])\n" - " ```\n" -). --spec from_dynamic(gleam@dynamic:dynamic_()) -> {ok, atom_()} | - {error, list(gleam@dynamic@decode:decode_error())}. -from_dynamic(From) -> - gleam_erlang_ffi:atom_from_dynamic(From). diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@charlist.erl b/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@charlist.erl deleted file mode 100644 index e1d7e86..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@charlist.erl +++ /dev/null @@ -1,36 +0,0 @@ --module(gleam@erlang@charlist). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([to_string/1, from_string/1]). --export_type([charlist/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " A charlist is a list of integers where all the integers are valid code\n" - " points.\n" - "\n" - " In practice, you will not come across them often, except perhaps when\n" - " interfacing with Erlang, in particular when using older libraries that do\n" - " not accept binaries as arguments.\n" -). - --type charlist() :: any(). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/charlist.gleam", 14). -?DOC(" Transform a charlist to a string\n"). --spec to_string(charlist()) -> binary(). -to_string(A) -> - unicode:characters_to_binary(A). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/charlist.gleam", 22). -?DOC(" Transform a string to a charlist\n"). --spec from_string(binary()) -> charlist(). -from_string(A) -> - unicode:characters_to_list(A). diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@node.erl b/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@node.erl deleted file mode 100644 index 96ec057..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@node.erl +++ /dev/null @@ -1,73 +0,0 @@ --module(gleam@erlang@node). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([self/0, visible/0, connect/1, send/3, to_atom/1]). --export_type([node_/0, do_not_leak/0, connect_error/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --type node_() :: any(). - --type do_not_leak() :: any(). - --type connect_error() :: failed_to_connect | local_node_is_not_alive. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/node.gleam", 10). -?DOC(" Return the current node.\n"). --spec self() -> node_(). -self() -> - erlang:node(). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/node.gleam", 23). -?DOC( - " Return a list of all visible nodes in the cluster, not including the current\n" - " node.\n" - "\n" - " The current node can be included by calling `self()` and prepending the\n" - " result.\n" - "\n" - " ```gleam\n" - " let all_nodes = [node.self(), ..node.visible()]\n" - " ```\n" -). --spec visible() -> list(node_()). -visible() -> - erlang:nodes(). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/node.gleam", 44). -?DOC( - " Establish a connection to a node, so the nodes can send messages to each\n" - " other and any other connected nodes.\n" - "\n" - " Returns `Error(FailedToConnect)` if the node is not reachable.\n" - "\n" - " Returns `Error(LocalNodeIsNotAlive)` if the local node is not alive, meaning\n" - " it is not running in distributed mode.\n" -). --spec connect(gleam@erlang@atom:atom_()) -> {ok, node_()} | - {error, connect_error()}. -connect(Node) -> - gleam_erlang_ffi:connect_node(Node). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/node.gleam", 51). -?DOC( - " Send a message to a named process on a given node.\n" - "\n" - " These messages are untyped, like regular Erlang messages.\n" -). --spec send(node_(), gleam@erlang@atom:atom_(), any()) -> nil. -send(Node, Name, Message) -> - erlang:send({Name, Node}, Message), - nil. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/node.gleam", 62). -?DOC(" Convert a node to the atom of its name.\n"). --spec to_atom(node_()) -> gleam@erlang@atom:atom_(). -to_atom(Node) -> - gleam_erlang_ffi:identity(Node). diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@os.erl b/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@os.erl deleted file mode 100644 index 85d9f38..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@os.erl +++ /dev/null @@ -1,41 +0,0 @@ --module(gleam@erlang@os). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([family/0]). --export_type([os_family/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --type os_family() :: windows_nt | linux | darwin | free_bsd | {other, binary()}. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/os.gleam", 36). -?DOC( - " Returns the kernel of the host operating system.\n" - "\n" - " Unknown kernels are reported as `Other(String)`; e.g. `Other(\"sunos\")`.\n" - "\n" - " ## Examples\n" - " ```gleam\n" - " family()\n" - " // -> Linux\n" - " ```\n" - " \n" - " ```gleam\n" - " family()\n" - " // -> Darwin\n" - " ```\n" - " \n" - " ```gleam\n" - " family()\n" - " // -> Other(\"sunos\")\n" - " ```\n" -). --spec family() -> os_family(). -family() -> - gleam_erlang_ffi:os_family(). diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@port.erl b/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@port.erl deleted file mode 100644 index eef3b79..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@port.erl +++ /dev/null @@ -1,34 +0,0 @@ --module(gleam@erlang@port). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([port_from_dynamic/1]). --export_type([port_/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --type port_() :: any(). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/port.gleam", 27). -?DOC( - " Checks to see whether a `Dynamic` value is a port, and return the port if\n" - " it is.\n" - "\n" - " ## Examples\n" - "\n" - " > import gleam/dynamic\n" - " > port_from_dynamic(dynamic.from(process.self()))\n" - " Ok(process.self())\n" - "\n" - " > port_from_dynamic(dynamic.from(123))\n" - " Error([DecodeError(expected: \"Port\", found: \"Int\", path: [])])\n" -). --spec port_from_dynamic(gleam@dynamic:dynamic_()) -> {ok, port_()} | - {error, list(gleam@dynamic@decode:decode_error())}. -port_from_dynamic(From) -> - gleam_erlang_ffi:port_from_dynamic(From). diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@process.erl b/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@process.erl deleted file mode 100644 index 8fdc1ba..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@process.erl +++ /dev/null @@ -1,855 +0,0 @@ --module(gleam@erlang@process). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([self/0, start/2, new_subject/0, subject_owner/1, send/2, 'receive'/2, receive_forever/1, new_selector/0, select/2, select_forever/1, map_selector/2, merge_selector/2, flush_messages/0, selecting_trapped_exits/2, selecting/3, selecting_record2/3, selecting_record3/3, selecting_record4/3, selecting_record5/3, selecting_record6/3, selecting_record7/3, selecting_record8/3, selecting_anything/2, deselecting/2, sleep/1, sleep_forever/0, is_alive/1, monitor_process/1, selecting_process_down/3, demonitor_process/1, deselecting_process_down/2, try_call/3, call/3, try_call_forever/2, call_forever/2, link/1, unlink/1, send_after/3, cancel_timer/1, kill/1, send_exit/1, send_abnormal_exit/2, trap_exits/1, register/2, unregister/1, named/1, pid_from_dynamic/1]). --export_type([pid_/0, subject/1, do_not_leak/0, selector/1, exit_message/0, exit_reason/0, anything_selector_tag/0, process_monitor_flag/0, process_monitor/0, process_down/0, call_error/1, timer/0, cancelled/0, kill_flag/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --type pid_() :: any(). - --opaque subject(FBZ) :: {subject, pid_(), gleam@erlang:reference_()} | - {gleam_phantom, FBZ}. - --type do_not_leak() :: any(). - --type selector(FCA) :: any() | {gleam_phantom, FCA}. - --type exit_message() :: {exit_message, pid_(), exit_reason()}. - --type exit_reason() :: normal | killed | {abnormal, binary()}. - --type anything_selector_tag() :: anything. - --type process_monitor_flag() :: process. - --opaque process_monitor() :: {process_monitor, gleam@erlang:reference_()}. - --type process_down() :: {process_down, pid_(), gleam@dynamic:dynamic_()}. - --type call_error(FCB) :: {callee_down, gleam@dynamic:dynamic_()} | - call_timeout | - {gleam_phantom, FCB}. - --type timer() :: any(). - --type cancelled() :: timer_not_found | {cancelled, integer()}. - --type kill_flag() :: kill. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 15). -?DOC(" Get the `Pid` for the current process.\n"). --spec self() -> pid_(). -self() -> - erlang:self(). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 29). -?DOC( - " Create a new Erlang process that runs concurrently to the creator. In other\n" - " languages this might be called a fibre, a green thread, or a coroutine.\n" - "\n" - " If `linked` is `True` then the created process is linked to the creator\n" - " process. When a process terminates an exit signal is sent to all other\n" - " processes that are linked to it, causing the process to either terminate or\n" - " have to handle the signal.\n" - "\n" - " More can be read about processes and links in the [Erlang documentation][1].\n" - "\n" - " [1]: https://www.erlang.org/doc/reference_manual/processes.html\n" -). --spec start(fun(() -> any()), boolean()) -> pid_(). -start(Implementation, Link) -> - case Link of - true -> - erlang:spawn_link(Implementation); - - false -> - erlang:spawn(Implementation) - end. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 71). -?DOC(" Create a new `Subject` owned by the current process.\n"). --spec new_subject() -> subject(any()). -new_subject() -> - {subject, erlang:self(), erlang:make_ref()}. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 78). -?DOC( - " Get the owner process for a `Subject`. This is the process that created the\n" - " `Subject` and will receive messages sent with it.\n" -). --spec subject_owner(subject(any())) -> pid_(). -subject_owner(Subject) -> - erlang:element(2, Subject). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 111). -?DOC( - " Send a message to a process using a `Subject`. The message must be of the\n" - " type that the `Subject` accepts.\n" - "\n" - " This function does not wait for the `Subject` owner process to call the\n" - " `receive` function, instead it returns once the message has been placed in\n" - " the process' mailbox.\n" - "\n" - " # Ordering\n" - "\n" - " If process P1 sends two messages to process P2 it is guaranteed that process\n" - " P1 will receive the messages in the order they were sent.\n" - "\n" - " If you wish to receive the messages in a different order you can send them\n" - " on two different subjects and the receiver function can call the `receive`\n" - " function for each subject in the desired order, or you can write some Erlang\n" - " code to perform a selective receive.\n" - "\n" - " # Examples\n" - "\n" - " ```gleam\n" - " let subject = new_subject()\n" - " send(subject, \"Hello, Joe!\")\n" - " ```\n" -). --spec send(subject(FCK), FCK) -> nil. -send(Subject, Message) -> - erlang:send( - erlang:element(2, Subject), - {erlang:element(3, Subject), Message} - ), - nil. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 132). -?DOC( - " Receive a message that has been sent to current process using the `Subject`.\n" - "\n" - " If there is not an existing message for the `Subject` in the process'\n" - " mailbox or one does not arrive `within` the permitted timeout then the\n" - " `Error(Nil)` is returned.\n" - "\n" - " Only the process that is owner of the `Subject` can receive a message using\n" - " it. If a process that does not own the `Subject` attempts to receive with it\n" - " then it will not receive a message.\n" - "\n" - " To wait for messages from multiple `Subject`s at the same time see the\n" - " `Selector` type.\n" - "\n" - " The `within` parameter specifies the timeout duration in milliseconds.\n" -). --spec 'receive'(subject(FCM), integer()) -> {ok, FCM} | {error, nil}. -'receive'(Subject, Timeout) -> - gleam_erlang_ffi:'receive'(Subject, Timeout). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 141). -?DOC( - " Receive a message that has been sent to current process using the `Subject`.\n" - "\n" - " Same as `receive` but waits forever and returns the message as is.\n" -). --spec receive_forever(subject(FCQ)) -> FCQ. -receive_forever(Subject) -> - gleam_erlang_ffi:'receive'(Subject). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 170). -?DOC( - " Create a new `Selector` which can be used to receive messages on multiple\n" - " `Subject`s at once.\n" -). --spec new_selector() -> selector(any()). -new_selector() -> - gleam_erlang_ffi:new_selector(). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 190). -?DOC( - " Receive a message that has been sent to current process using any of the\n" - " `Subject`s that have been added to the `Selector` with the `selecting`\n" - " function.\n" - "\n" - " If there is not an existing message for the `Selector` in the process'\n" - " mailbox or one does not arrive `within` the permitted timeout then the\n" - " `Error(Nil)` is returned.\n" - "\n" - " Only the process that is owner of the `Subject`s can receive a message using\n" - " them. If a process that does not own the a `Subject` attempts to receive\n" - " with it then it will not receive a message.\n" - "\n" - " To wait forever for the next message rather than for a limited amount of\n" - " time see the `select_forever` function.\n" - "\n" - " The `within` parameter specifies the timeout duration in milliseconds.\n" -). --spec select(selector(FCU), integer()) -> {ok, FCU} | {error, nil}. -select(From, Within) -> - gleam_erlang_ffi:select(From, Within). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 199). -?DOC( - " Similar to the `select` function but will wait forever for a message to\n" - " arrive rather than timing out after a specified amount of time.\n" -). --spec select_forever(selector(FCY)) -> FCY. -select_forever(From) -> - gleam_erlang_ffi:select(From). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 208). -?DOC( - " Add a transformation function to a selector. When a message is received\n" - " using this selector the transformation function is applied to the message.\n" - "\n" - " This function can be used to change the type of messages received and may\n" - " be useful when combined with the `merge_selector` function.\n" -). --spec map_selector(selector(FDA), fun((FDA) -> FDC)) -> selector(FDC). -map_selector(A, B) -> - gleam_erlang_ffi:map_selector(A, B). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 217). -?DOC( - " Merge one selector into another, producing a selector that contains the\n" - " message handlers of both.\n" - "\n" - " If a subject is handled by both selectors the handler function of the\n" - " second selector is used.\n" -). --spec merge_selector(selector(FDE), selector(FDE)) -> selector(FDE). -merge_selector(A, B) -> - gleam_erlang_ffi:merge_selector(A, B). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 261). -?DOC( - " Discard all messages in the current process' mailbox.\n" - "\n" - " Warning: This function may cause other processes to crash if they sent a\n" - " message to the current process and are waiting for a response, so use with\n" - " caution.\n" -). --spec flush_messages() -> nil. -flush_messages() -> - gleam_erlang_ffi:flush_messages(). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 233). -?DOC( - " Add a handler for trapped exit messages. In order for these messages to be\n" - " sent to the process when a linked process exits the process must call the\n" - " `trap_exit` beforehand.\n" -). --spec selecting_trapped_exits(selector(FDI), fun((exit_message()) -> FDI)) -> selector(FDI). -selecting_trapped_exits(Selector, Handler) -> - Tag = erlang:binary_to_atom(<<"EXIT"/utf8>>), - Handler@1 = fun(Message) -> - Reason = erlang:element(3, Message), - Normal = gleam_stdlib:identity(normal), - Killed = gleam_stdlib:identity(killed), - Reason@2 = case gleam@dynamic@decode:run( - Reason, - {decoder, fun gleam@dynamic@decode:decode_string/1} - ) of - _ when Reason =:= Normal -> - normal; - - _ when Reason =:= Killed -> - killed; - - {ok, Reason@1} -> - {abnormal, Reason@1}; - - {error, _} -> - {abnormal, gleam@string:inspect(Reason)} - end, - Handler({exit_message, erlang:element(2, Message), Reason@2}) - end, - gleam_erlang_ffi:insert_selector_handler(Selector, {Tag, 3}, Handler@1). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 274). -?DOC( - " Add a new `Subject` to the `Selector` so that its messages can be selected\n" - " from the receiver process inbox.\n" - "\n" - " The `mapping` function provided with the `Subject` can be used to convert\n" - " the type of messages received using this `Subject`. This is useful for when\n" - " you wish to add multiple `Subject`s to a `Selector` when they have differing\n" - " message types. If you do not wish to transform the incoming messages in any\n" - " way then the `identity` function can be given.\n" - "\n" - " See `deselecting` to remove a subject from a selector.\n" -). --spec selecting(selector(FDL), subject(FDN), fun((FDN) -> FDL)) -> selector(FDL). -selecting(Selector, Subject, Transform) -> - Handler = fun(Message) -> Transform(erlang:element(2, Message)) end, - gleam_erlang_ffi:insert_selector_handler( - Selector, - {erlang:element(3, Subject), 2}, - Handler - ). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 300). -?DOC( - " Add a handler to a selector for 2 element tuple messages with a given tag\n" - " element in the first position.\n" - "\n" - " Typically you want to use the `selecting` function with a `Subject` instead,\n" - " but this function may be useful if you need to receive messages sent from\n" - " other BEAM languages that do not use the `Subject` type.\n" -). --spec selecting_record2( - selector(FDV), - any(), - fun((gleam@dynamic:dynamic_()) -> FDV) -) -> selector(FDV). -selecting_record2(Selector, Tag, Transform) -> - Handler = fun(Message) -> Transform(erlang:element(2, Message)) end, - gleam_erlang_ffi:insert_selector_handler(Selector, {Tag, 2}, Handler). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 316). -?DOC( - " Add a handler to a selector for 3 element tuple messages with a given tag\n" - " element in the first position.\n" - "\n" - " Typically you want to use the `selecting` function with a `Subject` instead,\n" - " but this function may be useful if you need to receive messages sent from\n" - " other BEAM languages that do not use the `Subject` type.\n" -). --spec selecting_record3( - selector(FDZ), - any(), - fun((gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_()) -> FDZ) -) -> selector(FDZ). -selecting_record3(Selector, Tag, Transform) -> - Handler = fun(Message) -> - Transform(erlang:element(2, Message), erlang:element(3, Message)) - end, - gleam_erlang_ffi:insert_selector_handler(Selector, {Tag, 3}, Handler). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 334). -?DOC( - " Add a handler to a selector for 4 element tuple messages with a given tag\n" - " element in the first position.\n" - "\n" - " Typically you want to use the `selecting` function with a `Subject` instead,\n" - " but this function may be useful if you need to receive messages sent from\n" - " other BEAM languages that do not use the `Subject` type.\n" -). --spec selecting_record4( - selector(FED), - any(), - fun((gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_()) -> FED) -) -> selector(FED). -selecting_record4(Selector, Tag, Transform) -> - Handler = fun(Message) -> - Transform( - erlang:element(2, Message), - erlang:element(3, Message), - erlang:element(4, Message) - ) - end, - gleam_erlang_ffi:insert_selector_handler(Selector, {Tag, 4}, Handler). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 352). -?DOC( - " Add a handler to a selector for 5 element tuple messages with a given tag\n" - " element in the first position.\n" - "\n" - " Typically you want to use the `selecting` function with a `Subject` instead,\n" - " but this function may be useful if you need to receive messages sent from\n" - " other BEAM languages that do not use the `Subject` type.\n" -). --spec selecting_record5( - selector(FEH), - any(), - fun((gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_()) -> FEH) -) -> selector(FEH). -selecting_record5(Selector, Tag, Transform) -> - Handler = fun(Message) -> - Transform( - erlang:element(2, Message), - erlang:element(3, Message), - erlang:element(4, Message), - erlang:element(5, Message) - ) - end, - gleam_erlang_ffi:insert_selector_handler(Selector, {Tag, 5}, Handler). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 370). -?DOC( - " Add a handler to a selector for 6 element tuple messages with a given tag\n" - " element in the first position.\n" - "\n" - " Typically you want to use the `selecting` function with a `Subject` instead,\n" - " but this function may be useful if you need to receive messages sent from\n" - " other BEAM languages that do not use the `Subject` type.\n" -). --spec selecting_record6( - selector(FEL), - any(), - fun((gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_()) -> FEL) -) -> selector(FEL). -selecting_record6(Selector, Tag, Transform) -> - Handler = fun(Message) -> - Transform( - erlang:element(2, Message), - erlang:element(3, Message), - erlang:element(4, Message), - erlang:element(5, Message), - erlang:element(6, Message) - ) - end, - gleam_erlang_ffi:insert_selector_handler(Selector, {Tag, 6}, Handler). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 388). -?DOC( - " Add a handler to a selector for 7 element tuple messages with a given tag\n" - " element in the first position.\n" - "\n" - " Typically you want to use the `selecting` function with a `Subject` instead,\n" - " but this function may be useful if you need to receive messages sent from\n" - " other BEAM languages that do not use the `Subject` type.\n" -). --spec selecting_record7( - selector(FEP), - any(), - fun((gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_()) -> FEP) -) -> selector(FEP). -selecting_record7(Selector, Tag, Transform) -> - Handler = fun(Message) -> - Transform( - erlang:element(2, Message), - erlang:element(3, Message), - erlang:element(4, Message), - erlang:element(5, Message), - erlang:element(6, Message), - erlang:element(7, Message) - ) - end, - gleam_erlang_ffi:insert_selector_handler(Selector, {Tag, 7}, Handler). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 409). -?DOC( - " Add a handler to a selector for 8 element tuple messages with a given tag\n" - " element in the first position.\n" - "\n" - " Typically you want to use the `selecting` function with a `Subject` instead,\n" - " but this function may be useful if you need to receive messages sent from\n" - " other BEAM languages that do not use the `Subject` type.\n" -). --spec selecting_record8( - selector(FET), - any(), - fun((gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_(), gleam@dynamic:dynamic_()) -> FET) -) -> selector(FET). -selecting_record8(Selector, Tag, Transform) -> - Handler = fun(Message) -> - Transform( - erlang:element(2, Message), - erlang:element(3, Message), - erlang:element(4, Message), - erlang:element(5, Message), - erlang:element(6, Message), - erlang:element(7, Message), - erlang:element(8, Message) - ) - end, - gleam_erlang_ffi:insert_selector_handler(Selector, {Tag, 8}, Handler). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 459). -?DOC( - " Add a catch-all handler to a selector that will be used when no other\n" - " handler in a selector is suitable for a given message.\n" - "\n" - " This may be useful for when you want to ensure that any message in the inbox\n" - " is handled, or when you need to handle messages from other BEAM languages\n" - " which do not use subjects or record format messages.\n" -). --spec selecting_anything(selector(FEX), fun((gleam@dynamic:dynamic_()) -> FEX)) -> selector(FEX). -selecting_anything(Selector, Handler) -> - gleam_erlang_ffi:insert_selector_handler(Selector, anything, Handler). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 286). -?DOC( - " Remove a new `Subject` from the `Selector` so that its messages will not be\n" - " selected from the receiver process inbox.\n" -). --spec deselecting(selector(FDQ), subject(any())) -> selector(FDQ). -deselecting(Selector, Subject) -> - gleam_erlang_ffi:remove_selector_handler( - Selector, - {erlang:element(3, Subject), 2} - ). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 483). -?DOC( - " Suspends the process calling this function for the specified number of\n" - " milliseconds.\n" -). --spec sleep(integer()) -> nil. -sleep(A) -> - gleam_erlang_ffi:sleep(A). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 490). -?DOC( - " Suspends the process forever! This may be useful for suspending the main\n" - " process in a Gleam program when it has no more work to do but we want other\n" - " processes to continue to work.\n" -). --spec sleep_forever() -> nil. -sleep_forever() -> - gleam_erlang_ffi:sleep_forever(). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 499). -?DOC( - " Check to see whether the process for a given `Pid` is alive.\n" - "\n" - " See the [Erlang documentation][1] for more information.\n" - "\n" - " [1]: http://erlang.org/doc/man/erlang.html#is_process_alive-1\n" -). --spec is_alive(pid_()) -> boolean(). -is_alive(A) -> - erlang:is_process_alive(A). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 530). -?DOC( - " Start monitoring a process so that when the monitored process exits a\n" - " message is sent to the monitoring process.\n" - "\n" - " The message is only sent once, when the target process exits. If the\n" - " process was not alive when this function is called the message will never\n" - " be received.\n" - "\n" - " The down message can be received with a `Selector` and the\n" - " `selecting_process_down` function.\n" - "\n" - " The process can be demonitored with the `demonitor_process` function.\n" -). --spec monitor_process(pid_()) -> process_monitor(). -monitor_process(Pid) -> - _pipe = process, - _pipe@1 = erlang:monitor(_pipe, Pid), - {process_monitor, _pipe@1}. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 541). -?DOC( - " Add a `ProcessMonitor` to a `Selector` so that the `ProcessDown` message can\n" - " be received using the `Selector` and the `select` function. The\n" - " `ProcessMonitor` can be removed later with\n" - " [`deselecting_process_down`](#deselecting_process_down).\n" -). --spec selecting_process_down( - selector(FFJ), - process_monitor(), - fun((process_down()) -> FFJ) -) -> selector(FFJ). -selecting_process_down(Selector, Monitor, Mapping) -> - gleam_erlang_ffi:insert_selector_handler( - Selector, - erlang:element(2, Monitor), - Mapping - ). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 555). -?DOC( - " Remove the monitor for a process so that when the monitor process exits a\n" - " `ProcessDown` message is not sent to the monitoring process.\n" - "\n" - " If the message has already been sent it is removed from the monitoring\n" - " process' mailbox.\n" -). --spec demonitor_process(process_monitor()) -> nil. -demonitor_process(Monitor) -> - gleam_erlang_ffi:demonitor(Monitor), - nil. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 580). -?DOC( - " Remove a `ProcessMonitor` from a `Selector` prevoiusly added by\n" - " [`selecting_process_down`](#selecting_process_down). If the `ProcessMonitor` is not in the\n" - " `Selector` it will be returned unchanged.\n" -). --spec deselecting_process_down(selector(FFM), process_monitor()) -> selector(FFM). -deselecting_process_down(Selector, Monitor) -> - gleam_erlang_ffi:remove_selector_handler( - Selector, - erlang:element(2, Monitor) - ). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 595). -?DOC( - " Send a message to a process and wait for a reply.\n" - "\n" - " If the receiving process exits or does not reply within the allowed amount\n" - " of time then an error is returned.\n" - "\n" - " The `within` parameter specifies the timeout duration in milliseconds.\n" -). --spec try_call(subject(FFP), fun((subject(FFR)) -> FFP), integer()) -> {ok, FFR} | - {error, call_error(FFR)}. -try_call(Subject, Make_request, Timeout) -> - Reply_subject = new_subject(), - Monitor = monitor_process(subject_owner(Subject)), - send(Subject, Make_request(Reply_subject)), - Result = begin - _pipe = gleam_erlang_ffi:new_selector(), - _pipe@1 = selecting( - _pipe, - Reply_subject, - fun(Field@0) -> {ok, Field@0} end - ), - _pipe@2 = selecting_process_down( - _pipe@1, - Monitor, - fun(Down) -> {error, {callee_down, erlang:element(3, Down)}} end - ), - gleam_erlang_ffi:select(_pipe@2, Timeout) - end, - demonitor_process(Monitor), - case Result of - {error, nil} -> - {error, call_timeout}; - - {ok, Res} -> - Res - end. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 636). -?DOC( - " Send a message to a process and wait for a reply.\n" - "\n" - " If the receiving process exits or does not reply within the allowed amount\n" - " of time the calling process crashes. If you wish an error to be returned\n" - " instead see the `try_call` function.\n" - "\n" - " The `within` parameter specifies the timeout duration in milliseconds.\n" -). --spec call(subject(FFW), fun((subject(FFY)) -> FFW), integer()) -> FFY. -call(Subject, Make_request, Timeout) -> - _assert_subject = try_call(Subject, Make_request, Timeout), - {ok, Resp} = case _assert_subject of - {ok, _} -> _assert_subject; - _assert_fail -> - erlang:error(#{gleam_error => let_assert, - message => <<"Pattern match failed, no pattern matched the value."/utf8>>, - value => _assert_fail, - module => <<"gleam/erlang/process"/utf8>>, - function => <<"call"/utf8>>, - line => 641}) - end, - Resp. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 665). -?DOC( - " Similar to the `try_call` function but will wait forever for a message\n" - " to arrive rather than timing out after a specified amount of time.\n" - "\n" - " If the receiving process exits then an error is returned.\n" -). --spec try_call_forever(subject(FGE), fun((subject(FGG)) -> FGE)) -> {ok, FGG} | - {error, call_error(any())}. -try_call_forever(Subject, Make_request) -> - Reply_subject = new_subject(), - Monitor = monitor_process(subject_owner(Subject)), - send(Subject, Make_request(Reply_subject)), - Result = begin - _pipe = gleam_erlang_ffi:new_selector(), - _pipe@1 = selecting( - _pipe, - Reply_subject, - fun(Field@0) -> {ok, Field@0} end - ), - _pipe@2 = selecting_process_down( - _pipe@1, - Monitor, - fun(Down) -> {error, {callee_down, erlang:element(3, Down)}} end - ), - gleam_erlang_ffi:select(_pipe@2) - end, - demonitor_process(Monitor), - Result. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 652). -?DOC( - " Similar to the `call` function but will wait forever for a message to\n" - " arrive rather than timing out after a specified amount of time.\n" - "\n" - " If the receiving process exits, the calling process crashes.\n" - " If you wish an error to be returned instead see the `try_call_forever`\n" - " function.\n" -). --spec call_forever(subject(FGA), fun((subject(FGC)) -> FGA)) -> FGC. -call_forever(Subject, Make_request) -> - _assert_subject = try_call_forever(Subject, Make_request), - {ok, Response} = case _assert_subject of - {ok, _} -> _assert_subject; - _assert_fail -> - erlang:error(#{gleam_error => let_assert, - message => <<"Pattern match failed, no pattern matched the value."/utf8>>, - value => _assert_fail, - module => <<"gleam/erlang/process"/utf8>>, - function => <<"call_forever"/utf8>>, - line => 656}) - end, - Response. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 703). -?DOC( - " Creates a link between the calling process and another process.\n" - "\n" - " When a process crashes any linked processes will also crash. This is useful\n" - " to ensure that groups of processes that depend on each other all either\n" - " succeed or fail together.\n" - "\n" - " Returns `True` if the link was created successfully, returns `False` if the\n" - " process was not alive and as such could not be linked.\n" -). --spec link(pid_()) -> boolean(). -link(Pid) -> - gleam_erlang_ffi:link(Pid). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 710). -?DOC(" Removes any existing link between the caller process and the target process.\n"). --spec unlink(pid_()) -> nil. -unlink(Pid) -> - erlang:unlink(Pid), - nil. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 722). -?DOC(" Send a message over a channel after a specified number of milliseconds.\n"). --spec send_after(subject(FGN), integer(), FGN) -> timer(). -send_after(Subject, Delay, Message) -> - erlang:send_after( - Delay, - erlang:element(2, Subject), - {erlang:element(3, Subject), Message} - ). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 746). -?DOC(" Cancel a given timer, causing it not to trigger if it has not done already.\n"). --spec cancel_timer(timer()) -> cancelled(). -cancel_timer(Timer) -> - case gleam@dynamic@decode:run( - erlang:cancel_timer(Timer), - {decoder, fun gleam@dynamic@decode:decode_int/1} - ) of - {ok, I} -> - {cancelled, I}; - - {error, _} -> - timer_not_found - end. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 770). -?DOC( - " Send an untrappable `kill` exit signal to the target process.\n" - "\n" - " See the documentation for the Erlang [`erlang:exit`][1] function for more\n" - " information.\n" - "\n" - " [1]: https://erlang.org/doc/man/erlang.html#exit-1\n" -). --spec kill(pid_()) -> nil. -kill(Pid) -> - erlang:exit(Pid, kill), - nil. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 786). -?DOC( - " Sends an exit signal to a process, indicating that the process is to shut\n" - " down.\n" - "\n" - " See the [Erlang documentation][1] for more information.\n" - "\n" - " [1]: http://erlang.org/doc/man/erlang.html#exit-2\n" -). --spec send_exit(pid_()) -> nil. -send_exit(Pid) -> - erlang:exit(Pid, normal), - nil. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 798). -?DOC( - " Sends an exit signal to a process, indicating that the process is to shut\n" - " down due to an abnormal reason such as a failure.\n" - "\n" - " See the [Erlang documentation][1] for more information.\n" - "\n" - " [1]: http://erlang.org/doc/man/erlang.html#exit-2\n" -). --spec send_abnormal_exit(pid_(), binary()) -> nil. -send_abnormal_exit(Pid, Reason) -> - erlang:exit(Pid, {abnormal, Reason}), - nil. - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 814). -?DOC( - " Set whether the current process is to trap exit signals or not.\n" - "\n" - " When not trapping exits if a linked process crashes the exit signal\n" - " propagates to the process which will also crash.\n" - " This is the normal behaviour before this function is called.\n" - "\n" - " When trapping exits (after this function is called) if a linked process\n" - " crashes an exit message is sent to the process instead. These messages can\n" - " be handled with the `selecting_trapped_exits` function.\n" -). --spec trap_exits(boolean()) -> nil. -trap_exits(A) -> - gleam_erlang_ffi:trap_exits(A). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 826). -?DOC( - " Register a process under a given name, allowing it to be looked up using\n" - " the `named` function.\n" - "\n" - " This function will return an error under the following conditions:\n" - " - The process for the pid no longer exists.\n" - " - The name has already been registered.\n" - " - The process already has a name.\n" - " - The name is the atom `undefined`, which is reserved by Erlang.\n" -). --spec register(pid_(), gleam@erlang@atom:atom_()) -> {ok, nil} | {error, nil}. -register(Pid, Name) -> - gleam_erlang_ffi:register_process(Pid, Name). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 837). -?DOC( - " Un-register a process name, after which the process can no longer be looked\n" - " up by that name, and both the name and the process can be re-used in other\n" - " registrations.\n" - "\n" - " It is possible to un-register process that are not from your application,\n" - " including those from Erlang/OTP itself. This is not recommended and will\n" - " likely result in undesirable behaviour and crashes.\n" -). --spec unregister(gleam@erlang@atom:atom_()) -> {ok, nil} | {error, nil}. -unregister(Name) -> - gleam_erlang_ffi:unregister_process(Name). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 842). -?DOC(" Look up a process by name, returning the pid if it exists.\n"). --spec named(gleam@erlang@atom:atom_()) -> {ok, pid_()} | {error, nil}. -named(Name) -> - gleam_erlang_ffi:process_named(Name). - --file("/Users/louis/src/gleam/erlang/src/gleam/erlang/process.gleam", 860). -?DOC( - " Checks to see whether a `Dynamic` value is a pid, and return the pid if\n" - " it is.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " import gleam/dynamic\n" - " pid_from_dynamic(dynamic.from(process.self()))\n" - " // -> Ok(process.self())\n" - " ```\n" - "\n" - " ```gleam\n" - " pid_from_dynamic(dynamic.from(123))\n" - " // -> Error([DecodeError(expected: \"Pid\", found: \"Int\", path: [])])\n" - " ```\n" -). --spec pid_from_dynamic(gleam@dynamic:dynamic_()) -> {ok, pid_()} | - {error, list(gleam@dynamic@decode:decode_error())}. -pid_from_dynamic(From) -> - gleam_erlang_ffi:pid_from_dynamic(From). diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam_erlang.app.src b/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam_erlang.app.src deleted file mode 100644 index 38b3ca2..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam_erlang.app.src +++ /dev/null @@ -1,13 +0,0 @@ -{application, gleam_erlang, [ - {vsn, "0.34.0"}, - {applications, [gleam_stdlib]}, - {description, "A Gleam library for working with Erlang"}, - {modules, [gleam@erlang, - gleam@erlang@atom, - gleam@erlang@charlist, - gleam@erlang@node, - gleam@erlang@os, - gleam@erlang@port, - gleam@erlang@process]}, - {registered, []} -]}. diff --git a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam_erlang_ffi.erl b/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam_erlang_ffi.erl deleted file mode 100644 index 12ce581..0000000 --- a/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam_erlang_ffi.erl +++ /dev/null @@ -1,224 +0,0 @@ --module(gleam_erlang_ffi). --export([ - atom_from_dynamic/1, rescue/1, atom_from_string/1, get_line/1, - ensure_all_started/1, sleep/1, os_family/0, sleep_forever/0, - get_all_env/0, get_env/1, set_env/2, unset_env/1, demonitor/1, - new_selector/0, link/1, insert_selector_handler/3, - remove_selector_handler/2, select/1, select/2, trap_exits/1, - map_selector/2, merge_selector/2, flush_messages/0, - priv_directory/1, connect_node/1, register_process/2, unregister_process/1, - process_named/1, identity/1, pid_from_dynamic/1, reference_from_dynamic/1, - port_from_dynamic/1, 'receive'/1, 'receive'/2 -]). - --spec atom_from_string(binary()) -> {ok, atom()} | {error, atom_not_loaded}. -atom_from_string(S) -> - try {ok, binary_to_existing_atom(S)} - catch error:badarg -> {error, atom_not_loaded} - end. - -atom_from_dynamic(Data) when is_atom(Data) -> - {ok, Data}; -atom_from_dynamic(Data) -> - {error, [{decode_error, <<"Atom">>, gleam@dynamic:classify(Data), []}]}. - -pid_from_dynamic(Data) when is_pid(Data) -> - {ok, Data}; -pid_from_dynamic(Data) -> - {error, [{decode_error, <<"Pid">>, gleam@dynamic:classify(Data), []}]}. - -reference_from_dynamic(Data) when is_reference(Data) -> - {ok, Data}; -reference_from_dynamic(Data) -> - {error, [{decode_error, <<"Reference">>, gleam@dynamic:classify(Data), []}]}. - -port_from_dynamic(Data) when is_port(Data) -> - {ok, Data}; -port_from_dynamic(Data) -> - {error, [{decode_error, <<"Port">>, gleam@dynamic:classify(Data), []}]}. - --spec get_line(io:prompt()) -> {ok, unicode:unicode_binary()} | {error, eof | no_data}. -get_line(Prompt) -> - case io:get_line(Prompt) of - eof -> {error, eof}; - {error, _} -> {error, no_data}; - Data when is_binary(Data) -> {ok, Data}; - Data when is_list(Data) -> {ok, unicode:characters_to_binary(Data)} - end. - -rescue(F) -> - try {ok, F()} - catch - throw:X -> {error, {thrown, X}}; - error:X -> {error, {errored, X}}; - exit:X -> {error, {exited, X}} - end. - -ensure_all_started(Application) -> - case application:ensure_all_started(Application) of - {ok, _} = Ok -> Ok; - - {error, {ProblemApp, {"no such file or directory", _}}} -> - {error, {unknown_application, ProblemApp}} - end. - -sleep(Microseconds) -> - timer:sleep(Microseconds), - nil. - -sleep_forever() -> - timer:sleep(infinity), - nil. - -get_all_env() -> - BinVars = lists:map(fun(VarString) -> - [VarName, VarVal] = string:split(VarString, "="), - {list_to_binary(VarName), list_to_binary(VarVal)} - end, os:getenv()), - maps:from_list(BinVars). - -get_env(Name) -> - case os:getenv(binary_to_list(Name)) of - false -> {error, nil}; - Value -> {ok, list_to_binary(Value)} - end. - -set_env(Name, Value) -> - os:putenv(binary_to_list(Name), binary_to_list(Value)), - nil. - -unset_env(Name) -> - os:unsetenv(binary_to_list(Name)), - nil. - -os_family() -> - case os:type() of - {win32, nt} -> - windows_nt; - {unix, linux} -> - linux; - {unix, darwin} -> - darwin; - {unix, freebsd} -> - free_bsd; - {_, Other} -> - {other, atom_to_binary(Other, utf8)} - end. - -new_selector() -> - {selector, #{}}. - -map_selector({selector, Handlers}, Fn) -> - MappedHandlers = maps:map(fun(_Tag, Handler) -> - fun(Message) -> Fn(Handler(Message)) end - end, Handlers), - {selector, MappedHandlers}. - -merge_selector({selector, HandlersA}, {selector, HandlersB}) -> - {selector, maps:merge(HandlersA, HandlersB)}. - -insert_selector_handler({selector, Handlers}, Tag, Fn) -> - {selector, Handlers#{Tag => Fn}}. - -remove_selector_handler({selector, Handlers}, Tag) -> - {selector, maps:remove(Tag, Handlers)}. - -select(Selector) -> - {ok, Message} = select(Selector, infinity), - Message. - -select({selector, Handlers}, Timeout) -> - AnythingHandler = maps:get(anything, Handlers, undefined), - receive - % Monitored process down messages. - % This is special cased so we can selectively receive based on the - % reference as well as the record tag. - {'DOWN', Ref, process, Pid, Reason} when is_map_key(Ref, Handlers) -> - Fn = maps:get(Ref, Handlers), - {ok, Fn({process_down, Pid, Reason})}; - - Msg when is_map_key({element(1, Msg), tuple_size(Msg)}, Handlers) -> - Fn = maps:get({element(1, Msg), tuple_size(Msg)}, Handlers), - {ok, Fn(Msg)}; - - Msg when AnythingHandler =/= undefined -> - {ok, AnythingHandler(Msg)} - after Timeout -> - {error, nil} - end. - -'receive'({subject, _Pid, Ref}) -> - receive - {Ref, Message} -> - Message - end. - -'receive'({subject, _Pid, Ref}, Timeout) -> - receive - {Ref, Message} -> - {ok, Message} - after Timeout -> - {error, nil} - end. - -demonitor({_, Reference}) -> - erlang:demonitor(Reference, [flush]). - -link(Pid) -> - try - erlang:link(Pid) - catch - error:_ -> false - end. - -trap_exits(ShouldTrap) -> - erlang:process_flag(trap_exit, ShouldTrap), - nil. - -flush_messages() -> - receive _Message -> flush_messages() - after 0 -> nil - end. - -priv_directory(Name) -> - try erlang:binary_to_existing_atom(Name) of - Atom -> - case code:priv_dir(Atom) of - {error, _} -> {error, nil}; - Path -> {ok, unicode:characters_to_binary(Path)} - end - catch - error:badarg -> {error, nil} - end. - -connect_node(Node) -> - case net_kernel:connect_node(Node) of - true -> {ok, Node}; - false -> {error, failed_to_connect}; - ignored -> {error, local_node_is_not_alive} - end. - -register_process(Pid, Name) -> - try - true = erlang:register(Name, Pid), - {ok, nil} - catch - error:badarg -> {error, nil} - end. - -unregister_process(Name) -> - try - true = erlang:unregister(Name), - {ok, nil} - catch - error:badarg -> {error, nil} - end. - -process_named(Name) -> - case erlang:whereis(Name) of - Pid when is_pid(Pid) -> {ok, Pid}; - _ -> {error, nil} - end. - -identity(X) -> - X. diff --git a/lsp/bet-lsp/build/packages/gleam_http/LICENSE b/lsp/bet-lsp/build/packages/gleam_http/LICENSE deleted file mode 100644 index 619ec77..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/LICENSE +++ /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 2019, 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/lsp/bet-lsp/build/packages/gleam_http/README.md b/lsp/bet-lsp/build/packages/gleam_http/README.md deleted file mode 100644 index e0f5629..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/README.md +++ /dev/null @@ -1,69 +0,0 @@ -# Gleam HTTP - -Types and functions for HTTP clients and servers! - -## HTTP Service Example - -```gleam -import gleam/http/elli -import gleam/http/response.{type Response} -import gleam/http/request.{type Request} -import gleam/bytes_builder.{type BytesBuilder} - -// Define a HTTP service -// -pub fn my_service(_request: Request(t)) -> Response(BytesBuilder) { - let body = bytes_builder.from_string("Hello, world!") - - response.new(200) - |> response.prepend_header("made-with", "Gleam") - |> response.set_body(body) -} - -// Start it on port 3000 using the Elli web server -// -pub fn main() { - elli.become(my_service, on_port: 3000) -} -``` - -## Server adapters - -In the example above the Elli Erlang web server is used to run the Gleam HTTP -service. Here's a full list of the server adapters available, sorted -alphabetically. - -| Adapter | About | -| --- | --- | -| [Mist][mist] | [Mist][mist] is a high performance pure Gleam HTTP 1.1 server | -| [cgi][cgi] | [cgi][cgi] is a adapter for the Common Gateway Interface. | -| [gleam_cowboy][cowboy-adapter] | [Cowboy][cowboy] is an Erlang HTTP2 & HTTP1.1 web server | -| [gleam_elli][elli-adapter] | [Elli][elli] is an Erlang HTTP1.1 web server | -| [gleam_plug][plug-adapter] | [Plug][plug] is an Elixir web application interface | - -[cgi]: https://github.com/lpil/cgi -[cowboy-adapter]: https://github.com/gleam-lang/cowboy -[cowboy]:https://github.com/ninenines/cowboy -[elli-adapter]: https://github.com/gleam-lang/elli -[elli]:https://github.com/elli-lib/elli -[mist]: https://github.com/rawhat/mist -[plug-adapter]: https://github.com/gleam-lang/plug -[plug]:https://github.com/elixir-plug/plug - -## Client adapters - -Client adapters are used to send HTTP requests to services over the network. -Here's a full list of the client adapters available, sorted alphabetically. - -| Adapter | About | -| --- | --- | -| [gleam_fetch][fetch-adapter] | [fetch][fetch] is a HTTP client included with JavaScript | -| [gleam_hackney][hackney-adapter] | [Hackney][hackney] is a simple HTTP client for Erlang | -| [gleam_httpc][httpc-adapter] | [httpc][httpc] is a HTTP client included with Erlang | - -[hackney]: https://github.com/benoitc/hackney -[hackney-adapter]: https://github.com/gleam-lang/hackney -[httpc]: https://erlang.org/doc/man/httpc.html -[httpc-adapter]: https://github.com/gleam-lang/httpc -[fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API -[fetch-adapter]: https://github.com/gleam-lang/fetch diff --git a/lsp/bet-lsp/build/packages/gleam_http/gleam.toml b/lsp/bet-lsp/build/packages/gleam_http/gleam.toml deleted file mode 100644 index 3a3cf93..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/gleam.toml +++ /dev/null @@ -1,17 +0,0 @@ -name = "gleam_http" -version = "3.7.2" -licences = ["Apache-2.0"] -description = "Types and functions for Gleam HTTP clients and servers" -gleam = ">= 1.0.0" - -repository = { type = "github", user = "gleam-lang", repo = "http" } -links = [ - { title = "Website", href = "https://gleam.run" }, - { title = "Sponsor", href = "https://github.com/sponsors/lpil" }, -] - -[dependencies] -gleam_stdlib = ">= 0.45.0 and < 2.0.0" - -[dev-dependencies] -gleeunit = "~> 1.0" diff --git a/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http@cookie_Attributes.hrl b/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http@cookie_Attributes.hrl deleted file mode 100644 index 78a7d02..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http@cookie_Attributes.hrl +++ /dev/null @@ -1,8 +0,0 @@ --record(attributes, { - max_age :: gleam@option:option(integer()), - domain :: gleam@option:option(binary()), - path :: gleam@option:option(binary()), - secure :: boolean(), - http_only :: boolean(), - same_site :: gleam@option:option(gleam@http@cookie:same_site_policy()) -}). diff --git a/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http@request_Request.hrl b/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http@request_Request.hrl deleted file mode 100644 index c8bbae6..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http@request_Request.hrl +++ /dev/null @@ -1,10 +0,0 @@ --record(request, { - method :: gleam@http:method(), - headers :: list({binary(), binary()}), - body :: any(), - scheme :: gleam@http:scheme(), - host :: binary(), - port :: gleam@option:option(integer()), - path :: binary(), - 'query' :: gleam@option:option(binary()) -}). diff --git a/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http@response_Response.hrl b/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http@response_Response.hrl deleted file mode 100644 index ba6f077..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http@response_Response.hrl +++ /dev/null @@ -1,5 +0,0 @@ --record(response, { - status :: integer(), - headers :: list({binary(), binary()}), - body :: any() -}). diff --git a/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http_MoreRequiredForBody.hrl b/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http_MoreRequiredForBody.hrl deleted file mode 100644 index abd56dd..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http_MoreRequiredForBody.hrl +++ /dev/null @@ -1,5 +0,0 @@ --record(more_required_for_body, { - chunk :: bitstring(), - continuation :: fun((bitstring()) -> {ok, gleam@http:multipart_body()} | - {error, nil}) -}). diff --git a/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http_MoreRequiredForHeaders.hrl b/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http_MoreRequiredForHeaders.hrl deleted file mode 100644 index 43729c1..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http_MoreRequiredForHeaders.hrl +++ /dev/null @@ -1,4 +0,0 @@ --record(more_required_for_headers, { - continuation :: fun((bitstring()) -> {ok, gleam@http:multipart_headers()} | - {error, nil}) -}). diff --git a/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http_MultipartBody.hrl b/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http_MultipartBody.hrl deleted file mode 100644 index 4521591..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http_MultipartBody.hrl +++ /dev/null @@ -1,5 +0,0 @@ --record(multipart_body, { - chunk :: bitstring(), - done :: boolean(), - remaining :: bitstring() -}). diff --git a/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http_MultipartHeaders.hrl b/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http_MultipartHeaders.hrl deleted file mode 100644 index d9fca5c..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/include/gleam@http_MultipartHeaders.hrl +++ /dev/null @@ -1,4 +0,0 @@ --record(multipart_headers, { - headers :: list({binary(), binary()}), - remaining :: bitstring() -}). diff --git a/lsp/bet-lsp/build/packages/gleam_http/src/gleam/http.gleam b/lsp/bet-lsp/build/packages/gleam_http/src/gleam/http.gleam deleted file mode 100644 index f2d0afc..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/src/gleam/http.gleam +++ /dev/null @@ -1,563 +0,0 @@ -//// Functions for working with HTTP data structures in Gleam. -//// -//// This module makes it easy to create and modify Requests and Responses, data types. -//// A general HTTP message type is defined that enables functions to work on both requests and responses. -//// -//// This module does not implement a HTTP client or HTTP server, but it can be used as a base for them. - -import gleam/bit_array -import gleam/bool -import gleam/dynamic.{type DecodeError, type Dynamic, DecodeError} -import gleam/list -import gleam/result -import gleam/string - -/// HTTP standard method as defined by [RFC 2616](https://tools.ietf.org/html/rfc2616), -/// and PATCH which is defined by [RFC 5789](https://tools.ietf.org/html/rfc5789). -pub type Method { - Get - Post - Head - Put - Delete - Trace - Connect - Options - Patch - - /// Non-standard but valid HTTP methods. - Other(String) -} - -// TODO: check if the a is a valid HTTP method (i.e. it is a token, as per the -// spec) and return Ok(Other(s)) if so. -pub fn parse_method(s) -> Result(Method, Nil) { - case string.lowercase(s) { - "connect" -> Ok(Connect) - "delete" -> Ok(Delete) - "get" -> Ok(Get) - "head" -> Ok(Head) - "options" -> Ok(Options) - "patch" -> Ok(Patch) - "post" -> Ok(Post) - "put" -> Ok(Put) - "trace" -> Ok(Trace) - _ -> Error(Nil) - } -} - -pub fn method_to_string(method: Method) -> String { - case method { - Connect -> "connect" - Delete -> "delete" - Get -> "get" - Head -> "head" - Options -> "options" - Patch -> "patch" - Post -> "post" - Put -> "put" - Trace -> "trace" - Other(s) -> s - } -} - -/// The two URI schemes for HTTP -/// -pub type Scheme { - Http - Https -} - -/// Convert a scheme into a string. -/// -/// # Examples -/// -/// > scheme_to_string(Http) -/// "http" -/// -/// > scheme_to_string(Https) -/// "https" -/// -pub fn scheme_to_string(scheme: Scheme) -> String { - case scheme { - Http -> "http" - Https -> "https" - } -} - -/// Parse a HTTP scheme from a string -/// -/// # Examples -/// -/// > scheme_from_string("http") -/// Ok(Http) -/// -/// > scheme_from_string("ftp") -/// Error(Nil) -/// -pub fn scheme_from_string(scheme: String) -> Result(Scheme, Nil) { - case string.lowercase(scheme) { - "http" -> Ok(Http) - "https" -> Ok(Https) - _ -> Error(Nil) - } -} - -pub fn method_from_dynamic(value: Dynamic) -> Result(Method, List(DecodeError)) { - case do_method_from_dynamic(value) { - Ok(method) -> Ok(method) - Error(_) -> Error([DecodeError("HTTP method", dynamic.classify(value), [])]) - } -} - -pub type MultipartHeaders { - /// The headers for the part have been fully parsed. - /// Header keys are all lowercase. - MultipartHeaders( - headers: List(Header), - /// The remaining content that has not yet been parsed. This will contain - /// the body for this part, if any, and can be parsed with the - /// `parse_multipart_body` function. - remaining: BitArray, - ) - /// More input is required to parse the headers for this part. - MoreRequiredForHeaders( - /// Call this function to continue parsing the headers for this part. - continuation: fn(BitArray) -> Result(MultipartHeaders, Nil), - ) -} - -pub type MultipartBody { - /// The body for the part has been fully parsed. - MultipartBody( - // The rest of the body for this part. The full body of the part is this - // concatenated onto the end of each chunk returned by any previous - // `MoreRequiredForBody` returns. - chunk: BitArray, - /// This is `True` if this was the last part in the multipart message, - /// otherwise there are more parts to parse. - done: Bool, - /// The remaining content that has not yet been parsed. This will contain - /// the next part if `done` is `False`, otherwise it will contain the - /// epilogue, if any. - remaining: BitArray, - ) - MoreRequiredForBody( - // The body that has been parsed so far. The full body of the part is this - // concatenated with the chunk returned by each `MoreRequiredForBody` return - // value, and the final `MultipartBody` return value. - chunk: BitArray, - /// Call this function to continue parsing the body for this part. - continuation: fn(BitArray) -> Result(MultipartBody, Nil), - ) -} - -/// Parse the headers for part of a multipart message, as defined in RFC 2045. -/// -/// This function skips any preamble before the boundary. The preamble may be -/// retrieved using `parse_multipart_body`. -/// -/// This function will accept input of any size, it is up to the caller to limit -/// it if needed. -/// -/// To enable streaming parsing of multipart messages, this function will return -/// a continuation if there is not enough data to fully parse the headers. -/// Further information is available in the documentation for `MultipartBody`. -/// -pub fn parse_multipart_headers( - data: BitArray, - boundary: String, -) -> Result(MultipartHeaders, Nil) { - let boundary = bit_array.from_string(boundary) - // TODO: rewrite this to use a bit pattern once JavaScript supports - // the `b:binary-size(bsize)` pattern. - let prefix = <<45, 45, boundary:bits>> - case bit_array.slice(data, 0, bit_array.byte_size(prefix)) == Ok(prefix) { - // There is no preamble, parse the headers. - True -> parse_headers_after_prelude(data, boundary) - // There is a preamble, skip it before parsing. - False -> skip_preamble(data, boundary) - } -} - -/// Parse the body for part of a multipart message, as defined in RFC 2045. The -/// body is everything until the next boundary. This function is generally to be -/// called after calling `parse_multipart_headers` for a given part. -/// -/// This function will accept input of any size, it is up to the caller to limit -/// it if needed. -/// -/// To enable streaming parsing of multipart messages, this function will return -/// a continuation if there is not enough data to fully parse the body, along -/// with the data that has been parsed so far. Further information is available -/// in the documentation for `MultipartBody`. -/// -pub fn parse_multipart_body( - data: BitArray, - boundary: String, -) -> Result(MultipartBody, Nil) { - boundary - |> bit_array.from_string - |> parse_body_with_bit_array(data, _) -} - -fn parse_body_with_bit_array( - data: BitArray, - boundary: BitArray, -) -> Result(MultipartBody, Nil) { - let bsize = bit_array.byte_size(boundary) - let prefix = bit_array.slice(data, 0, 2 + bsize) - case prefix == Ok(<<45, 45, boundary:bits>>) { - True -> Ok(MultipartBody(<<>>, done: False, remaining: data)) - False -> parse_body_loop(data, boundary, <<>>) - } -} - -fn parse_body_loop( - data: BitArray, - boundary: BitArray, - body: BitArray, -) -> Result(MultipartBody, Nil) { - let dsize = bit_array.byte_size(data) - let bsize = bit_array.byte_size(boundary) - let required = 6 + bsize - case data { - _ if dsize < required -> { - more_please_body(parse_body_loop(_, boundary, <<>>), body, data) - } - - // TODO: flatten this into a single case expression once JavaScript supports - // the `b:binary-size(bsize)` pattern. - // - // \r\n - <<13, 10, data:bytes>> -> { - let desired = <<45, 45, boundary:bits>> - let size = bit_array.byte_size(desired) - let dsize = bit_array.byte_size(data) - let prefix = bit_array.slice(data, 0, size) - let rest = bit_array.slice(data, size, dsize - size) - case prefix == Ok(desired), rest { - // --boundary\r\n - True, Ok(<<13, 10, _:bytes>>) -> - Ok(MultipartBody(body, done: False, remaining: data)) - - // --boundary-- - True, Ok(<<45, 45, data:bytes>>) -> - Ok(MultipartBody(body, done: True, remaining: data)) - - False, _ -> parse_body_loop(data, boundary, <>) - _, _ -> Error(Nil) - } - } - - <> -> { - parse_body_loop(data, boundary, <>) - } - - _ -> panic as "unreachable" - } -} - -fn parse_headers_after_prelude( - data: BitArray, - boundary: BitArray, -) -> Result(MultipartHeaders, Nil) { - let dsize = bit_array.byte_size(data) - let bsize = bit_array.byte_size(boundary) - let required_size = bsize + 4 - - // TODO: this could be written as a single case expression if JavaScript had - // support for the `b:binary-size(bsize)` pattern. Rewrite this once the - // compiler support this. - - use <- bool.guard( - when: dsize < required_size, - return: more_please_headers(parse_headers_after_prelude(_, boundary), data), - ) - - use prefix <- result.try(bit_array.slice(data, 0, required_size - 2)) - use second <- result.try(bit_array.slice(data, 2 + bsize, 2)) - let desired = <<45, 45, boundary:bits>> - - use <- bool.guard(prefix != desired, return: Error(Nil)) - - case second == <<45, 45>> { - // --boundary-- - // The last boundary. Return the epilogue. - True -> { - let rest_size = dsize - required_size - use data <- result.map(bit_array.slice(data, required_size, rest_size)) - MultipartHeaders([], remaining: data) - } - - // --boundary - False -> { - let start = required_size - 2 - let rest_size = dsize - required_size + 2 - use data <- result.try(bit_array.slice(data, start, rest_size)) - do_parse_headers(data) - } - } -} - -fn skip_preamble( - data: BitArray, - boundary: BitArray, -) -> Result(MultipartHeaders, Nil) { - let data_size = bit_array.byte_size(data) - let boundary_size = bit_array.byte_size(boundary) - let required = boundary_size + 4 - case data { - _ if data_size < required -> - more_please_headers(skip_preamble(_, boundary), data) - - // TODO: change this to use one non-nested case expression once the compiler - // supports the `b:binary-size(bsize)` pattern on JS. - // \r\n-- - <<13, 10, 45, 45, data:bytes>> -> { - case bit_array.slice(data, 0, boundary_size) { - // --boundary - Ok(prefix) if prefix == boundary -> { - let start = boundary_size - let length = bit_array.byte_size(data) - boundary_size - use rest <- result.try(bit_array.slice(data, start, length)) - do_parse_headers(rest) - } - Ok(_) -> skip_preamble(data, boundary) - Error(_) -> Error(Nil) - } - } - - <<_, data:bytes>> -> skip_preamble(data, boundary) - - _ -> panic as "unreachable" - } -} - -fn skip_whitespace(data: BitArray) -> BitArray { - case data { - // Space or tab. - <<32, data:bytes>> | <<9, data:bytes>> -> skip_whitespace(data) - _ -> data - } -} - -fn do_parse_headers(data: BitArray) -> Result(MultipartHeaders, Nil) { - case data { - // \r\n\r\n - // We've reached the end, there are no headers. - <<13, 10, 13, 10, data:bytes>> -> Ok(MultipartHeaders([], remaining: data)) - - // \r\n - // Skip the line break after the boundary. - <<13, 10, data:bytes>> -> parse_header_name(data, [], <<>>) - - <<13>> | <<>> -> more_please_headers(do_parse_headers, data) - - _ -> Error(Nil) - } -} - -fn parse_header_name( - data: BitArray, - headers: List(Header), - name: BitArray, -) -> Result(MultipartHeaders, Nil) { - case skip_whitespace(data) { - // : - <<58, data:bytes>> -> - data - |> skip_whitespace - |> parse_header_value(headers, name, <<>>) - - <> -> - parse_header_name(data, headers, <>) - - _ -> more_please_headers(parse_header_name(_, headers, name), data) - } -} - -fn parse_header_value( - data: BitArray, - headers: List(Header), - name: BitArray, - value: BitArray, -) -> Result(MultipartHeaders, Nil) { - let size = bit_array.byte_size(data) - case data { - // We need at least 4 bytes to check for the end of the headers. - _ if size < 4 -> - fn(data) { - data - |> skip_whitespace - |> parse_header_value(headers, name, value) - } - |> more_please_headers(data) - - // \r\n\r\n - <<13, 10, 13, 10, data:bytes>> -> { - use name <- result.try(bit_array.to_string(name)) - use value <- result.map(bit_array.to_string(value)) - let headers = list.reverse([#(string.lowercase(name), value), ..headers]) - MultipartHeaders(headers, data) - } - - // \r\n\s - // \r\n\t - <<13, 10, 32, data:bytes>> | <<13, 10, 9, data:bytes>> -> - parse_header_value(data, headers, name, value) - - // \r\n - <<13, 10, data:bytes>> -> { - use name <- result.try(bit_array.to_string(name)) - use value <- result.try(bit_array.to_string(value)) - let headers = [#(string.lowercase(name), value), ..headers] - parse_header_name(data, headers, <<>>) - } - - <> -> { - let value = <> - parse_header_value(rest, headers, name, value) - } - - _ -> Error(Nil) - } -} - -fn more_please_headers( - continuation: fn(BitArray) -> Result(MultipartHeaders, Nil), - existing: BitArray, -) -> Result(MultipartHeaders, Nil) { - Ok( - MoreRequiredForHeaders(fn(more) { - use <- bool.guard(more == <<>>, return: Error(Nil)) - continuation(<>) - }), - ) -} - -pub type ContentDisposition { - ContentDisposition(String, parameters: List(#(String, String))) -} - -pub fn parse_content_disposition( - header: String, -) -> Result(ContentDisposition, Nil) { - parse_content_disposition_type(header, "") -} - -fn parse_content_disposition_type( - header: String, - name: String, -) -> Result(ContentDisposition, Nil) { - case string.pop_grapheme(header) { - Error(Nil) -> Ok(ContentDisposition(name, [])) - - Ok(#(" ", rest)) | Ok(#("\t", rest)) | Ok(#(";", rest)) -> { - let result = parse_rfc_2045_parameters(rest, []) - use parameters <- result.map(result) - ContentDisposition(name, parameters) - } - - Ok(#(grapheme, rest)) -> - parse_content_disposition_type(rest, name <> string.lowercase(grapheme)) - } -} - -fn parse_rfc_2045_parameters( - header: String, - parameters: List(#(String, String)), -) -> Result(List(#(String, String)), Nil) { - case string.pop_grapheme(header) { - Error(Nil) -> Ok(list.reverse(parameters)) - - Ok(#(";", rest)) | Ok(#(" ", rest)) | Ok(#("\t", rest)) -> - parse_rfc_2045_parameters(rest, parameters) - - Ok(#(grapheme, rest)) -> { - let acc = string.lowercase(grapheme) - use #(parameter, rest) <- result.try(parse_rfc_2045_parameter(rest, acc)) - parse_rfc_2045_parameters(rest, [parameter, ..parameters]) - } - } -} - -fn parse_rfc_2045_parameter( - header: String, - name: String, -) -> Result(#(#(String, String), String), Nil) { - use #(grapheme, rest) <- result.try(string.pop_grapheme(header)) - case grapheme { - "=" -> parse_rfc_2045_parameter_value(rest, name) - _ -> parse_rfc_2045_parameter(rest, name <> string.lowercase(grapheme)) - } -} - -fn parse_rfc_2045_parameter_value( - header: String, - name: String, -) -> Result(#(#(String, String), String), Nil) { - case string.pop_grapheme(header) { - Error(Nil) -> Error(Nil) - Ok(#("\"", rest)) -> parse_rfc_2045_parameter_quoted_value(rest, name, "") - Ok(#(grapheme, rest)) -> - Ok(parse_rfc_2045_parameter_unquoted_value(rest, name, grapheme)) - } -} - -fn parse_rfc_2045_parameter_quoted_value( - header: String, - name: String, - value: String, -) -> Result(#(#(String, String), String), Nil) { - case string.pop_grapheme(header) { - Error(Nil) -> Error(Nil) - Ok(#("\"", rest)) -> Ok(#(#(name, value), rest)) - Ok(#("\\", rest)) -> { - use #(grapheme, rest) <- result.try(string.pop_grapheme(rest)) - parse_rfc_2045_parameter_quoted_value(rest, name, value <> grapheme) - } - Ok(#(grapheme, rest)) -> - parse_rfc_2045_parameter_quoted_value(rest, name, value <> grapheme) - } -} - -fn parse_rfc_2045_parameter_unquoted_value( - header: String, - name: String, - value: String, -) -> #(#(String, String), String) { - case string.pop_grapheme(header) { - Error(Nil) -> #(#(name, value), header) - - Ok(#(";", rest)) | Ok(#(" ", rest)) | Ok(#("\t", rest)) -> #( - #(name, value), - rest, - ) - - Ok(#(grapheme, rest)) -> - parse_rfc_2045_parameter_unquoted_value(rest, name, value <> grapheme) - } -} - -fn more_please_body( - continuation: fn(BitArray) -> Result(MultipartBody, Nil), - chunk: BitArray, - existing: BitArray, -) -> Result(MultipartBody, Nil) { - fn(more) { - use <- bool.guard(more == <<>>, return: Error(Nil)) - continuation(<>) - } - |> MoreRequiredForBody(chunk, _) - |> Ok -} - -@external(erlang, "gleam_http_native", "decode_method") -@external(javascript, "../gleam_http_native.mjs", "decode_method") -fn do_method_from_dynamic(a: Dynamic) -> Result(Method, Nil) - -/// A HTTP header is a key-value pair. Header keys must be all lowercase -/// characters. -pub type Header = - #(String, String) diff --git a/lsp/bet-lsp/build/packages/gleam_http/src/gleam/http/cookie.gleam b/lsp/bet-lsp/build/packages/gleam_http/src/gleam/http/cookie.gleam deleted file mode 100644 index e22d512..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/src/gleam/http/cookie.gleam +++ /dev/null @@ -1,127 +0,0 @@ -import gleam/http.{type Scheme} -import gleam/int -import gleam/list -import gleam/option.{type Option, Some} -import gleam/result -import gleam/string - -/// Policy options for the SameSite cookie attribute -/// -/// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite -pub type SameSitePolicy { - Lax - Strict - None -} - -fn same_site_to_string(policy) { - case policy { - Lax -> "Lax" - Strict -> "Strict" - None -> "None" - } -} - -/// Attributes of a cookie when sent to a client in the `set-cookie` header. -pub type Attributes { - Attributes( - max_age: Option(Int), - domain: Option(String), - path: Option(String), - secure: Bool, - http_only: Bool, - same_site: Option(SameSitePolicy), - ) -} - -/// Helper to create sensible default attributes for a set cookie. -/// -/// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#Attributes -pub fn defaults(scheme: Scheme) { - Attributes( - max_age: option.None, - domain: option.None, - path: option.Some("/"), - secure: scheme == http.Https, - http_only: True, - same_site: Some(Lax), - ) -} - -const epoch = "Expires=Thu, 01 Jan 1970 00:00:00 GMT" - -fn cookie_attributes_to_list(attributes) { - let Attributes( - max_age: max_age, - domain: domain, - path: path, - secure: secure, - http_only: http_only, - same_site: same_site, - ) = attributes - [ - // Expires is a deprecated attribute for cookies, it has been replaced with MaxAge - // MaxAge is widely supported and so Expires values are not set. - // Only when deleting cookies is the exception made to use the old format, - // to ensure complete clearup of cookies if required by an application. - case max_age { - option.Some(0) -> option.Some([epoch]) - _ -> option.None - }, - option.map(max_age, fn(max_age) { ["Max-Age=", int.to_string(max_age)] }), - option.map(domain, fn(domain) { ["Domain=", domain] }), - option.map(path, fn(path) { ["Path=", path] }), - case secure { - True -> option.Some(["Secure"]) - False -> option.None - }, - case http_only { - True -> option.Some(["HttpOnly"]) - False -> option.None - }, - option.map(same_site, fn(same_site) { - ["SameSite=", same_site_to_string(same_site)] - }), - ] - |> list.filter_map(option.to_result(_, Nil)) -} - -pub fn set_header(name: String, value: String, attributes: Attributes) -> String { - [[name, "=", value], ..cookie_attributes_to_list(attributes)] - |> list.map(string.join(_, "")) - |> string.join("; ") -} - -/// Parse a list of cookies from a header string. Any malformed cookies will be -/// discarded. -/// -pub fn parse(cookie_string: String) -> List(#(String, String)) { - cookie_string - |> string.split(";") - |> list.flat_map(string.split(_, ",")) - |> list.filter_map(fn(pair) { - case string.split_once(string.trim(pair), "=") { - Ok(#("", _)) -> Error(Nil) - Ok(#(key, value)) -> { - let key = string.trim(key) - let value = string.trim(value) - use _ <- result.then(check_token(key)) - use _ <- result.then(check_token(value)) - Ok(#(key, value)) - } - Error(Nil) -> Error(Nil) - } - }) -} - -fn check_token(token: String) -> Result(Nil, Nil) { - case string.pop_grapheme(token) { - Error(Nil) -> Ok(Nil) - Ok(#(" ", _)) -> Error(Nil) - Ok(#("\t", _)) -> Error(Nil) - Ok(#("\r", _)) -> Error(Nil) - Ok(#("\n", _)) -> Error(Nil) - Ok(#("\f", _)) -> Error(Nil) - Ok(#(_, rest)) -> check_token(rest) - } -} diff --git a/lsp/bet-lsp/build/packages/gleam_http/src/gleam/http/request.gleam b/lsp/bet-lsp/build/packages/gleam_http/src/gleam/http/request.gleam deleted file mode 100644 index 1ba1571..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/src/gleam/http/request.gleam +++ /dev/null @@ -1,305 +0,0 @@ -import gleam/http.{type Header, type Method, type Scheme, Get} -import gleam/http/cookie -import gleam/list -import gleam/option.{type Option} -import gleam/result -import gleam/string -import gleam/uri.{type Uri, Uri} - -/// A HTTP request. -/// -/// The body of the request is parameterised. The HTTP server or client you are -/// using will have a particular set of types it supports for the body. -/// -pub type Request(body) { - Request( - method: Method, - /// The request headers. The keys must always be lowercase. - headers: List(Header), - body: body, - scheme: Scheme, - host: String, - port: Option(Int), - path: String, - query: Option(String), - ) -} - -/// Return the uri that a request was sent to. -/// -pub fn to_uri(request: Request(a)) -> Uri { - Uri( - scheme: option.Some(http.scheme_to_string(request.scheme)), - userinfo: option.None, - host: option.Some(request.host), - port: request.port, - path: request.path, - query: request.query, - fragment: option.None, - ) -} - -/// Construct a request from a URI. -/// -pub fn from_uri(uri: Uri) -> Result(Request(String), Nil) { - use scheme <- result.then( - uri.scheme - |> option.unwrap("") - |> http.scheme_from_string, - ) - use host <- result.then( - uri.host - |> option.to_result(Nil), - ) - let req = - Request( - method: Get, - headers: [], - body: "", - scheme: scheme, - host: host, - port: uri.port, - path: uri.path, - query: uri.query, - ) - Ok(req) -} - -/// Get the value for a given header. -/// -/// If the request does not have that header then `Error(Nil)` is returned. -/// -/// Header keys are always lowercase in `gleam_http`. To use any uppercase -/// letter is invalid. -/// -pub fn get_header(request: Request(body), key: String) -> Result(String, Nil) { - list.key_find(request.headers, string.lowercase(key)) -} - -/// Set the header with the given value under the given header key. -/// -/// If already present, it is replaced. -/// -/// Header keys are always lowercase in `gleam_http`. To use any uppercase -/// letter is invalid. -/// -pub fn set_header( - request: Request(body), - key: String, - value: String, -) -> Request(body) { - let headers = list.key_set(request.headers, string.lowercase(key), value) - Request(..request, headers: headers) -} - -/// Prepend the header with the given value under the given header key. -/// -/// Similar to `set_header` except if the header already exists it prepends -/// another header with the same key. -/// -/// Header keys are always lowercase in `gleam_http`. To use any uppercase -/// letter is invalid. -/// -pub fn prepend_header( - request: Request(body), - key: String, - value: String, -) -> Request(body) { - let headers = [#(string.lowercase(key), value), ..request.headers] - Request(..request, headers: headers) -} - -// TODO: record update syntax, which can't be done currently as body type changes -/// Set the body of the request, overwriting any existing body. -/// -pub fn set_body(req: Request(old_body), body: new_body) -> Request(new_body) { - let Request( - method: method, - headers: headers, - scheme: scheme, - host: host, - port: port, - path: path, - query: query, - .., - ) = req - Request( - method: method, - headers: headers, - body: body, - scheme: scheme, - host: host, - port: port, - path: path, - query: query, - ) -} - -/// Update the body of a request using a given function. -/// -pub fn map( - request: Request(old_body), - transform: fn(old_body) -> new_body, -) -> Request(new_body) { - request.body - |> transform - |> set_body(request, _) -} - -/// Return the non-empty segments of a request path. -/// -/// # Examples -/// -/// ```gleam -/// > new() -/// > |> set_path("/one/two/three") -/// > |> path_segments -/// ["one", "two", "three"] -/// ``` -/// -pub fn path_segments(request: Request(body)) -> List(String) { - request.path - |> uri.path_segments -} - -/// Decode the query of a request. -pub fn get_query(request: Request(body)) -> Result(List(#(String, String)), Nil) { - case request.query { - option.Some(query_string) -> uri.parse_query(query_string) - option.None -> Ok([]) - } -} - -/// Set the query of the request. -/// Query params will be percent encoded before being added to the Request. -/// -pub fn set_query( - req: Request(body), - query: List(#(String, String)), -) -> Request(body) { - let pair = fn(t: #(String, String)) { - uri.percent_encode(t.0) <> "=" <> uri.percent_encode(t.1) - } - let query = - query - |> list.map(pair) - |> list.intersperse("&") - |> string.concat - |> option.Some - Request(..req, query: query) -} - -/// Set the method of the request. -/// -pub fn set_method(req: Request(body), method: Method) -> Request(body) { - Request(..req, method: method) -} - -/// A request with commonly used default values. This request can be used as -/// an initial value and then update to create the desired request. -/// -pub fn new() -> Request(String) { - Request( - method: Get, - headers: [], - body: "", - scheme: http.Https, - host: "localhost", - port: option.None, - path: "", - query: option.None, - ) -} - -/// Construct a request from a URL string -/// -pub fn to(url: String) -> Result(Request(String), Nil) { - url - |> uri.parse - |> result.then(from_uri) -} - -/// Set the scheme (protocol) of the request. -/// -pub fn set_scheme(req: Request(body), scheme: Scheme) -> Request(body) { - Request(..req, scheme: scheme) -} - -/// Set the host of the request. -/// -pub fn set_host(req: Request(body), host: String) -> Request(body) { - Request(..req, host: host) -} - -/// Set the port of the request. -/// -pub fn set_port(req: Request(body), port: Int) -> Request(body) { - Request(..req, port: option.Some(port)) -} - -/// Set the path of the request. -/// -pub fn set_path(req: Request(body), path: String) -> Request(body) { - Request(..req, path: path) -} - -/// Send a cookie with a request -/// -/// Multiple cookies are added to the same cookie header. -pub fn set_cookie(req: Request(body), name: String, value: String) { - let new_cookie_string = string.join([name, value], "=") - - let #(cookies_string, headers) = case list.key_pop(req.headers, "cookie") { - Ok(#(cookies_string, headers)) -> { - let cookies_string = - string.join([cookies_string, new_cookie_string], "; ") - #(cookies_string, headers) - } - Error(Nil) -> #(new_cookie_string, req.headers) - } - - Request(..req, headers: [#("cookie", cookies_string), ..headers]) -} - -/// Fetch the cookies sent in a request. -/// -/// Note badly formed cookie pairs will be ignored. -/// RFC6265 specifies that invalid cookie names/attributes should be ignored. -pub fn get_cookies(req) -> List(#(String, String)) { - let Request(headers: headers, ..) = req - - headers - |> list.filter_map(fn(header) { - let #(name, value) = header - case name { - "cookie" -> Ok(cookie.parse(value)) - _ -> Error(Nil) - } - }) - |> list.flatten() -} - -/// Remove a cookie from a request -/// -/// Remove a cookie from the request. If no cookie is found return the request unchanged. -/// This will not remove the cookie from the client. -pub fn remove_cookie(req: Request(body), name: String) { - case list.key_pop(req.headers, "cookie") { - Ok(#(cookies_string, headers)) -> { - let new_cookies_string = - string.split(cookies_string, ";") - |> list.filter(fn(str) { - string.trim(str) - |> string.split_once("=") - // Keep cookie if name does not match - |> result.map(fn(tup) { tup.0 != name }) - // Don't do anything with malformed cookies - |> result.unwrap(True) - }) - |> string.join(";") - - Request(..req, headers: [#("cookie", new_cookies_string), ..headers]) - } - Error(_) -> req - } -} diff --git a/lsp/bet-lsp/build/packages/gleam_http/src/gleam/http/response.gleam b/lsp/bet-lsp/build/packages/gleam_http/src/gleam/http/response.gleam deleted file mode 100644 index 99da298..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/src/gleam/http/response.gleam +++ /dev/null @@ -1,158 +0,0 @@ -import gleam/http.{type Header} -import gleam/http/cookie -import gleam/list -import gleam/option -import gleam/result -import gleam/string - -/// A HTTP response. -/// -/// The body of the request is parameterised. The HTTP server or client you are -/// using will have a particular set of types it supports for the body. -/// -pub type Response(body) { - Response( - status: Int, - /// The request headers. The keys must always be lowercase. - headers: List(Header), - body: body, - ) -} - -/// Update the body of a response using a given result returning function. -/// -/// If the given function returns an `Ok` value the body is set, if it returns -/// an `Error` value then the error is returned. -/// -pub fn try_map( - response: Response(old_body), - transform: fn(old_body) -> Result(new_body, error), -) -> Result(Response(new_body), error) { - use body <- result.then(transform(response.body)) - Ok(set_body(response, body)) -} - -/// Construct an empty Response. -/// -/// The body type of the returned response is `String` and could be set with a -/// call to `set_body`. -/// -pub fn new(status: Int) -> Response(String) { - Response(status: status, headers: [], body: "") -} - -/// Get the value for a given header. -/// -/// If the response does not have that header then `Error(Nil)` is returned. -/// -pub fn get_header(response: Response(body), key: String) -> Result(String, Nil) { - list.key_find(response.headers, string.lowercase(key)) -} - -/// Set the header with the given value under the given header key. -/// -/// If the response already has that key, it is replaced. -/// -/// Header keys are always lowercase in `gleam_http`. To use any uppercase -/// letter is invalid. -/// -pub fn set_header( - response: Response(body), - key: String, - value: String, -) -> Response(body) { - let headers = list.key_set(response.headers, string.lowercase(key), value) - Response(..response, headers: headers) -} - -/// Prepend the header with the given value under the given header key. -/// -/// Similar to `set_header` except if the header already exists it prepends -/// another header with the same key. -/// -/// Header keys are always lowercase in `gleam_http`. To use any uppercase -/// letter is invalid. -/// -pub fn prepend_header( - response: Response(body), - key: String, - value: String, -) -> Response(body) { - let headers = [#(string.lowercase(key), value), ..response.headers] - Response(..response, headers: headers) -} - -/// Set the body of the response, overwriting any existing body. -/// -pub fn set_body( - response: Response(old_body), - body: new_body, -) -> Response(new_body) { - let Response(status: status, headers: headers, ..) = response - Response(status: status, headers: headers, body: body) -} - -/// Update the body of a response using a given function. -/// -pub fn map( - response: Response(old_body), - transform: fn(old_body) -> new_body, -) -> Response(new_body) { - response.body - |> transform - |> set_body(response, _) -} - -/// Create a response that redirects to the given uri. -/// -pub fn redirect(uri: String) -> Response(String) { - Response( - status: 303, - headers: [#("location", uri)], - body: string.append("You are being redirected to ", uri), - ) -} - -/// Fetch the cookies sent in a response. -/// -/// Badly formed cookies will be discarded. -/// -pub fn get_cookies(resp) -> List(#(String, String)) { - let Response(headers: headers, ..) = resp - headers - |> list.filter_map(fn(header) { - let #(name, value) = header - case name { - "set-cookie" -> Ok(cookie.parse(value)) - _ -> Error(Nil) - } - }) - |> list.flatten() -} - -/// Set a cookie value for a client -/// -pub fn set_cookie( - response: Response(t), - name: String, - value: String, - attributes: cookie.Attributes, -) -> Response(t) { - prepend_header( - response, - "set-cookie", - cookie.set_header(name, value, attributes), - ) -} - -/// Expire a cookie value for a client -/// -/// Note: The attributes value should be the same as when the response cookie was set. -pub fn expire_cookie( - response: Response(t), - name: String, - attributes: cookie.Attributes, -) -> Response(t) { - let attrs = cookie.Attributes(..attributes, max_age: option.Some(0)) - set_cookie(response, name, "", attrs) -} diff --git a/lsp/bet-lsp/build/packages/gleam_http/src/gleam/http/service.gleam b/lsp/bet-lsp/build/packages/gleam_http/src/gleam/http/service.gleam deleted file mode 100644 index 4b0f815..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/src/gleam/http/service.gleam +++ /dev/null @@ -1,61 +0,0 @@ -import gleam/http.{Delete, Patch, Post, Put} -import gleam/http/request.{type Request} -import gleam/http/response.{type Response} -import gleam/list -import gleam/result - -@deprecated("Use middleware packages such as Wisp or Glen instead") -pub type Service(in, out) = - fn(Request(in)) -> Response(out) - -@deprecated("Use middleware packages such as Wisp or Glen instead") -pub type Middleware(before_req, before_resp, after_req, after_resp) = - fn(fn(Request(before_req)) -> Response(before_resp)) -> - fn(Request(after_req)) -> Response(after_resp) - -@deprecated("Use middleware packages such as Wisp or Glen instead") -pub fn map_response_body(service, with mapper: fn(a) -> b) { - fn(req) { - req - |> service - |> response.map(mapper) - } -} - -@deprecated("Use middleware packages such as Wisp or Glen instead") -pub fn prepend_response_header(service, key: String, value: String) { - fn(req) { - req - |> service - |> response.prepend_header(key, value) - } -} - -fn ensure_post(req: Request(a)) { - case req.method { - Post -> Ok(req) - _ -> Error(Nil) - } -} - -fn get_override_method(request: Request(t)) -> Result(http.Method, Nil) { - use query_params <- result.then(request.get_query(request)) - use method <- result.then(list.key_find(query_params, "_method")) - use method <- result.then(http.parse_method(method)) - case method { - Put | Patch | Delete -> Ok(method) - _ -> Error(Nil) - } -} - -@deprecated("Use middleware packages such as Wisp or Glen instead") -pub fn method_override(service) { - fn(request) { - request - |> ensure_post - |> result.then(get_override_method) - |> result.map(request.set_method(request, _)) - |> result.unwrap(request) - |> service - } -} diff --git a/lsp/bet-lsp/build/packages/gleam_http/src/gleam@http.erl b/lsp/bet-lsp/build/packages/gleam_http/src/gleam@http.erl deleted file mode 100644 index 0ae4072..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/src/gleam@http.erl +++ /dev/null @@ -1,661 +0,0 @@ --module(gleam@http). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([parse_method/1, method_to_string/1, scheme_to_string/1, scheme_from_string/1, parse_content_disposition/1, parse_multipart_body/2, method_from_dynamic/1, parse_multipart_headers/2]). --export_type([method/0, scheme/0, multipart_headers/0, multipart_body/0, content_disposition/0]). - --type method() :: get | - post | - head | - put | - delete | - trace | - connect | - options | - patch | - {other, binary()}. - --type scheme() :: http | https. - --type multipart_headers() :: {multipart_headers, - list({binary(), binary()}), - bitstring()} | - {more_required_for_headers, - fun((bitstring()) -> {ok, multipart_headers()} | {error, nil})}. - --type multipart_body() :: {multipart_body, bitstring(), boolean(), bitstring()} | - {more_required_for_body, - bitstring(), - fun((bitstring()) -> {ok, multipart_body()} | {error, nil})}. - --type content_disposition() :: {content_disposition, - binary(), - list({binary(), binary()})}. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 34). --spec parse_method(binary()) -> {ok, method()} | {error, nil}. -parse_method(S) -> - case string:lowercase(S) of - <<"connect"/utf8>> -> - {ok, connect}; - - <<"delete"/utf8>> -> - {ok, delete}; - - <<"get"/utf8>> -> - {ok, get}; - - <<"head"/utf8>> -> - {ok, head}; - - <<"options"/utf8>> -> - {ok, options}; - - <<"patch"/utf8>> -> - {ok, patch}; - - <<"post"/utf8>> -> - {ok, post}; - - <<"put"/utf8>> -> - {ok, put}; - - <<"trace"/utf8>> -> - {ok, trace}; - - _ -> - {error, nil} - end. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 49). --spec method_to_string(method()) -> binary(). -method_to_string(Method) -> - case Method of - connect -> - <<"connect"/utf8>>; - - delete -> - <<"delete"/utf8>>; - - get -> - <<"get"/utf8>>; - - head -> - <<"head"/utf8>>; - - options -> - <<"options"/utf8>>; - - patch -> - <<"patch"/utf8>>; - - post -> - <<"post"/utf8>>; - - put -> - <<"put"/utf8>>; - - trace -> - <<"trace"/utf8>>; - - {other, S} -> - S - end. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 81). --spec scheme_to_string(scheme()) -> binary(). -scheme_to_string(Scheme) -> - case Scheme of - http -> - <<"http"/utf8>>; - - https -> - <<"https"/utf8>> - end. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 98). --spec scheme_from_string(binary()) -> {ok, scheme()} | {error, nil}. -scheme_from_string(Scheme) -> - case string:lowercase(Scheme) of - <<"http"/utf8>> -> - {ok, http}; - - <<"https"/utf8>> -> - {ok, https}; - - _ -> - {error, nil} - end. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 337). --spec skip_whitespace(bitstring()) -> bitstring(). -skip_whitespace(Data) -> - case Data of - <<32, Data@1/binary>> -> - skip_whitespace(Data@1); - - <<9, Data@1/binary>> -> - skip_whitespace(Data@1); - - _ -> - Data - end. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 427). --spec more_please_headers( - fun((bitstring()) -> {ok, multipart_headers()} | {error, nil}), - bitstring() -) -> {ok, multipart_headers()} | {error, nil}. -more_please_headers(Continuation, Existing) -> - {ok, - {more_required_for_headers, - fun(More) -> - gleam@bool:guard( - More =:= <<>>, - {error, nil}, - fun() -> - Continuation(<>) - end - ) - end}}. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 508). --spec parse_rfc_2045_parameter_quoted_value(binary(), binary(), binary()) -> {ok, - {{binary(), binary()}, binary()}} | - {error, nil}. -parse_rfc_2045_parameter_quoted_value(Header, Name, Value) -> - case gleam_stdlib:string_pop_grapheme(Header) of - {error, nil} -> - {error, nil}; - - {ok, {<<"\""/utf8>>, Rest}} -> - {ok, {{Name, Value}, Rest}}; - - {ok, {<<"\\"/utf8>>, Rest@1}} -> - gleam@result:'try'( - gleam_stdlib:string_pop_grapheme(Rest@1), - fun(_use0) -> - {Grapheme, Rest@2} = _use0, - parse_rfc_2045_parameter_quoted_value( - Rest@2, - Name, - <> - ) - end - ); - - {ok, {Grapheme@1, Rest@3}} -> - parse_rfc_2045_parameter_quoted_value( - Rest@3, - Name, - <> - ) - end. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 525). --spec parse_rfc_2045_parameter_unquoted_value(binary(), binary(), binary()) -> {{binary(), - binary()}, - binary()}. -parse_rfc_2045_parameter_unquoted_value(Header, Name, Value) -> - case gleam_stdlib:string_pop_grapheme(Header) of - {error, nil} -> - {{Name, Value}, Header}; - - {ok, {<<";"/utf8>>, Rest}} -> - {{Name, Value}, Rest}; - - {ok, {<<" "/utf8>>, Rest}} -> - {{Name, Value}, Rest}; - - {ok, {<<"\t"/utf8>>, Rest}} -> - {{Name, Value}, Rest}; - - {ok, {Grapheme, Rest@1}} -> - parse_rfc_2045_parameter_unquoted_value( - Rest@1, - Name, - <> - ) - end. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 496). --spec parse_rfc_2045_parameter_value(binary(), binary()) -> {ok, - {{binary(), binary()}, binary()}} | - {error, nil}. -parse_rfc_2045_parameter_value(Header, Name) -> - case gleam_stdlib:string_pop_grapheme(Header) of - {error, nil} -> - {error, nil}; - - {ok, {<<"\""/utf8>>, Rest}} -> - parse_rfc_2045_parameter_quoted_value(Rest, Name, <<""/utf8>>); - - {ok, {Grapheme, Rest@1}} -> - {ok, - parse_rfc_2045_parameter_unquoted_value(Rest@1, Name, Grapheme)} - end. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 485). --spec parse_rfc_2045_parameter(binary(), binary()) -> {ok, - {{binary(), binary()}, binary()}} | - {error, nil}. -parse_rfc_2045_parameter(Header, Name) -> - gleam@result:'try'( - gleam_stdlib:string_pop_grapheme(Header), - fun(_use0) -> - {Grapheme, Rest} = _use0, - case Grapheme of - <<"="/utf8>> -> - parse_rfc_2045_parameter_value(Rest, Name); - - _ -> - parse_rfc_2045_parameter( - Rest, - <> - ) - end - end - ). - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 467). --spec parse_rfc_2045_parameters(binary(), list({binary(), binary()})) -> {ok, - list({binary(), binary()})} | - {error, nil}. -parse_rfc_2045_parameters(Header, Parameters) -> - case gleam_stdlib:string_pop_grapheme(Header) of - {error, nil} -> - {ok, lists:reverse(Parameters)}; - - {ok, {<<";"/utf8>>, Rest}} -> - parse_rfc_2045_parameters(Rest, Parameters); - - {ok, {<<" "/utf8>>, Rest}} -> - parse_rfc_2045_parameters(Rest, Parameters); - - {ok, {<<"\t"/utf8>>, Rest}} -> - parse_rfc_2045_parameters(Rest, Parameters); - - {ok, {Grapheme, Rest@1}} -> - Acc = string:lowercase(Grapheme), - gleam@result:'try'( - parse_rfc_2045_parameter(Rest@1, Acc), - fun(_use0) -> - {Parameter, Rest@2} = _use0, - parse_rfc_2045_parameters(Rest@2, [Parameter | Parameters]) - end - ) - end. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 449). --spec parse_content_disposition_type(binary(), binary()) -> {ok, - content_disposition()} | - {error, nil}. -parse_content_disposition_type(Header, Name) -> - case gleam_stdlib:string_pop_grapheme(Header) of - {error, nil} -> - {ok, {content_disposition, Name, []}}; - - {ok, {<<" "/utf8>>, Rest}} -> - Result = parse_rfc_2045_parameters(Rest, []), - gleam@result:map( - Result, - fun(Parameters) -> {content_disposition, Name, Parameters} end - ); - - {ok, {<<"\t"/utf8>>, Rest}} -> - Result = parse_rfc_2045_parameters(Rest, []), - gleam@result:map( - Result, - fun(Parameters) -> {content_disposition, Name, Parameters} end - ); - - {ok, {<<";"/utf8>>, Rest}} -> - Result = parse_rfc_2045_parameters(Rest, []), - gleam@result:map( - Result, - fun(Parameters) -> {content_disposition, Name, Parameters} end - ); - - {ok, {Grapheme, Rest@1}} -> - parse_content_disposition_type( - Rest@1, - <> - ) - end. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 443). --spec parse_content_disposition(binary()) -> {ok, content_disposition()} | - {error, nil}. -parse_content_disposition(Header) -> - parse_content_disposition_type(Header, <<""/utf8>>). - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 543). --spec more_please_body( - fun((bitstring()) -> {ok, multipart_body()} | {error, nil}), - bitstring(), - bitstring() -) -> {ok, multipart_body()} | {error, nil}. -more_please_body(Continuation, Chunk, Existing) -> - _pipe = fun(More) -> - gleam@bool:guard( - More =:= <<>>, - {error, nil}, - fun() -> Continuation(<>) end - ) - end, - _pipe@1 = {more_required_for_body, Chunk, _pipe}, - {ok, _pipe@1}. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 216). --spec parse_body_loop(bitstring(), bitstring(), bitstring()) -> {ok, - multipart_body()} | - {error, nil}. -parse_body_loop(Data, Boundary, Body) -> - Dsize = erlang:byte_size(Data), - Bsize = erlang:byte_size(Boundary), - Required = 6 + Bsize, - case Data of - _ when Dsize < Required -> - more_please_body( - fun(_capture) -> parse_body_loop(_capture, Boundary, <<>>) end, - Body, - Data - ); - - <<13, 10, Data@1/binary>> -> - Desired = <<45, 45, Boundary/bitstring>>, - Size = erlang:byte_size(Desired), - Dsize@1 = erlang:byte_size(Data@1), - Prefix = gleam_stdlib:bit_array_slice(Data@1, 0, Size), - Rest = gleam_stdlib:bit_array_slice(Data@1, Size, Dsize@1 - Size), - case {Prefix =:= {ok, Desired}, Rest} of - {true, {ok, <<13, 10, _/binary>>}} -> - {ok, {multipart_body, Body, false, Data@1}}; - - {true, {ok, <<45, 45, Data@2/binary>>}} -> - {ok, {multipart_body, Body, true, Data@2}}; - - {false, _} -> - parse_body_loop( - Data@1, - Boundary, - <> - ); - - {_, _} -> - {error, nil} - end; - - <> -> - parse_body_loop(Data@3, Boundary, <>); - - _ -> - erlang:error(#{gleam_error => panic, - message => <<"unreachable"/utf8>>, - module => <<"gleam/http"/utf8>>, - function => <<"parse_body_loop"/utf8>>, - line => 257}) - end. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 204). --spec parse_body_with_bit_array(bitstring(), bitstring()) -> {ok, - multipart_body()} | - {error, nil}. -parse_body_with_bit_array(Data, Boundary) -> - Bsize = erlang:byte_size(Boundary), - Prefix = gleam_stdlib:bit_array_slice(Data, 0, 2 + Bsize), - case Prefix =:= {ok, <<45, 45, Boundary/bitstring>>} of - true -> - {ok, {multipart_body, <<>>, false, Data}}; - - false -> - parse_body_loop(Data, Boundary, <<>>) - end. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 195). --spec parse_multipart_body(bitstring(), binary()) -> {ok, multipart_body()} | - {error, nil}. -parse_multipart_body(Data, Boundary) -> - _pipe = Boundary, - _pipe@1 = gleam_stdlib:identity(_pipe), - parse_body_with_bit_array(Data, _pipe@1). - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 106). --spec method_from_dynamic(gleam@dynamic:dynamic_()) -> {ok, method()} | - {error, list(gleam@dynamic:decode_error())}. -method_from_dynamic(Value) -> - case gleam_http_native:decode_method(Value) of - {ok, Method} -> - {ok, Method}; - - {error, _} -> - {error, - [{decode_error, - <<"HTTP method"/utf8>>, - gleam_stdlib:classify_dynamic(Value), - []}]} - end. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 380). --spec parse_header_value( - bitstring(), - list({binary(), binary()}), - bitstring(), - bitstring() -) -> {ok, multipart_headers()} | {error, nil}. -parse_header_value(Data, Headers, Name, Value) -> - Size = erlang:byte_size(Data), - case Data of - _ when Size < 4 -> - _pipe@2 = fun(Data@1) -> _pipe = Data@1, - _pipe@1 = skip_whitespace(_pipe), - parse_header_value(_pipe@1, Headers, Name, Value) end, - more_please_headers(_pipe@2, Data); - - <<13, 10, 13, 10, Data@2/binary>> -> - gleam@result:'try'( - gleam@bit_array:to_string(Name), - fun(Name@1) -> - gleam@result:map( - gleam@bit_array:to_string(Value), - fun(Value@1) -> - Headers@1 = lists:reverse( - [{string:lowercase(Name@1), Value@1} | Headers] - ), - {multipart_headers, Headers@1, Data@2} - end - ) - end - ); - - <<13, 10, 32, Data@3/binary>> -> - parse_header_value(Data@3, Headers, Name, Value); - - <<13, 10, 9, Data@3/binary>> -> - parse_header_value(Data@3, Headers, Name, Value); - - <<13, 10, Data@4/binary>> -> - gleam@result:'try'( - gleam@bit_array:to_string(Name), - fun(Name@2) -> - gleam@result:'try'( - gleam@bit_array:to_string(Value), - fun(Value@2) -> - Headers@2 = [{string:lowercase(Name@2), Value@2} | - Headers], - parse_header_name(Data@4, Headers@2, <<>>) - end - ) - end - ); - - <> -> - Value@3 = <>, - parse_header_value(Rest, Headers, Name, Value@3); - - _ -> - {error, nil} - end. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 361). --spec parse_header_name(bitstring(), list({binary(), binary()}), bitstring()) -> {ok, - multipart_headers()} | - {error, nil}. -parse_header_name(Data, Headers, Name) -> - case skip_whitespace(Data) of - <<58, Data@1/binary>> -> - _pipe = Data@1, - _pipe@1 = skip_whitespace(_pipe), - parse_header_value(_pipe@1, Headers, Name, <<>>); - - <> -> - parse_header_name(Data@2, Headers, <>); - - _ -> - more_please_headers( - fun(_capture) -> parse_header_name(_capture, Headers, Name) end, - Data - ) - end. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 345). --spec do_parse_headers(bitstring()) -> {ok, multipart_headers()} | {error, nil}. -do_parse_headers(Data) -> - case Data of - <<13, 10, 13, 10, Data@1/binary>> -> - {ok, {multipart_headers, [], Data@1}}; - - <<13, 10, Data@2/binary>> -> - parse_header_name(Data@2, [], <<>>); - - <<13>> -> - more_please_headers(fun do_parse_headers/1, Data); - - <<>> -> - more_please_headers(fun do_parse_headers/1, Data); - - _ -> - {error, nil} - end. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 261). --spec parse_headers_after_prelude(bitstring(), bitstring()) -> {ok, - multipart_headers()} | - {error, nil}. -parse_headers_after_prelude(Data, Boundary) -> - Dsize = erlang:byte_size(Data), - Bsize = erlang:byte_size(Boundary), - Required_size = Bsize + 4, - gleam@bool:guard( - Dsize < Required_size, - more_please_headers( - fun(_capture) -> parse_headers_after_prelude(_capture, Boundary) end, - Data - ), - fun() -> - gleam@result:'try'( - gleam_stdlib:bit_array_slice(Data, 0, Required_size - 2), - fun(Prefix) -> - gleam@result:'try'( - gleam_stdlib:bit_array_slice(Data, 2 + Bsize, 2), - fun(Second) -> - Desired = <<45, 45, Boundary/bitstring>>, - gleam@bool:guard( - Prefix /= Desired, - {error, nil}, - fun() -> case Second =:= <<45, 45>> of - true -> - Rest_size = Dsize - Required_size, - gleam@result:map( - gleam_stdlib:bit_array_slice( - Data, - Required_size, - Rest_size - ), - fun(Data@1) -> - {multipart_headers, - [], - Data@1} - end - ); - - false -> - Start = Required_size - 2, - Rest_size@1 = (Dsize - Required_size) - + 2, - gleam@result:'try'( - gleam_stdlib:bit_array_slice( - Data, - Start, - Rest_size@1 - ), - fun(Data@2) -> - do_parse_headers(Data@2) - end - ) - end end - ) - end - ) - end - ) - end - ). - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 303). --spec skip_preamble(bitstring(), bitstring()) -> {ok, multipart_headers()} | - {error, nil}. -skip_preamble(Data, Boundary) -> - Data_size = erlang:byte_size(Data), - Boundary_size = erlang:byte_size(Boundary), - Required = Boundary_size + 4, - case Data of - _ when Data_size < Required -> - more_please_headers( - fun(_capture) -> skip_preamble(_capture, Boundary) end, - Data - ); - - <<13, 10, 45, 45, Data@1/binary>> -> - case gleam_stdlib:bit_array_slice(Data@1, 0, Boundary_size) of - {ok, Prefix} when Prefix =:= Boundary -> - Start = Boundary_size, - Length = erlang:byte_size(Data@1) - Boundary_size, - gleam@result:'try'( - gleam_stdlib:bit_array_slice(Data@1, Start, Length), - fun(Rest) -> do_parse_headers(Rest) end - ); - - {ok, _} -> - skip_preamble(Data@1, Boundary); - - {error, _} -> - {error, nil} - end; - - <<_, Data@2/binary>> -> - skip_preamble(Data@2, Boundary); - - _ -> - erlang:error(#{gleam_error => panic, - message => <<"unreachable"/utf8>>, - module => <<"gleam/http"/utf8>>, - function => <<"skip_preamble"/utf8>>, - line => 333}) - end. - --file("/Users/louis/src/gleam/http/src/gleam/http.gleam", 167). --spec parse_multipart_headers(bitstring(), binary()) -> {ok, - multipart_headers()} | - {error, nil}. -parse_multipart_headers(Data, Boundary) -> - Boundary@1 = gleam_stdlib:identity(Boundary), - Prefix = <<45, 45, Boundary@1/bitstring>>, - case gleam_stdlib:bit_array_slice(Data, 0, erlang:byte_size(Prefix)) =:= {ok, - Prefix} of - true -> - parse_headers_after_prelude(Data, Boundary@1); - - false -> - skip_preamble(Data, Boundary@1) - end. diff --git a/lsp/bet-lsp/build/packages/gleam_http/src/gleam@http@cookie.erl b/lsp/bet-lsp/build/packages/gleam_http/src/gleam@http@cookie.erl deleted file mode 100644 index a75d08d..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/src/gleam@http@cookie.erl +++ /dev/null @@ -1,153 +0,0 @@ --module(gleam@http@cookie). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([defaults/1, parse/1, set_header/3]). --export_type([same_site_policy/0, attributes/0]). - --type same_site_policy() :: lax | strict | none. - --type attributes() :: {attributes, - gleam@option:option(integer()), - gleam@option:option(binary()), - gleam@option:option(binary()), - boolean(), - boolean(), - gleam@option:option(same_site_policy())}. - --file("/Users/louis/src/gleam/http/src/gleam/http/cookie.gleam", 17). --spec same_site_to_string(same_site_policy()) -> binary(). -same_site_to_string(Policy) -> - case Policy of - lax -> - <<"Lax"/utf8>>; - - strict -> - <<"Strict"/utf8>>; - - none -> - <<"None"/utf8>> - end. - --file("/Users/louis/src/gleam/http/src/gleam/http/cookie.gleam", 40). --spec defaults(gleam@http:scheme()) -> attributes(). -defaults(Scheme) -> - {attributes, - none, - none, - {some, <<"/"/utf8>>}, - Scheme =:= https, - true, - {some, lax}}. - --file("/Users/louis/src/gleam/http/src/gleam/http/cookie.gleam", 117). --spec check_token(binary()) -> {ok, nil} | {error, nil}. -check_token(Token) -> - case gleam_stdlib:string_pop_grapheme(Token) of - {error, nil} -> - {ok, nil}; - - {ok, {<<" "/utf8>>, _}} -> - {error, nil}; - - {ok, {<<"\t"/utf8>>, _}} -> - {error, nil}; - - {ok, {<<"\r"/utf8>>, _}} -> - {error, nil}; - - {ok, {<<"\n"/utf8>>, _}} -> - {error, nil}; - - {ok, {<<"\f"/utf8>>, _}} -> - {error, nil}; - - {ok, {_, Rest}} -> - check_token(Rest) - end. - --file("/Users/louis/src/gleam/http/src/gleam/http/cookie.gleam", 98). --spec parse(binary()) -> list({binary(), binary()}). -parse(Cookie_string) -> - _pipe = Cookie_string, - _pipe@1 = gleam@string:split(_pipe, <<";"/utf8>>), - _pipe@2 = gleam@list:flat_map( - _pipe@1, - fun(_capture) -> gleam@string:split(_capture, <<","/utf8>>) end - ), - gleam@list:filter_map( - _pipe@2, - fun(Pair) -> - case gleam@string:split_once(gleam@string:trim(Pair), <<"="/utf8>>) of - {ok, {<<""/utf8>>, _}} -> - {error, nil}; - - {ok, {Key, Value}} -> - Key@1 = gleam@string:trim(Key), - Value@1 = gleam@string:trim(Value), - gleam@result:then( - check_token(Key@1), - fun(_) -> - gleam@result:then( - check_token(Value@1), - fun(_) -> {ok, {Key@1, Value@1}} end - ) - end - ); - - {error, nil} -> - {error, nil} - end - end - ). - --file("/Users/louis/src/gleam/http/src/gleam/http/cookie.gleam", 53). --spec cookie_attributes_to_list(attributes()) -> list(list(binary())). -cookie_attributes_to_list(Attributes) -> - {attributes, Max_age, Domain, Path, Secure, Http_only, Same_site} = Attributes, - _pipe = [case Max_age of - {some, 0} -> - {some, [<<"Expires=Thu, 01 Jan 1970 00:00:00 GMT"/utf8>>]}; - - _ -> - none - end, gleam@option:map( - Max_age, - fun(Max_age@1) -> - [<<"Max-Age="/utf8>>, erlang:integer_to_binary(Max_age@1)] - end - ), gleam@option:map( - Domain, - fun(Domain@1) -> [<<"Domain="/utf8>>, Domain@1] end - ), gleam@option:map(Path, fun(Path@1) -> [<<"Path="/utf8>>, Path@1] end), case Secure of - true -> - {some, [<<"Secure"/utf8>>]}; - - false -> - none - end, case Http_only of - true -> - {some, [<<"HttpOnly"/utf8>>]}; - - false -> - none - end, gleam@option:map( - Same_site, - fun(Same_site@1) -> - [<<"SameSite="/utf8>>, same_site_to_string(Same_site@1)] - end - )], - gleam@list:filter_map( - _pipe, - fun(_capture) -> gleam@option:to_result(_capture, nil) end - ). - --file("/Users/louis/src/gleam/http/src/gleam/http/cookie.gleam", 89). --spec set_header(binary(), binary(), attributes()) -> binary(). -set_header(Name, Value, Attributes) -> - _pipe = [[Name, <<"="/utf8>>, Value] | - cookie_attributes_to_list(Attributes)], - _pipe@1 = gleam@list:map( - _pipe, - fun(_capture) -> gleam@string:join(_capture, <<""/utf8>>) end - ), - gleam@string:join(_pipe@1, <<"; "/utf8>>). diff --git a/lsp/bet-lsp/build/packages/gleam_http/src/gleam@http@request.erl b/lsp/bet-lsp/build/packages/gleam_http/src/gleam@http@request.erl deleted file mode 100644 index d43cc06..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/src/gleam@http@request.erl +++ /dev/null @@ -1,327 +0,0 @@ --module(gleam@http@request). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([to_uri/1, from_uri/1, get_header/2, set_header/3, prepend_header/3, set_body/2, map/2, path_segments/1, get_query/1, set_query/2, set_method/2, new/0, to/1, set_scheme/2, set_host/2, set_port/2, set_path/2, set_cookie/3, get_cookies/1, remove_cookie/2]). --export_type([request/1]). - --type request(GNK) :: {request, - gleam@http:method(), - list({binary(), binary()}), - GNK, - gleam@http:scheme(), - binary(), - gleam@option:option(integer()), - binary(), - gleam@option:option(binary())}. - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 30). --spec to_uri(request(any())) -> gleam@uri:uri(). -to_uri(Request) -> - {uri, - {some, gleam@http:scheme_to_string(erlang:element(5, Request))}, - none, - {some, erlang:element(6, Request)}, - erlang:element(7, Request), - erlang:element(8, Request), - erlang:element(9, Request), - none}. - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 44). --spec from_uri(gleam@uri:uri()) -> {ok, request(binary())} | {error, nil}. -from_uri(Uri) -> - gleam@result:then( - begin - _pipe = erlang:element(2, Uri), - _pipe@1 = gleam@option:unwrap(_pipe, <<""/utf8>>), - gleam@http:scheme_from_string(_pipe@1) - end, - fun(Scheme) -> - gleam@result:then( - begin - _pipe@2 = erlang:element(4, Uri), - gleam@option:to_result(_pipe@2, nil) - end, - fun(Host) -> - Req = {request, - get, - [], - <<""/utf8>>, - Scheme, - Host, - erlang:element(5, Uri), - erlang:element(6, Uri), - erlang:element(7, Uri)}, - {ok, Req} - end - ) - end - ). - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 75). --spec get_header(request(any()), binary()) -> {ok, binary()} | {error, nil}. -get_header(Request, Key) -> - gleam@list:key_find(erlang:element(3, Request), string:lowercase(Key)). - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 86). --spec set_header(request(GNU), binary(), binary()) -> request(GNU). -set_header(Request, Key, Value) -> - Headers = gleam@list:key_set( - erlang:element(3, Request), - string:lowercase(Key), - Value - ), - _record = Request, - {request, - erlang:element(2, _record), - Headers, - erlang:element(4, _record), - erlang:element(5, _record), - erlang:element(6, _record), - erlang:element(7, _record), - erlang:element(8, _record), - erlang:element(9, _record)}. - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 103). --spec prepend_header(request(GNX), binary(), binary()) -> request(GNX). -prepend_header(Request, Key, Value) -> - Headers = [{string:lowercase(Key), Value} | erlang:element(3, Request)], - _record = Request, - {request, - erlang:element(2, _record), - Headers, - erlang:element(4, _record), - erlang:element(5, _record), - erlang:element(6, _record), - erlang:element(7, _record), - erlang:element(8, _record), - erlang:element(9, _record)}. - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 115). --spec set_body(request(any()), GOC) -> request(GOC). -set_body(Req, Body) -> - {request, Method, Headers, _, Scheme, Host, Port, Path, Query} = Req, - {request, Method, Headers, Body, Scheme, Host, Port, Path, Query}. - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 140). --spec map(request(GOE), fun((GOE) -> GOG)) -> request(GOG). -map(Request, Transform) -> - _pipe = erlang:element(4, Request), - _pipe@1 = Transform(_pipe), - set_body(Request, _pipe@1). - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 160). --spec path_segments(request(any())) -> list(binary()). -path_segments(Request) -> - _pipe = erlang:element(8, Request), - gleam@uri:path_segments(_pipe). - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 166). --spec get_query(request(any())) -> {ok, list({binary(), binary()})} | - {error, nil}. -get_query(Request) -> - case erlang:element(9, Request) of - {some, Query_string} -> - gleam_stdlib:parse_query(Query_string); - - none -> - {ok, []} - end. - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 176). --spec set_query(request(GOQ), list({binary(), binary()})) -> request(GOQ). -set_query(Req, Query) -> - Pair = fun(T) -> - <<<<(gleam_stdlib:percent_encode(erlang:element(1, T)))/binary, - "="/utf8>>/binary, - (gleam_stdlib:percent_encode(erlang:element(2, T)))/binary>> - end, - Query@1 = begin - _pipe = Query, - _pipe@1 = gleam@list:map(_pipe, Pair), - _pipe@2 = gleam@list:intersperse(_pipe@1, <<"&"/utf8>>), - _pipe@3 = gleam@string:concat(_pipe@2), - {some, _pipe@3} - end, - _record = Req, - {request, - erlang:element(2, _record), - erlang:element(3, _record), - erlang:element(4, _record), - erlang:element(5, _record), - erlang:element(6, _record), - erlang:element(7, _record), - erlang:element(8, _record), - Query@1}. - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 194). --spec set_method(request(GOU), gleam@http:method()) -> request(GOU). -set_method(Req, Method) -> - _record = Req, - {request, - Method, - erlang:element(3, _record), - erlang:element(4, _record), - erlang:element(5, _record), - erlang:element(6, _record), - erlang:element(7, _record), - erlang:element(8, _record), - erlang:element(9, _record)}. - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 201). --spec new() -> request(binary()). -new() -> - {request, - get, - [], - <<""/utf8>>, - https, - <<"localhost"/utf8>>, - none, - <<""/utf8>>, - none}. - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 216). --spec to(binary()) -> {ok, request(binary())} | {error, nil}. -to(Url) -> - _pipe = Url, - _pipe@1 = gleam_stdlib:uri_parse(_pipe), - gleam@result:then(_pipe@1, fun from_uri/1). - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 224). --spec set_scheme(request(GPB), gleam@http:scheme()) -> request(GPB). -set_scheme(Req, Scheme) -> - _record = Req, - {request, - erlang:element(2, _record), - erlang:element(3, _record), - erlang:element(4, _record), - Scheme, - erlang:element(6, _record), - erlang:element(7, _record), - erlang:element(8, _record), - erlang:element(9, _record)}. - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 230). --spec set_host(request(GPE), binary()) -> request(GPE). -set_host(Req, Host) -> - _record = Req, - {request, - erlang:element(2, _record), - erlang:element(3, _record), - erlang:element(4, _record), - erlang:element(5, _record), - Host, - erlang:element(7, _record), - erlang:element(8, _record), - erlang:element(9, _record)}. - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 236). --spec set_port(request(GPH), integer()) -> request(GPH). -set_port(Req, Port) -> - _record = Req, - {request, - erlang:element(2, _record), - erlang:element(3, _record), - erlang:element(4, _record), - erlang:element(5, _record), - erlang:element(6, _record), - {some, Port}, - erlang:element(8, _record), - erlang:element(9, _record)}. - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 242). --spec set_path(request(GPK), binary()) -> request(GPK). -set_path(Req, Path) -> - _record = Req, - {request, - erlang:element(2, _record), - erlang:element(3, _record), - erlang:element(4, _record), - erlang:element(5, _record), - erlang:element(6, _record), - erlang:element(7, _record), - Path, - erlang:element(9, _record)}. - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 249). --spec set_cookie(request(GPN), binary(), binary()) -> request(GPN). -set_cookie(Req, Name, Value) -> - New_cookie_string = gleam@string:join([Name, Value], <<"="/utf8>>), - {Cookies_string@2, Headers@1} = case gleam@list:key_pop( - erlang:element(3, Req), - <<"cookie"/utf8>> - ) of - {ok, {Cookies_string, Headers}} -> - Cookies_string@1 = gleam@string:join( - [Cookies_string, New_cookie_string], - <<"; "/utf8>> - ), - {Cookies_string@1, Headers}; - - {error, nil} -> - {New_cookie_string, erlang:element(3, Req)} - end, - _record = Req, - {request, - erlang:element(2, _record), - [{<<"cookie"/utf8>>, Cookies_string@2} | Headers@1], - erlang:element(4, _record), - erlang:element(5, _record), - erlang:element(6, _record), - erlang:element(7, _record), - erlang:element(8, _record), - erlang:element(9, _record)}. - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 268). --spec get_cookies(request(any())) -> list({binary(), binary()}). -get_cookies(Req) -> - {request, _, Headers, _, _, _, _, _, _} = Req, - _pipe = Headers, - _pipe@1 = gleam@list:filter_map( - _pipe, - fun(Header) -> - {Name, Value} = Header, - case Name of - <<"cookie"/utf8>> -> - {ok, gleam@http@cookie:parse(Value)}; - - _ -> - {error, nil} - end - end - ), - gleam@list:flatten(_pipe@1). - --file("/Users/louis/src/gleam/http/src/gleam/http/request.gleam", 286). --spec remove_cookie(request(GPS), binary()) -> request(GPS). -remove_cookie(Req, Name) -> - case gleam@list:key_pop(erlang:element(3, Req), <<"cookie"/utf8>>) of - {ok, {Cookies_string, Headers}} -> - New_cookies_string = begin - _pipe = gleam@string:split(Cookies_string, <<";"/utf8>>), - _pipe@4 = gleam@list:filter( - _pipe, - fun(Str) -> _pipe@1 = gleam@string:trim(Str), - _pipe@2 = gleam@string:split_once(_pipe@1, <<"="/utf8>>), - _pipe@3 = gleam@result:map( - _pipe@2, - fun(Tup) -> erlang:element(1, Tup) /= Name end - ), - gleam@result:unwrap(_pipe@3, true) end - ), - gleam@string:join(_pipe@4, <<";"/utf8>>) - end, - _record = Req, - {request, - erlang:element(2, _record), - [{<<"cookie"/utf8>>, New_cookies_string} | Headers], - erlang:element(4, _record), - erlang:element(5, _record), - erlang:element(6, _record), - erlang:element(7, _record), - erlang:element(8, _record), - erlang:element(9, _record)}; - - {error, _} -> - Req - end. diff --git a/lsp/bet-lsp/build/packages/gleam_http/src/gleam@http@response.erl b/lsp/bet-lsp/build/packages/gleam_http/src/gleam@http@response.erl deleted file mode 100644 index 80ecd2a..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/src/gleam@http@response.erl +++ /dev/null @@ -1,115 +0,0 @@ --module(gleam@http@response). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([new/1, get_header/2, set_header/3, prepend_header/3, set_body/2, try_map/2, map/2, redirect/1, get_cookies/1, set_cookie/4, expire_cookie/3]). --export_type([response/1]). - --type response(GXV) :: {response, integer(), list({binary(), binary()}), GXV}. - --file("/Users/louis/src/gleam/http/src/gleam/http/response.gleam", 40). --spec new(integer()) -> response(binary()). -new(Status) -> - {response, Status, [], <<""/utf8>>}. - --file("/Users/louis/src/gleam/http/src/gleam/http/response.gleam", 48). --spec get_header(response(any()), binary()) -> {ok, binary()} | {error, nil}. -get_header(Response, Key) -> - gleam@list:key_find(erlang:element(3, Response), string:lowercase(Key)). - --file("/Users/louis/src/gleam/http/src/gleam/http/response.gleam", 59). --spec set_header(response(GYK), binary(), binary()) -> response(GYK). -set_header(Response, Key, Value) -> - Headers = gleam@list:key_set( - erlang:element(3, Response), - string:lowercase(Key), - Value - ), - _record = Response, - {response, erlang:element(2, _record), Headers, erlang:element(4, _record)}. - --file("/Users/louis/src/gleam/http/src/gleam/http/response.gleam", 76). --spec prepend_header(response(GYN), binary(), binary()) -> response(GYN). -prepend_header(Response, Key, Value) -> - Headers = [{string:lowercase(Key), Value} | erlang:element(3, Response)], - _record = Response, - {response, erlang:element(2, _record), Headers, erlang:element(4, _record)}. - --file("/Users/louis/src/gleam/http/src/gleam/http/response.gleam", 87). --spec set_body(response(any()), GYS) -> response(GYS). -set_body(Response, Body) -> - {response, Status, Headers, _} = Response, - {response, Status, Headers, Body}. - --file("/Users/louis/src/gleam/http/src/gleam/http/response.gleam", 27). --spec try_map(response(GXW), fun((GXW) -> {ok, GXY} | {error, GXZ})) -> {ok, - response(GXY)} | - {error, GXZ}. -try_map(Response, Transform) -> - gleam@result:then( - Transform(erlang:element(4, Response)), - fun(Body) -> {ok, set_body(Response, Body)} end - ). - --file("/Users/louis/src/gleam/http/src/gleam/http/response.gleam", 97). --spec map(response(GYU), fun((GYU) -> GYW)) -> response(GYW). -map(Response, Transform) -> - _pipe = erlang:element(4, Response), - _pipe@1 = Transform(_pipe), - set_body(Response, _pipe@1). - --file("/Users/louis/src/gleam/http/src/gleam/http/response.gleam", 108). --spec redirect(binary()) -> response(binary()). -redirect(Uri) -> - {response, - 303, - [{<<"location"/utf8>>, Uri}], - gleam@string:append(<<"You are being redirected to "/utf8>>, Uri)}. - --file("/Users/louis/src/gleam/http/src/gleam/http/response.gleam", 120). --spec get_cookies(response(any())) -> list({binary(), binary()}). -get_cookies(Resp) -> - {response, _, Headers, _} = Resp, - _pipe = Headers, - _pipe@1 = gleam@list:filter_map( - _pipe, - fun(Header) -> - {Name, Value} = Header, - case Name of - <<"set-cookie"/utf8>> -> - {ok, gleam@http@cookie:parse(Value)}; - - _ -> - {error, nil} - end - end - ), - gleam@list:flatten(_pipe@1). - --file("/Users/louis/src/gleam/http/src/gleam/http/response.gleam", 135). --spec set_cookie( - response(GZB), - binary(), - binary(), - gleam@http@cookie:attributes() -) -> response(GZB). -set_cookie(Response, Name, Value, Attributes) -> - prepend_header( - Response, - <<"set-cookie"/utf8>>, - gleam@http@cookie:set_header(Name, Value, Attributes) - ). - --file("/Users/louis/src/gleam/http/src/gleam/http/response.gleam", 151). --spec expire_cookie(response(GZE), binary(), gleam@http@cookie:attributes()) -> response(GZE). -expire_cookie(Response, Name, Attributes) -> - Attrs = begin - _record = Attributes, - {attributes, - {some, 0}, - erlang:element(3, _record), - erlang:element(4, _record), - erlang:element(5, _record), - erlang:element(6, _record), - erlang:element(7, _record)} - end, - set_cookie(Response, Name, <<""/utf8>>, Attrs). diff --git a/lsp/bet-lsp/build/packages/gleam_http/src/gleam@http@service.erl b/lsp/bet-lsp/build/packages/gleam_http/src/gleam@http@service.erl deleted file mode 100644 index daa64b7..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/src/gleam@http@service.erl +++ /dev/null @@ -1,85 +0,0 @@ --module(gleam@http@service). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([map_response_body/2, prepend_response_header/3, method_override/1]). - --file("/Users/louis/src/gleam/http/src/gleam/http/service.gleam", 17). --spec map_response_body( - fun((HCK) -> gleam@http@response:response(HBW)), - fun((HBW) -> HBX) -) -> fun((HCK) -> gleam@http@response:response(HBX)). -map_response_body(Service, Mapper) -> - fun(Req) -> _pipe = Req, - _pipe@1 = Service(_pipe), - gleam@http@response:map(_pipe@1, Mapper) end. - --file("/Users/louis/src/gleam/http/src/gleam/http/service.gleam", 26). --spec prepend_response_header( - fun((HCO) -> gleam@http@response:response(HCQ)), - binary(), - binary() -) -> fun((HCO) -> gleam@http@response:response(HCQ)). -prepend_response_header(Service, Key, Value) -> - fun(Req) -> _pipe = Req, - _pipe@1 = Service(_pipe), - gleam@http@response:prepend_header(_pipe@1, Key, Value) end. - --file("/Users/louis/src/gleam/http/src/gleam/http/service.gleam", 34). --spec ensure_post(gleam@http@request:request(HCB)) -> {ok, - gleam@http@request:request(HCB)} | - {error, nil}. -ensure_post(Req) -> - case erlang:element(2, Req) of - post -> - {ok, Req}; - - _ -> - {error, nil} - end. - --file("/Users/louis/src/gleam/http/src/gleam/http/service.gleam", 41). --spec get_override_method(gleam@http@request:request(any())) -> {ok, - gleam@http:method()} | - {error, nil}. -get_override_method(Request) -> - gleam@result:then( - gleam@http@request:get_query(Request), - fun(Query_params) -> - gleam@result:then( - gleam@list:key_find(Query_params, <<"_method"/utf8>>), - fun(Method) -> - gleam@result:then( - gleam@http:parse_method(Method), - fun(Method@1) -> case Method@1 of - put -> - {ok, Method@1}; - - patch -> - {ok, Method@1}; - - delete -> - {ok, Method@1}; - - _ -> - {error, nil} - end end - ) - end - ) - end - ). - --file("/Users/louis/src/gleam/http/src/gleam/http/service.gleam", 52). --spec method_override(fun((gleam@http@request:request(HDX)) -> HEF)) -> fun((gleam@http@request:request(HDX)) -> HEF). -method_override(Service) -> - fun(Request) -> _pipe = Request, - _pipe@1 = ensure_post(_pipe), - _pipe@2 = gleam@result:then(_pipe@1, fun get_override_method/1), - _pipe@3 = gleam@result:map( - _pipe@2, - fun(_capture) -> - gleam@http@request:set_method(Request, _capture) - end - ), - _pipe@4 = gleam@result:unwrap(_pipe@3, Request), - Service(_pipe@4) end. diff --git a/lsp/bet-lsp/build/packages/gleam_http/src/gleam_http.app.src b/lsp/bet-lsp/build/packages/gleam_http/src/gleam_http.app.src deleted file mode 100644 index 99261b8..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/src/gleam_http.app.src +++ /dev/null @@ -1,11 +0,0 @@ -{application, gleam_http, [ - {vsn, "3.7.2"}, - {applications, [gleam_stdlib]}, - {description, "Types and functions for Gleam HTTP clients and servers"}, - {modules, [gleam@http, - gleam@http@cookie, - gleam@http@request, - gleam@http@response, - gleam@http@service]}, - {registered, []} -]}. diff --git a/lsp/bet-lsp/build/packages/gleam_http/src/gleam_http_native.erl b/lsp/bet-lsp/build/packages/gleam_http/src/gleam_http_native.erl deleted file mode 100644 index bb499bb..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/src/gleam_http_native.erl +++ /dev/null @@ -1,88 +0,0 @@ --module(gleam_http_native). --export([decode_method/1]). - -decode_method(Term) -> - case Term of - "connect" -> {ok, connect}; - "delete" -> {ok, delete}; - "get" -> {ok, get}; - "head" -> {ok, head}; - "options" -> {ok, options}; - "patch" -> {ok, patch}; - "post" -> {ok, post}; - "put" -> {ok, put}; - "trace" -> {ok, trace}; - "CONNECT" -> {ok, connect}; - "DELETE" -> {ok, delete}; - "GET" -> {ok, get}; - "HEAD" -> {ok, head}; - "OPTIONS" -> {ok, options}; - "PATCH" -> {ok, patch}; - "POST" -> {ok, post}; - "PUT" -> {ok, put}; - "TRACE" -> {ok, trace}; - "Connect" -> {ok, connect}; - "Delete" -> {ok, delete}; - "Get" -> {ok, get}; - "Head" -> {ok, head}; - "Options" -> {ok, options}; - "Patch" -> {ok, patch}; - "Post" -> {ok, post}; - "Put" -> {ok, put}; - "Trace" -> {ok, trace}; - 'connect' -> {ok, connect}; - 'delete' -> {ok, delete}; - 'get' -> {ok, get}; - 'head' -> {ok, head}; - 'options' -> {ok, options}; - 'patch' -> {ok, patch}; - 'post' -> {ok, post}; - 'put' -> {ok, put}; - 'trace' -> {ok, trace}; - 'CONNECT' -> {ok, connect}; - 'DELETE' -> {ok, delete}; - 'GET' -> {ok, get}; - 'HEAD' -> {ok, head}; - 'OPTIONS' -> {ok, options}; - 'PATCH' -> {ok, patch}; - 'POST' -> {ok, post}; - 'PUT' -> {ok, put}; - 'TRACE' -> {ok, trace}; - 'Connect' -> {ok, connect}; - 'Delete' -> {ok, delete}; - 'Get' -> {ok, get}; - 'Head' -> {ok, head}; - 'Options' -> {ok, options}; - 'Patch' -> {ok, patch}; - 'Post' -> {ok, post}; - 'Put' -> {ok, put}; - 'Trace' -> {ok, trace}; - <<"connect">> -> {ok, connect}; - <<"delete">> -> {ok, delete}; - <<"get">> -> {ok, get}; - <<"head">> -> {ok, head}; - <<"options">> -> {ok, options}; - <<"patch">> -> {ok, patch}; - <<"post">> -> {ok, post}; - <<"put">> -> {ok, put}; - <<"trace">> -> {ok, trace}; - <<"CONNECT">> -> {ok, connect}; - <<"DELETE">> -> {ok, delete}; - <<"GET">> -> {ok, get}; - <<"HEAD">> -> {ok, head}; - <<"OPTIONS">> -> {ok, options}; - <<"PATCH">> -> {ok, patch}; - <<"POST">> -> {ok, post}; - <<"PUT">> -> {ok, put}; - <<"TRACE">> -> {ok, trace}; - <<"Connect">> -> {ok, connect}; - <<"Delete">> -> {ok, delete}; - <<"Get">> -> {ok, get}; - <<"Head">> -> {ok, head}; - <<"Options">> -> {ok, options}; - <<"Patch">> -> {ok, patch}; - <<"Post">> -> {ok, post}; - <<"Put">> -> {ok, put}; - <<"Trace">> -> {ok, trace}; - _ -> {error, nil} - end. diff --git a/lsp/bet-lsp/build/packages/gleam_http/src/gleam_http_native.mjs b/lsp/bet-lsp/build/packages/gleam_http/src/gleam_http_native.mjs deleted file mode 100644 index c871a8b..0000000 --- a/lsp/bet-lsp/build/packages/gleam_http/src/gleam_http_native.mjs +++ /dev/null @@ -1,38 +0,0 @@ -import { Ok, Error } from "./gleam.mjs"; -import { - Get, - Post, - Head, - Put, - Delete, - Trace, - Connect, - Options, - Patch, -} from "./gleam/http.mjs"; - -export function decode_method(value) { - try { - switch (value.toLowerCase()) { - case "get": - return new Ok(new Get()); - case "post": - return new Ok(new Post()); - case "head": - return new Ok(new Head()); - case "put": - return new Ok(new Put()); - case "delete": - return new Ok(new Delete()); - case "trace": - return new Ok(new Trace()); - case "connect": - return new Ok(new Connect()); - case "options": - return new Ok(new Options()); - case "patch": - return new Ok(new Patch()); - } - } catch {} - return new Error(undefined); -} diff --git a/lsp/bet-lsp/build/packages/gleam_json/LICENCE b/lsp/bet-lsp/build/packages/gleam_json/LICENCE deleted file mode 100644 index 3d89615..0000000 --- a/lsp/bet-lsp/build/packages/gleam_json/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 - present, 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/lsp/bet-lsp/build/packages/gleam_json/README.md b/lsp/bet-lsp/build/packages/gleam_json/README.md deleted file mode 100644 index 87d806b..0000000 --- a/lsp/bet-lsp/build/packages/gleam_json/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# json 🐑 - -Work with JSON in Gleam! - -Under the hood library uses [Thoas](https://github.com/lpil/thoas/), the fastest -and most memory efficient pure Erlang JSON encoder/decoder. - -## Installation - -Add this package to your Gleam project. - -```shell -gleam add gleam_json -``` - -### Encoding - -```gleam -import myapp.{Cat} -import gleam/json.{object, string, array, int, null} - -pub fn cat_to_json(cat: Cat) -> String { - object([ - #("name", string(cat.name)), - #("lives", int(cat.lives)), - #("flaws", null()), - #("nicknames", array(cat.nicknames, of: string)), - ]) - |> json.to_string -} -``` - -### Decoding - -JSON is decoded into a `Dynamic` value which can be decoded using the -`gleam/dynamic` module from the Gleam standard library. - -```gleam -import myapp.{Cat} -import gleam/json -import gleam/dynamic.{field, list, int, string} - -pub fn cat_from_json(json_string: String) -> Result(Cat, json.DecodeError) { - let cat_decoder = dynamic.decode3( - Cat, - field("name", of: string), - field("lives", of: int), - field("nicknames", of: list(string)), - ) - - json.decode(from: json_string, using: cat_decoder) -} -``` diff --git a/lsp/bet-lsp/build/packages/gleam_json/gleam.toml b/lsp/bet-lsp/build/packages/gleam_json/gleam.toml deleted file mode 100644 index cfb5fca..0000000 --- a/lsp/bet-lsp/build/packages/gleam_json/gleam.toml +++ /dev/null @@ -1,19 +0,0 @@ -name = "gleam_json" -version = "1.0.1" -gleam = ">= 0.32.0" - -licences = ["Apache-2.0"] -description = "Work with JSON in Gleam" - -repository = { type = "github", user = "gleam-lang", repo = "json" } -links = [ - { title = "Website", href = "https://gleam.run" }, - { title = "Sponsor", href = "https://github.com/sponsors/lpil" }, -] - -[dependencies] -gleam_stdlib = ">= 0.19.0 and < 2.0.0" -thoas = ">= 0.2.0 and < 2.0.0" - -[dev-dependencies] -gleeunit = "~> 1.0" diff --git a/lsp/bet-lsp/build/packages/gleam_json/include/gleam@json_UnexpectedByte.hrl b/lsp/bet-lsp/build/packages/gleam_json/include/gleam@json_UnexpectedByte.hrl deleted file mode 100644 index 9fe337e..0000000 --- a/lsp/bet-lsp/build/packages/gleam_json/include/gleam@json_UnexpectedByte.hrl +++ /dev/null @@ -1 +0,0 @@ --record(unexpected_byte, {byte :: binary(), position :: integer()}). diff --git a/lsp/bet-lsp/build/packages/gleam_json/include/gleam@json_UnexpectedSequence.hrl b/lsp/bet-lsp/build/packages/gleam_json/include/gleam@json_UnexpectedSequence.hrl deleted file mode 100644 index 97f1b7d..0000000 --- a/lsp/bet-lsp/build/packages/gleam_json/include/gleam@json_UnexpectedSequence.hrl +++ /dev/null @@ -1 +0,0 @@ --record(unexpected_sequence, {byte :: binary(), position :: integer()}). diff --git a/lsp/bet-lsp/build/packages/gleam_json/src/gleam/json.gleam b/lsp/bet-lsp/build/packages/gleam_json/src/gleam/json.gleam deleted file mode 100644 index 3c50712..0000000 --- a/lsp/bet-lsp/build/packages/gleam_json/src/gleam/json.gleam +++ /dev/null @@ -1,305 +0,0 @@ -import gleam/list -import gleam/result -import gleam/bit_array -import gleam/option.{type Option, None, Some} -import gleam/dynamic.{type Dynamic} -import gleam/string_builder.{type StringBuilder} - -pub type Json - -pub type DecodeError { - UnexpectedEndOfInput - UnexpectedByte(byte: String, position: Int) - UnexpectedSequence(byte: String, position: Int) - UnexpectedFormat(List(dynamic.DecodeError)) -} - -/// Decode a JSON string into dynamically typed data which can be decoded into -/// typed data with the `gleam/dynamic` module. -/// -/// ## Examples -/// -/// ```gleam -/// > decode("[1,2,3]", dynamic.list(of: dynamic.int)) -/// Ok([1, 2, 3]) -/// ``` -/// -/// ```gleam -/// > decode("[", dynamic.list(of: dynamic.int)) -/// Error(UnexpectedEndOfInput) -/// ``` -/// -/// ```gleam -/// > decode("1", dynamic.string) -/// Error(UnexpectedFormat([dynamic.DecodeError("String", "Int", [])])) -/// ``` -/// -pub fn decode( - from json: String, - using decoder: dynamic.Decoder(t), -) -> Result(t, DecodeError) { - do_decode(from: json, using: decoder) -} - -@target(erlang) -fn do_decode( - from json: String, - using decoder: dynamic.Decoder(t), -) -> Result(t, DecodeError) { - let bits = bit_array.from_string(json) - decode_bits(bits, decoder) -} - -@target(javascript) -fn do_decode( - from json: String, - using decoder: dynamic.Decoder(t), -) -> Result(t, DecodeError) { - use dynamic_value <- result.then(decode_string(json)) - decoder(dynamic_value) - |> result.map_error(UnexpectedFormat) -} - -@target(javascript) -@external(javascript, "../gleam_json_ffi.mjs", "decode") -fn decode_string(a: String) -> Result(Dynamic, DecodeError) - -/// Decode a JSON bit string into dynamically typed data which can be decoded -/// into typed data with the `gleam/dynamic` module. -/// -/// ## Examples -/// -/// ```gleam -/// > decode_bits(<<"[1,2,3]">>, dynamic.list(of: dynamic.int)) -/// Ok([1, 2, 3]) -/// ``` -/// -/// ```gleam -/// > decode_bits(<<"[">>, dynamic.list(of: dynamic.int)) -/// Error(UnexpectedEndOfInput) -/// ``` -/// -/// ```gleam -/// > decode_bits("<<1">>, dynamic.string) -/// Error(UnexpectedFormat([dynamic.DecodeError("String", "Int", [])])) -/// ``` -/// -pub fn decode_bits( - from json: BitArray, - using decoder: dynamic.Decoder(t), -) -> Result(t, DecodeError) { - use dynamic_value <- result.then(decode_to_dynamic(json)) - decoder(dynamic_value) - |> result.map_error(UnexpectedFormat) -} - -@target(erlang) -@external(erlang, "gleam_json_ffi", "decode") -fn decode_to_dynamic(a: BitArray) -> Result(Dynamic, DecodeError) - -@target(javascript) -fn decode_to_dynamic(json: BitArray) -> Result(Dynamic, DecodeError) { - case bit_array.to_string(json) { - Ok(string) -> decode_string(string) - Error(Nil) -> Error(UnexpectedByte("", 0)) - } -} - -/// Convert a JSON value into a string. -/// -/// Where possible prefer the `to_string_builder` function as it is faster than -/// this function, and BEAM VM IO is optimised for sending `StringBuilder` data. -/// -/// ## Examples -/// -/// ```gleam -/// > to_string(array([1, 2, 3], of: int)) -/// "[1,2,3]" -/// ``` -/// -pub fn to_string(json: Json) -> String { - do_to_string(json) -} - -@external(erlang, "gleam_json_ffi", "json_to_string") -@external(javascript, "../gleam_json_ffi.mjs", "json_to_string") -fn do_to_string(a: Json) -> String - -/// Convert a JSON value into a string builder. -/// -/// Where possible prefer this function to the `to_string` function as it is -/// slower than this function, and BEAM VM IO is optimised for sending -/// `StringBuilder` data. -/// -/// ## Examples -/// -/// ```gleam -/// > to_string_builder(array([1, 2, 3], of: int)) -/// string_builder.from_string("[1,2,3]") -/// ``` -/// -pub fn to_string_builder(json: Json) -> StringBuilder { - do_to_string_builder(json) -} - -@external(erlang, "gleam_json_ffi", "json_to_iodata") -@external(javascript, "../gleam_json_ffi.mjs", "json_to_string") -fn do_to_string_builder(a: Json) -> StringBuilder - -/// Encode a string into JSON, using normal JSON escaping. -/// -/// ## Examples -/// -/// ```gleam -/// > to_string(string("Hello!")) -/// "\"Hello!\"" -/// ``` -/// -pub fn string(input: String) -> Json { - do_string(input) -} - -@external(erlang, "gleam_json_ffi", "string") -@external(javascript, "../gleam_json_ffi.mjs", "identity") -fn do_string(a: String) -> Json - -/// Encode a bool into JSON. -/// -/// ## Examples -/// -/// ```gleam -/// > to_string(bool(False)) -/// "false" -/// ``` -/// -pub fn bool(input: Bool) -> Json { - do_bool(input) -} - -@external(erlang, "gleam_json_ffi", "bool") -@external(javascript, "../gleam_json_ffi.mjs", "identity") -fn do_bool(a: Bool) -> Json - -/// Encode an int into JSON. -/// -/// ## Examples -/// -/// ```gleam -/// > to_string(int(50)) -/// "50" -/// ``` -/// -pub fn int(input: Int) -> Json { - do_int(input) -} - -@external(erlang, "gleam_json_ffi", "int") -@external(javascript, "../gleam_json_ffi.mjs", "identity") -fn do_int(a: Int) -> Json - -/// Encode a float into JSON. -/// -/// ## Examples -/// -/// ```gleam -/// > to_string(float(4.7)) -/// "4.7" -/// ``` -/// -pub fn float(input: Float) -> Json { - do_float(input) -} - -@external(erlang, "gleam_json_ffi", "float") -@external(javascript, "../gleam_json_ffi.mjs", "identity") -fn do_float(input input: Float) -> Json - -/// The JSON value null. -/// -/// ## Examples -/// -/// ```gleam -/// > to_string(null()) -/// "null" -/// ``` -/// -pub fn null() -> Json { - do_null() -} - -@external(erlang, "gleam_json_ffi", "null") -@external(javascript, "../gleam_json_ffi.mjs", "do_null") -fn do_null() -> Json - -/// Encode an optional value into JSON, using null if it is the `None` variant. -/// -/// ## Examples -/// -/// ```gleam -/// > to_string(nullable(Some(50), of: int)) -/// "50" -/// ``` -/// -/// ```gleam -/// > to_string(nullable(None, of: int)) -/// "null" -/// ``` -/// -pub fn nullable(from input: Option(a), of inner_type: fn(a) -> Json) -> Json { - case input { - Some(value) -> inner_type(value) - None -> null() - } -} - -/// Encode a list of key-value pairs into a JSON object. -/// -/// ## Examples -/// -/// ```gleam -/// > to_string(object([ -/// #("game", string("Pac-Man")), -/// #("score", int(3333360)), -/// ])) -/// "{\"game\":\"Pac-Mac\",\"score\":3333360}" -/// ``` -/// -pub fn object(entries: List(#(String, Json))) -> Json { - do_object(entries) -} - -@external(erlang, "gleam_json_ffi", "object") -@external(javascript, "../gleam_json_ffi.mjs", "object") -fn do_object(entries entries: List(#(String, Json))) -> Json - -/// Encode a list into a JSON array. -/// -/// ## Examples -/// -/// ```gleam -/// > to_string(array([1, 2, 3], of: int)) -/// "[1, 2, 3]" -/// ``` -/// -pub fn array(from entries: List(a), of inner_type: fn(a) -> Json) -> Json { - entries - |> list.map(inner_type) - |> preprocessed_array -} - -/// Encode a list of JSON values into a JSON array. -/// -/// ## Examples -/// -/// ```gleam -/// > to_string(preprocessed_array([int(1), float(2.0), string("3")])) -/// "[1, 2.0, \"3\"]" -/// ``` -/// -pub fn preprocessed_array(from: List(Json)) -> Json { - do_preprocessed_array(from) -} - -@external(erlang, "gleam_json_ffi", "array") -@external(javascript, "../gleam_json_ffi.mjs", "array") -fn do_preprocessed_array(from from: List(Json)) -> Json diff --git a/lsp/bet-lsp/build/packages/gleam_json/src/gleam@json.erl b/lsp/bet-lsp/build/packages/gleam_json/src/gleam@json.erl deleted file mode 100644 index 51fb1ee..0000000 --- a/lsp/bet-lsp/build/packages/gleam_json/src/gleam@json.erl +++ /dev/null @@ -1,96 +0,0 @@ --module(gleam@json). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([decode_bits/2, decode/2, to_string/1, to_string_builder/1, string/1, bool/1, int/1, float/1, null/0, nullable/2, object/1, preprocessed_array/1, array/2]). --export_type([json/0, decode_error/0]). - --type json() :: any(). - --type decode_error() :: unexpected_end_of_input | - {unexpected_byte, binary(), integer()} | - {unexpected_sequence, binary(), integer()} | - {unexpected_format, list(gleam@dynamic:decode_error())}. - --spec decode_bits( - bitstring(), - fun((gleam@dynamic:dynamic_()) -> {ok, FLX} | - {error, list(gleam@dynamic:decode_error())}) -) -> {ok, FLX} | {error, decode_error()}. -decode_bits(Json, Decoder) -> - gleam@result:then( - gleam_json_ffi:decode(Json), - fun(Dynamic_value) -> _pipe = Decoder(Dynamic_value), - gleam@result:map_error( - _pipe, - fun(Field@0) -> {unexpected_format, Field@0} end - ) end - ). - --spec do_decode( - binary(), - fun((gleam@dynamic:dynamic_()) -> {ok, FLT} | - {error, list(gleam@dynamic:decode_error())}) -) -> {ok, FLT} | {error, decode_error()}. -do_decode(Json, Decoder) -> - Bits = gleam_stdlib:identity(Json), - decode_bits(Bits, Decoder). - --spec decode( - binary(), - fun((gleam@dynamic:dynamic_()) -> {ok, FLP} | - {error, list(gleam@dynamic:decode_error())}) -) -> {ok, FLP} | {error, decode_error()}. -decode(Json, Decoder) -> - do_decode(Json, Decoder). - --spec to_string(json()) -> binary(). -to_string(Json) -> - gleam_json_ffi:json_to_string(Json). - --spec to_string_builder(json()) -> gleam@string_builder:string_builder(). -to_string_builder(Json) -> - gleam_json_ffi:json_to_iodata(Json). - --spec string(binary()) -> json(). -string(Input) -> - gleam_json_ffi:string(Input). - --spec bool(boolean()) -> json(). -bool(Input) -> - gleam_json_ffi:bool(Input). - --spec int(integer()) -> json(). -int(Input) -> - gleam_json_ffi:int(Input). - --spec float(float()) -> json(). -float(Input) -> - gleam_json_ffi:float(Input). - --spec null() -> json(). -null() -> - gleam_json_ffi:null(). - --spec nullable(gleam@option:option(FMD), fun((FMD) -> json())) -> json(). -nullable(Input, Inner_type) -> - case Input of - {some, Value} -> - Inner_type(Value); - - none -> - null() - end. - --spec object(list({binary(), json()})) -> json(). -object(Entries) -> - gleam_json_ffi:object(Entries). - --spec preprocessed_array(list(json())) -> json(). -preprocessed_array(From) -> - gleam_json_ffi:array(From). - --spec array(list(FMH), fun((FMH) -> json())) -> json(). -array(Entries, Inner_type) -> - _pipe = Entries, - _pipe@1 = gleam@list:map(_pipe, Inner_type), - preprocessed_array(_pipe@1). diff --git a/lsp/bet-lsp/build/packages/gleam_json/src/gleam_json.app.src b/lsp/bet-lsp/build/packages/gleam_json/src/gleam_json.app.src deleted file mode 100644 index 0103c94..0000000 --- a/lsp/bet-lsp/build/packages/gleam_json/src/gleam_json.app.src +++ /dev/null @@ -1,9 +0,0 @@ -{application, gleam_json, [ - {vsn, "1.0.1"}, - {applications, [gleam_stdlib, - gleeunit, - thoas]}, - {description, "Work with JSON in Gleam"}, - {modules, [gleam@json]}, - {registered, []} -]}. diff --git a/lsp/bet-lsp/build/packages/gleam_json/src/gleam_json_ffi.erl b/lsp/bet-lsp/build/packages/gleam_json/src/gleam_json_ffi.erl deleted file mode 100644 index c33f87f..0000000 --- a/lsp/bet-lsp/build/packages/gleam_json/src/gleam_json_ffi.erl +++ /dev/null @@ -1,25 +0,0 @@ --module(gleam_json_ffi). - --export([ - decode/1, json_to_iodata/1, json_to_string/1, int/1, float/1, string/1, - bool/1, null/0, array/1, object/1 -]). - -decode(Json) -> - thoas:decode(Json). - -json_to_iodata(Json) -> - Json. - -json_to_string(Json) when is_binary(Json) -> - Json; -json_to_string(Json) when is_list(Json) -> - list_to_binary(Json). - -null() -> thoas_encode:null(). -int(X) -> thoas_encode:integer(X). -bool(X) -> thoas_encode:boolean(X). -float(X) -> thoas_encode:float(X). -string(X) -> thoas_encode:string(X). -object(X) -> thoas_encode:non_recursive_object(X). -array(X) -> thoas_encode:non_recursive_array(X). diff --git a/lsp/bet-lsp/build/packages/gleam_json/src/gleam_json_ffi.mjs b/lsp/bet-lsp/build/packages/gleam_json/src/gleam_json_ffi.mjs deleted file mode 100644 index 85a81b0..0000000 --- a/lsp/bet-lsp/build/packages/gleam_json/src/gleam_json_ffi.mjs +++ /dev/null @@ -1,193 +0,0 @@ -import { Ok, Error } from "./gleam.mjs"; -import { UnexpectedByte, UnexpectedEndOfInput } from "./gleam/json.mjs"; - -export function json_to_string(json) { - return JSON.stringify(json); -} - -export function object(entries) { - return Object.fromEntries(entries); -} - -export function identity(x) { - return x; -} - -export function array(list) { - return list.toArray(); -} - -export function do_null() { - return null; -} - -export function decode(string) { - try { - const result = JSON.parse(string); - return new Ok(result); - } catch (err) { - return new Error(getJsonDecodeError(err, string)); - } -} - -export function getJsonDecodeError(stdErr, json) { - if (isUnexpectedEndOfInput(stdErr)) return new UnexpectedEndOfInput(); - return toUnexpectedByteError(stdErr, json); -} - -/** - * Matches unexpected end of input messages in: - * - Chromium (edge, chrome, node) - * - Spidermonkey (firefox) - * - JavascriptCore (safari) - * - * Note that Spidermonkey and JavascriptCore will both incorrectly report some - * UnexpectedByte errors as UnexpectedEndOfInput errors. For example: - * - * @example - * // in JavascriptCore - * JSON.parse('{"a"]: "b"}) - * // => JSON Parse error: Expected ':' before value - * - * JSON.parse('{"a"') - * // => JSON Parse error: Expected ':' before value - * - * // in Chromium (correct) - * JSON.parse('{"a"]: "b"}) - * // => Unexpected token ] in JSON at position 4 - * - * JSON.parse('{"a"') - * // => Unexpected end of JSON input - */ -function isUnexpectedEndOfInput(err) { - const unexpectedEndOfInputRegex = - /((unexpected (end|eof))|(end of data)|(unterminated string)|(json( parse error|\.parse)\: expected '(\:|\}|\])'))/i; - return unexpectedEndOfInputRegex.test(err.message); -} - -/** - * Converts a SyntaxError to an UnexpectedByte error based on the JS runtime. - * - * For Chromium, the unexpected byte and position are reported by the runtime. - * - * For JavascriptCore, only the unexpected byte is reported by the runtime, so - * there is no way to know which position that character is in unless we then - * parse the string again ourselves. So instead, the position is reported as 0. - * - * For Spidermonkey, the position is reported by the runtime as a line and column number - * and the unexpected byte is found using those coordinates. - * - * @param {'chromium' | 'spidermonkey' | 'jscore'} runtime - * @param {SyntaxError} err - * @param {string} json - * @returns {UnexpectedByte} - */ -function toUnexpectedByteError(err, json) { - let converters = [ - v8UnexpectedByteError, - oldV8UnexpectedByteError, - jsCoreUnexpectedByteError, - spidermonkeyUnexpectedByteError, - ]; - - for (let converter of converters) { - let result = converter(err, json); - if (result) return result; - } - - return new UnexpectedByte("", 0); -} - -/** - * Matches unexpected byte messages in: - * - V8 (edge, chrome, node) - * - * Matches the character but not the position as this is no longer reported by - * V8. Boo! - */ -function v8UnexpectedByteError(err) { - const regex = /unexpected token '(.)', ".+" is not valid JSON/i; - const match = regex.exec(err.message); - if (!match) return null; - const byte = toHex(match[1]); - return new UnexpectedByte(byte, -1); -} - -/** - * Matches unexpected byte messages in: - * - V8 (edge, chrome, node) - * - * No longer works in current versions of V8. - * - * Matches the character and its position. - */ -function oldV8UnexpectedByteError(err) { - const regex = /unexpected token (.) in JSON at position (\d+)/i; - const match = regex.exec(err.message); - if (!match) return null; - const byte = toHex(match[1]); - const position = Number(match[2]); - return new UnexpectedByte(byte, position); -} - -/** - * Matches unexpected byte messages in: - * - Spidermonkey (firefox) - * - * Matches the position in a 2d grid only and not the character. - */ -function spidermonkeyUnexpectedByteError(err, json) { - const regex = - /(unexpected character|expected .*) at line (\d+) column (\d+)/i; - const match = regex.exec(err.message); - if (!match) return null; - const line = Number(match[2]); - const column = Number(match[3]); - const position = getPositionFromMultiline(line, column, json); - const byte = toHex(json[position]); - return new UnexpectedByte(byte, position); -} - -/** - * Matches unexpected byte messages in: - * - JavascriptCore (safari) - * - * JavascriptCore only reports what the character is and not its position. - */ -function jsCoreUnexpectedByteError(err) { - const regex = /unexpected (identifier|token) "(.)"/i; - const match = regex.exec(err.message); - if (!match) return null; - const byte = toHex(match[2]); - return new UnexpectedByte(byte, 0); -} - -function toHex(char) { - return "0x" + char.charCodeAt(0).toString(16).toUpperCase(); -} - -/** - * Gets the position of a character in a flattened (i.e. single line) string - * from a line and column number. Note that the position is 0-indexed and - * the line and column numbers are 1-indexed. - * - * @param {number} line - * @param {number} column - * @param {string} string - */ -function getPositionFromMultiline(line, column, string) { - if (line === 1) return column - 1; - - let currentLn = 1; - let position = 0; - string.split("").find((char, idx) => { - if (char === "\n") currentLn += 1; - if (currentLn === line) { - position = idx + column; - return true; - } - return false; - }); - - return position; -} diff --git a/lsp/bet-lsp/build/packages/gleam_otp/LICENCE b/lsp/bet-lsp/build/packages/gleam_otp/LICENCE deleted file mode 100644 index 619ec77..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/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 2019, 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/lsp/bet-lsp/build/packages/gleam_otp/README.md b/lsp/bet-lsp/build/packages/gleam_otp/README.md deleted file mode 100644 index 75b854d..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/README.md +++ /dev/null @@ -1,94 +0,0 @@ -# Gleam OTP - -GitHub release -Discord chat -![CI](https://github.com/gleam-lang/otp/workflows/test/badge.svg?branch=main) - -A Gleam library for building fault tolerant multi-core programs using the -actor model. It is compatible with Erlang's OTP framework. - -Gleam’s actor system is built with a few primary goals: - -- Full type safety of actors and messages. -- Be compatible with Erlang’s OTP actor framework. -- Provide fault tolerance and self-healing through supervisors. -- Have equivalent performance to Erlang’s OTP. - -This library documents its abstractions and functionality, but you may also wish -to read the documentation or other material on Erlang’s OTP framework to get a -fuller understanding of OTP, the problems it solves, and and the motivations for -its design. - -Not all Erlang/OTP functionality is included in this library. Some is not -possible to represent in a type safe way, so it is not included. Other features -are still in development, such as further process supervision strategies. - -## Usage - -Add this library to your Gleam project. - -```shell -gleam add gleam_otp -``` - -## Actor hierarchy - -This library provides several different types of actor that can be used in -Gleam programs. - -### Process - -The process is the lowest level building block of OTP, all other actors are -built on top of processes either directly or indirectly. Typically this -abstraction would not be used very often in Gleam applications, favour -other actor types that provide more functionality. - -Gleam's [process](https://hexdocs.pm/gleam_erlang/gleam/erlang/process.html) module is defined in the `gleam_erlang` library. - -### Actor - -The `actor` is the most commonly used process type in Gleam and serves as a good -building block for other abstractions. Like Erlang's `gen_server` it handles -OTP's system messages automatically to enable OTP's debugging and tracing -functionality. - -[Documentation](https://hexdocs.pm/gleam_otp/gleam/otp/actor.html) - -### Task - -A task is a kind of process that computes a value and then sends the result back -to its parent. Commonly multiple tasks are used to compute multiple things at -once. - -- [gleam/otp/task](https://hexdocs.pm/gleam_otp/gleam/otp/task.html) - documentation. - -### Supervisor - -Supervisors is a process that starts and then supervises a group of processes, -restarting them if they crash. Supervisors can start other supervisors, -resulting in a hierarchical process structure called a supervision tree, -providing fault tolerance to a Gleam application. - -- [gleam/otp/static_supervisor](https://hexdocs.pm/gleam_otp/gleam/otp/static_supervisor.html) documentation. -- [gleam/otp/supervisor](https://hexdocs.pm/gleam_otp/gleam/otp/supervisor.html) - documentation. - -## Limitations and known issues - -This library does not currently replicate all of the Erlang/OTP functionality. -Some limitations include: - -- There is no support for named processes. They are untyped global mutable - variables which may be uninitialized, more research is needed to find a - suitable type safe alternative. -- There are relatively few actor abstractions provided by this library. More - will be added in the future. -- Actors do not yet support all OTP system messages. Unsupported messages are - dropped. -- Supervisors do not yet support different shutdown periods per child. In - practice this means that children that are supervisors do not get an - unlimited amount of time to shut down, as is expected in Erlang or Elixir. -- This library has not seen much testing compared to the Erlang OTP - libraries, both in terms of unit tests and real world testing in - applications. diff --git a/lsp/bet-lsp/build/packages/gleam_otp/gleam.toml b/lsp/bet-lsp/build/packages/gleam_otp/gleam.toml deleted file mode 100644 index 7736fce..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/gleam.toml +++ /dev/null @@ -1,20 +0,0 @@ -name = "gleam_otp" -version = "0.16.1" -licences = ["Apache-2.0"] -description = "Fault tolerant multicore Gleam programs with OTP" - -gleam = ">= 1.4.0" - -repository = { type = "github", user = "gleam-lang", repo = "otp" } -links = [ - { title = "Website", href = "https://gleam.run" }, - { title = "Sponsor", href = "https://github.com/sponsors/lpil" }, -] - -[dependencies] -gleam_stdlib = ">= 0.32.0 and < 1.0.0" -gleam_erlang = ">= 0.22.0 and < 1.0.0" - -[dev-dependencies] -gleeunit = ">= 1.0.0 and < 2.0.0" -logging = ">= 1.3.0 and < 2.0.0" diff --git a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@actor_Continue.hrl b/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@actor_Continue.hrl deleted file mode 100644 index 85677d1..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@actor_Continue.hrl +++ /dev/null @@ -1,4 +0,0 @@ --record(continue, { - state :: any(), - selector :: gleam@option:option(gleam@erlang@process:selector(any())) -}). diff --git a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@actor_Ready.hrl b/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@actor_Ready.hrl deleted file mode 100644 index 75faa95..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@actor_Ready.hrl +++ /dev/null @@ -1 +0,0 @@ --record(ready, {state :: any(), selector :: gleam@erlang@process:selector(any())}). diff --git a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@actor_Spec.hrl b/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@actor_Spec.hrl deleted file mode 100644 index 5287439..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@actor_Spec.hrl +++ /dev/null @@ -1,5 +0,0 @@ --record(spec, { - init :: fun(() -> gleam@otp@actor:init_result(any(), any())), - init_timeout :: integer(), - loop :: fun((any(), any()) -> gleam@otp@actor:next(any(), any())) -}). diff --git a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@intensity_tracker_IntensityTracker.hrl b/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@intensity_tracker_IntensityTracker.hrl deleted file mode 100644 index 3ed0b01..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@intensity_tracker_IntensityTracker.hrl +++ /dev/null @@ -1,5 +0,0 @@ --record(intensity_tracker, { - limit :: integer(), - period :: integer(), - events :: list(integer()) -}). diff --git a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@static_supervisor_Builder.hrl b/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@static_supervisor_Builder.hrl deleted file mode 100644 index b7641d7..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@static_supervisor_Builder.hrl +++ /dev/null @@ -1,7 +0,0 @@ --record(builder, { - strategy :: gleam@otp@static_supervisor:strategy(), - intensity :: integer(), - period :: integer(), - auto_shutdown :: gleam@otp@static_supervisor:auto_shutdown(), - children :: list(gleam@otp@static_supervisor:child_builder()) -}). diff --git a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@static_supervisor_ChildBuilder.hrl b/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@static_supervisor_ChildBuilder.hrl deleted file mode 100644 index 69c7e06..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@static_supervisor_ChildBuilder.hrl +++ /dev/null @@ -1,8 +0,0 @@ --record(child_builder, { - id :: binary(), - starter :: fun(() -> {ok, gleam@erlang@process:pid_()} | - {error, gleam@dynamic:dynamic_()}), - restart :: gleam@otp@static_supervisor:restart(), - significant :: boolean(), - child_type :: gleam@otp@static_supervisor:child_type() -}). diff --git a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@static_supervisor_Worker.hrl b/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@static_supervisor_Worker.hrl deleted file mode 100644 index 4b32c7a..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@static_supervisor_Worker.hrl +++ /dev/null @@ -1 +0,0 @@ --record(worker, {shutdown_ms :: integer()}). diff --git a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@supervisor_ChildSpec.hrl b/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@supervisor_ChildSpec.hrl deleted file mode 100644 index 7afd07f..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@supervisor_ChildSpec.hrl +++ /dev/null @@ -1,5 +0,0 @@ --record(child_spec, { - start :: fun((any()) -> {ok, gleam@erlang@process:subject(any())} | - {error, gleam@otp@actor:start_error()}), - returning :: fun((any(), gleam@erlang@process:subject(any())) -> any()) -}). diff --git a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@supervisor_Spec.hrl b/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@supervisor_Spec.hrl deleted file mode 100644 index b10bd9f..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@supervisor_Spec.hrl +++ /dev/null @@ -1,6 +0,0 @@ --record(spec, { - argument :: any(), - max_frequency :: integer(), - frequency_period :: integer(), - init :: fun((gleam@otp@supervisor:children(any())) -> gleam@otp@supervisor:children(any())) -}). diff --git a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@system_StatusInfo.hrl b/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@system_StatusInfo.hrl deleted file mode 100644 index 99ab4cb..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@system_StatusInfo.hrl +++ /dev/null @@ -1,7 +0,0 @@ --record(status_info, { - module :: gleam@erlang@atom:atom_(), - parent :: gleam@erlang@process:pid_(), - mode :: gleam@otp@system:mode(), - debug_state :: gleam@otp@system:debug_state(), - state :: gleam@dynamic:dynamic_() -}). diff --git a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@task_Exit.hrl b/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@task_Exit.hrl deleted file mode 100644 index 7c83874..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@task_Exit.hrl +++ /dev/null @@ -1 +0,0 @@ --record(exit, {reason :: gleam@dynamic:dynamic_()}). diff --git a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@task_Task.hrl b/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@task_Task.hrl deleted file mode 100644 index 4796470..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/include/gleam@otp@task_Task.hrl +++ /dev/null @@ -1,5 +0,0 @@ --record(task, { - owner :: gleam@erlang@process:pid_(), - pid :: gleam@erlang@process:pid_(), - subject :: gleam@erlang@process:subject(any()) -}). diff --git a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/actor.gleam b/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/actor.gleam deleted file mode 100644 index 72f6e9e..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/actor.gleam +++ /dev/null @@ -1,551 +0,0 @@ -//// This module provides the _Actor_ abstraction, one of the most common -//// building blocks of Gleam OTP programs. -//// -//// An Actor is a process like any other BEAM process and can be used to hold -//// state, execute code, and communicate with other processes by sending and -//// receiving messages. The advantage of using the actor abstraction over a bare -//// process is that it provides a single interface for commonly needed -//// functionality, including support for the [tracing and debugging -//// features in OTP][erlang-sys]. -//// -//// Gleam's Actor is similar to Erlang's `gen_server` and Elixir's `GenServer` -//// but differs in that it offers a fully typed interface. This different API is -//// why Gleam uses the name Actor rather than some variation of generic-server. -//// -//// [erlang-sys]: https://www.erlang.org/doc/man/sys.html -//// -//// ## Example -//// -//// An Actor can be used to create a client-server interaction between an Actor -//// (the server) and other processes (the clients). In this example we have an -//// Actor that works as a stack, allowing clients to push and pop elements. -//// -//// ```gleam -//// pub fn main() { -//// // Start the actor with initial state of an empty list, and the -//// // `handle_message` callback function (defined below). -//// // We assert that it starts successfully. -//// // -//// // In real-world Gleam OTP programs we would likely write wrapper functions -//// // called `start`, `push` `pop`, `shutdown` to start and interact with the -//// // Actor. We are not doing that here for the sake of showing how the Actor -//// // API works. -//// let assert Ok(my_actor) = actor.start([], handle_message) -//// -//// // We can send a message to the actor to push elements onto the stack. -//// process.send(my_actor, Push("Joe")) -//// process.send(my_actor, Push("Mike")) -//// process.send(my_actor, Push("Robert")) -//// -//// // The `Push` message expects no response, these messages are sent purely for -//// // the side effect of mutating the state held by the actor. -//// // -//// // We can also send the `Pop` message to take a value off of the actor's -//// // stack. This message expects a response, so we use `process.call` to send a -//// // message and wait until a reply is received. -//// // -//// // In this instance we are giving the actor 10 milliseconds to reply, if the -//// // `call` function doesn't get a reply within this time it will panic and -//// // crash the client process. -//// let assert Ok("Robert") = process.call(my_actor, Pop, 10) -//// let assert Ok("Mike") = process.call(my_actor, Pop, 10) -//// let assert Ok("Joe") = process.call(my_actor, Pop, 10) -//// -//// // The stack is now empty, so if we pop again the actor replies with an error. -//// let assert Error(Nil) = process.call(my_actor, Pop, 10) -//// -//// // Lastly, we can send a message to the actor asking it to shut down. -//// process.send(my_actor, Shutdown) -//// } -//// ``` -//// -//// Here is the code that is used to implement this actor: -//// -//// ```gleam -//// import gleam/erlang/process.{type Subject} -//// import gleam/otp/actor -//// -//// // First step of implementing the stack Actor is to define the message type that -//// // it can receive. -//// // -//// // The type of the elements in the stack is not fixed so a type parameter is used -//// // for it instead of a concrete type such as `String` or `Int`. -//// pub type Message(element) { -//// // The `Shutdown` message is used to tell the actor to stop. -//// // It is the simplest message type, it contains no data. -//// Shutdown -//// -//// // The `Push` message is used to add a new element to the stack. -//// // It contains the item to add, the type of which is the `element` -//// // parameterised type. -//// Push(push: element) -//// -//// // The `Pop` message is used to remove an element from the stack. -//// // It contains a `Subject`, which is used to send the response back to the -//// // message sender. In this case the reply is of type `Result(element, Nil)`. -//// Pop(reply_with: Subject(Result(element, Nil))) -//// } -//// -//// // The last part is to implement the `handle_message` callback function. -//// // -//// // This function is called by the Actor for each message it receives. -//// // Actor is single threaded and only does one thing at a time, so it handles -//// // messages sequentially and one at a time, in the order they are received. -//// // -//// // The function takes the message and the current state, and returns a data -//// // structure that indicates what to do next, along with the new state. -//// fn handle_message( -//// message: Message(e), -//// stack: List(e), -//// ) -> actor.Next(Message(e), List(e)) { -//// case message { -//// // For the `Shutdown` message we return the `actor.Stop` value, which causes -//// // the actor to discard any remaining messages and stop. -//// Shutdown -> actor.Stop(process.Normal) -//// -//// // For the `Push` message we add the new element to the stack and return -//// // `actor.continue` with this new stack, causing the actor to process any -//// // queued messages or wait for more. -//// Push(value) -> { -//// let new_state = [value, ..stack] -//// actor.continue(new_state) -//// } -//// -//// // For the `Pop` message we attempt to remove an element from the stack, -//// // sending it or an error back to the caller, before continuing. -//// Pop(client) -> -//// case stack { -//// [] -> { -//// // When the stack is empty we can't pop an element, so we send an -//// // error back. -//// process.send(client, Error(Nil)) -//// actor.continue([]) -//// } -//// -//// [first, ..rest] -> { -//// // Otherwise we send the first element back and use the remaining -//// // elements as the new state. -//// process.send(client, Ok(first)) -//// actor.continue(rest) -//// } -//// } -//// } -//// } -//// ``` - -// - -import gleam/dynamic.{type Dynamic} -import gleam/erlang/atom -import gleam/erlang/charlist.{type Charlist} -import gleam/erlang/process.{ - type ExitReason, type Pid, type Selector, type Subject, Abnormal, -} -import gleam/option.{type Option, None, Some} -import gleam/otp/system.{ - type DebugState, type Mode, type StatusInfo, type SystemMessage, GetState, - GetStatus, Resume, Running, StatusInfo, Suspend, Suspended, -} -import gleam/string - -type Message(message) { - /// A regular message excepted by the process - Message(message) - - /// An OTP system message, for debugging or maintenance - System(SystemMessage) - - /// An unexpected message - Unexpected(Dynamic) -} - -/// The type used to indicate what to do after handling a message. -/// -pub type Next(message, state) { - /// Continue handling messages. - /// - /// An optional selector can be provided to changes the messages that the - /// actor is handling. This replaces any selector that was previously given - /// in the actor's `init` callback, or in any previous `Next` value. - /// - Continue(state: state, selector: Option(Selector(message))) - - /// Stop handling messages and shut down. - /// - Stop(ExitReason) -} - -pub fn continue(state: state) -> Next(message, state) { - Continue(state, None) -} - -/// Provide a selector to change the messages that the actor is handling -/// going forward. This replaces any selector that was previously given -/// in the actor's `init` callback, or in any previous `Next` value. -/// -pub fn with_selector( - value: Next(message, state), - selector: Selector(message), -) -> Next(message, state) { - case value { - Continue(state, _) -> Continue(state, Some(selector)) - _ -> value - } -} - -/// The type used to indicate whether an actor has started successfully or not. -/// -pub type InitResult(state, message) { - /// The actor has successfully initialised. The actor can start handling - /// messages and actor's channel sender can be returned to the parent - /// process. - /// - Ready(state: state, selector: Selector(message)) - - /// The actor has failed to initialise. The actor shuts down and an error is - /// returned to the parent process. - /// - Failed(String) -} - -type Self(state, msg) { - Self( - /// The mode the actor is currently in, either active or suspended. - mode: Mode, - /// The pid of the process that started this actor. - parent: Pid, - /// The state of this actor, provided by the programmer. - state: state, - /// The subject that was created by this actor during initialisation. - subject: Subject(msg), - /// The selector that actor is currently using to reveive messages. This - /// can be changed by the `Next` value returned by the actor's `loop` callback. - selector: Selector(Message(msg)), - /// An opaque value used by the OTP system debug APIs. - debug_state: DebugState, - /// The message handling code provided by the programmer. - message_handler: fn(msg, state) -> Next(msg, state), - ) -} - -/// This data structure holds all the values required by the `start_spec` -/// function in order to create an actor. -/// -/// If you do not need to configure the initialisation behaviour of your actor -/// consider using the `start` function. -/// -pub type Spec(state, msg) { - Spec( - /// The initialisation functionality for the actor. This function is called - /// just after the actor starts but before the channel sender is returned - /// to the parent. - /// - /// This function is used to ensure that any required data or state is - /// correct. If this function returns an error it means that the actor has - /// failed to start and an error is returned to the parent. - /// - init: fn() -> InitResult(state, msg), - /// How many milliseconds the `init` function has to return before it is - /// considered to have taken too long and failed. - /// - init_timeout: Int, - /// This function is called to handle each message that the actor receives. - /// - loop: fn(msg, state) -> Next(msg, state), - ) -} - -// TODO: Check needed functionality here to be OTP compatible -fn exit_process(reason: ExitReason) -> ExitReason { - // TODO - reason -} - -fn receive_message(self: Self(state, msg)) -> Message(msg) { - let selector = case self.mode { - // When suspended we only respond to system messages - Suspended -> - process.new_selector() - |> selecting_system_messages - - // When running we respond to all messages - Running -> - // The actor needs to handle various different messages: - // - // - OTP system messages. These are handled by the actor for the - // programmer, they don't need to do anything. - // - Messages sent to the subject the actor creates during initialisation - // and returns to the parent. - // - Any arbitrary messages the programmer expects the actor to receive. - // For example, messages sent by a pubsub system where it does not - // support using the actor's subject. - // - Any unexpected messages. - // - // We add the handler for unexpected messages first so that the user - // supplied selector can override it if desired. - process.new_selector() - |> process.selecting_anything(Unexpected) - |> process.merge_selector(self.selector) - |> selecting_system_messages - } - - process.select_forever(selector) -} - -fn selecting_system_messages( - selector: Selector(Message(msg)), -) -> Selector(Message(msg)) { - selector - |> process.selecting_record3( - atom.create_from_string("system"), - convert_system_message, - ) -} - -@external(erlang, "gleam_otp_external", "convert_system_message") -fn convert_system_message(a: Dynamic, b: Dynamic) -> Message(msg) - -fn process_status_info(self: Self(state, msg)) -> StatusInfo { - StatusInfo( - module: atom.create_from_string("gleam@otp@actor"), - parent: self.parent, - mode: self.mode, - debug_state: self.debug_state, - state: dynamic.from(self.state), - ) -} - -fn loop(self: Self(state, msg)) -> ExitReason { - case receive_message(self) { - // An OTP system message. This is handled by the actor for the programmer, - // behind the scenes. - System(system) -> - case system { - GetState(callback) -> { - callback(dynamic.from(self.state)) - loop(self) - } - Resume(callback) -> { - callback() - loop(Self(..self, mode: Running)) - } - Suspend(callback) -> { - callback() - loop(Self(..self, mode: Suspended)) - } - GetStatus(callback) -> { - callback(process_status_info(self)) - loop(self) - } - } - - // An unexpected message. It this is reached then the programmer has not - // handled this, so log a warning. - Unexpected(message) -> { - log_warning( - charlist.from_string("Actor discarding unexpected message: ~s"), - [charlist.from_string(string.inspect(message))], - ) - loop(self) - } - - // A regular message that the programmer is expecting, either over the - // subject or some other messsage that the programmer's selector expects. - Message(msg) -> - case self.message_handler(msg, self.state) { - Stop(reason) -> exit_process(reason) - - Continue(state: state, selector: new_selector) -> { - let selector = - new_selector - |> option.map(init_selector(self.subject, _)) - |> option.unwrap(self.selector) - loop(Self(..self, state: state, selector: selector)) - } - } - } -} - -// TODO: replace this when we have Gleam bindings to the logger -@external(erlang, "logger", "warning") -fn log_warning(a: Charlist, b: List(Charlist)) -> Nil - -// Run automatically when the actor is first started. -fn initialise_actor( - spec: Spec(state, msg), - ack: Subject(Result(Subject(msg), ExitReason)), -) -> ExitReason { - // This is the main subject for the actor, the one that the actor.start - // functions return. - // Once the actor has been initialised this will be sent to the parent for - // the function to return. - let subject = process.new_subject() - - // Run the programmer supplied initialisation code. - let result = spec.init() - - case result { - // Init was OK, send the subject to the parent and start handling messages. - Ready(state, selector) -> { - let selector = init_selector(subject, selector) - // Signal to parent that the process has initialised successfully - process.send(ack, Ok(subject)) - // Start message receive loop - let self = - Self( - state: state, - parent: process.subject_owner(ack), - subject: subject, - selector: selector, - message_handler: spec.loop, - debug_state: system.debug_state([]), - mode: Running, - ) - loop(self) - } - - // The init failed. Exit with an error. - Failed(reason) -> { - process.send(ack, Error(Abnormal(reason))) - exit_process(Abnormal(reason)) - } - } -} - -fn init_selector(subject, selector) { - process.new_selector() - |> process.selecting(subject, Message) - |> process.merge_selector(process.map_selector(selector, Message)) -} - -pub type StartError { - InitTimeout - InitFailed(ExitReason) - InitCrashed(Dynamic) -} - -/// The result of starting a Gleam actor. -/// -/// This type is compatible with Gleam supervisors. If you wish to convert it -/// to a type compatible with Erlang supervisors see the `ErlangStartResult` -/// type and `erlang_start_result` function. -/// -pub type StartResult(msg) = - Result(Subject(msg), StartError) - -/// An Erlang supervisor compatible process start result. -/// -pub type ErlangStartResult = - Result(Pid, Dynamic) - -/// Convert a Gleam actor start result into an Erlang supervisor-compatible -/// process start result. -/// -pub fn to_erlang_start_result(res: StartResult(msg)) -> ErlangStartResult { - case res { - Ok(x) -> Ok(process.subject_owner(x)) - Error(x) -> Error(dynamic.from(x)) - } -} - -type StartInitMessage(msg) { - Ack(Result(Subject(msg), ExitReason)) - Mon(process.ProcessDown) -} - -// TODO: test init_timeout. Currently if we test it eunit prints an error from -// the process death. How do we avoid this? -// -/// Start an actor from a given specification. If the actor's `init` function -/// returns an error or does not return within `init_timeout` then an error is -/// returned. -/// -/// If you do not need to specify the initialisation behaviour of your actor -/// consider using the `start` function. -/// -pub fn start_spec(spec: Spec(state, msg)) -> Result(Subject(msg), StartError) { - let ack_subject = process.new_subject() - - let child = - process.start(linked: True, running: fn() { - initialise_actor(spec, ack_subject) - }) - - let monitor = process.monitor_process(child) - let selector = - process.new_selector() - |> process.selecting(ack_subject, Ack) - |> process.selecting_process_down(monitor, Mon) - - let result = case process.select(selector, spec.init_timeout) { - // Child started OK - Ok(Ack(Ok(channel))) -> Ok(channel) - - // Child initialiser returned an error - Ok(Ack(Error(reason))) -> Error(InitFailed(reason)) - - // Child went down while initialising - Ok(Mon(down)) -> Error(InitCrashed(down.reason)) - - // Child did not finish initialising in time - Error(Nil) -> { - // Unlink the child before killing it, so that we only return the error, - // but don't also send an exit message to the linked parent process. - process.unlink(child) - process.kill(child) - Error(InitTimeout) - } - } - - // Remove the monitor used for the starting of the actor as to avoid an extra - // message arriving at the parent if the child dies later. - process.demonitor_process(monitor) - - result -} - -/// Start an actor with a given initial state and message handling loop -/// function. -/// -/// This function returns a `Result` but it will always be `Ok` so it is safe -/// to use with `assert` if you are not starting this actor as part of a -/// supervision tree. -/// -/// If you wish to configure the initialisation behaviour of a new actor see -/// the `Spec` record and the `start_spec` function. -/// -pub fn start( - state: state, - loop: fn(msg, state) -> Next(msg, state), -) -> Result(Subject(msg), StartError) { - start_spec(Spec( - init: fn() { Ready(state, process.new_selector()) }, - loop: loop, - init_timeout: 5000, - )) -} - -/// Send a message over a given channel. -/// -/// This is a re-export of `process.send`, for the sake of convenience. -/// -pub fn send(subject: Subject(msg), msg: msg) -> Nil { - process.send(subject, msg) -} - -/// Send a synchronous message and wait for a response from the receiving -/// process. -/// -/// If a reply is not received within the given timeout then the sender process -/// crashes. If you wish to receive a `Result` rather than crashing see the -/// `process.try_call` function. -/// -/// This is a re-export of `process.call`, for the sake of convenience. -/// -pub fn call( - subject: Subject(message), - make_message: fn(Subject(reply)) -> message, - timeout: Int, -) -> reply { - process.call(subject, make_message, timeout) -} diff --git a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/intensity_tracker.gleam b/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/intensity_tracker.gleam deleted file mode 100644 index 7d9c4f2..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/intensity_tracker.gleam +++ /dev/null @@ -1,45 +0,0 @@ -//// The intensity tracker is used to monitor how frequently an event happens, -//// erroring if it happens too many times within a period of time. - -import gleam/list - -pub opaque type IntensityTracker { - IntensityTracker(limit: Int, period: Int, events: List(Int)) -} - -pub type TooIntense { - TooIntense -} - -pub fn new(limit limit: Int, period period: Int) -> IntensityTracker { - IntensityTracker(limit: limit, period: period, events: []) -} - -@external(erlang, "erlang", "monotonic_time") -fn monotonic_time(a: Int) -> Int - -fn now_seconds() -> Int { - monotonic_time(1) -} - -pub fn trim_window(events: List(Int), now: Int, period: Int) -> List(Int) { - case events { - [] -> [] - [event, ..events] -> - case now < event + period { - True -> [event, ..trim_window(events, now, period)] - False -> [] - } - } -} - -pub fn add_event( - tracker: IntensityTracker, -) -> Result(IntensityTracker, TooIntense) { - let now = now_seconds() - let events = trim_window([now, ..tracker.events], now, tracker.period) - case list.length(events) > tracker.limit { - True -> Error(TooIntense) - False -> Ok(IntensityTracker(..tracker, events: events)) - } -} diff --git a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/port.gleam b/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/port.gleam deleted file mode 100644 index 73d7b00..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/port.gleam +++ /dev/null @@ -1,12 +0,0 @@ -/// Deprecated: Use gleam_erlang Port instead. -/// -/// Ports are how code running on the Erlang virtual machine interacts with -/// the outside world. Bytes of data can be sent to and read from ports, -/// providing a form of message passing to an external program or resource. -/// -/// For more information on ports see the [Erlang ports documentation][1]. -/// -/// [1]: https://erlang.org/doc/reference_manual/ports.html -/// -@deprecated("Use gleam_erlang Port instead") -pub type Port diff --git a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/static_supervisor.gleam b/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/static_supervisor.gleam deleted file mode 100644 index 27d4fe1..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/static_supervisor.gleam +++ /dev/null @@ -1,306 +0,0 @@ -//// Bindings to Erlang/OTP's `supervisor` module. -//// -//// For further detail see the Erlang documentation: -//// . -//// -//// # Example -//// -//// ```gleam -//// import gleam/erlang/process.{type Pid} -//// import gleam/otp/static_supervisor as sup -//// -//// pub fn start_supervisor() { -//// sup.new(sup.OneForOne) -//// |> sup.add(sup.worker_child("db", start_database_connection)) -//// |> sup.add(sup.worker_child("workers", start_workers)) -//// |> sup.add(sup.worker_child("web", start_http_server)) -//// |> sup.start_link -//// } -//// ``` - -import gleam/dict.{type Dict} -import gleam/dynamic.{type Dynamic} -import gleam/erlang/atom.{type Atom} -import gleam/erlang/process.{type Pid} -import gleam/list -import gleam/result - -pub type Strategy { - /// If one child process terminates and is to be restarted, only that child - /// process is affected. This is the default restart strategy. - OneForOne - - /// If one child process terminates and is to be restarted, all other child - /// processes are terminated and then all child processes are restarted. - OneForAll - - /// If one child process terminates and is to be restarted, the 'rest' of the - /// child processes (that is, the child processes after the terminated child - /// process in the start order) are terminated. Then the terminated child - /// process and all child processes after it are restarted. - RestForOne -} - -/// A supervisor can be configured to automatically shut itself down with exit -/// reason shutdown when significant children terminate with the auto_shutdown -/// key in the above map. -pub type AutoShutdown { - /// Automic shutdown is disabled. This is the default setting. - /// - /// With auto_shutdown set to never, child specs with the significant flag - /// set to true are considered invalid and will be rejected. - Never - /// The supervisor will shut itself down when any significant child - /// terminates, that is, when a transient significant child terminates - /// normally or when a temporary significant child terminates normally or - /// abnormally. - AnySignificant - /// The supervisor will shut itself down when all significant children have - /// terminated, that is, when the last active significant child terminates. - /// The same rules as for any_significant apply. - AllSignificant -} - -pub opaque type Builder { - Builder( - strategy: Strategy, - intensity: Int, - period: Int, - auto_shutdown: AutoShutdown, - children: List(ChildBuilder), - ) -} - -pub fn new(strategy strategy: Strategy) -> Builder { - Builder( - strategy: strategy, - intensity: 2, - period: 5, - auto_shutdown: Never, - children: [], - ) -} - -/// To prevent a supervisor from getting into an infinite loop of child -/// process terminations and restarts, a maximum restart intensity is -/// defined using two integer values specified with keys intensity and -/// period in the above map. Assuming the values MaxR for intensity and MaxT -/// for period, then, if more than MaxR restarts occur within MaxT seconds, -/// the supervisor terminates all child processes and then itself. The -/// termination reason for the supervisor itself in that case will be -/// shutdown. -/// -/// Intensity defaults to 1 and period defaults to 5. -pub fn restart_tolerance( - builder: Builder, - intensity intensity: Int, - period period: Int, -) -> Builder { - Builder(..builder, intensity: intensity, period: period) -} - -/// A supervisor can be configured to automatically shut itself down with -/// exit reason shutdown when significant children terminate. -pub fn auto_shutdown(builder: Builder, value: AutoShutdown) -> Builder { - Builder(..builder, auto_shutdown: value) -} - -/// Restart defines when a terminated child process must be restarted. -pub type Restart { - /// A permanent child process is always restarted. - Permanent - /// A transient child process is restarted only if it terminates abnormally, - /// that is, with another exit reason than `normal`, `shutdown`, or - /// `{shutdown,Term}`. - Transient - /// A temporary child process is never restarted (even when the supervisor's - /// restart strategy is `RestForOne` or `OneForAll` and a sibling's death - /// causes the temporary process to be terminated). - Temporary -} - -pub type ChildType { - Worker( - /// The number of milliseconds the child is given to shut down. The - /// supervisor tells the child process to terminate by calling - /// `exit(Child,shutdown)` and then wait for an exit signal with reason - /// shutdown back from the child process. If no exit signal is received - /// within the specified number of milliseconds, the child process is - /// unconditionally terminated using `exit(Child,kill)`. - shutdown_ms: Int, - ) - Supervisor -} - -pub opaque type ChildBuilder { - ChildBuilder( - /// id is used to identify the child specification internally by the - /// supervisor. - /// - /// Notice that this identifier on occations has been called "name". As far - /// as possible, the terms "identifier" or "id" are now used but to keep - /// backward compatibility, some occurences of "name" can still be found, for - /// example in error messages. - id: String, - /// A function to call to start the child process. - starter: fn() -> Result(Pid, Dynamic), - /// When the child is to be restarted. See the `Restart` documentation for - /// more. - /// - /// You most likely want the `Permanent` variant. - restart: Restart, - /// This defines if a child is considered significant for automatic - /// self-shutdown of the supervisor. - /// - /// You most likely do not want to consider any children significant. - /// - /// This will be ignored if the supervisor auto shutdown is set to `Never`, - /// which is the default. - significant: Bool, - /// Whether the child is a supervisor or not. - child_type: ChildType, - ) -} - -pub fn start_link(builder: Builder) -> Result(Pid, Dynamic) { - let flags = - dict.new() - |> property("strategy", builder.strategy) - |> property("intensity", builder.intensity) - |> property("period", builder.period) - |> property("auto_shutdown", builder.auto_shutdown) - - let children = builder.children |> list.reverse |> list.map(convert_child) - - erlang_start_link(#(flags, children)) -} - -@external(erlang, "gleam_otp_external", "static_supervisor_start_link") -fn erlang_start_link( - args: #(Dict(Atom, Dynamic), List(Dict(Atom, Dynamic))), -) -> Result(Pid, Dynamic) - -/// Add a child to the supervisor. -pub fn add(builder: Builder, child: ChildBuilder) -> Builder { - Builder(..builder, children: [child, ..builder.children]) -} - -/// A regular child that is not also a supervisor. -/// -/// id is used to identify the child specification internally by the -/// supervisor. -/// Notice that this identifier on occations has been called "name". As far -/// as possible, the terms "identifier" or "id" are now used but to keep -/// backward compatibility, some occurences of "name" can still be found, for -/// example in error messages. -/// -pub fn worker_child( - id id: String, - run starter: fn() -> Result(Pid, whatever), -) -> ChildBuilder { - ChildBuilder( - id: id, - starter: fn() { starter() |> result.map_error(dynamic.from) }, - restart: Permanent, - significant: False, - child_type: Worker(5000), - ) -} - -/// A special child that is a supervisor itself. -/// -/// id is used to identify the child specification internally by the -/// supervisor. -/// Notice that this identifier on occations has been called "name". As far -/// as possible, the terms "identifier" or "id" are now used but to keep -/// backward compatibility, some occurences of "name" can still be found, for -/// example in error messages. -/// -pub fn supervisor_child( - id id: String, - run starter: fn() -> Result(Pid, whatever), -) -> ChildBuilder { - ChildBuilder( - id: id, - starter: fn() { starter() |> result.map_error(dynamic.from) }, - restart: Permanent, - significant: False, - child_type: Supervisor, - ) -} - -/// This defines if a child is considered significant for automatic -/// self-shutdown of the supervisor. -/// -/// You most likely do not want to consider any children significant. -/// -/// This will be ignored if the supervisor auto shutdown is set to `Never`, -/// which is the default. -/// -/// The default value for significance is `False`. -pub fn significant(child: ChildBuilder, significant: Bool) -> ChildBuilder { - ChildBuilder(..child, significant: significant) -} - -/// This defines the amount of milliseconds a child has to shut down before -/// being brutal killed by the supervisor. -/// -/// If not set the default for a child is 5000ms. -/// -/// This will be ignored if the child is a supervisor itself. -/// -pub fn timeout(child: ChildBuilder, ms ms: Int) -> ChildBuilder { - case child.child_type { - Worker(_) -> ChildBuilder(..child, child_type: Worker(ms)) - _ -> child - } -} - -/// When the child is to be restarted. See the `Restart` documentation for -/// more. -/// -/// The default value for restart is `Permanent`. -pub fn restart(child: ChildBuilder, restart: Restart) -> ChildBuilder { - ChildBuilder(..child, restart: restart) -} - -fn convert_child(child: ChildBuilder) -> Dict(Atom, Dynamic) { - let mfa = #( - atom.create_from_string("erlang"), - atom.create_from_string("apply"), - [dynamic.from(child.starter), dynamic.from([])], - ) - - let #(type_, shutdown) = case child.child_type { - Supervisor -> #( - atom.create_from_string("supervisor"), - dynamic.from(atom.create_from_string("infinity")), - ) - Worker(timeout) -> #( - atom.create_from_string("worker"), - dynamic.from(timeout), - ) - } - - dict.new() - |> property("id", child.id) - |> property("start", mfa) - |> property("restart", child.restart) - |> property("significant", child.significant) - |> property("type", type_) - |> property("shutdown", shutdown) -} - -fn property( - dict: Dict(Atom, Dynamic), - key: String, - value: anything, -) -> Dict(Atom, Dynamic) { - dict.insert(dict, atom.create_from_string(key), dynamic.from(value)) -} - -// Callback used by the Erlang supervisor module. -@internal -pub fn init(start_data: Dynamic) -> Result(Dynamic, never) { - Ok(start_data) -} diff --git a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/supervisor.gleam b/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/supervisor.gleam deleted file mode 100644 index c293a15..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/supervisor.gleam +++ /dev/null @@ -1,459 +0,0 @@ -//// A supervisor that can pass state from older children to younger ones. -//// -//// If you don't need this consider using the `gleam/otp/static_supervisor` -//// module instead. - -// TODO: specify amount of time permitted for shut-down -import gleam/erlang/node.{type Node} -import gleam/erlang/process.{type Pid, type Subject} -import gleam/option.{type Option, None, Some} -import gleam/otp/actor.{type StartError} -import gleam/otp/intensity_tracker.{type IntensityTracker} -import gleam/result -import gleam/string - -/// This data structure holds all the values required by the `start_spec` -/// function in order to create an supervisor. -/// -/// If you do not need to configure the behaviour of your supervisor consider -/// using the `start` function. -/// -pub type Spec(argument, return) { - Spec( - argument: argument, - max_frequency: Int, - frequency_period: Int, - init: fn(Children(argument)) -> Children(return), - ) -} - -/// This type represents the starting children of a supervisor within the -/// `init` function. -/// -pub opaque type Children(argument) { - Ready(Starter(argument)) - Failed(ChildStartError) -} - -/// This type contains all the information required to start a new child and -/// add it to the `Children`. -/// -/// This is typically created with the `worker` function. -/// -pub opaque type ChildSpec(msg, argument, returning) { - ChildSpec( - // TODO: merge this into one field - start: fn(argument) -> Result(Subject(msg), StartError), - returning: fn(argument, Subject(msg)) -> returning, - ) -} - -type ChildStartError { - ChildStartError(previous_pid: Option(Pid), error: StartError) -} - -pub opaque type Message { - Exit(process.ExitMessage) - RetryRestart(Pid) -} - -type Instruction { - StartAll - StartFrom(Pid) -} - -type State(a) { - State( - restarts: IntensityTracker, - starter: Starter(a), - retry_restarts: Subject(Pid), - ) -} - -type Starter(argument) { - Starter( - argument: argument, - exec: Option( - fn(Instruction) -> - Result(#(Starter(argument), Instruction), ChildStartError), - ), - ) -} - -type Child(argument) { - Child(pid: Pid, argument: argument) -} - -fn start_child( - child_spec: ChildSpec(msg, argument_in, argument_out), - argument: argument_in, -) -> Result(Child(argument_out), ChildStartError) { - use subject <- result.then( - child_spec.start(argument) - |> result.map_error(ChildStartError(None, _)), - ) - - Ok(Child( - pid: process.subject_owner(subject), - // Merge the new child's pid into the argument to produce the new argument - // used to start any remaining children. - argument: child_spec.returning(argument, subject), - )) -} - -// TODO: more sophsiticated stopping of processes. i.e. give supervisors -// more time to shut down. -fn shutdown_child(pid: Pid, _spec: ChildSpec(msg, arg_1, arg_2)) -> Nil { - process.send_exit(pid) -} - -fn perform_instruction_for_child( - argument: argument_in, - instruction: Instruction, - child_spec: ChildSpec(msg, argument_in, argument_out), - child: Child(argument_out), -) -> Result(#(Child(argument_out), Instruction), ChildStartError) { - let current = child.pid - case instruction { - // This child is older than the StartFrom target, we don't need to - // restart it - StartFrom(target) if target != current -> Ok(#(child, instruction)) - - // This pid either is the cause of the problem, or we have the StartAll - // instruction. Either way it and its younger siblings need to be restarted. - _ -> { - shutdown_child(current, child_spec) - use child <- result.then(start_child(child_spec, argument)) - Ok(#(child, StartAll)) - } - } -} - -fn add_child_to_starter( - starter: Starter(argument_in), - child_spec: ChildSpec(msg, argument_in, argument_out), - child: Child(argument_out), -) -> Starter(argument_out) { - let starter = fn( - instruction, - // Restart the older children. We use `try` to return early if the older - // children failed to start - ) { - use #(starter, instruction) <- result.then(case starter.exec { - Some(start) -> start(instruction) - None -> Ok(#(starter, instruction)) - }) - - // Perform the instruction, restarting the child as required - use #(child, instruction) <- result.then(perform_instruction_for_child( - starter.argument, - instruction, - child_spec, - child, - )) - - // Create a new starter for the next time the supervisor needs to restart - let starter = add_child_to_starter(starter, child_spec, child) - - Ok(#(starter, instruction)) - } - - Starter(exec: Some(starter), argument: child.argument) -} - -fn start_and_add_child( - state: Starter(argument_0), - child_spec: ChildSpec(msg, argument_0, argument_1), -) -> Children(argument_1) { - case start_child(child_spec, state.argument) { - Ok(child) -> Ready(add_child_to_starter(state, child_spec, child)) - Error(reason) -> Failed(reason) - } -} - -/// Add a child to the collection of children of the supervisor -/// -/// This function starts the child from the child spec. -/// -pub fn add( - children: Children(argument), - child_spec: ChildSpec(msg, argument, new_argument), -) -> Children(new_argument) { - case children { - // If one of the previous children has failed then we cannot continue - Failed(fail) -> Failed(fail) - - // If everything is OK so far then we can add the child - Ready(state) -> start_and_add_child(state, child_spec) - } -} - -// TODO: test -// TODO: unlimitd shut down duration -/// Prepare a new supervisor type child. -/// -/// If you wish to prepare a new non-supervisor type child see the `worker` -/// function. -/// -/// If you wish to change the type of the argument for later children see the -/// `returning` function. -/// -/// Note: Gleam supervisors do not yet support different shutdown periods per -/// child so this function is currently identical in behaviour to `worker`. It is -/// recommended to use this function for supervisor children nevertheless so the -/// correct shut down behaviour is used in later releases of this library. -/// -pub fn supervisor( - start: fn(argument) -> Result(Subject(msg), StartError), -) -> ChildSpec(msg, argument, argument) { - ChildSpec(start: start, returning: fn(argument, _channel) { argument }) -} - -/// Prepare a new worker type child. -/// -/// If you wish to prepare a new supervisor type child see the `supervisor` -/// function. -/// -/// If you wish to change the type of the argument for later children see the -/// `returning` function. -/// -/// ## Examples -/// -/// ```gleam -/// worker(fn(argument) { -/// my_actor.start(argument) -/// }) -/// ``` -/// -pub fn worker( - start: fn(argument) -> Result(Subject(msg), StartError), -) -> ChildSpec(msg, argument, argument) { - ChildSpec(start: start, returning: fn(argument, _channel) { argument }) -} - -// TODO: test -/// As each child is added to a supervisors children a new argument is prepared -/// with which to start the next child. By default argument is the same as the -/// previous argument, but this function can be used to change it to something -/// else by passing a function that takes the previous argument and the sender -/// of the previous child. -/// -pub fn returning( - child: ChildSpec(msg, argument_a, argument_b), - updater: fn(argument_a, Subject(msg)) -> argument_c, -) -> ChildSpec(msg, argument_a, argument_c) { - ChildSpec(start: child.start, returning: updater) -} - -fn init( - spec: Spec(argument, return), -) -> actor.InitResult(State(return), Message) { - // Create a subject so that we can asynchronously retry restarting when we - // fail to bring an exited child - let retry = process.new_subject() - - // Trap exits so that we get a message when a child crashes - process.trap_exits(True) - - // Combine selectors - let selector = - process.new_selector() - |> process.selecting(retry, RetryRestart) - |> process.selecting_trapped_exits(Exit) - - // Start any children - let result = - Starter(argument: spec.argument, exec: None) - |> Ready - |> spec.init - - // Pass back up the result - case result { - Ready(starter) -> { - let restarts = - intensity_tracker.new( - limit: spec.max_frequency, - period: spec.frequency_period, - ) - let state = - State(starter: starter, restarts: restarts, retry_restarts: retry) - actor.Ready(state, selector) - } - - Failed(error) -> - actor.Failed(case error.error { - actor.InitTimeout -> "Child initialisation timed out" - actor.InitCrashed(reason) -> - string.append( - "Child crashed during initialisation: ", - string.inspect(reason), - ) - actor.InitFailed(reason) -> - string.append( - "Child failed to start during initialisation: ", - string.inspect(reason), - ) - }) - } -} - -type HandleExitError { - RestartFailed(pid: Pid, restarts: IntensityTracker) - TooManyRestarts -} - -fn handle_exit(pid: Pid, state: State(a)) -> actor.Next(Message, State(a)) { - let outcome = { - // If we are handling an exit then we must have some children - let assert Some(start) = state.starter.exec - - // Check to see if there has been too many restarts in this period - use restarts <- result.then( - state.restarts - |> intensity_tracker.add_event - |> result.map_error(fn(_) { TooManyRestarts }), - ) - - // Restart the exited child and any following children - use #(starter, _) <- result.then( - start(StartFrom(pid)) - |> result.map_error(fn(e: ChildStartError) { - RestartFailed(option.unwrap(e.previous_pid, pid), restarts) - }), - ) - - Ok(State(..state, starter: starter, restarts: restarts)) - } - - case outcome { - Ok(state) -> actor.continue(state) - Error(RestartFailed(failed_child, restarts)) -> { - // Asynchronously enqueue the restarting of this child again as we were - // unable to restart them this time. We do this asynchronously as we want - // to have a chance to handle any system messages that have come in. - process.send(state.retry_restarts, failed_child) - let state = State(..state, restarts: restarts) - actor.continue(state) - } - Error(TooManyRestarts) -> - actor.Stop(process.Abnormal( - "Child processes restarted too many times within allowed period", - )) - } -} - -fn loop( - message: Message, - state: State(argument), -) -> actor.Next(Message, State(argument)) { - case message { - Exit(exit_message) -> handle_exit(exit_message.pid, state) - RetryRestart(pid) -> handle_exit(pid, state) - } -} - -/// Start a supervisor from a given specification. -/// -/// -/// ## Examples -/// -/// ```gleam -/// let worker = worker(my_actor.start) -/// -/// let children = fn(children) { -/// children -/// |> add(worker) -/// |> add(worker) -/// } -/// -/// start_spec(Spec( -/// argument: initial_state, -/// frequency_period: 1, -/// max_frequency: 5, -/// init: children, -/// )) -/// ``` -/// -pub fn start_spec(spec: Spec(a, b)) -> Result(Subject(Message), StartError) { - actor.start_spec(actor.Spec( - init: fn() { init(spec) }, - loop: loop, - init_timeout: 60_000, - )) -} - -/// Start a supervisor from a given `init` function. -/// -/// The init argument passed to children will be `Nil` and the maximum restart -/// intensity will be 1 restart per 5 seconds (the same as the default for -/// [Erlang supervisors][erl-sup]). If you wish to specify these values, see -/// the `start_spec` function and the `Spec` type. -/// -/// [erl-sup]: https://www.erlang.org/doc/design_principles/sup_princ.html#maximum-restart-intensity -/// -/// ## Examples -/// -/// ```gleam -/// let worker = worker(my_actor.start) -/// -/// let children = fn(children) { -/// children -/// |> add(worker) -/// |> add(worker) -/// } -/// -/// start(children) -/// ``` -/// -pub fn start( - init: fn(Children(Nil)) -> Children(a), -) -> Result(Subject(Message), StartError) { - start_spec(Spec( - init: init, - argument: Nil, - max_frequency: 1, - frequency_period: 5, - )) -} - -/// A type used to describe the situation in which an Erlang based application -/// is starting. -/// -/// For more information see the [Erlang distributed application -/// documentation][1] and the Learn You Some Erlang chapter on [distributed -/// applications][2]. -/// -/// [1]: https://erlang.org/doc/design_principles/distributed_applications.html -/// [2]: https://learnyousomeerlang.com/distributed-otp-applications -/// -pub type ApplicationStartMode { - Normal - Takeover(Node) - Failover(Node) -} - -pub type ApplicationStop - -@external(erlang, "gleam_otp_external", "application_stopped") -pub fn application_stopped() -> ApplicationStop - -/// The result of starting a Gleam actor. -/// -/// This type is compatible with Gleam supervisors. If you wish to convert it -/// to a type compatible with Erlang supervisors see the `ErlangStartResult` -/// type and `erlang_start_result` function. -/// -pub type StartResult(msg) = - actor.StartResult(msg) - -/// An Erlang supervisor compatible process start result. -/// -pub type ErlangStartResult = - actor.ErlangStartResult - -/// Convert a Gleam actor start result into an Erlang supervisor compatible -/// process start result. -/// -pub fn to_erlang_start_result(res: StartResult(msg)) -> ErlangStartResult { - actor.to_erlang_start_result(res) -} diff --git a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/system.gleam b/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/system.gleam deleted file mode 100644 index 8916116..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/system.gleam +++ /dev/null @@ -1,95 +0,0 @@ -import gleam/dynamic.{type Dynamic} -import gleam/erlang/atom.{type Atom} -import gleam/erlang/process.{type Pid} - -pub type Mode { - /// Currently handling message as normal. - Running - /// Termporarily not handling messages, other than system messages. - Suspended -} - -pub type DebugOption { - NoDebug -} - -pub type DebugState - -@external(erlang, "sys", "debug_options") -pub fn debug_state(a: List(DebugOption)) -> DebugState - -pub type StatusInfo { - StatusInfo( - module: Atom, - parent: Pid, - mode: Mode, - debug_state: DebugState, - state: Dynamic, - ) -} - -// TODO: document -// TODO: implement remaining messages -pub type SystemMessage { - // {replace_state, StateFn} - // {change_code, Mod, Vsn, Extra} - // {terminate, Reason} - // {debug, {log, Flag}} - // {debug, {trace, Flag}} - // {debug, {log_to_file, FileName}} - // {debug, {statistics, Flag}} - // {debug, no_debug} - // {debug, {install, {Func, FuncState}}} - // {debug, {install, {FuncId, Func, FuncState}}} - // {debug, {remove, FuncOrId}} - Resume(fn() -> Nil) - Suspend(fn() -> Nil) - GetState(fn(Dynamic) -> Nil) - GetStatus(fn(StatusInfo) -> Nil) -} - -type DoNotLeak - -/// Get the state of a given OTP compatible process. This function is only -/// intended for debugging. -/// -/// Requires Erlang/OTP 26.1 or newer, as the underlying interface changed -/// in [OTP-18633][1] from a literal type to a result type. -/// -/// For more information see the [Erlang documentation][2]. -/// -/// [1]: https://www.erlang.org/patches/otp-26.1#stdlib-5.1 -/// [2]: https://erlang.org/doc/man/sys.html#get_state-1 -/// -@external(erlang, "sys", "get_state") -pub fn get_state(from from: Pid) -> Dynamic - -@external(erlang, "sys", "suspend") -fn erl_suspend(a: Pid) -> DoNotLeak - -/// Request an OTP compatible process to suspend, causing it to only handle -/// system messages. -/// -/// For more information see the [Erlang documentation][1]. -/// -/// [1]: https://erlang.org/doc/man/sys.html#suspend-1 -/// -pub fn suspend(pid: Pid) -> Nil { - erl_suspend(pid) - Nil -} - -@external(erlang, "sys", "resume") -fn erl_resume(from from: Pid) -> DoNotLeak - -/// Request a suspended OTP compatible process to result, causing it to handle -/// all messages rather than only system messages. -/// -/// For more information see the [Erlang documentation][1]. -/// -/// [1]: https://erlang.org/doc/man/sys.html#resume-1 -/// -pub fn resume(pid: Pid) -> Nil { - erl_resume(pid) - Nil -} diff --git a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/task.gleam b/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/task.gleam deleted file mode 100644 index 70b7802..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam/otp/task.gleam +++ /dev/null @@ -1,457 +0,0 @@ -//// A task is a kind of process that computes a value and then sends the result back -//// to its parent. Commonly multiple tasks are used to compute multiple things at -//// once. -//// -//// If you do not care to receive a result back at the end then you should not -//// use this module, `actor` or `process` are likely more suitable. -//// -//// ```gleam -//// let task = task.async(fn() { do_some_work() }) -//// let value = do_some_other_work() -//// value + task.await(task, 100) -//// ``` -//// -//// Tasks spawned with async can be awaited on by their caller process (and -//// only their caller) as shown in the example above. They are implemented by -//// spawning a process that sends a message to the caller once the given -//// computation is performed. -//// -//// There are some important things to consider when using tasks: -//// -//// 1. If you are using async tasks, you must await a reply as they are always -//// sent. -//// -//// 2. Tasks link the caller and the spawned process. This means that, -//// if the caller crashes, the task will crash too and vice-versa. This is -//// on purpose: if the process meant to receive the result no longer -//// exists, there is no purpose in completing the computation. -//// -//// 3. A task's callback function must complete by returning or panicking. -//// It must not `exit` with the reason "normal". -//// -//// This module is inspired by Elixir's [Task module][1]. -//// -//// [1]: https://hexdocs.pm/elixir/master/Task.html -//// - -import gleam/dict -import gleam/dynamic.{type Dynamic} -import gleam/erlang/process.{type Pid, type Selector, type Subject} -import gleam/function -import gleam/list -import gleam/option.{type Option, None, Some} - -pub opaque type Task(value) { - Task(owner: Pid, pid: Pid, subject: Subject(value)) -} - -// TODO: test -/// Spawn a task process that calls a given function in order to perform some -/// work. The result of this function is sent back to the parent and can be -/// received using the `await` function. -/// -/// See the top level module documentation for more information on async/await. -/// -pub fn async(work: fn() -> value) -> Task(value) { - let owner = process.self() - let subject = process.new_subject() - let pid = - process.start(linked: True, running: fn() { process.send(subject, work()) }) - Task(owner: owner, pid: pid, subject: subject) -} - -pub type AwaitError { - Timeout - Exit(reason: Dynamic) -} - -// We can only wait on a task if we are the owner of it so crash if we are -// waiting on a task we don't own. -fn assert_owner(task: Task(a)) -> Nil { - let self = process.self() - case task.owner == self { - True -> Nil - False -> - process.send_abnormal_exit( - self, - "awaited on a task that does not belong to this process", - ) - } -} - -// TODO: test -/// Wait for the value computed by a task. -/// -/// If the a value is not received before the timeout has elapsed then an error -/// is returned. -/// -pub fn try_await(task: Task(value), timeout: Int) -> Result(value, AwaitError) { - assert_owner(task) - let selector = - process.new_selector() - |> process.selecting(task.subject, function.identity) - case process.select(selector, timeout) { - // The task process has sent back a value - Ok(x) -> Ok(x) - - // The task process is alive but has not sent a value yet - Error(Nil) -> Error(Timeout) - } -} - -/// Wait for the value computed by a task. -/// -/// If the a value is not received before the timeout has elapsed or if the -/// task process crashes then this function crashes. -/// -pub fn await(task: Task(value), timeout: Int) -> value { - let assert Ok(value) = try_await(task, timeout) - value -} - -/// Get the `Pid` for a task. -/// -pub fn pid(task: Task(value)) -> Pid { - task.pid -} - -/// Wait endlessly for the value computed by a task. -/// -/// Be Careful! Like `try_await_forever`, this function does not return until -/// there is a value to receive. -/// -/// If the task process crashes then this function crashes. -/// -pub fn await_forever(task: Task(value)) -> value { - assert_owner(task) - let selector = - process.new_selector() - |> process.selecting(task.subject, function.identity) - process.select_forever(selector) -} - -type Message2(t1, t2) { - M2FromSubject1(t1) - M2FromSubject2(t2) - M2Timeout -} - -/// Wait for the values computed by multiple tasks. -/// -/// For each task, if the a value is not received before the timeout has -/// elapsed then an error is returned. -/// -pub fn try_await2( - task1: Task(t1), - task2: Task(t2), - timeout: Int, -) -> #(Result(t1, AwaitError), Result(t2, AwaitError)) { - assert_owner(task1) - assert_owner(task2) - - let timeout_subject = process.new_subject() - let timer = process.send_after(timeout_subject, timeout, M2Timeout) - - process.new_selector() - |> process.selecting(task1.subject, M2FromSubject1) - |> process.selecting(task2.subject, M2FromSubject2) - |> process.selecting(timeout_subject, function.identity) - |> try_await2_loop(None, None, timer) -} - -fn try_await2_loop( - selector: Selector(Message2(t1, t2)), - t1: Option(Result(t1, AwaitError)), - t2: Option(Result(t2, AwaitError)), - timer: process.Timer, -) -> #(Result(t1, AwaitError), Result(t2, AwaitError)) { - case t1, t2 { - Some(t1), Some(t2) -> { - process.cancel_timer(timer) - #(t1, t2) - } - - _, _ -> { - case process.select_forever(selector) { - // The task process has sent back a value - M2FromSubject1(x) -> { - let t1 = Some(Ok(x)) - try_await2_loop(selector, t1, t2, timer) - } - M2FromSubject2(x) -> { - let t2 = Some(Ok(x)) - try_await2_loop(selector, t1, t2, timer) - } - - M2Timeout -> { - #( - option.unwrap(t1, Error(Timeout)), - option.unwrap(t2, Error(Timeout)), - ) - } - } - } - } -} - -type Message3(t1, t2, t3) { - M3FromSubject1(t1) - M3FromSubject2(t2) - M3FromSubject3(t3) - M3Timeout -} - -/// Wait for the values computed by multiple tasks. -/// -/// For each task, if the a value is not received before the timeout has -/// elapsed then an error is returned. -/// -pub fn try_await3( - task1: Task(t1), - task2: Task(t2), - task3: Task(t3), - timeout: Int, -) -> #(Result(t1, AwaitError), Result(t2, AwaitError), Result(t3, AwaitError)) { - assert_owner(task1) - assert_owner(task2) - assert_owner(task3) - - let timeout_subject = process.new_subject() - let timer = process.send_after(timeout_subject, timeout, M3Timeout) - - process.new_selector() - |> process.selecting(task1.subject, M3FromSubject1) - |> process.selecting(task2.subject, M3FromSubject2) - |> process.selecting(task3.subject, M3FromSubject3) - |> process.selecting(timeout_subject, function.identity) - |> try_await3_loop(None, None, None, timer) -} - -fn try_await3_loop( - selector: Selector(Message3(t1, t2, t3)), - t1: Option(Result(t1, AwaitError)), - t2: Option(Result(t2, AwaitError)), - t3: Option(Result(t3, AwaitError)), - timer: process.Timer, -) -> #(Result(t1, AwaitError), Result(t2, AwaitError), Result(t3, AwaitError)) { - case t1, t2, t3 { - Some(t1), Some(t2), Some(t3) -> { - process.cancel_timer(timer) - #(t1, t2, t3) - } - - _, _, _ -> { - case process.select_forever(selector) { - // The task process has sent back a value - M3FromSubject1(x) -> { - let t1 = Some(Ok(x)) - try_await3_loop(selector, t1, t2, t3, timer) - } - M3FromSubject2(x) -> { - let t2 = Some(Ok(x)) - try_await3_loop(selector, t1, t2, t3, timer) - } - M3FromSubject3(x) -> { - let t3 = Some(Ok(x)) - try_await3_loop(selector, t1, t2, t3, timer) - } - - M3Timeout -> { - #( - option.unwrap(t1, Error(Timeout)), - option.unwrap(t2, Error(Timeout)), - option.unwrap(t3, Error(Timeout)), - ) - } - } - } - } -} - -type Message4(t1, t2, t3, t4) { - M4FromSubject1(t1) - M4FromSubject2(t2) - M4FromSubject3(t3) - M4FromSubject4(t4) - M4Timeout -} - -/// Wait for the values computed by multiple tasks. -/// -/// For each task, if the a value is not received before the timeout has -/// elapsed then an error is returned. -/// -pub fn try_await4( - task1: Task(t1), - task2: Task(t2), - task3: Task(t3), - task4: Task(t4), - timeout: Int, -) -> #( - Result(t1, AwaitError), - Result(t2, AwaitError), - Result(t3, AwaitError), - Result(t4, AwaitError), -) { - assert_owner(task1) - assert_owner(task2) - assert_owner(task3) - - let timeout_subject = process.new_subject() - let timer = process.send_after(timeout_subject, timeout, M4Timeout) - - process.new_selector() - |> process.selecting(task1.subject, M4FromSubject1) - |> process.selecting(task2.subject, M4FromSubject2) - |> process.selecting(task3.subject, M4FromSubject3) - |> process.selecting(task4.subject, M4FromSubject4) - |> process.selecting(timeout_subject, function.identity) - |> try_await4_loop(None, None, None, None, timer) -} - -fn try_await4_loop( - selector: Selector(Message4(t1, t2, t3, t4)), - t1: Option(Result(t1, AwaitError)), - t2: Option(Result(t2, AwaitError)), - t3: Option(Result(t3, AwaitError)), - t4: Option(Result(t4, AwaitError)), - timer: process.Timer, -) -> #( - Result(t1, AwaitError), - Result(t2, AwaitError), - Result(t3, AwaitError), - Result(t4, AwaitError), -) { - case t1, t2, t3, t4 { - Some(t1), Some(t2), Some(t3), Some(t4) -> { - process.cancel_timer(timer) - #(t1, t2, t3, t4) - } - - _, _, _, _ -> { - case process.select_forever(selector) { - // The task process has sent back a value - M4FromSubject1(x) -> { - let t1 = Some(Ok(x)) - try_await4_loop(selector, t1, t2, t3, t4, timer) - } - M4FromSubject2(x) -> { - let t2 = Some(Ok(x)) - try_await4_loop(selector, t1, t2, t3, t4, timer) - } - M4FromSubject3(x) -> { - let t3 = Some(Ok(x)) - try_await4_loop(selector, t1, t2, t3, t4, timer) - } - M4FromSubject4(x) -> { - let t4 = Some(Ok(x)) - try_await4_loop(selector, t1, t2, t3, t4, timer) - } - - M4Timeout -> { - #( - option.unwrap(t1, Error(Timeout)), - option.unwrap(t2, Error(Timeout)), - option.unwrap(t3, Error(Timeout)), - option.unwrap(t4, Error(Timeout)), - ) - } - } - } - } -} - -type Message(t) { - Message(from: Int, value: t) - MessageTimeout -} - -/// Wait for the values computed by multiple tasks. -/// -/// For each task, if the a value is not received before the timeout has -/// elapsed then an error is returned. -/// -pub fn try_await_all( - tasks: List(Task(t)), - timeout: Int, -) -> List(Result(t, AwaitError)) { - let #(selector, tasks_count) = { - let acc = #(process.new_selector(), 0) - // We need to do a couple of things before we start listening: - // - we have to check the owner of every task - // - we have to count the tasks to know when we can stop waiting for results - // - we have to map each task's message to keep track of its position in the - // original list - // - // Instead of iterating through the tasks list three times we do everything - // in a single fold that has to go through the list just once! - use #(selector, tasks_count), task, index <- list.index_fold(tasks, acc) - assert_owner(task) - let selector = process.selecting(selector, task.subject, Message(index, _)) - #(selector, tasks_count + 1) - } - - let timeout_subject = process.new_subject() - let timer = process.send_after(timeout_subject, timeout, MessageTimeout) - let selector = process.selecting(selector, timeout_subject, function.identity) - - try_await_all_loop(dict.new(), tasks_count, timer, selector) -} - -fn try_await_all_loop( - values: dict.Dict(Int, Result(b, AwaitError)), - tasks_count: Int, - timer: process.Timer, - selector: Selector(Message(b)), -) -> List(Result(b, AwaitError)) { - case dict.size(values) == tasks_count { - // If there's no more values to receive then we can return the list... - True -> { - process.cancel_timer(timer) - dict_to_list(values, tasks_count, Error(Timeout)) - } - // Otherwise we wait to receive another message (or the timeout) from one of - // the tasks. - False -> - case process.select_forever(selector) { - MessageTimeout -> dict_to_list(values, tasks_count, Error(Timeout)) - Message(from: index, value:) -> { - let values = dict.insert(values, index, Ok(value)) - try_await_all_loop(values, tasks_count, timer, selector) - } - } - } -} - -/// Given a dict returns a list with size `sized` where each item at index `i` -/// is `dict.get(dict, i) |> result.unwrap(default)`. -/// -/// ## Examples -/// -/// ```gleam -/// dict.from_list([#(1, "a"), #(4, "b")]) -/// |> dict_to_list(5, " ") -/// // -> [" ", "a", " ", " ", "b"] -/// ``` -/// -fn dict_to_list(dict: dict.Dict(Int, a), sized: Int, default: a) -> List(a) { - dict_to_list_loop(dict, default, sized - 1, []) -} - -fn dict_to_list_loop( - dict: dict.Dict(Int, a), - default: a, - index: Int, - list: List(a), -) -> List(a) { - case index < 0 { - True -> list - False -> { - let value = case dict.get(dict, index) { - Error(_) -> default - Ok(value) -> value - } - dict_to_list_loop(dict, default, index - 1, [value, ..list]) - } - } -} diff --git a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@actor.erl b/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@actor.erl deleted file mode 100644 index d30f4b3..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@actor.erl +++ /dev/null @@ -1,507 +0,0 @@ --module(gleam@otp@actor). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([continue/1, with_selector/2, to_erlang_start_result/1, start_spec/1, start/2, send/2, call/3]). --export_type([message/1, next/2, init_result/2, self/2, spec/2, start_error/0, start_init_message/1]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " This module provides the _Actor_ abstraction, one of the most common\n" - " building blocks of Gleam OTP programs.\n" - " \n" - " An Actor is a process like any other BEAM process and can be used to hold\n" - " state, execute code, and communicate with other processes by sending and\n" - " receiving messages. The advantage of using the actor abstraction over a bare\n" - " process is that it provides a single interface for commonly needed\n" - " functionality, including support for the [tracing and debugging\n" - " features in OTP][erlang-sys].\n" - "\n" - " Gleam's Actor is similar to Erlang's `gen_server` and Elixir's `GenServer`\n" - " but differs in that it offers a fully typed interface. This different API is\n" - " why Gleam uses the name Actor rather than some variation of generic-server.\n" - "\n" - " [erlang-sys]: https://www.erlang.org/doc/man/sys.html\n" - "\n" - " ## Example\n" - "\n" - " An Actor can be used to create a client-server interaction between an Actor\n" - " (the server) and other processes (the clients). In this example we have an\n" - " Actor that works as a stack, allowing clients to push and pop elements.\n" - "\n" - " ```gleam\n" - " pub fn main() {\n" - " // Start the actor with initial state of an empty list, and the\n" - " // `handle_message` callback function (defined below).\n" - " // We assert that it starts successfully.\n" - " // \n" - " // In real-world Gleam OTP programs we would likely write wrapper functions\n" - " // called `start`, `push` `pop`, `shutdown` to start and interact with the\n" - " // Actor. We are not doing that here for the sake of showing how the Actor \n" - " // API works.\n" - " let assert Ok(my_actor) = actor.start([], handle_message)\n" - " \n" - " // We can send a message to the actor to push elements onto the stack.\n" - " process.send(my_actor, Push(\"Joe\"))\n" - " process.send(my_actor, Push(\"Mike\"))\n" - " process.send(my_actor, Push(\"Robert\"))\n" - " \n" - " // The `Push` message expects no response, these messages are sent purely for\n" - " // the side effect of mutating the state held by the actor.\n" - " //\n" - " // We can also send the `Pop` message to take a value off of the actor's\n" - " // stack. This message expects a response, so we use `process.call` to send a\n" - " // message and wait until a reply is received.\n" - " //\n" - " // In this instance we are giving the actor 10 milliseconds to reply, if the\n" - " // `call` function doesn't get a reply within this time it will panic and\n" - " // crash the client process.\n" - " let assert Ok(\"Robert\") = process.call(my_actor, Pop, 10)\n" - " let assert Ok(\"Mike\") = process.call(my_actor, Pop, 10)\n" - " let assert Ok(\"Joe\") = process.call(my_actor, Pop, 10)\n" - " \n" - " // The stack is now empty, so if we pop again the actor replies with an error.\n" - " let assert Error(Nil) = process.call(my_actor, Pop, 10)\n" - " \n" - " // Lastly, we can send a message to the actor asking it to shut down.\n" - " process.send(my_actor, Shutdown)\n" - " }\n" - " ```\n" - "\n" - " Here is the code that is used to implement this actor:\n" - "\n" - " ```gleam\n" - " import gleam/erlang/process.{type Subject}\n" - " import gleam/otp/actor\n" - "\n" - " // First step of implementing the stack Actor is to define the message type that\n" - " // it can receive.\n" - " //\n" - " // The type of the elements in the stack is not fixed so a type parameter is used\n" - " // for it instead of a concrete type such as `String` or `Int`.\n" - " pub type Message(element) {\n" - " // The `Shutdown` message is used to tell the actor to stop.\n" - " // It is the simplest message type, it contains no data.\n" - " Shutdown\n" - " \n" - " // The `Push` message is used to add a new element to the stack.\n" - " // It contains the item to add, the type of which is the `element`\n" - " // parameterised type.\n" - " Push(push: element)\n" - " \n" - " // The `Pop` message is used to remove an element from the stack.\n" - " // It contains a `Subject`, which is used to send the response back to the\n" - " // message sender. In this case the reply is of type `Result(element, Nil)`.\n" - " Pop(reply_with: Subject(Result(element, Nil)))\n" - " }\n" - " \n" - " // The last part is to implement the `handle_message` callback function.\n" - " //\n" - " // This function is called by the Actor for each message it receives.\n" - " // Actor is single threaded and only does one thing at a time, so it handles\n" - " // messages sequentially and one at a time, in the order they are received.\n" - " //\n" - " // The function takes the message and the current state, and returns a data\n" - " // structure that indicates what to do next, along with the new state.\n" - " fn handle_message(\n" - " message: Message(e),\n" - " stack: List(e),\n" - " ) -> actor.Next(Message(e), List(e)) {\n" - " case message {\n" - " // For the `Shutdown` message we return the `actor.Stop` value, which causes\n" - " // the actor to discard any remaining messages and stop.\n" - " Shutdown -> actor.Stop(process.Normal)\n" - " \n" - " // For the `Push` message we add the new element to the stack and return\n" - " // `actor.continue` with this new stack, causing the actor to process any\n" - " // queued messages or wait for more.\n" - " Push(value) -> {\n" - " let new_state = [value, ..stack]\n" - " actor.continue(new_state)\n" - " }\n" - " \n" - " // For the `Pop` message we attempt to remove an element from the stack,\n" - " // sending it or an error back to the caller, before continuing.\n" - " Pop(client) ->\n" - " case stack {\n" - " [] -> {\n" - " // When the stack is empty we can't pop an element, so we send an\n" - " // error back.\n" - " process.send(client, Error(Nil))\n" - " actor.continue([])\n" - " }\n" - " \n" - " [first, ..rest] -> {\n" - " // Otherwise we send the first element back and use the remaining\n" - " // elements as the new state.\n" - " process.send(client, Ok(first))\n" - " actor.continue(rest)\n" - " }\n" - " }\n" - " }\n" - " }\n" - " ```\n" -). - --type message(GJL) :: {message, GJL} | - {system, gleam@otp@system:system_message()} | - {unexpected, gleam@dynamic:dynamic_()}. - --type next(GJM, GJN) :: {continue, - GJN, - gleam@option:option(gleam@erlang@process:selector(GJM))} | - {stop, gleam@erlang@process:exit_reason()}. - --type init_result(GJO, GJP) :: {ready, GJO, gleam@erlang@process:selector(GJP)} | - {failed, binary()}. - --type self(GJQ, GJR) :: {self, - gleam@otp@system:mode(), - gleam@erlang@process:pid_(), - GJQ, - gleam@erlang@process:subject(GJR), - gleam@erlang@process:selector(message(GJR)), - gleam@otp@system:debug_state(), - fun((GJR, GJQ) -> next(GJR, GJQ))}. - --type spec(GJS, GJT) :: {spec, - fun(() -> init_result(GJS, GJT)), - integer(), - fun((GJT, GJS) -> next(GJT, GJS))}. - --type start_error() :: init_timeout | - {init_failed, gleam@erlang@process:exit_reason()} | - {init_crashed, gleam@dynamic:dynamic_()}. - --type start_init_message(GJU) :: {ack, - {ok, gleam@erlang@process:subject(GJU)} | - {error, gleam@erlang@process:exit_reason()}} | - {mon, gleam@erlang@process:process_down()}. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/actor.gleam", 178). --spec continue(GKB) -> next(any(), GKB). -continue(State) -> - {continue, State, none}. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/actor.gleam", 186). -?DOC( - " Provide a selector to change the messages that the actor is handling\n" - " going forward. This replaces any selector that was previously given\n" - " in the actor's `init` callback, or in any previous `Next` value.\n" -). --spec with_selector(next(GKF, GKG), gleam@erlang@process:selector(GKF)) -> next(GKF, GKG). -with_selector(Value, Selector) -> - case Value of - {continue, State, _} -> - {continue, State, {some, Selector}}; - - _ -> - Value - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/actor.gleam", 259). --spec exit_process(gleam@erlang@process:exit_reason()) -> gleam@erlang@process:exit_reason(). -exit_process(Reason) -> - Reason. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/actor.gleam", 295). --spec selecting_system_messages(gleam@erlang@process:selector(message(GKR))) -> gleam@erlang@process:selector(message(GKR)). -selecting_system_messages(Selector) -> - _pipe = Selector, - gleam@erlang@process:selecting_record3( - _pipe, - erlang:binary_to_atom(<<"system"/utf8>>), - fun gleam_otp_external:convert_system_message/2 - ). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/actor.gleam", 264). --spec receive_message(self(any(), GKN)) -> message(GKN). -receive_message(Self) -> - Selector = case erlang:element(2, Self) of - suspended -> - _pipe = gleam_erlang_ffi:new_selector(), - selecting_system_messages(_pipe); - - running -> - _pipe@1 = gleam_erlang_ffi:new_selector(), - _pipe@2 = gleam@erlang@process:selecting_anything( - _pipe@1, - fun(Field@0) -> {unexpected, Field@0} end - ), - _pipe@3 = gleam_erlang_ffi:merge_selector( - _pipe@2, - erlang:element(6, Self) - ), - selecting_system_messages(_pipe@3) - end, - gleam_erlang_ffi:select(Selector). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/actor.gleam", 308). --spec process_status_info(self(any(), any())) -> gleam@otp@system:status_info(). -process_status_info(Self) -> - {status_info, - erlang:binary_to_atom(<<"gleam@otp@actor"/utf8>>), - erlang:element(3, Self), - erlang:element(2, Self), - erlang:element(7, Self), - gleam_stdlib:identity(erlang:element(4, Self))}. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/actor.gleam", 415). --spec init_selector( - gleam@erlang@process:subject(GPR), - gleam@erlang@process:selector(GPR) -) -> gleam@erlang@process:selector(message(GPR)). -init_selector(Subject, Selector) -> - _pipe = gleam_erlang_ffi:new_selector(), - _pipe@1 = gleam@erlang@process:selecting( - _pipe, - Subject, - fun(Field@0) -> {message, Field@0} end - ), - gleam_erlang_ffi:merge_selector( - _pipe@1, - gleam_erlang_ffi:map_selector( - Selector, - fun(Field@0) -> {message, Field@0} end - ) - ). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/actor.gleam", 318). --spec loop(self(any(), any())) -> gleam@erlang@process:exit_reason(). -loop(Self) -> - case receive_message(Self) of - {system, System} -> - case System of - {get_state, Callback} -> - Callback(gleam_stdlib:identity(erlang:element(4, Self))), - loop(Self); - - {resume, Callback@1} -> - Callback@1(), - loop( - begin - _record = Self, - {self, - running, - erlang:element(3, _record), - erlang:element(4, _record), - erlang:element(5, _record), - erlang:element(6, _record), - erlang:element(7, _record), - erlang:element(8, _record)} - end - ); - - {suspend, Callback@2} -> - Callback@2(), - loop( - begin - _record@1 = Self, - {self, - suspended, - erlang:element(3, _record@1), - erlang:element(4, _record@1), - erlang:element(5, _record@1), - erlang:element(6, _record@1), - erlang:element(7, _record@1), - erlang:element(8, _record@1)} - end - ); - - {get_status, Callback@3} -> - Callback@3(process_status_info(Self)), - loop(Self) - end; - - {unexpected, Message} -> - logger:warning( - unicode:characters_to_list( - <<"Actor discarding unexpected message: ~s"/utf8>> - ), - [unicode:characters_to_list(gleam@string:inspect(Message))] - ), - loop(Self); - - {message, Msg} -> - case (erlang:element(8, Self))(Msg, erlang:element(4, Self)) of - {stop, Reason} -> - exit_process(Reason); - - {continue, State, New_selector} -> - Selector = begin - _pipe = New_selector, - _pipe@1 = gleam@option:map( - _pipe, - fun(_capture) -> - init_selector(erlang:element(5, Self), _capture) - end - ), - gleam@option:unwrap(_pipe@1, erlang:element(6, Self)) - end, - loop( - begin - _record@2 = Self, - {self, - erlang:element(2, _record@2), - erlang:element(3, _record@2), - State, - erlang:element(5, _record@2), - Selector, - erlang:element(7, _record@2), - erlang:element(8, _record@2)} - end - ) - end - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/actor.gleam", 374). --spec initialise_actor( - spec(any(), GLI), - gleam@erlang@process:subject({ok, gleam@erlang@process:subject(GLI)} | - {error, gleam@erlang@process:exit_reason()}) -) -> gleam@erlang@process:exit_reason(). -initialise_actor(Spec, Ack) -> - Subject = gleam@erlang@process:new_subject(), - Result = (erlang:element(2, Spec))(), - case Result of - {ready, State, Selector} -> - Selector@1 = init_selector(Subject, Selector), - gleam@erlang@process:send(Ack, {ok, Subject}), - Self = {self, - running, - gleam@erlang@process:subject_owner(Ack), - State, - Subject, - Selector@1, - sys:debug_options([]), - erlang:element(4, Spec)}, - loop(Self); - - {failed, Reason} -> - gleam@erlang@process:send(Ack, {error, {abnormal, Reason}}), - exit_process({abnormal, Reason}) - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/actor.gleam", 444). -?DOC( - " Convert a Gleam actor start result into an Erlang supervisor-compatible\n" - " process start result.\n" -). --spec to_erlang_start_result( - {ok, gleam@erlang@process:subject(any())} | {error, start_error()} -) -> {ok, gleam@erlang@process:pid_()} | {error, gleam@dynamic:dynamic_()}. -to_erlang_start_result(Res) -> - case Res of - {ok, X} -> - {ok, gleam@erlang@process:subject_owner(X)}; - - {error, X@1} -> - {error, gleam_stdlib:identity(X@1)} - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/actor.gleam", 466). -?DOC( - " Start an actor from a given specification. If the actor's `init` function\n" - " returns an error or does not return within `init_timeout` then an error is\n" - " returned.\n" - "\n" - " If you do not need to specify the initialisation behaviour of your actor\n" - " consider using the `start` function.\n" -). --spec start_spec(spec(any(), GLV)) -> {ok, gleam@erlang@process:subject(GLV)} | - {error, start_error()}. -start_spec(Spec) -> - Ack_subject = gleam@erlang@process:new_subject(), - Child = gleam@erlang@process:start( - fun() -> initialise_actor(Spec, Ack_subject) end, - true - ), - Monitor = gleam@erlang@process:monitor_process(Child), - Selector = begin - _pipe = gleam_erlang_ffi:new_selector(), - _pipe@1 = gleam@erlang@process:selecting( - _pipe, - Ack_subject, - fun(Field@0) -> {ack, Field@0} end - ), - gleam@erlang@process:selecting_process_down( - _pipe@1, - Monitor, - fun(Field@0) -> {mon, Field@0} end - ) - end, - Result = case gleam_erlang_ffi:select(Selector, erlang:element(3, Spec)) of - {ok, {ack, {ok, Channel}}} -> - {ok, Channel}; - - {ok, {ack, {error, Reason}}} -> - {error, {init_failed, Reason}}; - - {ok, {mon, Down}} -> - {error, {init_crashed, erlang:element(3, Down)}}; - - {error, nil} -> - gleam@erlang@process:unlink(Child), - gleam@erlang@process:kill(Child), - {error, init_timeout} - end, - gleam_erlang_ffi:demonitor(Monitor), - Result. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/actor.gleam", 517). -?DOC( - " Start an actor with a given initial state and message handling loop\n" - " function.\n" - "\n" - " This function returns a `Result` but it will always be `Ok` so it is safe\n" - " to use with `assert` if you are not starting this actor as part of a\n" - " supervision tree.\n" - "\n" - " If you wish to configure the initialisation behaviour of a new actor see\n" - " the `Spec` record and the `start_spec` function.\n" -). --spec start(GMB, fun((GMC, GMB) -> next(GMC, GMB))) -> {ok, - gleam@erlang@process:subject(GMC)} | - {error, start_error()}. -start(State, Loop) -> - start_spec( - {spec, - fun() -> {ready, State, gleam_erlang_ffi:new_selector()} end, - 5000, - Loop} - ). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/actor.gleam", 532). -?DOC( - " Send a message over a given channel.\n" - "\n" - " This is a re-export of `process.send`, for the sake of convenience.\n" -). --spec send(gleam@erlang@process:subject(GMI), GMI) -> nil. -send(Subject, Msg) -> - gleam@erlang@process:send(Subject, Msg). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/actor.gleam", 545). -?DOC( - " Send a synchronous message and wait for a response from the receiving\n" - " process.\n" - "\n" - " If a reply is not received within the given timeout then the sender process\n" - " crashes. If you wish to receive a `Result` rather than crashing see the\n" - " `process.try_call` function.\n" - "\n" - " This is a re-export of `process.call`, for the sake of convenience.\n" -). --spec call( - gleam@erlang@process:subject(GMK), - fun((gleam@erlang@process:subject(GMM)) -> GMK), - integer() -) -> GMM. -call(Subject, Make_message, Timeout) -> - gleam@erlang@process:call(Subject, Make_message, Timeout). diff --git a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@intensity_tracker.erl b/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@intensity_tracker.erl deleted file mode 100644 index e42fce6..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@intensity_tracker.erl +++ /dev/null @@ -1,77 +0,0 @@ --module(gleam@otp@intensity_tracker). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([new/2, trim_window/3, add_event/1]). --export_type([intensity_tracker/0, too_intense/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " The intensity tracker is used to monitor how frequently an event happens,\n" - " erroring if it happens too many times within a period of time.\n" -). - --opaque intensity_tracker() :: {intensity_tracker, - integer(), - integer(), - list(integer())}. - --type too_intense() :: too_intense. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/intensity_tracker.gleam", 14). --spec new(integer(), integer()) -> intensity_tracker(). -new(Limit, Period) -> - {intensity_tracker, Limit, Period, []}. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/intensity_tracker.gleam", 21). --spec now_seconds() -> integer(). -now_seconds() -> - erlang:monotonic_time(1). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/intensity_tracker.gleam", 25). --spec trim_window(list(integer()), integer(), integer()) -> list(integer()). -trim_window(Events, Now, Period) -> - case Events of - [] -> - []; - - [Event | Events@1] -> - case Now < (Event + Period) of - true -> - [Event | trim_window(Events@1, Now, Period)]; - - false -> - [] - end - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/intensity_tracker.gleam", 36). --spec add_event(intensity_tracker()) -> {ok, intensity_tracker()} | - {error, too_intense()}. -add_event(Tracker) -> - Now = now_seconds(), - Events = trim_window( - [Now | erlang:element(4, Tracker)], - Now, - erlang:element(3, Tracker) - ), - case erlang:length(Events) > erlang:element(2, Tracker) of - true -> - {error, too_intense}; - - false -> - {ok, - begin - _record = Tracker, - {intensity_tracker, - erlang:element(2, _record), - erlang:element(3, _record), - Events} - end} - end. diff --git a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@port.erl b/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@port.erl deleted file mode 100644 index 9bad092..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@port.erl +++ /dev/null @@ -1,8 +0,0 @@ --module(gleam@otp@port). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export_type([port_/0]). - --type port_() :: any(). - - diff --git a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@static_supervisor.erl b/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@static_supervisor.erl deleted file mode 100644 index e4e8eb8..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@static_supervisor.erl +++ /dev/null @@ -1,296 +0,0 @@ --module(gleam@otp@static_supervisor). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([new/1, restart_tolerance/3, auto_shutdown/2, add/2, worker_child/2, supervisor_child/2, significant/2, timeout/2, restart/2, start_link/1, init/1]). --export_type([strategy/0, auto_shutdown/0, builder/0, restart/0, child_type/0, child_builder/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " Bindings to Erlang/OTP's `supervisor` module.\n" - "\n" - " For further detail see the Erlang documentation:\n" - " .\n" - "\n" - " # Example\n" - "\n" - " ```gleam\n" - " import gleam/erlang/process.{type Pid}\n" - " import gleam/otp/static_supervisor as sup\n" - " \n" - " pub fn start_supervisor() {\n" - " sup.new(sup.OneForOne)\n" - " |> sup.add(sup.worker_child(\"db\", start_database_connection))\n" - " |> sup.add(sup.worker_child(\"workers\", start_workers))\n" - " |> sup.add(sup.worker_child(\"web\", start_http_server))\n" - " |> sup.start_link\n" - " }\n" - " ```\n" -). - --type strategy() :: one_for_one | one_for_all | rest_for_one. - --type auto_shutdown() :: never | any_significant | all_significant. - --opaque builder() :: {builder, - strategy(), - integer(), - integer(), - auto_shutdown(), - list(child_builder())}. - --type restart() :: permanent | transient | temporary. - --type child_type() :: {worker, integer()} | supervisor. - --opaque child_builder() :: {child_builder, - binary(), - fun(() -> {ok, gleam@erlang@process:pid_()} | - {error, gleam@dynamic:dynamic_()}), - restart(), - boolean(), - child_type()}. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/static_supervisor.gleam", 74). --spec new(strategy()) -> builder(). -new(Strategy) -> - {builder, Strategy, 2, 5, never, []}. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/static_supervisor.gleam", 94). -?DOC( - " To prevent a supervisor from getting into an infinite loop of child\n" - " process terminations and restarts, a maximum restart intensity is\n" - " defined using two integer values specified with keys intensity and\n" - " period in the above map. Assuming the values MaxR for intensity and MaxT\n" - " for period, then, if more than MaxR restarts occur within MaxT seconds,\n" - " the supervisor terminates all child processes and then itself. The\n" - " termination reason for the supervisor itself in that case will be\n" - " shutdown. \n" - "\n" - " Intensity defaults to 1 and period defaults to 5.\n" -). --spec restart_tolerance(builder(), integer(), integer()) -> builder(). -restart_tolerance(Builder, Intensity, Period) -> - _record = Builder, - {builder, - erlang:element(2, _record), - Intensity, - Period, - erlang:element(5, _record), - erlang:element(6, _record)}. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/static_supervisor.gleam", 104). -?DOC( - " A supervisor can be configured to automatically shut itself down with\n" - " exit reason shutdown when significant children terminate.\n" -). --spec auto_shutdown(builder(), auto_shutdown()) -> builder(). -auto_shutdown(Builder, Value) -> - _record = Builder, - {builder, - erlang:element(2, _record), - erlang:element(3, _record), - erlang:element(4, _record), - Value, - erlang:element(6, _record)}. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/static_supervisor.gleam", 184). -?DOC(" Add a child to the supervisor.\n"). --spec add(builder(), child_builder()) -> builder(). -add(Builder, Child) -> - _record = Builder, - {builder, - erlang:element(2, _record), - erlang:element(3, _record), - erlang:element(4, _record), - erlang:element(5, _record), - [Child | erlang:element(6, Builder)]}. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/static_supervisor.gleam", 197). -?DOC( - " A regular child that is not also a supervisor.\n" - "\n" - " id is used to identify the child specification internally by the\n" - " supervisor.\n" - " Notice that this identifier on occations has been called \"name\". As far\n" - " as possible, the terms \"identifier\" or \"id\" are now used but to keep\n" - " backward compatibility, some occurences of \"name\" can still be found, for\n" - " example in error messages.\n" -). --spec worker_child( - binary(), - fun(() -> {ok, gleam@erlang@process:pid_()} | {error, any()}) -) -> child_builder(). -worker_child(Id, Starter) -> - {child_builder, Id, fun() -> _pipe = Starter(), - gleam@result:map_error(_pipe, fun gleam_stdlib:identity/1) end, permanent, false, {worker, - 5000}}. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/static_supervisor.gleam", 219). -?DOC( - " A special child that is a supervisor itself.\n" - "\n" - " id is used to identify the child specification internally by the\n" - " supervisor.\n" - " Notice that this identifier on occations has been called \"name\". As far\n" - " as possible, the terms \"identifier\" or \"id\" are now used but to keep\n" - " backward compatibility, some occurences of \"name\" can still be found, for\n" - " example in error messages.\n" -). --spec supervisor_child( - binary(), - fun(() -> {ok, gleam@erlang@process:pid_()} | {error, any()}) -) -> child_builder(). -supervisor_child(Id, Starter) -> - {child_builder, Id, fun() -> _pipe = Starter(), - gleam@result:map_error(_pipe, fun gleam_stdlib:identity/1) end, permanent, false, supervisor}. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/static_supervisor.gleam", 241). -?DOC( - " This defines if a child is considered significant for automatic\n" - " self-shutdown of the supervisor.\n" - "\n" - " You most likely do not want to consider any children significant.\n" - "\n" - " This will be ignored if the supervisor auto shutdown is set to `Never`,\n" - " which is the default.\n" - "\n" - " The default value for significance is `False`.\n" -). --spec significant(child_builder(), boolean()) -> child_builder(). -significant(Child, Significant) -> - _record = Child, - {child_builder, - erlang:element(2, _record), - erlang:element(3, _record), - erlang:element(4, _record), - Significant, - erlang:element(6, _record)}. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/static_supervisor.gleam", 252). -?DOC( - " This defines the amount of milliseconds a child has to shut down before\n" - " being brutal killed by the supervisor.\n" - "\n" - " If not set the default for a child is 5000ms.\n" - "\n" - " This will be ignored if the child is a supervisor itself.\n" -). --spec timeout(child_builder(), integer()) -> child_builder(). -timeout(Child, Ms) -> - case erlang:element(6, Child) of - {worker, _} -> - _record = Child, - {child_builder, - erlang:element(2, _record), - erlang:element(3, _record), - erlang:element(4, _record), - erlang:element(5, _record), - {worker, Ms}}; - - _ -> - Child - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/static_supervisor.gleam", 263). -?DOC( - " When the child is to be restarted. See the `Restart` documentation for\n" - " more.\n" - "\n" - " The default value for restart is `Permanent`.\n" -). --spec restart(child_builder(), restart()) -> child_builder(). -restart(Child, Restart) -> - _record = Child, - {child_builder, - erlang:element(2, _record), - erlang:element(3, _record), - Restart, - erlang:element(5, _record), - erlang:element(6, _record)}. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/static_supervisor.gleam", 294). --spec property( - gleam@dict:dict(gleam@erlang@atom:atom_(), gleam@dynamic:dynamic_()), - binary(), - any() -) -> gleam@dict:dict(gleam@erlang@atom:atom_(), gleam@dynamic:dynamic_()). -property(Dict, Key, Value) -> - gleam@dict:insert( - Dict, - erlang:binary_to_atom(Key), - gleam_stdlib:identity(Value) - ). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/static_supervisor.gleam", 267). --spec convert_child(child_builder()) -> gleam@dict:dict(gleam@erlang@atom:atom_(), gleam@dynamic:dynamic_()). -convert_child(Child) -> - Mfa = {erlang:binary_to_atom(<<"erlang"/utf8>>), - erlang:binary_to_atom(<<"apply"/utf8>>), - [gleam_stdlib:identity(erlang:element(3, Child)), - gleam_stdlib:identity([])]}, - {Type_, Shutdown} = case erlang:element(6, Child) of - supervisor -> - {erlang:binary_to_atom(<<"supervisor"/utf8>>), - gleam_stdlib:identity( - erlang:binary_to_atom(<<"infinity"/utf8>>) - )}; - - {worker, Timeout} -> - {erlang:binary_to_atom(<<"worker"/utf8>>), - gleam_stdlib:identity(Timeout)} - end, - _pipe = maps:new(), - _pipe@1 = property(_pipe, <<"id"/utf8>>, erlang:element(2, Child)), - _pipe@2 = property(_pipe@1, <<"start"/utf8>>, Mfa), - _pipe@3 = property(_pipe@2, <<"restart"/utf8>>, erlang:element(4, Child)), - _pipe@4 = property( - _pipe@3, - <<"significant"/utf8>>, - erlang:element(5, Child) - ), - _pipe@5 = property(_pipe@4, <<"type"/utf8>>, Type_), - property(_pipe@5, <<"shutdown"/utf8>>, Shutdown). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/static_supervisor.gleam", 165). --spec start_link(builder()) -> {ok, gleam@erlang@process:pid_()} | - {error, gleam@dynamic:dynamic_()}. -start_link(Builder) -> - Flags = begin - _pipe = maps:new(), - _pipe@1 = property( - _pipe, - <<"strategy"/utf8>>, - erlang:element(2, Builder) - ), - _pipe@2 = property( - _pipe@1, - <<"intensity"/utf8>>, - erlang:element(3, Builder) - ), - _pipe@3 = property( - _pipe@2, - <<"period"/utf8>>, - erlang:element(4, Builder) - ), - property(_pipe@3, <<"auto_shutdown"/utf8>>, erlang:element(5, Builder)) - end, - Children = begin - _pipe@4 = erlang:element(6, Builder), - _pipe@5 = lists:reverse(_pipe@4), - gleam@list:map(_pipe@5, fun convert_child/1) - end, - gleam_otp_external:static_supervisor_start_link({Flags, Children}). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/static_supervisor.gleam", 304). -?DOC(false). --spec init(gleam@dynamic:dynamic_()) -> {ok, gleam@dynamic:dynamic_()} | - {error, any()}. -init(Start_data) -> - {ok, Start_data}. diff --git a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@supervisor.erl b/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@supervisor.erl deleted file mode 100644 index 0b5b68e..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@supervisor.erl +++ /dev/null @@ -1,455 +0,0 @@ --module(gleam@otp@supervisor). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([add/2, supervisor/1, worker/1, returning/2, start_spec/1, start/1, application_stopped/0, to_erlang_start_result/1]). --export_type([spec/2, children/1, child_spec/3, child_start_error/0, message/0, instruction/0, state/1, starter/1, child/1, handle_exit_error/0, application_start_mode/0, application_stop/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " A supervisor that can pass state from older children to younger ones.\n" - "\n" - " If you don't need this consider using the `gleam/otp/static_supervisor`\n" - " module instead.\n" -). - --type spec(GZS, GZT) :: {spec, - GZS, - integer(), - integer(), - fun((children(GZS)) -> children(GZT))}. - --opaque children(GZU) :: {ready, starter(GZU)} | {failed, child_start_error()}. - --opaque child_spec(GZV, GZW, GZX) :: {child_spec, - fun((GZW) -> {ok, gleam@erlang@process:subject(GZV)} | - {error, gleam@otp@actor:start_error()}), - fun((GZW, gleam@erlang@process:subject(GZV)) -> GZX)}. - --type child_start_error() :: {child_start_error, - gleam@option:option(gleam@erlang@process:pid_()), - gleam@otp@actor:start_error()}. - --opaque message() :: {exit, gleam@erlang@process:exit_message()} | - {retry_restart, gleam@erlang@process:pid_()}. - --type instruction() :: start_all | {start_from, gleam@erlang@process:pid_()}. - --type state(GZY) :: {state, - gleam@otp@intensity_tracker:intensity_tracker(), - starter(GZY), - gleam@erlang@process:subject(gleam@erlang@process:pid_())}. - --type starter(GZZ) :: {starter, - GZZ, - gleam@option:option(fun((instruction()) -> {ok, - {starter(GZZ), instruction()}} | - {error, child_start_error()}))}. - --type child(HAA) :: {child, gleam@erlang@process:pid_(), HAA}. - --type handle_exit_error() :: {restart_failed, - gleam@erlang@process:pid_(), - gleam@otp@intensity_tracker:intensity_tracker()} | - too_many_restarts. - --type application_start_mode() :: normal | - {takeover, gleam@erlang@node:node_()} | - {failover, gleam@erlang@node:node_()}. - --type application_stop() :: any(). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/supervisor.gleam", 87). --spec start_child(child_spec(any(), HAE, HAF), HAE) -> {ok, child(HAF)} | - {error, child_start_error()}. -start_child(Child_spec, Argument) -> - gleam@result:then( - begin - _pipe = (erlang:element(2, Child_spec))(Argument), - gleam@result:map_error( - _pipe, - fun(_capture) -> {child_start_error, none, _capture} end - ) - end, - fun(Subject) -> - {ok, - {child, - gleam@erlang@process:subject_owner(Subject), - (erlang:element(3, Child_spec))(Argument, Subject)}} - end - ). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/supervisor.gleam", 106). --spec shutdown_child( - gleam@erlang@process:pid_(), - child_spec(any(), any(), any()) -) -> nil. -shutdown_child(Pid, _) -> - gleam@erlang@process:send_exit(Pid). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/supervisor.gleam", 110). --spec perform_instruction_for_child( - HAS, - instruction(), - child_spec(any(), HAS, HAU), - child(HAU) -) -> {ok, {child(HAU), instruction()}} | {error, child_start_error()}. -perform_instruction_for_child(Argument, Instruction, Child_spec, Child) -> - Current = erlang:element(2, Child), - case Instruction of - {start_from, Target} when Target =/= Current -> - {ok, {Child, Instruction}}; - - _ -> - shutdown_child(Current, Child_spec), - gleam@result:then( - start_child(Child_spec, Argument), - fun(Child@1) -> {ok, {Child@1, start_all}} end - ) - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/supervisor.gleam", 132). --spec add_child_to_starter( - starter(HBC), - child_spec(any(), HBC, HBF), - child(HBF) -) -> starter(HBF). -add_child_to_starter(Starter, Child_spec, Child) -> - Starter@3 = fun(Instruction) -> - gleam@result:then(case erlang:element(3, Starter) of - {some, Start} -> - Start(Instruction); - - none -> - {ok, {Starter, Instruction}} - end, fun(_use0) -> - {Starter@1, Instruction@1} = _use0, - gleam@result:then( - perform_instruction_for_child( - erlang:element(2, Starter@1), - Instruction@1, - Child_spec, - Child - ), - fun(_use0@1) -> - {Child@1, Instruction@2} = _use0@1, - Starter@2 = add_child_to_starter( - Starter@1, - Child_spec, - Child@1 - ), - {ok, {Starter@2, Instruction@2}} - end - ) - end) - end, - {starter, erlang:element(3, Child), {some, Starter@3}}. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/supervisor.gleam", 164). --spec start_and_add_child(starter(HBL), child_spec(any(), HBL, HBO)) -> children(HBO). -start_and_add_child(State, Child_spec) -> - case start_child(Child_spec, erlang:element(2, State)) of - {ok, Child} -> - {ready, add_child_to_starter(State, Child_spec, Child)}; - - {error, Reason} -> - {failed, Reason} - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/supervisor.gleam", 178). -?DOC( - " Add a child to the collection of children of the supervisor\n" - "\n" - " This function starts the child from the child spec.\n" -). --spec add(children(HBT), child_spec(any(), HBT, HBW)) -> children(HBW). -add(Children, Child_spec) -> - case Children of - {failed, Fail} -> - {failed, Fail}; - - {ready, State} -> - start_and_add_child(State, Child_spec) - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/supervisor.gleam", 206). -?DOC( - " Prepare a new supervisor type child.\n" - "\n" - " If you wish to prepare a new non-supervisor type child see the `worker`\n" - " function.\n" - "\n" - " If you wish to change the type of the argument for later children see the\n" - " `returning` function.\n" - "\n" - " Note: Gleam supervisors do not yet support different shutdown periods per\n" - " child so this function is currently identical in behaviour to `worker`. It is\n" - " recommended to use this function for supervisor children nevertheless so the\n" - " correct shut down behaviour is used in later releases of this library.\n" -). --spec supervisor( - fun((HCB) -> {ok, gleam@erlang@process:subject(HCC)} | - {error, gleam@otp@actor:start_error()}) -) -> child_spec(HCC, HCB, HCB). -supervisor(Start) -> - {child_spec, Start, fun(Argument, _) -> Argument end}. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/supervisor.gleam", 228). -?DOC( - " Prepare a new worker type child.\n" - "\n" - " If you wish to prepare a new supervisor type child see the `supervisor`\n" - " function.\n" - "\n" - " If you wish to change the type of the argument for later children see the\n" - " `returning` function.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " worker(fn(argument) {\n" - " my_actor.start(argument)\n" - " })\n" - " ```\n" -). --spec worker( - fun((HCJ) -> {ok, gleam@erlang@process:subject(HCK)} | - {error, gleam@otp@actor:start_error()}) -) -> child_spec(HCK, HCJ, HCJ). -worker(Start) -> - {child_spec, Start, fun(Argument, _) -> Argument end}. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/supervisor.gleam", 241). -?DOC( - " As each child is added to a supervisors children a new argument is prepared\n" - " with which to start the next child. By default argument is the same as the\n" - " previous argument, but this function can be used to change it to something\n" - " else by passing a function that takes the previous argument and the sender\n" - " of the previous child.\n" -). --spec returning( - child_spec(HCR, HCS, any()), - fun((HCS, gleam@erlang@process:subject(HCR)) -> HCY) -) -> child_spec(HCR, HCS, HCY). -returning(Child, Updater) -> - {child_spec, erlang:element(2, Child), Updater}. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/supervisor.gleam", 248). --spec init(spec(any(), HDD)) -> gleam@otp@actor:init_result(state(HDD), message()). -init(Spec) -> - Retry = gleam@erlang@process:new_subject(), - gleam_erlang_ffi:trap_exits(true), - Selector = begin - _pipe = gleam_erlang_ffi:new_selector(), - _pipe@1 = gleam@erlang@process:selecting( - _pipe, - Retry, - fun(Field@0) -> {retry_restart, Field@0} end - ), - gleam@erlang@process:selecting_trapped_exits( - _pipe@1, - fun(Field@0) -> {exit, Field@0} end - ) - end, - Result = begin - _pipe@2 = {starter, erlang:element(2, Spec), none}, - _pipe@3 = {ready, _pipe@2}, - (erlang:element(5, Spec))(_pipe@3) - end, - case Result of - {ready, Starter} -> - Restarts = gleam@otp@intensity_tracker:new( - erlang:element(3, Spec), - erlang:element(4, Spec) - ), - State = {state, Restarts, Starter, Retry}, - {ready, State, Selector}; - - {failed, Error} -> - {failed, case erlang:element(3, Error) of - init_timeout -> - <<"Child initialisation timed out"/utf8>>; - - {init_crashed, Reason} -> - gleam@string:append( - <<"Child crashed during initialisation: "/utf8>>, - gleam@string:inspect(Reason) - ); - - {init_failed, Reason@1} -> - gleam@string:append( - <<"Child failed to start during initialisation: "/utf8>>, - gleam@string:inspect(Reason@1) - ) - end} - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/supervisor.gleam", 305). --spec handle_exit(gleam@erlang@process:pid_(), state(HDJ)) -> gleam@otp@actor:next(message(), state(HDJ)). -handle_exit(Pid, State) -> - Outcome = begin - _assert_subject = erlang:element(3, erlang:element(3, State)), - {some, Start} = case _assert_subject of - {some, _} -> _assert_subject; - _assert_fail -> - erlang:error(#{gleam_error => let_assert, - message => <<"Pattern match failed, no pattern matched the value."/utf8>>, - value => _assert_fail, - module => <<"gleam/otp/supervisor"/utf8>>, - function => <<"handle_exit"/utf8>>, - line => 308}) - end, - gleam@result:then( - begin - _pipe = erlang:element(2, State), - _pipe@1 = gleam@otp@intensity_tracker:add_event(_pipe), - gleam@result:map_error(_pipe@1, fun(_) -> too_many_restarts end) - end, - fun(Restarts) -> - gleam@result:then( - begin - _pipe@2 = Start({start_from, Pid}), - gleam@result:map_error( - _pipe@2, - fun(E) -> - {restart_failed, - gleam@option:unwrap( - erlang:element(2, E), - Pid - ), - Restarts} - end - ) - end, - fun(_use0) -> - {Starter, _} = _use0, - {ok, - begin - _record = State, - {state, - Restarts, - Starter, - erlang:element(4, _record)} - end} - end - ) - end - ) - end, - case Outcome of - {ok, State@1} -> - gleam@otp@actor:continue(State@1); - - {error, {restart_failed, Failed_child, Restarts@1}} -> - gleam@erlang@process:send(erlang:element(4, State), Failed_child), - State@2 = begin - _record@1 = State, - {state, - Restarts@1, - erlang:element(3, _record@1), - erlang:element(4, _record@1)} - end, - gleam@otp@actor:continue(State@2); - - {error, too_many_restarts} -> - {stop, - {abnormal, - <<"Child processes restarted too many times within allowed period"/utf8>>}} - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/supervisor.gleam", 345). --spec loop(message(), state(HDO)) -> gleam@otp@actor:next(message(), state(HDO)). -loop(Message, State) -> - case Message of - {exit, Exit_message} -> - handle_exit(erlang:element(2, Exit_message), State); - - {retry_restart, Pid} -> - handle_exit(Pid, State) - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/supervisor.gleam", 377). -?DOC( - " Start a supervisor from a given specification.\n" - "\n" - "\n" - " ## Examples\n" - " \n" - " ```gleam\n" - " let worker = worker(my_actor.start)\n" - "\n" - " let children = fn(children) {\n" - " children\n" - " |> add(worker)\n" - " |> add(worker)\n" - " }\n" - "\n" - " start_spec(Spec(\n" - " argument: initial_state,\n" - " frequency_period: 1,\n" - " max_frequency: 5,\n" - " init: children,\n" - " ))\n" - " ```\n" -). --spec start_spec(spec(any(), any())) -> {ok, - gleam@erlang@process:subject(message())} | - {error, gleam@otp@actor:start_error()}. -start_spec(Spec) -> - gleam@otp@actor:start_spec( - {spec, fun() -> init(Spec) end, 60000, fun loop/2} - ). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/supervisor.gleam", 408). -?DOC( - " Start a supervisor from a given `init` function.\n" - "\n" - " The init argument passed to children will be `Nil` and the maximum restart\n" - " intensity will be 1 restart per 5 seconds (the same as the default for\n" - " [Erlang supervisors][erl-sup]). If you wish to specify these values, see\n" - " the `start_spec` function and the `Spec` type.\n" - "\n" - " [erl-sup]: https://www.erlang.org/doc/design_principles/sup_princ.html#maximum-restart-intensity\n" - "\n" - " ## Examples\n" - " \n" - " ```gleam\n" - " let worker = worker(my_actor.start)\n" - "\n" - " let children = fn(children) {\n" - " children\n" - " |> add(worker)\n" - " |> add(worker)\n" - " }\n" - "\n" - " start(children)\n" - " ```\n" -). --spec start(fun((children(nil)) -> children(any()))) -> {ok, - gleam@erlang@process:subject(message())} | - {error, gleam@otp@actor:start_error()}. -start(Init) -> - start_spec({spec, nil, 1, 5, Init}). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/supervisor.gleam", 438). --spec application_stopped() -> application_stop(). -application_stopped() -> - gleam_otp_external:application_stopped(). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/supervisor.gleam", 457). -?DOC( - " Convert a Gleam actor start result into an Erlang supervisor compatible\n" - " process start result.\n" -). --spec to_erlang_start_result( - {ok, gleam@erlang@process:subject(any())} | - {error, gleam@otp@actor:start_error()} -) -> {ok, gleam@erlang@process:pid_()} | {error, gleam@dynamic:dynamic_()}. -to_erlang_start_result(Res) -> - gleam@otp@actor:to_erlang_start_result(Res). diff --git a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@system.erl b/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@system.erl deleted file mode 100644 index 87b1358..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@system.erl +++ /dev/null @@ -1,83 +0,0 @@ --module(gleam@otp@system). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([debug_state/1, get_state/1, suspend/1, resume/1]). --export_type([mode/0, debug_option/0, debug_state/0, status_info/0, system_message/0, do_not_leak/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --type mode() :: running | suspended. - --type debug_option() :: no_debug. - --type debug_state() :: any(). - --type status_info() :: {status_info, - gleam@erlang@atom:atom_(), - gleam@erlang@process:pid_(), - mode(), - debug_state(), - gleam@dynamic:dynamic_()}. - --type system_message() :: {resume, fun(() -> nil)} | - {suspend, fun(() -> nil)} | - {get_state, fun((gleam@dynamic:dynamic_()) -> nil)} | - {get_status, fun((status_info()) -> nil)}. - --type do_not_leak() :: any(). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/system.gleam", 19). --spec debug_state(list(debug_option())) -> debug_state(). -debug_state(A) -> - sys:debug_options(A). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/system.gleam", 65). -?DOC( - " Get the state of a given OTP compatible process. This function is only\n" - " intended for debugging.\n" - "\n" - " Requires Erlang/OTP 26.1 or newer, as the underlying interface changed\n" - " in [OTP-18633][1] from a literal type to a result type.\n" - "\n" - " For more information see the [Erlang documentation][2].\n" - "\n" - " [1]: https://www.erlang.org/patches/otp-26.1#stdlib-5.1\n" - " [2]: https://erlang.org/doc/man/sys.html#get_state-1\n" -). --spec get_state(gleam@erlang@process:pid_()) -> gleam@dynamic:dynamic_(). -get_state(From) -> - sys:get_state(From). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/system.gleam", 77). -?DOC( - " Request an OTP compatible process to suspend, causing it to only handle\n" - " system messages.\n" - "\n" - " For more information see the [Erlang documentation][1].\n" - "\n" - " [1]: https://erlang.org/doc/man/sys.html#suspend-1\n" -). --spec suspend(gleam@erlang@process:pid_()) -> nil. -suspend(Pid) -> - sys:suspend(Pid), - nil. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/system.gleam", 92). -?DOC( - " Request a suspended OTP compatible process to result, causing it to handle\n" - " all messages rather than only system messages.\n" - "\n" - " For more information see the [Erlang documentation][1].\n" - "\n" - " [1]: https://erlang.org/doc/man/sys.html#resume-1\n" -). --spec resume(gleam@erlang@process:pid_()) -> nil. -resume(Pid) -> - sys:resume(Pid), - nil. diff --git a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@task.erl b/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@task.erl deleted file mode 100644 index a9678ef..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam@otp@task.erl +++ /dev/null @@ -1,530 +0,0 @@ --module(gleam@otp@task). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([async/1, try_await/2, await/2, pid/1, await_forever/1, try_await2/3, try_await3/4, try_await4/5, try_await_all/2]). --export_type([task/1, await_error/0, message2/2, message3/3, message4/4, message/1]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " A task is a kind of process that computes a value and then sends the result back\n" - " to its parent. Commonly multiple tasks are used to compute multiple things at\n" - " once.\n" - "\n" - " If you do not care to receive a result back at the end then you should not\n" - " use this module, `actor` or `process` are likely more suitable.\n" - "\n" - " ```gleam\n" - " let task = task.async(fn() { do_some_work() })\n" - " let value = do_some_other_work()\n" - " value + task.await(task, 100)\n" - " ```\n" - "\n" - " Tasks spawned with async can be awaited on by their caller process (and\n" - " only their caller) as shown in the example above. They are implemented by\n" - " spawning a process that sends a message to the caller once the given\n" - " computation is performed.\n" - "\n" - " There are some important things to consider when using tasks:\n" - "\n" - " 1. If you are using async tasks, you must await a reply as they are always\n" - " sent.\n" - "\n" - " 2. Tasks link the caller and the spawned process. This means that,\n" - " if the caller crashes, the task will crash too and vice-versa. This is\n" - " on purpose: if the process meant to receive the result no longer\n" - " exists, there is no purpose in completing the computation.\n" - "\n" - " 3. A task's callback function must complete by returning or panicking.\n" - " It must not `exit` with the reason \"normal\".\n" - "\n" - " This module is inspired by Elixir's [Task module][1].\n" - "\n" - " [1]: https://hexdocs.pm/elixir/master/Task.html\n" - "\n" -). - --opaque task(HNB) :: {task, - gleam@erlang@process:pid_(), - gleam@erlang@process:pid_(), - gleam@erlang@process:subject(HNB)}. - --type await_error() :: timeout | {exit, gleam@dynamic:dynamic_()}. - --type message2(HNC, HND) :: {m2_from_subject1, HNC} | - {m2_from_subject2, HND} | - m2_timeout. - --type message3(HNE, HNF, HNG) :: {m3_from_subject1, HNE} | - {m3_from_subject2, HNF} | - {m3_from_subject3, HNG} | - m3_timeout. - --type message4(HNH, HNI, HNJ, HNK) :: {m4_from_subject1, HNH} | - {m4_from_subject2, HNI} | - {m4_from_subject3, HNJ} | - {m4_from_subject4, HNK} | - m4_timeout. - --type message(HNL) :: {message, integer(), HNL} | message_timeout. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/task.gleam", 55). -?DOC( - " Spawn a task process that calls a given function in order to perform some\n" - " work. The result of this function is sent back to the parent and can be\n" - " received using the `await` function.\n" - "\n" - " See the top level module documentation for more information on async/await.\n" -). --spec async(fun(() -> HNM)) -> task(HNM). -async(Work) -> - Owner = erlang:self(), - Subject = gleam@erlang@process:new_subject(), - Pid = gleam@erlang@process:start( - fun() -> gleam@erlang@process:send(Subject, Work()) end, - true - ), - {task, Owner, Pid, Subject}. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/task.gleam", 70). --spec assert_owner(task(any())) -> nil. -assert_owner(Task) -> - Self = erlang:self(), - case erlang:element(2, Task) =:= Self of - true -> - nil; - - false -> - gleam@erlang@process:send_abnormal_exit( - Self, - <<"awaited on a task that does not belong to this process"/utf8>> - ) - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/task.gleam", 88). -?DOC( - " Wait for the value computed by a task.\n" - "\n" - " If the a value is not received before the timeout has elapsed then an error\n" - " is returned.\n" -). --spec try_await(task(HNQ), integer()) -> {ok, HNQ} | {error, await_error()}. -try_await(Task, Timeout) -> - assert_owner(Task), - Selector = begin - _pipe = gleam_erlang_ffi:new_selector(), - gleam@erlang@process:selecting( - _pipe, - erlang:element(4, Task), - fun gleam@function:identity/1 - ) - end, - case gleam_erlang_ffi:select(Selector, Timeout) of - {ok, X} -> - {ok, X}; - - {error, nil} -> - {error, timeout} - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/task.gleam", 107). -?DOC( - " Wait for the value computed by a task.\n" - "\n" - " If the a value is not received before the timeout has elapsed or if the\n" - " task process crashes then this function crashes.\n" -). --spec await(task(HNU), integer()) -> HNU. -await(Task, Timeout) -> - _assert_subject = try_await(Task, Timeout), - {ok, Value} = case _assert_subject of - {ok, _} -> _assert_subject; - _assert_fail -> - erlang:error(#{gleam_error => let_assert, - message => <<"Pattern match failed, no pattern matched the value."/utf8>>, - value => _assert_fail, - module => <<"gleam/otp/task"/utf8>>, - function => <<"await"/utf8>>, - line => 108}) - end, - Value. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/task.gleam", 114). -?DOC(" Get the `Pid` for a task.\n"). --spec pid(task(any())) -> gleam@erlang@process:pid_(). -pid(Task) -> - erlang:element(3, Task). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/task.gleam", 125). -?DOC( - " Wait endlessly for the value computed by a task.\n" - "\n" - " Be Careful! Like `try_await_forever`, this function does not return until\n" - " there is a value to receive.\n" - "\n" - " If the task process crashes then this function crashes.\n" -). --spec await_forever(task(HNY)) -> HNY. -await_forever(Task) -> - assert_owner(Task), - Selector = begin - _pipe = gleam_erlang_ffi:new_selector(), - gleam@erlang@process:selecting( - _pipe, - erlang:element(4, Task), - fun gleam@function:identity/1 - ) - end, - gleam_erlang_ffi:select(Selector). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/task.gleam", 162). --spec try_await2_loop( - gleam@erlang@process:selector(message2(HOI, HOJ)), - gleam@option:option({ok, HOI} | {error, await_error()}), - gleam@option:option({ok, HOJ} | {error, await_error()}), - gleam@erlang@process:timer() -) -> {{ok, HOI} | {error, await_error()}, {ok, HOJ} | {error, await_error()}}. -try_await2_loop(Selector, T1, T2, Timer) -> - case {T1, T2} of - {{some, T1@1}, {some, T2@1}} -> - gleam@erlang@process:cancel_timer(Timer), - {T1@1, T2@1}; - - {_, _} -> - case gleam_erlang_ffi:select(Selector) of - {m2_from_subject1, X} -> - T1@2 = {some, {ok, X}}, - try_await2_loop(Selector, T1@2, T2, Timer); - - {m2_from_subject2, X@1} -> - T2@2 = {some, {ok, X@1}}, - try_await2_loop(Selector, T1, T2@2, Timer); - - m2_timeout -> - {gleam@option:unwrap(T1, {error, timeout}), - gleam@option:unwrap(T2, {error, timeout})} - end - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/task.gleam", 144). -?DOC( - " Wait for the values computed by multiple tasks.\n" - "\n" - " For each task, if the a value is not received before the timeout has\n" - " elapsed then an error is returned.\n" -). --spec try_await2(task(HOA), task(HOC), integer()) -> {{ok, HOA} | - {error, await_error()}, - {ok, HOC} | {error, await_error()}}. -try_await2(Task1, Task2, Timeout) -> - assert_owner(Task1), - assert_owner(Task2), - Timeout_subject = gleam@erlang@process:new_subject(), - Timer = gleam@erlang@process:send_after( - Timeout_subject, - Timeout, - m2_timeout - ), - _pipe = gleam_erlang_ffi:new_selector(), - _pipe@1 = gleam@erlang@process:selecting( - _pipe, - erlang:element(4, Task1), - fun(Field@0) -> {m2_from_subject1, Field@0} end - ), - _pipe@2 = gleam@erlang@process:selecting( - _pipe@1, - erlang:element(4, Task2), - fun(Field@0) -> {m2_from_subject2, Field@0} end - ), - _pipe@3 = gleam@erlang@process:selecting( - _pipe@2, - Timeout_subject, - fun gleam@function:identity/1 - ), - try_await2_loop(_pipe@3, none, none, Timer). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/task.gleam", 230). --spec try_await3_loop( - gleam@erlang@process:selector(message3(HPJ, HPK, HPL)), - gleam@option:option({ok, HPJ} | {error, await_error()}), - gleam@option:option({ok, HPK} | {error, await_error()}), - gleam@option:option({ok, HPL} | {error, await_error()}), - gleam@erlang@process:timer() -) -> {{ok, HPJ} | {error, await_error()}, - {ok, HPK} | {error, await_error()}, - {ok, HPL} | {error, await_error()}}. -try_await3_loop(Selector, T1, T2, T3, Timer) -> - case {T1, T2, T3} of - {{some, T1@1}, {some, T2@1}, {some, T3@1}} -> - gleam@erlang@process:cancel_timer(Timer), - {T1@1, T2@1, T3@1}; - - {_, _, _} -> - case gleam_erlang_ffi:select(Selector) of - {m3_from_subject1, X} -> - T1@2 = {some, {ok, X}}, - try_await3_loop(Selector, T1@2, T2, T3, Timer); - - {m3_from_subject2, X@1} -> - T2@2 = {some, {ok, X@1}}, - try_await3_loop(Selector, T1, T2@2, T3, Timer); - - {m3_from_subject3, X@2} -> - T3@2 = {some, {ok, X@2}}, - try_await3_loop(Selector, T1, T2, T3@2, Timer); - - m3_timeout -> - {gleam@option:unwrap(T1, {error, timeout}), - gleam@option:unwrap(T2, {error, timeout}), - gleam@option:unwrap(T3, {error, timeout})} - end - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/task.gleam", 209). -?DOC( - " Wait for the values computed by multiple tasks.\n" - "\n" - " For each task, if the a value is not received before the timeout has\n" - " elapsed then an error is returned.\n" -). --spec try_await3(task(HOX), task(HOZ), task(HPB), integer()) -> {{ok, HOX} | - {error, await_error()}, - {ok, HOZ} | {error, await_error()}, - {ok, HPB} | {error, await_error()}}. -try_await3(Task1, Task2, Task3, Timeout) -> - assert_owner(Task1), - assert_owner(Task2), - assert_owner(Task3), - Timeout_subject = gleam@erlang@process:new_subject(), - Timer = gleam@erlang@process:send_after( - Timeout_subject, - Timeout, - m3_timeout - ), - _pipe = gleam_erlang_ffi:new_selector(), - _pipe@1 = gleam@erlang@process:selecting( - _pipe, - erlang:element(4, Task1), - fun(Field@0) -> {m3_from_subject1, Field@0} end - ), - _pipe@2 = gleam@erlang@process:selecting( - _pipe@1, - erlang:element(4, Task2), - fun(Field@0) -> {m3_from_subject2, Field@0} end - ), - _pipe@3 = gleam@erlang@process:selecting( - _pipe@2, - erlang:element(4, Task3), - fun(Field@0) -> {m3_from_subject3, Field@0} end - ), - _pipe@4 = gleam@erlang@process:selecting( - _pipe@3, - Timeout_subject, - fun gleam@function:identity/1 - ), - try_await3_loop(_pipe@4, none, none, none, Timer). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/task.gleam", 312). --spec try_await4_loop( - gleam@erlang@process:selector(message4(HQV, HQW, HQX, HQY)), - gleam@option:option({ok, HQV} | {error, await_error()}), - gleam@option:option({ok, HQW} | {error, await_error()}), - gleam@option:option({ok, HQX} | {error, await_error()}), - gleam@option:option({ok, HQY} | {error, await_error()}), - gleam@erlang@process:timer() -) -> {{ok, HQV} | {error, await_error()}, - {ok, HQW} | {error, await_error()}, - {ok, HQX} | {error, await_error()}, - {ok, HQY} | {error, await_error()}}. -try_await4_loop(Selector, T1, T2, T3, T4, Timer) -> - case {T1, T2, T3, T4} of - {{some, T1@1}, {some, T2@1}, {some, T3@1}, {some, T4@1}} -> - gleam@erlang@process:cancel_timer(Timer), - {T1@1, T2@1, T3@1, T4@1}; - - {_, _, _, _} -> - case gleam_erlang_ffi:select(Selector) of - {m4_from_subject1, X} -> - T1@2 = {some, {ok, X}}, - try_await4_loop(Selector, T1@2, T2, T3, T4, Timer); - - {m4_from_subject2, X@1} -> - T2@2 = {some, {ok, X@1}}, - try_await4_loop(Selector, T1, T2@2, T3, T4, Timer); - - {m4_from_subject3, X@2} -> - T3@2 = {some, {ok, X@2}}, - try_await4_loop(Selector, T1, T2, T3@2, T4, Timer); - - {m4_from_subject4, X@3} -> - T4@2 = {some, {ok, X@3}}, - try_await4_loop(Selector, T1, T2, T3, T4@2, Timer); - - m4_timeout -> - {gleam@option:unwrap(T1, {error, timeout}), - gleam@option:unwrap(T2, {error, timeout}), - gleam@option:unwrap(T3, {error, timeout}), - gleam@option:unwrap(T4, {error, timeout})} - end - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/task.gleam", 284). -?DOC( - " Wait for the values computed by multiple tasks.\n" - "\n" - " For each task, if the a value is not received before the timeout has\n" - " elapsed then an error is returned.\n" -). --spec try_await4(task(HQF), task(HQH), task(HQJ), task(HQL), integer()) -> {{ok, - HQF} | - {error, await_error()}, - {ok, HQH} | {error, await_error()}, - {ok, HQJ} | {error, await_error()}, - {ok, HQL} | {error, await_error()}}. -try_await4(Task1, Task2, Task3, Task4, Timeout) -> - assert_owner(Task1), - assert_owner(Task2), - assert_owner(Task3), - Timeout_subject = gleam@erlang@process:new_subject(), - Timer = gleam@erlang@process:send_after( - Timeout_subject, - Timeout, - m4_timeout - ), - _pipe = gleam_erlang_ffi:new_selector(), - _pipe@1 = gleam@erlang@process:selecting( - _pipe, - erlang:element(4, Task1), - fun(Field@0) -> {m4_from_subject1, Field@0} end - ), - _pipe@2 = gleam@erlang@process:selecting( - _pipe@1, - erlang:element(4, Task2), - fun(Field@0) -> {m4_from_subject2, Field@0} end - ), - _pipe@3 = gleam@erlang@process:selecting( - _pipe@2, - erlang:element(4, Task3), - fun(Field@0) -> {m4_from_subject3, Field@0} end - ), - _pipe@4 = gleam@erlang@process:selecting( - _pipe@3, - erlang:element(4, Task4), - fun(Field@0) -> {m4_from_subject4, Field@0} end - ), - _pipe@5 = gleam@erlang@process:selecting( - _pipe@4, - Timeout_subject, - fun gleam@function:identity/1 - ), - try_await4_loop(_pipe@5, none, none, none, none, Timer). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/task.gleam", 441). --spec dict_to_list_loop( - gleam@dict:dict(integer(), HSS), - HSS, - integer(), - list(HSS) -) -> list(HSS). -dict_to_list_loop(Dict, Default, Index, List) -> - case Index < 0 of - true -> - List; - - false -> - Value@1 = case gleam_stdlib:map_get(Dict, Index) of - {error, _} -> - Default; - - {ok, Value} -> - Value - end, - dict_to_list_loop(Dict, Default, Index - 1, [Value@1 | List]) - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/task.gleam", 437). -?DOC( - " Given a dict returns a list with size `sized` where each item at index `i`\n" - " is `dict.get(dict, i) |> result.unwrap(default)`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " dict.from_list([#(1, \"a\"), #(4, \"b\")])\n" - " |> dict_to_list(5, \" \")\n" - " // -> [\" \", \"a\", \" \", \" \", \"b\"]\n" - " ```\n" -). --spec dict_to_list(gleam@dict:dict(integer(), HSO), integer(), HSO) -> list(HSO). -dict_to_list(Dict, Sized, Default) -> - dict_to_list_loop(Dict, Default, Sized - 1, []). - --file("/Users/louis/src/gleam/otp/src/gleam/otp/task.gleam", 401). --spec try_await_all_loop( - gleam@dict:dict(integer(), {ok, HSE} | {error, await_error()}), - integer(), - gleam@erlang@process:timer(), - gleam@erlang@process:selector(message(HSE)) -) -> list({ok, HSE} | {error, await_error()}). -try_await_all_loop(Values, Tasks_count, Timer, Selector) -> - case maps:size(Values) =:= Tasks_count of - true -> - gleam@erlang@process:cancel_timer(Timer), - dict_to_list(Values, Tasks_count, {error, timeout}); - - false -> - case gleam_erlang_ffi:select(Selector) of - message_timeout -> - dict_to_list(Values, Tasks_count, {error, timeout}); - - {message, Index, Value} -> - Values@1 = gleam@dict:insert(Values, Index, {ok, Value}), - try_await_all_loop(Values@1, Tasks_count, Timer, Selector) - end - end. - --file("/Users/louis/src/gleam/otp/src/gleam/otp/task.gleam", 374). -?DOC( - " Wait for the values computed by multiple tasks.\n" - "\n" - " For each task, if the a value is not received before the timeout has\n" - " elapsed then an error is returned.\n" -). --spec try_await_all(list(task(HRY)), integer()) -> list({ok, HRY} | - {error, await_error()}). -try_await_all(Tasks, Timeout) -> - {Selector@2, Tasks_count@1} = begin - Acc = {gleam_erlang_ffi:new_selector(), 0}, - gleam@list:index_fold( - Tasks, - Acc, - fun(_use0, Task, Index) -> - {Selector, Tasks_count} = _use0, - assert_owner(Task), - Selector@1 = gleam@erlang@process:selecting( - Selector, - erlang:element(4, Task), - fun(_capture) -> {message, Index, _capture} end - ), - {Selector@1, Tasks_count + 1} - end - ) - end, - Timeout_subject = gleam@erlang@process:new_subject(), - Timer = gleam@erlang@process:send_after( - Timeout_subject, - Timeout, - message_timeout - ), - Selector@3 = gleam@erlang@process:selecting( - Selector@2, - Timeout_subject, - fun gleam@function:identity/1 - ), - try_await_all_loop(maps:new(), Tasks_count@1, Timer, Selector@3). diff --git a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam_otp.app.src b/lsp/bet-lsp/build/packages/gleam_otp/src/gleam_otp.app.src deleted file mode 100644 index 14ffa23..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam_otp.app.src +++ /dev/null @@ -1,14 +0,0 @@ -{application, gleam_otp, [ - {vsn, "0.16.1"}, - {applications, [gleam_erlang, - gleam_stdlib]}, - {description, "Fault tolerant multicore Gleam programs with OTP"}, - {modules, [gleam@otp@actor, - gleam@otp@intensity_tracker, - gleam@otp@port, - gleam@otp@static_supervisor, - gleam@otp@supervisor, - gleam@otp@system, - gleam@otp@task]}, - {registered, []} -]}. diff --git a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam_otp_external.erl b/lsp/bet-lsp/build/packages/gleam_otp/src/gleam_otp_external.erl deleted file mode 100644 index 27c1073..0000000 --- a/lsp/bet-lsp/build/packages/gleam_otp/src/gleam_otp_external.erl +++ /dev/null @@ -1,52 +0,0 @@ --module(gleam_otp_external). - --export([ - application_stopped/0, convert_system_message/2, - static_supervisor_start_link/1 -]). - -% TODO: support other system messages -% {replace_state, StateFn} -% {change_code, Mod, Vsn, Extra} -% {terminate, Reason} -% {debug, {log, Flag}} -% {debug, {trace, Flag}} -% {debug, {log_to_file, FileName}} -% {debug, {statistics, Flag}} -% {debug, no_debug} -% {debug, {install, {Func, FuncState}}} -% {debug, {install, {FuncId, Func, FuncState}}} -% {debug, {remove, FuncOrId}} -% GetStatus(Subject(StatusInfo)) -convert_system_message({From, Ref}, Request) when is_pid(From) -> - Reply = fun(Msg) -> - erlang:send(From, {Ref, Msg}), - nil - end, - System = fun(Callback) -> - {system, {Request, Callback}} - end, - case Request of - get_status -> System(fun(Status) -> Reply(process_status(Status)) end); - get_state -> System(fun(State) -> Reply({ok, State}) end); - suspend -> System(fun() -> Reply(ok) end); - resume -> System(fun() -> Reply(ok) end); - Other -> {unexpected, Other} - end. - -process_status({status_info, Module, Parent, Mode, DebugState, State}) -> - Data = [ - get(), Mode, Parent, DebugState, - [{header, "Status for Gleam process " ++ pid_to_list(self())}, - {data, [{'Status', Mode}, {'Parent', Parent}, {'State', State}]}] - ], - {status, self(), {module, Module}, Data}. - -application_stopped() -> - ok. - -static_supervisor_start_link(Arg) -> - case supervisor:start_link(gleam@otp@static_supervisor, Arg) of - {ok, P} -> {ok, P}; - {error, E} -> {error, {init_crashed, E}} - end. diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/LICENCE b/lsp/bet-lsp/build/packages/gleam_stdlib/LICENCE deleted file mode 100644 index c1dabd0..0000000 --- a/lsp/bet-lsp/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/lsp/bet-lsp/build/packages/gleam_stdlib/README.md b/lsp/bet-lsp/build/packages/gleam_stdlib/README.md deleted file mode 100644 index 5e1ed4c..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# stdlib - -[![Package Version](https://img.shields.io/hexpm/v/gleam_stdlib)](https://hex.pm/packages/gleam_stdlib) -[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/gleam_stdlib/) -[![Discord chat](https://img.shields.io/discord/768594524158427167?color=blue)](https://discord.gg/Fm8Pwmy) - -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 -``` -```gleam -import gleam/io - -pub fn greet(name: String) -> Nil { - io.println("Hello " <> name <> "!") -} -``` - -## Targets - -Gleam's standard library supports both targets: Erlang and JavaScript. - -### Compatibility - -This library is compatible with all versions of Erlang/OTP 26 and higher, -as well as all NodeJS, Deno, Bun, 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/lsp/bet-lsp/build/packages/gleam_stdlib/gleam.toml b/lsp/bet-lsp/build/packages/gleam_stdlib/gleam.toml deleted file mode 100644 index d43d7f3..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/gleam.toml +++ /dev/null @@ -1,14 +0,0 @@ -name = "gleam_stdlib" -version = "0.68.1" -gleam = ">= 1.14.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/lsp/bet-lsp/build/packages/gleam_stdlib/include/gleam@dynamic@decode_DecodeError.hrl b/lsp/bet-lsp/build/packages/gleam_stdlib/include/gleam@dynamic@decode_DecodeError.hrl deleted file mode 100644 index b1135f2..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/include/gleam@dynamic@decode_DecodeError.hrl +++ /dev/null @@ -1,5 +0,0 @@ --record(decode_error, { - expected :: binary(), - found :: binary(), - path :: list(binary()) -}). diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/include/gleam@dynamic@decode_Decoder.hrl b/lsp/bet-lsp/build/packages/gleam_stdlib/include/gleam@dynamic@decode_Decoder.hrl deleted file mode 100644 index a2fcfc6..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/include/gleam@dynamic@decode_Decoder.hrl +++ /dev/null @@ -1,4 +0,0 @@ --record(decoder, { - function :: fun((gleam@dynamic:dynamic_()) -> {any(), - list(gleam@dynamic@decode:decode_error())}) -}). diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/include/gleam@set_Set.hrl b/lsp/bet-lsp/build/packages/gleam_stdlib/include/gleam@set_Set.hrl deleted file mode 100644 index 51fb778..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/include/gleam@set_Set.hrl +++ /dev/null @@ -1 +0,0 @@ --record(set, {dict :: gleam@dict:dict(any(), list(nil))}). diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/include/gleam@uri_Uri.hrl b/lsp/bet-lsp/build/packages/gleam_stdlib/include/gleam@uri_Uri.hrl deleted file mode 100644 index 50150f4..0000000 --- a/lsp/bet-lsp/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/lsp/bet-lsp/build/packages/gleam_stdlib/src/dict.mjs b/lsp/bet-lsp/build/packages/gleam_stdlib/src/dict.mjs deleted file mode 100644 index 3db3b5f..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/dict.mjs +++ /dev/null @@ -1,710 +0,0 @@ -/** - * This file uses jsdoc to annotate types. - * These types can be checked using the typescript compiler with "checkjs" option. - */ - -import { isEqual, Result$Error, Result$Ok } from "./gleam.mjs"; - -// -- HASH -------------------------------------------------------------------- - -const referenceMap = /* @__PURE__ */ new WeakMap(); -const tempDataView = /* @__PURE__ */ new DataView( - /* @__PURE__ */ 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 - } -} - -// -- DICT -------------------------------------------------------------------- - -/** - * An implementation of the CHAMP data structure, an optimised HAMT. - * - * See: M. J. Steindorfer, J.J. Vinju (2015). Optimizing Hash-Array Mapped Tries for - Fast and Lean Immutable JVM Collections. Available: https://michael.steindorfer.name/publications/oopsla15.pdf - */ -export default class Dict { - constructor(size, root) { - this.size = size; - this.root = root; - } -} - -/// The power-of-2 branching factor for the dict. For example, a value of `5` indicates a 32-ary tree. -const bits = 5; -const mask = (1 << bits) - 1; - -/// This symbol is used internally to avoid constructing results. -const noElementMarker = Symbol(); - -/// This symbol is used to store the "generation" on a node. -/// Using a symbol makes the property not enumerable, which means the generation -/// will be ignored during equality checks. -const generationKey = Symbol(); - -// Some commonly used constants throughout the code. -const emptyNode = /* @__PURE__ */ newNode(0); -const emptyDict = /* @__PURE__ */ new Dict(0, emptyNode); -const errorNil = /* @__PURE__ */ Result$Error(undefined); - -function makeNode(generation, datamap, nodemap, data) { - // The order of fields is important, as they define the order `isEqual` will - // compare our fields. Putting the bitmaps first means that equality can - // early-out if the bitmaps are not equal. - return { - // A node is a high-arity (32 in practice) hybrid tree node. - // Hybrid means that it stores data directly as well as pointers to child nodes. - // - // Each node contains 2 bitmaps: - // - The datamap has a bit set if that slot in the node contains direct data - // - The nodemap has a bit set if that slot in the node contains another node. - // - // Both are exclusive to on another, so datamap & nodemap == 0. - // - // Every key/hash value directly correlates to a specific bit by using a trie - // suffix (least significant bits first) encoding. - // For example, if the last 5 bits of the hash are 1101, the bit to check for - // that value is the 13th bit. - datamap, - nodemap, - // The slots itself are stored in a single contiguous array that contains - // both direct k/v-pairs and child nodes. - // - // The direct children come first, followed by the child nodes in _reverse order_: - // - // 7654321 - // datamap: 1000100 - // nodemap: 10011 - // data: [key3, value3, key7, value7, child5, child2, child1] - // -------------------------> <--------------------- - // datamap nodemap - // - // Every `1` bit in the datamap corresponds to a pair of [key, value] entries, - // and every `1` bit in the nodemap corresponds to a child node entry. - // - // Children are stored in reverse order to avoid having to store or calculate an - // "offset" value to skip over the direct children. - data, - // The generation is used to track which nodes need to be copied during transient updates. - // Using a symbol here makes `isEqual` ignore this field. - [generationKey]: generation, - }; -} - -function newNode(generation) { - return makeNode(generation, 0, 0, []); -} - -/** - * Copies a node and its data array if it's from another generation, making it safe - * to mutate the node. - */ -function copyNode(node, generation) { - if (node[generationKey] === generation) { - return node; - } - - const newData = node.data.slice(0); - return makeNode(generation, node.datamap, node.nodemap, newData); -} - -/** - * Copies a node if needed and sets a new value. - */ -function copyAndSet(node, generation, idx, val) { - if (node.data[idx] === val) { - return node; - } - - // Using copyNode is faster than a specialised implementation. - node = copyNode(node, generation); - node.data[idx] = val; - return node; -} - -/** - * Copies a node if needed, and then inserts a new key-value pair. - */ -function copyAndInsertPair(node, generation, bit, idx, key, val) { - const data = node.data; - const length = data.length; - - // the fastest way to insert a pair is to always copy. - const newData = new Array(length + 2); - - let readIndex = 0; - let writeIndex = 0; - - while (readIndex < idx) newData[writeIndex++] = data[readIndex++]; - newData[writeIndex++] = key; - newData[writeIndex++] = val; - while (readIndex < length) newData[writeIndex++] = data[readIndex++]; - - return makeNode(generation, node.datamap | bit, node.nodemap, newData); -} - -function copyAndRemovePair(node, generation, bit, idx) { - node = copyNode(node, generation); - - const data = node.data; - const length = data.length; - for (let w = idx, r = idx + 2; r < length; ++r, ++w) { - data[w] = data[r]; - } - data.pop(); - data.pop(); - - node.datamap ^= bit; - return node; -} - -export function make() { - return emptyDict; -} - -export function from(iterable) { - let transient = toTransient(emptyDict); - for (const [key, value] of iterable) { - transient = destructiveTransientInsert(key, value, transient); - } - return fromTransient(transient); -} - -export function size(dict) { - return dict.size; -} - -export function get(dict, key) { - const result = lookup(dict.root, key, getHash(key)); - return result !== noElementMarker ? Result$Ok(result) : errorNil; -} - -export function has(dict, key) { - return lookup(dict.root, key, getHash(key)) !== noElementMarker; -} - -function lookup(node, key, hash) { - for (let shift = 0; shift < 32; shift += bits) { - const data = node.data; - const bit = hashbit(hash, shift); - - if (node.nodemap & bit) { - // we found our hash inside the nodemap, so we can continue our search there. - node = data[data.length - 1 - index(node.nodemap, bit)]; - } else if (node.datamap & bit) { - // we store this hash directly! - // - // this also means that there are no other values with the same - // hash prefix in this dict. - // - // We still need to check if the key matches, but if it does we know for - // sure that this is the correct value, and if it doesn't that we don't - // contain the value in question. - const dataidx = Math.imul(index(node.datamap, bit), 2); - return isEqual(key, data[dataidx]) ? data[dataidx + 1] : noElementMarker; - } else { - // if the hash bit is not set in neither bitmaps, we immediately know that - // this key cannot be inside this dict. - return noElementMarker; - } - } - - // our shift has exceeded 32 bits. Everything that follows is - // implicitely an overflow node and only contains direct children. - const overflow = node.data; - for (let i = 0; i < overflow.length; i += 2) { - if (isEqual(key, overflow[i])) { - return overflow[i + 1]; - } - } - - return noElementMarker; -} - -/** - * We use "transient" values to allow for safer internal mutations of the data - * structure. This is an optimisation only. No mutable API is exposed to the user. - * - * Transients are to be treated as having a linear (single-use, think rust) type. - * A transient value becomes invalid as soon as it's passed to one of the functions. - * - * Internally, we track a "generation" value on each node. If the generation - * doesn't match the one for the current transient, we have to copy - the node - * could still be referenced by another dict instance! - * After that, no other references than the transient one exists, so it's safe - * to mutate in place. - */ -export function toTransient(dict) { - return { - generation: nextGeneration(dict), - root: dict.root, - size: dict.size, - dict: dict, - }; -} - -/** - * Consume a transient, producing a normal Dict again. - */ -export function fromTransient(transient) { - if (transient.root === transient.dict.root) { - return transient.dict; - } - - return new Dict(transient.size, transient.root); -} - -/** - * Find and allocate the next generation id. - * - * @template K,V - * @param {Dict} dict - * @returns {number} - */ -function nextGeneration(dict) { - const root = dict.root; - if (root[generationKey] < Number.MAX_SAFE_INTEGER) { - return root[generationKey] + 1; - } - - // we have reached MAX_SAFE_INTEGER generations - - // at this point, we have to walk the dictionary once to reset the counter - // on every node. This is safe since it's part of the contract for transient - // that only one of them exists at any given time. - // - const queue = [root]; - while (queue.length) { - // order doesn't matter, so we can use push/pop for faster array usage. - const node = queue.pop(); - - // reset the generation to 0 - node[generationKey] = 0; - - // queue all other referenced nodes - // We need to query the length from the nodemap, as we don't know if this - // is an overflow node or not! if it is, it will never have datamap set! - const nodeStart = data.length - popcount(node.nodemap); - for (let i = nodeStart; i < node.data.length; ++i) { - queue.push(node.data[i]); - } - } - - return 1; -} - -/// Insert is the second-most performance-sensitive operation. -/// We use a global "transient" value here to avoid doing a memory allocation. -const globalTransient = /* @__PURE__ */ toTransient(emptyDict); - -export function insert(dict, key, value) { - globalTransient.generation = nextGeneration(dict); - globalTransient.size = dict.size; - - const hash = getHash(key); - const root = insertIntoNode(globalTransient, dict.root, key, value, hash, 0); - if (root === dict.root) { - return dict; - } - - return new Dict(globalTransient.size, root); -} - -/** - * Consume a transient, writing a new key/value pair into the dictionary it - * represents. If the key already exists, it will be overwritten. - * - * Returns a new transient. - */ -export function destructiveTransientInsert(key, value, transient) { - const hash = getHash(key); - transient.root = insertIntoNode(transient, transient.root, key, value, hash, 0); - return transient; -} - -/** - * Consume a transient, writing a new key/value pair if the key doesn't exist or updating - * the existing value with a function if it does. - * - * Returns a new transient. - */ -export function destructiveTransientUpdateWith(key, fun, value, transient) { - const hash = getHash(key); - - const existing = lookup(transient.root, key, hash); - if (existing !== noElementMarker) { - value = fun(existing); - } - transient.root = insertIntoNode(transient, transient.root, key, value, hash, 0); - return transient; -} - -function insertIntoNode(transient, node, key, value, hash, shift) { - const data = node.data; - const generation = transient.generation; - - // 1. Overflow Node - // overflow nodes only contain key/value-pairs. we walk the data linearly trying to find a match. - if (shift > 32) { - for (let i = 0; i < data.length; i += 2) { - if (isEqual(key, data[i])) { - return copyAndSet(node, generation, i + 1, value); - } - } - - transient.size += 1; - return copyAndInsertPair(node, generation, 0, data.length, key, value); - } - - const bit = hashbit(hash, shift); - - // 2. Child Node - // We have to check first if there is already a child node we have to traverse to. - if (node.nodemap & bit) { - const nodeidx = data.length - 1 - index(node.nodemap, bit); - - let child = data[nodeidx]; - child = insertIntoNode(transient, child, key, value, hash, shift + bits); - return copyAndSet(node, generation, nodeidx, child); - } - - // 3. New Data Node - // No child node and no data node exists yet, so we can potentially just insert a new value. - const dataidx = Math.imul(index(node.datamap, bit), 2); - if ((node.datamap & bit) === 0) { - transient.size += 1; - return copyAndInsertPair(node, generation, bit, dataidx, key, value); - } - - // 4. Existing Data Node - // We have a match that we can update, or remove. - if (isEqual(key, data[dataidx])) { - return copyAndSet(node, generation, dataidx + 1, value); - } - - // 5. Collision - // There is no child node, but a data node with the same hash, but with a different key. - // To resolve this, we push both nodes down one level. - const childShift = shift + bits; - - let child = emptyNode; - child = insertIntoNode(transient, child, key, value, hash, childShift); - - const key2 = data[dataidx]; - const value2 = data[dataidx + 1]; - const hash2 = getHash(key2); - child = insertIntoNode(transient, child, key2, value2, hash2, childShift); - - // we inserted 2 elements, but implicitely deleted the one we pushed down from the datamap. - transient.size -= 1; - - // remove the old data pair, and insert the new child node. - const length = data.length; - const nodeidx = length - 1 - index(node.nodemap, bit); - - // writing these loops in javascript instead of a combination of splices - // turns out to be faster. Copying always turned out to be faster. - const newData = new Array(length - 1); - - let readIndex = 0; - let writeIndex = 0; - - // [0..dataidx, skip 2 elements, ..nodeidx, newChild, ..rest] - while (readIndex < dataidx) newData[writeIndex++] = data[readIndex++]; - readIndex += 2; - while (readIndex <= nodeidx) newData[writeIndex++] = data[readIndex++]; - newData[writeIndex++] = child; - while (readIndex < length) newData[writeIndex++] = data[readIndex++]; - - return makeNode(generation, node.datamap ^ bit, node.nodemap | bit, newData); -} - -/** - * Consume a transient, removing a key if it exists. - * Returns a new transient. - */ -export function destructiveTransientDelete(key, transient) { - const hash = getHash(key); - transient.root = deleteFromNode(transient, transient.root, key, hash, 0); - return transient; -} - -function deleteFromNode(transient, node, key, hash, shift) { - const data = node.data; - const generation = transient.generation; - - // 1. Overflow Node - // overflow nodes only contain key/value-pairs. we walk the data linearly trying to find a match. - if (shift > 32) { - for (let i = 0; i < data.length; i += 2) { - if (isEqual(key, data[i])) { - transient.size -= 1; - return copyAndRemovePair(node, generation, 0, i); - } - } - - return node; - } - - const bit = hashbit(hash, shift); - const dataidx = Math.imul(index(node.datamap, bit), 2); - - // 2. Child Node - // We have to check first if there is already a child node we have to traverse to. - if ((node.nodemap & bit) !== 0) { - const nodeidx = data.length - 1 - index(node.nodemap, bit); - - let child = data[nodeidx]; - child = deleteFromNode(transient, child, key, hash, shift + bits); - - // the node did change, so let's copy to incorporate that change. - if (child.nodemap !== 0 || child.data.length > 2) { - return copyAndSet(node, generation, nodeidx, child); - } - - // this node only has a single data (k/v-pair) child. - // to restore the CHAMP invariant, we "pull" that pair up into ourselves. - // this ensures that every tree stays in its single optimal representation, - // and allows dicts to be structurally compared. - const length = data.length; - const newData = new Array(length + 1); - - let readIndex = 0; - let writeIndex = 0; - - while (readIndex < dataidx) newData[writeIndex++] = data[readIndex++]; - newData[writeIndex++] = child.data[0]; - newData[writeIndex++] = child.data[1]; - while (readIndex < nodeidx) newData[writeIndex++] = data[readIndex++]; - readIndex++; - while (readIndex < length) newData[writeIndex++] = data[readIndex++]; - - return makeNode(generation, node.datamap | bit, node.nodemap ^ bit, newData); - } - - // 3. Data Node - // There is no data entry here, or it is a prefix for a different key - if ((node.datamap & bit) === 0 || !isEqual(key, data[dataidx])) { - return node; - } - - // we found a data entry that we can delete. - transient.size -= 1; - return copyAndRemovePair(node, generation, bit, dataidx); -} - -export function map(dict, fun) { - // map can never modify the structure, so we can walk the dictionary directly, - // but still move to a new generation to make sure we get a new copy of every node. - const generation = nextGeneration(dict); - const root = copyNode(dict.root, generation); - const queue = [root]; - - while (queue.length) { - // order doesn't matter, so we can use push/pop for faster array usage. - const node = queue.pop(); - const data = node.data; - // every node contains popcount(datamap) direct entries - // We need to query the length from the nodemap, as we don't know if this - // is an overflow node or not! if it is, it will never have datamap set! - const edgesStart = data.length - popcount(node.nodemap); - for (let i = 0; i < edgesStart; i += 2) { - // we copied the node while queueing it, so direct mutation here is safe. - data[i + 1] = fun(data[i], data[i + 1]); - } - // the remaining entries are other nodes we can queue - for (let i = edgesStart; i < data.length; ++i) { - // copy the node first to make it safe to mutate - data[i] = copyNode(data[i], generation); - queue.push(data[i]); - } - } - - return new Dict(dict.size, root); -} - -export function fold(dict, state, fun) { - const queue = [dict.root]; - - while (queue.length) { - // order doesn't matter, so we can use push/pop for faster array usage. - const node = queue.pop(); - const data = node.data; - // every node contains popcount(datamap) direct entries - // We need to query the length from the nodemap, as we don't know if this - // is an overflow node or not! if it is, it will never have datamap set! - const edgesStart = data.length - popcount(node.nodemap); - for (let i = 0; i < edgesStart; i += 2) { - state = fun(state, data[i], data[i + 1]); - } - // the remaining entries are child nodes we can queue. - for (let i = edgesStart; i < data.length; ++i) { - queue.push(data[i]); - } - } - - return state; -} - -/** - * How many `1` bits are set in a 32-bit integer. - */ -function popcount(n) { - n -= (n >>> 1) & 0x55555555; - n = (n & 0x33333333) + ((n >>> 2) & 0x33333333); - return Math.imul((n + (n >>> 4)) & 0x0f0f0f0f, 0x01010101) >>> 24; -} - -/** - * Given a population bitmap and a bit selected from that map, returns - * how many less significant 1 bits there are. - * - * For example, index(10101, 100) returns 1, since there is a single less - * significant `1` bit. This translates to the 0-based "index" of that bit. - */ -function index(bitmap, bit) { - return popcount(bitmap & (bit - 1)); -} - -/** - * Extracts a single slice of the hash, and returns a bitmask for the resulting value. - * For example, if the slice returns 5, this function returns 10000 = 1 << 5. - */ -function hashbit(hash, shift) { - return 1 << ((hash >>> shift) & mask); -} diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/bit_array.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/bit_array.gleam deleted file mode 100644 index 544b74a..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/bit_array.gleam +++ /dev/null @@ -1,280 +0,0 @@ -//// BitArrays are a sequence of binary data of any length. - -import gleam/int -import gleam/order -import gleam/string - -/// Converts a UTF-8 `String` type into a `BitArray`. -/// -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "bit_array_from_string") -pub fn from_string(x: String) -> BitArray - -/// Returns an integer which is the number of bits in the bit array. -/// -@external(erlang, "erlang", "bit_size") -@external(javascript, "../gleam_stdlib.mjs", "bit_array_bit_size") -pub fn bit_size(x: BitArray) -> Int - -/// Returns an integer which is the number of bytes in the bit array. -/// -@external(erlang, "erlang", "byte_size") -@external(javascript, "../gleam_stdlib.mjs", "bit_array_byte_size") -pub fn byte_size(x: BitArray) -> Int - -/// Pads a bit array with zeros so that it is a whole number of bytes. -/// -@external(erlang, "gleam_stdlib", "bit_array_pad_to_bytes") -@external(javascript, "../gleam_stdlib.mjs", "bit_array_pad_to_bytes") -pub fn pad_to_bytes(x: BitArray) -> BitArray - -/// Creates a new bit array by joining two bit arrays. -/// -/// ## Examples -/// -/// ```gleam -/// append(to: from_string("butter"), suffix: from_string("fly")) -/// // -> from_string("butterfly") -/// ``` -/// -pub fn append(to first: BitArray, suffix second: BitArray) -> BitArray { - concat([first, second]) -} - -/// Extracts a sub-section of a bit array. -/// -/// 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 array. -/// -/// This function runs in constant time. -/// -@external(erlang, "gleam_stdlib", "bit_array_slice") -@external(javascript, "../gleam_stdlib.mjs", "bit_array_slice") -pub fn slice( - from string: BitArray, - at position: Int, - take length: Int, -) -> Result(BitArray, Nil) - -/// Tests to see whether a bit array is valid UTF-8. -/// -pub fn is_utf8(bits: BitArray) -> Bool { - is_utf8_loop(bits) -} - -@target(erlang) -fn is_utf8_loop(bits: BitArray) -> Bool { - case bits { - <<>> -> True - <<_:utf8, rest:bytes>> -> is_utf8_loop(rest) - _ -> False - } -} - -@target(javascript) -fn is_utf8_loop(bits: BitArray) -> Bool { - case to_string(bits) { - Ok(_) -> True - Error(_) -> False - } -} - -/// Converts a bit array to a string. -/// -/// Returns an error if the bit array is invalid UTF-8 data. -/// -@external(javascript, "../gleam_stdlib.mjs", "bit_array_to_string") -pub fn to_string(bits: BitArray) -> Result(String, Nil) { - case is_utf8(bits) { - True -> Ok(unsafe_to_string(bits)) - False -> Error(Nil) - } -} - -@external(erlang, "gleam_stdlib", "identity") -fn unsafe_to_string(a: BitArray) -> String - -/// Creates a new bit array by joining multiple binaries. -/// -/// ## Examples -/// -/// ```gleam -/// concat([from_string("butter"), from_string("fly")]) -/// // -> from_string("butterfly") -/// ``` -/// -@external(erlang, "gleam_stdlib", "bit_array_concat") -@external(javascript, "../gleam_stdlib.mjs", "bit_array_concat") -pub fn concat(bit_arrays: List(BitArray)) -> BitArray - -/// Encodes a BitArray into a base 64 encoded string. -/// -/// If the bit array does not contain a whole number of bytes then it is padded -/// with zero bits prior to being encoded. -/// -@external(erlang, "gleam_stdlib", "base64_encode") -@external(javascript, "../gleam_stdlib.mjs", "base64_encode") -pub fn base64_encode(input: BitArray, padding: Bool) -> String - -/// Decodes a base 64 encoded string into a `BitArray`. -/// -pub fn base64_decode(encoded: String) -> Result(BitArray, Nil) { - let padded = case byte_size(from_string(encoded)) % 4 { - 0 -> encoded - n -> string.append(encoded, string.repeat("=", 4 - n)) - } - decode64(padded) -} - -@external(erlang, "gleam_stdlib", "base64_decode") -@external(javascript, "../gleam_stdlib.mjs", "base64_decode") -fn decode64(a: String) -> Result(BitArray, Nil) - -/// Encodes a `BitArray` into a base 64 encoded string with URL and filename -/// safe alphabet. -/// -/// If the bit array does not contain a whole number of bytes then it is padded -/// with zero bits prior to being encoded. -/// -pub fn base64_url_encode(input: BitArray, padding: Bool) -> String { - input - |> base64_encode(padding) - |> string.replace("+", "-") - |> string.replace("/", "_") -} - -/// Decodes a base 64 encoded string with URL and filename safe alphabet into a -/// `BitArray`. -/// -pub fn base64_url_decode(encoded: String) -> Result(BitArray, Nil) { - encoded - |> string.replace("-", "+") - |> string.replace("_", "/") - |> base64_decode() -} - -/// Encodes a `BitArray` into a base 16 encoded string. -/// -/// If the bit array does not contain a whole number of bytes then it is padded -/// with zero bits prior to being encoded. -/// -@external(erlang, "gleam_stdlib", "base16_encode") -@external(javascript, "../gleam_stdlib.mjs", "base16_encode") -pub fn base16_encode(input: BitArray) -> String - -/// Decodes a base 16 encoded string into a `BitArray`. -/// -@external(erlang, "gleam_stdlib", "base16_decode") -@external(javascript, "../gleam_stdlib.mjs", "base16_decode") -pub fn base16_decode(input: String) -> Result(BitArray, Nil) - -/// Converts a bit array to a string containing the decimal value of each byte. -/// -/// Use this over `string.inspect` when you have a bit array you want printed -/// in the array syntax even if it is valid UTF-8. -/// -/// ## Examples -/// -/// ```gleam -/// inspect(<<0, 20, 0x20, 255>>) -/// // -> "<<0, 20, 32, 255>>" -/// -/// inspect(<<100, 5:3>>) -/// // -> "<<100, 5:size(3)>>" -/// ``` -/// -pub fn inspect(input: BitArray) -> String { - inspect_loop(input, "<<") <> ">>" -} - -fn inspect_loop(input: BitArray, accumulator: String) -> String { - case input { - <<>> -> accumulator - - <> -> accumulator <> int.to_string(x) <> ":size(1)" - <> -> accumulator <> int.to_string(x) <> ":size(2)" - <> -> accumulator <> int.to_string(x) <> ":size(3)" - <> -> accumulator <> int.to_string(x) <> ":size(4)" - <> -> accumulator <> int.to_string(x) <> ":size(5)" - <> -> accumulator <> int.to_string(x) <> ":size(6)" - <> -> accumulator <> int.to_string(x) <> ":size(7)" - - <> -> { - let suffix = case rest { - <<>> -> "" - _ -> ", " - } - - let accumulator = accumulator <> int.to_string(x) <> suffix - inspect_loop(rest, accumulator) - } - - _ -> accumulator - } -} - -/// Compare two bit arrays as sequences of bytes. -/// -/// ## Examples -/// -/// ```gleam -/// compare(<<1>>, <<2>>) -/// // -> Lt -/// -/// compare(<<"AB":utf8>>, <<"AA":utf8>>) -/// // -> Gt -/// -/// compare(<<1, 2:size(2)>>, with: <<1, 2:size(2)>>) -/// // -> Eq -/// ``` -/// -pub fn compare(a: BitArray, with b: BitArray) -> order.Order { - case a, b { - <>, <> -> - case first_byte, second_byte { - f, s if f > s -> order.Gt - f, s if f < s -> order.Lt - _, _ -> compare(first_rest, second_rest) - } - - <<>>, <<>> -> order.Eq - // First has more items, example: "AB" > "A": - _, <<>> -> order.Gt - // Second has more items, example: "A" < "AB": - <<>>, _ -> order.Lt - // This happens when there's unusually sized elements. - // Handle these special cases via custom erlang function. - first, second -> - case bit_array_to_int_and_size(first), bit_array_to_int_and_size(second) { - #(a, _), #(b, _) if a > b -> order.Gt - #(a, _), #(b, _) if a < b -> order.Lt - #(_, size_a), #(_, size_b) if size_a > size_b -> order.Gt - #(_, size_a), #(_, size_b) if size_a < size_b -> order.Lt - _, _ -> order.Eq - } - } -} - -@external(erlang, "gleam_stdlib", "bit_array_to_int_and_size") -@external(javascript, "../gleam_stdlib.mjs", "bit_array_to_int_and_size") -fn bit_array_to_int_and_size(a: BitArray) -> #(Int, Int) - -/// Checks whether the first `BitArray` starts with the second one. -/// -/// ## Examples -/// -/// ```gleam -/// starts_with(<<1, 2, 3, 4>>, <<1, 2>>) -/// // -> True -/// ``` -/// -@external(javascript, "../gleam_stdlib.mjs", "bit_array_starts_with") -pub fn starts_with(bits: BitArray, prefix: BitArray) -> Bool { - let prefix_size = bit_size(prefix) - - case bits { - <> if pref == prefix -> True - _ -> False - } -} diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/bool.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/bool.gleam deleted file mode 100644 index ad66b31..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/bool.gleam +++ /dev/null @@ -1,316 +0,0 @@ -//// A type with two possible values, `True` and `False`. Used to indicate whether -//// things are... true or false! -//// -//// It is often 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`. - -/// 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 { - !bool -} - -/// 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 { - !{ a || b } -} - -/// 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 { - !{ a && b } -} - -/// 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 { - a != b -} - -/// 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 { - a == b -} - -/// 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 nor side-effects 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: a, - otherwise alternative: fn() -> a, -) -> a { - case requirement { - True -> consequence - False -> alternative() - } -} - -/// Runs a callback function if the given bool is `True`, otherwise runs an -/// alternative callback function. -/// -/// Useful when further computation should be delayed regardless of the given -/// bool's value. -/// -/// See [`guard`](#guard) for more info. -/// -/// ## Examples -/// -/// ```gleam -/// let name = "Kamaka" -/// let inquiry = fn() { "How may we address you?" } -/// use <- lazy_guard(when: name == "", return: inquiry) -/// "Hello, " <> name -/// // -> "Hello, Kamaka" -/// ``` -/// -/// ```gleam -/// import gleam/int -/// -/// let name = "" -/// let greeting = fn() { "Hello, " <> name } -/// use <- lazy_guard(when: name == "", otherwise: greeting) -/// let number = int.random(99) -/// let name = "User " <> int.to_string(number) -/// "Welcome, " <> name -/// // -> "Welcome, User 54" -/// ``` -/// -pub fn lazy_guard( - when requirement: Bool, - return consequence: fn() -> a, - otherwise alternative: fn() -> a, -) -> a { - case requirement { - True -> consequence() - False -> alternative() - } -} diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/bytes_tree.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/bytes_tree.gleam deleted file mode 100644 index e712fa9..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/bytes_tree.gleam +++ /dev/null @@ -1,190 +0,0 @@ -//// `BytesTree` is a type used for efficiently building binary content to be -//// written to a file or a socket. Internally it is represented as a tree so to -//// append or prepend to a bytes tree is a constant time operation that -//// allocates a new node in the tree without copying any of the content. When -//// writing to an output stream the tree is traversed and the content is sent -//// directly rather than copying it into a single buffer beforehand. -//// -//// If we append one bit array to another the bit arrays must be copied to a -//// new location in memory so that they can sit together. This behaviour -//// enables efficient reading of the data but copying can be expensive, -//// especially if we want to join many bit arrays together. -//// -//// BytesTree is different in that it can be joined together in constant -//// time using minimal memory, and then can be efficiently converted to a -//// bit array using the `to_bit_array` function. -//// -//// Byte trees are always byte aligned, so that a number of bits that is not -//// divisible by 8 will be padded with 0s. -//// -//// On Erlang this type is compatible with Erlang's iolists. - -import gleam/bit_array -import gleam/list -import gleam/string_tree.{type StringTree} - -pub opaque type BytesTree { - Bytes(BitArray) - Text(StringTree) - Many(List(BytesTree)) -} - -/// Create an empty `BytesTree`. Useful as the start of a pipe chaining many -/// trees together. -/// -pub fn new() -> BytesTree { - concat([]) -} - -/// Prepends a bit array to the start of a bytes tree. -/// -/// Runs in constant time. -/// -pub fn prepend(to second: BytesTree, prefix first: BitArray) -> BytesTree { - append_tree(from_bit_array(first), second) -} - -/// Appends a bit array to the end of a bytes tree. -/// -/// Runs in constant time. -/// -pub fn append(to first: BytesTree, suffix second: BitArray) -> BytesTree { - append_tree(first, from_bit_array(second)) -} - -/// Prepends a bytes tree onto the start of another. -/// -/// Runs in constant time. -/// -pub fn prepend_tree(to second: BytesTree, prefix first: BytesTree) -> BytesTree { - append_tree(first, second) -} - -/// Appends a bytes tree onto the end of another. -/// -/// Runs in constant time. -/// -@external(erlang, "gleam_stdlib", "iodata_append") -pub fn append_tree(to first: BytesTree, suffix second: BytesTree) -> BytesTree { - case second { - Many(trees) -> Many([first, ..trees]) - Text(_) | Bytes(_) -> Many([first, second]) - } -} - -/// Prepends a string onto the start of a bytes tree. -/// -/// Runs in constant time when running on Erlang. -/// Runs in linear time with the length of the string otherwise. -/// -pub fn prepend_string(to second: BytesTree, prefix first: String) -> BytesTree { - append_tree(from_string(first), second) -} - -/// Appends a string onto the end of a bytes tree. -/// -/// Runs in constant time when running on Erlang. -/// Runs in linear time with the length of the string otherwise. -/// -pub fn append_string(to first: BytesTree, suffix second: String) -> BytesTree { - append_tree(first, from_string(second)) -} - -/// Joins a list of bytes trees into a single one. -/// -/// Runs in constant time. -/// -@external(erlang, "gleam_stdlib", "identity") -pub fn concat(trees: List(BytesTree)) -> BytesTree { - Many(trees) -} - -/// Joins a list of bit arrays into a single bytes tree. -/// -/// Runs in constant time. -/// -pub fn concat_bit_arrays(bits: List(BitArray)) -> BytesTree { - bits - |> list.map(from_bit_array) - |> concat() -} - -/// Creates a new bytes tree from a string. -/// -/// Runs in constant time when running on Erlang. -/// Runs in linear time otherwise. -/// -@external(erlang, "gleam_stdlib", "wrap_list") -pub fn from_string(string: String) -> BytesTree { - Text(string_tree.from_string(string)) -} - -/// Creates a new bytes tree from a string tree. -/// -/// Runs in constant time when running on Erlang. -/// Runs in linear time otherwise. -/// -@external(erlang, "gleam_stdlib", "wrap_list") -pub fn from_string_tree(tree: string_tree.StringTree) -> BytesTree { - Text(tree) -} - -/// Creates a new bytes tree from a bit array. -/// -/// Runs in constant time. -/// -pub fn from_bit_array(bits: BitArray) -> BytesTree { - bits - |> bit_array.pad_to_bytes - |> wrap_list -} - -@external(erlang, "gleam_stdlib", "wrap_list") -fn wrap_list(bits: BitArray) -> BytesTree { - Bytes(bits) -} - -/// Turns a bytes tree into a bit array. -/// -/// Runs in linear time. -/// -/// When running on Erlang this function is implemented natively by the -/// virtual machine and is highly optimised. -/// -@external(erlang, "erlang", "list_to_bitstring") -pub fn to_bit_array(tree: BytesTree) -> BitArray { - [[tree]] - |> to_list([]) - |> list.reverse - |> bit_array.concat -} - -fn to_list(stack: List(List(BytesTree)), acc: List(BitArray)) -> List(BitArray) { - case stack { - [] -> acc - - [[], ..remaining_stack] -> to_list(remaining_stack, acc) - - [[Bytes(bits), ..rest], ..remaining_stack] -> - to_list([rest, ..remaining_stack], [bits, ..acc]) - - [[Text(tree), ..rest], ..remaining_stack] -> { - let bits = bit_array.from_string(string_tree.to_string(tree)) - to_list([rest, ..remaining_stack], [bits, ..acc]) - } - - [[Many(trees), ..rest], ..remaining_stack] -> - to_list([trees, rest, ..remaining_stack], acc) - } -} - -/// Returns the size of the bytes tree's content in bytes. -/// -/// Runs in linear time. -/// -@external(erlang, "erlang", "iolist_size") -pub fn byte_size(tree: BytesTree) -> Int { - [[tree]] - |> to_list([]) - |> list.fold(0, fn(acc, bits) { bit_array.byte_size(bits) + acc }) -} diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/dict.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/dict.gleam deleted file mode 100644 index f35a380..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/dict.gleam +++ /dev/null @@ -1,590 +0,0 @@ -import gleam/option.{type Option} - -/// A dictionary of keys and values. -/// -/// Any type can be used for the keys and values of a dict, 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 dict once. -/// -/// Dicts 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 Dict(key, value) - -/// "TransientDict" is a mutable view on a dictionary used internally by the -/// JavaScript target. No mutable API is exposed to the user. -/// -/// Transients are to be treated as having a linear (single-use, think rust) type. -/// A transient value becomes invalid as soon as it's passed to one of the functions. -type TransientDict(key, value) - -/// Convert a normal Dict to a transient dict. -/// A transient dict is a mutable copy of the original. -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../dict.mjs", "toTransient") -fn to_transient(dict: Dict(key, value)) -> TransientDict(key, value) - -/// Convert a transient dict back into a normal dict, freezing its contents. -/// Using the transient after this point is highly unsafe and leads to undefined behavior. -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../dict.mjs", "fromTransient") -fn from_transient(transient: TransientDict(key, value)) -> Dict(key, value) - -/// Determines the number of key-value pairs in the dict. -/// This function runs in constant time and does not need to iterate the dict. -/// -/// ## Examples -/// -/// ```gleam -/// new() |> size -/// // -> 0 -/// ``` -/// -/// ```gleam -/// new() |> insert("key", "value") |> size -/// // -> 1 -/// ``` -/// -@external(erlang, "maps", "size") -@external(javascript, "../dict.mjs", "size") -pub fn size(dict: Dict(k, v)) -> Int - -/// Determines whether or not the dict is empty. -/// -/// ## Examples -/// -/// ```gleam -/// new() |> is_empty -/// // -> True -/// ``` -/// -/// ```gleam -/// new() |> insert("b", 1) |> is_empty -/// // -> False -/// ``` -/// -pub fn is_empty(dict: Dict(k, v)) -> Bool { - size(dict) == 0 -} - -/// Converts the dict to a list of 2-element tuples `#(key, value)`, one for -/// each key-value pair in the dict. -/// -/// The tuples in the list have no specific order. -/// -/// ## Examples -/// -/// Calling `to_list` on an empty `dict` returns an empty list. -/// -/// ```gleam -/// new() |> to_list -/// // -> [] -/// ``` -/// -/// The ordering of elements in the resulting list is an implementation detail -/// that should not be relied upon. -/// -/// ```gleam -/// new() |> insert("b", 1) |> insert("a", 0) |> insert("c", 2) |> to_list -/// // -> [#("a", 0), #("b", 1), #("c", 2)] -/// ``` -/// -@external(erlang, "maps", "to_list") -pub fn to_list(dict: Dict(k, v)) -> List(#(k, v)) { - fold(dict, from: [], with: fn(acc, key, value) { [#(key, value), ..acc] }) -} - -/// Converts a list of 2-element tuples `#(key, value)` to a dict. -/// -/// If two tuples have the same key the last one in the list will be the one -/// that is present in the dict. -/// -@external(erlang, "maps", "from_list") -pub fn from_list(list: List(#(k, v))) -> Dict(k, v) { - from_list_loop(to_transient(new()), list) -} - -fn from_list_loop( - transient: TransientDict(k, v), - list: List(#(k, v)), -) -> Dict(k, v) { - case list { - [] -> from_transient(transient) - [#(key, value), ..rest] -> - from_list_loop(transient_insert(key, value, transient), rest) - } -} - -/// Determines whether or not a value is present in the dict for a given key. -/// -/// ## Examples -/// -/// ```gleam -/// new() |> insert("a", 0) |> has_key("a") -/// // -> True -/// ``` -/// -/// ```gleam -/// new() |> insert("a", 0) |> has_key("b") -/// // -> False -/// ``` -/// -@external(javascript, "../dict.mjs", "has") -pub fn has_key(dict: Dict(k, v), key: k) -> Bool { - do_has_key(key, dict) -} - -@external(erlang, "maps", "is_key") -fn do_has_key(key: k, dict: Dict(k, v)) -> Bool - -/// Creates a fresh dict that contains no values. -/// -@external(erlang, "maps", "new") -@external(javascript, "../dict.mjs", "make") -pub fn new() -> Dict(k, v) - -/// Fetches a value from a dict for a given key. -/// -/// The dict 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) -/// ``` -/// -@external(erlang, "gleam_stdlib", "map_get") -@external(javascript, "../dict.mjs", "get") -pub fn get(from: Dict(k, v), get: k) -> Result(v, Nil) - -/// Inserts a value into the dict with the given key. -/// -/// If the dict already has a value for the given key then the value is -/// replaced with the new value. -/// -/// ## Examples -/// -/// ```gleam -/// new() |> insert("a", 0) -/// // -> from_list([#("a", 0)]) -/// ``` -/// -/// ```gleam -/// new() |> insert("a", 0) |> insert("a", 5) -/// // -> from_list([#("a", 5)]) -/// ``` -/// -@external(javascript, "../dict.mjs", "insert") -pub fn insert(into dict: Dict(k, v), for key: k, insert value: v) -> Dict(k, v) { - do_insert(key, value, dict) -} - -@external(erlang, "maps", "put") -fn do_insert(key: k, value: v, dict: Dict(k, v)) -> Dict(k, v) - -@external(erlang, "maps", "put") -@external(javascript, "../dict.mjs", "destructiveTransientInsert") -fn transient_insert( - key: k, - value: v, - transient: TransientDict(k, v), -) -> TransientDict(k, v) - -/// Updates all values in a given dict by calling a given function on each key -/// and value. -/// -/// ## Examples -/// -/// ```gleam -/// from_list([#(3, 3), #(2, 4)]) -/// |> map_values(fn(key, value) { key * value }) -/// // -> from_list([#(3, 9), #(2, 8)]) -/// ``` -/// -@external(javascript, "../dict.mjs", "map") -pub fn map_values(in dict: Dict(k, v), with fun: fn(k, v) -> a) -> Dict(k, a) { - do_map_values(fun, dict) -} - -@external(erlang, "maps", "map") -fn do_map_values(f: fn(k, v) -> a, dict: Dict(k, v)) -> Dict(k, a) - -/// Gets a list of all keys in a given dict. -/// -/// Dicts 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 -/// from_list([#("a", 0), #("b", 1)]) |> keys -/// // -> ["a", "b"] -/// ``` -/// -@external(erlang, "maps", "keys") -pub fn keys(dict: Dict(k, v)) -> List(k) { - fold(dict, [], fn(acc, key, _value) { [key, ..acc] }) -} - -/// Gets a list of all values in a given dict. -/// -/// Dicts 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 -/// from_list([#("a", 0), #("b", 1)]) |> values -/// // -> [0, 1] -/// ``` -/// -@external(erlang, "maps", "values") -pub fn values(dict: Dict(k, v)) -> List(v) { - fold(dict, [], fn(acc, _key, value) { [value, ..acc] }) -} - -/// Creates a new dict from a given dict, 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 dict: Dict(k, v), - keeping predicate: fn(k, v) -> Bool, -) -> Dict(k, v) { - do_filter(predicate, dict) -} - -@external(erlang, "maps", "filter") -fn do_filter(f: fn(k, v) -> Bool, dict: Dict(k, v)) -> Dict(k, v) { - to_transient(new()) - |> fold(over: dict, with: fn(transient, key, value) { - case f(key, value) { - True -> transient_insert(key, value, transient) - False -> transient - } - }) - |> from_transient -} - -/// Creates a new dict from a given dict, 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 dict: Dict(k, v), keeping desired_keys: List(k)) -> Dict(k, v) { - do_take(desired_keys, dict) -} - -@external(erlang, "maps", "with") -fn do_take(desired_keys: List(k), dict: Dict(k, v)) -> Dict(k, v) { - do_take_loop(dict, desired_keys, to_transient(new())) -} - -fn do_take_loop( - dict: Dict(k, v), - desired_keys: List(k), - acc: TransientDict(k, v), -) -> Dict(k, v) { - case desired_keys { - [] -> from_transient(acc) - [key, ..rest] -> - case get(dict, key) { - Ok(value) -> do_take_loop(dict, rest, transient_insert(key, value, acc)) - Error(_) -> do_take_loop(dict, rest, acc) - } - } -} - -/// Creates a new dict from a pair of given dicts by combining their entries. -/// -/// If there are entries with the same keys in both dicts the entry from the -/// second dict 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)]) -/// ``` -/// -@external(erlang, "maps", "merge") -pub fn merge(into dict: Dict(k, v), from new_entries: Dict(k, v)) -> Dict(k, v) { - combine(dict, new_entries, fn(_, new_entry) { new_entry }) -} - -/// Creates a new dict from a given dict with all the same entries except for the -/// one with a given key, if it exists. -/// -/// ## Examples -/// -/// ```gleam -/// from_list([#("a", 0), #("b", 1)]) |> delete("a") -/// // -> from_list([#("b", 1)]) -/// ``` -/// -/// ```gleam -/// from_list([#("a", 0), #("b", 1)]) |> delete("c") -/// // -> from_list([#("a", 0), #("b", 1)]) -/// ``` -/// -pub fn delete(from dict: Dict(k, v), delete key: k) -> Dict(k, v) { - to_transient(dict) |> transient_delete(key, _) |> from_transient -} - -@external(erlang, "maps", "remove") -@external(javascript, "../dict.mjs", "destructiveTransientDelete") -fn transient_delete(a: k, b: TransientDict(k, v)) -> TransientDict(k, v) - -/// Creates a new dict from a given dict with all the same entries except any with -/// keys found in a given list. -/// -/// ## Examples -/// -/// ```gleam -/// from_list([#("a", 0), #("b", 1)]) |> drop(["a"]) -/// // -> from_list([#("b", 1)]) -/// ``` -/// -/// ```gleam -/// from_list([#("a", 0), #("b", 1)]) |> drop(["c"]) -/// // -> from_list([#("a", 0), #("b", 1)]) -/// ``` -/// -/// ```gleam -/// from_list([#("a", 0), #("b", 1)]) |> drop(["a", "b", "c"]) -/// // -> from_list([]) -/// ``` -/// -pub fn drop(from dict: Dict(k, v), drop disallowed_keys: List(k)) -> Dict(k, v) { - do_drop(disallowed_keys, dict) -} - -@external(erlang, "maps", "without") -fn do_drop(disallowed_keys: List(k), dict: Dict(k, v)) -> Dict(k, v) { - drop_loop(to_transient(dict), disallowed_keys) -} - -fn drop_loop( - transient: TransientDict(k, v), - disallowed_keys: List(k), -) -> Dict(k, v) { - case disallowed_keys { - [] -> from_transient(transient) - [key, ..rest] -> drop_loop(transient_delete(key, transient), rest) - } -} - -/// Creates a new dict with one entry inserted or updated using a given function. -/// -/// If there was not an entry in the dict for the given key then the function -/// gets `None` as its argument, otherwise it gets `Some(value)`. -/// -/// ## Examples -/// -/// ```gleam -/// let dict = from_list([#("a", 0)]) -/// let increment = fn(x) { -/// case x { -/// Some(i) -> i + 1 -/// None -> 0 -/// } -/// } -/// -/// upsert(dict, "a", increment) -/// // -> from_list([#("a", 1)]) -/// -/// upsert(dict, "b", increment) -/// // -> from_list([#("a", 0), #("b", 0)]) -/// ``` -/// -pub fn upsert( - in dict: Dict(k, v), - update key: k, - with fun: fn(Option(v)) -> v, -) -> Dict(k, v) { - case get(dict, key) { - Ok(value) -> insert(dict, key, fun(option.Some(value))) - Error(_) -> insert(dict, key, fun(option.None)) - } -} - -/// Combines all entries into a single value by calling a given function on each -/// one. -/// -/// Dicts 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 dict = from_list([#("a", 1), #("b", 3), #("c", 9)]) -/// fold(dict, 0, fn(accumulator, key, value) { accumulator + value }) -/// // -> 13 -/// ``` -/// -/// ```gleam -/// import gleam/string -/// -/// let dict = from_list([#("a", 1), #("b", 3), #("c", 9)]) -/// fold(dict, "", fn(accumulator, key, value) { -/// string.append(accumulator, key) -/// }) -/// // -> "abc" -/// ``` -/// -@external(javascript, "../dict.mjs", "fold") -pub fn fold( - over dict: Dict(k, v), - from initial: acc, - with fun: fn(acc, k, v) -> acc, -) -> acc { - let fun = fn(key, value, acc) { fun(acc, key, value) } - do_fold(fun, initial, dict) -} - -@external(erlang, "maps", "fold") -fn do_fold(fun: fn(k, v, acc) -> acc, initial: acc, dict: Dict(k, v)) -> acc - -/// Calls a function for each key and value in a dict, discarding the return -/// value. -/// -/// Useful for producing a side effect for every item of a dict. -/// -/// ```gleam -/// import gleam/io -/// -/// let dict = from_list([#("a", "apple"), #("b", "banana"), #("c", "cherry")]) -/// -/// each(dict, fn(k, v) { -/// io.println(key <> " => " <> value) -/// }) -/// // -> Nil -/// // a => apple -/// // b => banana -/// // c => cherry -/// ``` -/// -/// The order of elements in the iteration is an implementation detail that -/// should not be relied upon. -/// -pub fn each(dict: Dict(k, v), fun: fn(k, v) -> a) -> Nil { - fold(dict, Nil, fn(nil, k, v) { - fun(k, v) - nil - }) -} - -/// Creates a new dict from a pair of given dicts by combining their entries. -/// -/// If there are entries with the same keys in both dicts the given function is -/// used to determine the new value to use in the resulting dict. -/// -/// ## Examples -/// -/// ```gleam -/// let a = from_list([#("a", 0), #("b", 1)]) -/// let b = from_list([#("a", 2), #("c", 3)]) -/// combine(a, b, fn(one, other) { one + other }) -/// // -> from_list([#("a", 2), #("b", 1), #("c", 3)]) -/// ``` -/// -pub fn combine( - dict: Dict(k, v), - other: Dict(k, v), - with fun: fn(v, v) -> v, -) -> Dict(k, v) { - do_combine(fn(_, l, r) { fun(l, r) }, dict, other) -} - -@external(erlang, "maps", "merge_with") -fn do_combine( - combine: fn(k, v, v) -> v, - left: Dict(k, v), - right: Dict(k, v), -) -> Dict(k, v) { - let #(big, small, combine) = case size(left) >= size(right) { - True -> #(left, right, combine) - False -> #(right, left, fn(k, l, r) { combine(k, r, l) }) - } - - to_transient(big) - |> fold(over: small, with: fn(transient, key, value) { - let update = fn(existing) { combine(key, existing, value) } - transient_update_with(key, update, value, transient) - }) - |> from_transient -} - -@external(erlang, "maps", "update_with") -@external(javascript, "../dict.mjs", "destructiveTransientUpdateWith") -fn transient_update_with( - key: k, - fun: fn(v) -> v, - init: v, - transient: TransientDict(k, v), -) -> TransientDict(k, v) - -@internal -pub fn group(key: fn(v) -> k, list: List(v)) -> Dict(k, List(v)) { - group_loop(to_transient(new()), key, list) -} - -fn group_loop( - transient: TransientDict(k, List(v)), - to_key: fn(v) -> k, - list: List(v), -) -> Dict(k, List(v)) { - case list { - [] -> from_transient(transient) - [value, ..rest] -> { - let key = to_key(value) - let update = fn(existing) { [value, ..existing] } - - transient - |> transient_update_with(key, update, [value], _) - |> group_loop(to_key, rest) - } - } -} diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/dynamic.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/dynamic.gleam deleted file mode 100644 index dd594d4..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/dynamic.gleam +++ /dev/null @@ -1,100 +0,0 @@ -import gleam/dict - -/// `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. -/// -/// This module contains code for forming dynamic data, and the -/// `gleam/dynamic/decode` module contains code for turning dynamic data back -/// into Gleam data with known types. You will likely mostly use the other -/// module in your projects. -/// -/// The exact runtime representation of dynamic values will depend on the -/// compilation target used. -/// -pub type Dynamic - -/// Return a string indicating the type of the dynamic value. -/// -/// This function may be useful for constructing error messages or logs. If you -/// want to turn dynamic data into well typed data then you want the -/// `gleam/dynamic/decode` module. -/// -/// ```gleam -/// classify(string("Hello")) -/// // -> "String" -/// ``` -/// -@external(erlang, "gleam_stdlib", "classify_dynamic") -@external(javascript, "../gleam_stdlib.mjs", "classify_dynamic") -pub fn classify(data: Dynamic) -> String - -/// Create a dynamic value from a bool. -/// -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "identity") -pub fn bool(a: Bool) -> Dynamic - -/// Create a dynamic value from a string. -/// -/// On Erlang this will be a binary string rather than a character list. -/// -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "identity") -pub fn string(a: String) -> Dynamic - -/// Create a dynamic value from a float. -/// -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "identity") -pub fn float(a: Float) -> Dynamic - -/// Create a dynamic value from an int. -/// -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "identity") -pub fn int(a: Int) -> Dynamic - -/// Create a dynamic value from a bit array. -/// -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "identity") -pub fn bit_array(a: BitArray) -> Dynamic - -/// Create a dynamic value from a list. -/// -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "identity") -pub fn list(a: List(Dynamic)) -> Dynamic - -/// Create a dynamic value from a list, converting it to a sequential runtime -/// format rather than the regular list format. -/// -/// On Erlang this will be a tuple, on JavaScript this will be an array. -/// -@external(erlang, "erlang", "list_to_tuple") -@external(javascript, "../gleam_stdlib.mjs", "list_to_array") -pub fn array(a: List(Dynamic)) -> Dynamic - -/// Create a dynamic value made of an unordered series of keys and values, where -/// the keys are unique. -/// -/// On Erlang this will be a map, on JavaScript this will be a Gleam dict -/// object. -/// -pub fn properties(entries: List(#(Dynamic, Dynamic))) -> Dynamic { - cast(dict.from_list(entries)) -} - -/// A dynamic value representing nothing. -/// -/// On Erlang this will be the atom `nil`, on JavaScript this will be -/// `undefined`. -/// -pub fn nil() -> Dynamic { - cast(Nil) -} - -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "identity") -fn cast(a: anything) -> Dynamic diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/dynamic/decode.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/dynamic/decode.gleam deleted file mode 100644 index 315dfc5..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/dynamic/decode.gleam +++ /dev/null @@ -1,1103 +0,0 @@ -//// The `Dynamic` type is used to represent dynamically typed data. That is, data -//// that we don't know the precise type of yet, so we need to introspect the data to -//// see if it is of the desired type before we can use it. Typically data like this -//// would come from user input or from untyped languages such as Erlang or JavaScript. -//// -//// This module provides the `Decoder` type and associated functions, which provides -//// a type-safe and composable way to convert dynamic data into some desired type, -//// or into errors if the data doesn't have the desired structure. -//// -//// The `Decoder` type is generic and has 1 type parameter, which is the type that -//// it attempts to decode. A `Decoder(String)` can be used to decode strings, and a -//// `Decoder(Option(Int))` can be used to decode `Option(Int)`s -//// -//// Decoders work using _runtime reflection_ and the data structures of the target -//// platform. Differences between Erlang and JavaScript data structures may impact -//// your decoders, so it is important to test your decoders on all supported -//// platforms. -//// -//// The decoding technique used by this module was inspired by Juraj Petráš' -//// [Toy](https://github.com/Hackder/toy), Go's `encoding/json`, and Elm's -//// `Json.Decode`. Thank you to them! -//// -//// # Examples -//// -//// Dynamic data may come from various sources and so many different syntaxes could -//// be used to describe or construct them. In these examples a pseudocode -//// syntax is used to describe the data. -//// -//// ## Simple types -//// -//// This module defines decoders for simple data types such as [`string`](#string), -//// [`int`](#int), [`float`](#float), [`bit_array`](#bit_array), and [`bool`](#bool). -//// -//// ```gleam -//// // Data: -//// // "Hello, Joe!" -//// -//// let result = decode.run(data, decode.string) -//// assert result == Ok("Hello, Joe!") -//// ``` -//// -//// ## Lists -//// -//// The [`list`](#list) decoder decodes `List`s. To use it you must construct it by -//// passing in another decoder into the `list` function, which is the decoder that -//// is to be used for the elements of the list, type checking both the list and its -//// elements. -//// -//// ```gleam -//// // Data: -//// // [1, 2, 3, 4] -//// -//// let result = decode.run(data, decode.list(decode.int)) -//// assert result == Ok([1, 2, 3, 4]) -//// ``` -//// -//// On Erlang this decoder can decode from lists, and on JavaScript it can -//// decode from lists as well as JavaScript arrays. -//// -//// ## Options -//// -//// The [`optional`](#optional) decoder is used to decode values that may or may not -//// be present. In other environments these might be called "nullable" values. -//// -//// Like the `list` decoder, the `optional` decoder takes another decoder, -//// which is used to decode the value if it is present. -//// -//// ```gleam -//// // Data: -//// // 12.45 -//// -//// let result = decode.run(data, decode.optional(decode.float)) -//// assert result == Ok(option.Some(12.45)) -//// ``` -//// ```gleam -//// // Data: -//// // null -//// -//// let result = decode.run(data, decode.optional(decode.int)) -//// assert result == Ok(option.None) -//// ``` -//// -//// This decoder knows how to handle multiple different runtime representations of -//// absent values, including `Nil`, `None`, `null`, and `undefined`. -//// -//// ## Dicts -//// -//// The [`dict`](#dict) decoder decodes `Dicts` and contains two other decoders, one -//// for the keys, one for the values. -//// -//// ```gleam -//// // Data: -//// // { "Lucy" -> 10, "Nubi" -> 20 } -//// -//// let result = decode.run(data, decode.dict(decode.string, decode.int)) -//// assert result == Ok(dict.from_list([ -//// #("Lucy", 10), -//// #("Nubi", 20), -//// ])) -//// ``` -//// -//// ## Indexing objects -//// -//// The [`at`](#at) decoder can be used to decode a value that is nested within -//// key-value containers such as Gleam dicts, Erlang maps, or JavaScript objects. -//// -//// ```gleam -//// // Data: -//// // { "one" -> { "two" -> 123 } } -//// -//// let result = decode.run(data, decode.at(["one", "two"], decode.int)) -//// assert result == Ok(123) -//// ``` -//// -//// ## Indexing arrays -//// -//// If you use ints as keys then the [`at`](#at) decoder can be used to index into -//// array-like containers such as Gleam or Erlang tuples, or JavaScript arrays. -//// -//// ```gleam -//// // Data: -//// // ["one", "two", "three"] -//// -//// let result = decode.run(data, decode.at([1], decode.string)) -//// assert result == Ok("two") -//// ``` -//// -//// ## Records -//// -//// Decoding records from dynamic data is more complex and requires combining a -//// decoder for each field and a special constructor that builds your records with -//// the decoded field values. -//// -//// ```gleam -//// // Data: -//// // { -//// // "score" -> 180, -//// // "name" -> "Mel Smith", -//// // "is-admin" -> false, -//// // "enrolled" -> true, -//// // "colour" -> "Red", -//// // } -//// -//// let decoder = { -//// use name <- decode.field("name", decode.string) -//// use score <- decode.field("score", decode.int) -//// use colour <- decode.field("colour", decode.string) -//// use enrolled <- decode.field("enrolled", decode.bool) -//// decode.success(Player(name:, score:, colour:, enrolled:)) -//// } -//// -//// let result = decode.run(data, decoder) -//// assert result == Ok(Player("Mel Smith", 180, "Red", True)) -//// ``` -//// -//// ## Enum variants -//// -//// Imagine you have a custom type where all the variants do not contain any values. -//// -//// ```gleam -//// pub type PocketMonsterType { -//// Fire -//// Water -//// Grass -//// Electric -//// } -//// ``` -//// -//// You might choose to encode these variants as strings, `"fire"` for `Fire`, -//// `"water"` for `Water`, and so on. To decode them you'll need to decode the dynamic -//// data as a string, but then you'll need to decode it further still as not all -//// strings are valid values for the enum. This can be done with the `then` -//// function, which enables running a second decoder after the first one -//// succeeds. -//// -//// ```gleam -//// let decoder = { -//// use decoded_string <- decode.then(decode.string) -//// case decoded_string { -//// // Return succeeding decoders for valid strings -//// "fire" -> decode.success(Fire) -//// "water" -> decode.success(Water) -//// "grass" -> decode.success(Grass) -//// "electric" -> decode.success(Electric) -//// // Return a failing decoder for any other strings -//// _ -> decode.failure(Fire, expected: "PocketMonsterType") -//// } -//// } -//// -//// let result = decode.run(dynamic.string("water"), decoder) -//// assert result == Ok(Water) -//// -//// let result = decode.run(dynamic.string("wobble"), decoder) -//// assert result == Error([DecodeError("PocketMonsterType", "String", [])]) -//// ``` -//// -//// ## Record variants -//// -//// Decoding type variants that contain other values is done by combining the -//// techniques from the "enum variants" and "records" examples. Imagine you have -//// this custom type that you want to decode: -//// -//// ```gleam -//// pub type PocketMonsterPerson { -//// Trainer(name: String, badge_count: Int) -//// GymLeader(name: String, speciality: PocketMonsterType) -//// } -//// ``` -//// And you would like to be able to decode these from dynamic data like this: -//// ```erlang -//// { -//// "type" -> "trainer", -//// "name" -> "Ash", -//// "badge-count" -> 1, -//// } -//// ``` -//// ```erlang -//// { -//// "type" -> "gym-leader", -//// "name" -> "Misty", -//// "speciality" -> "water", -//// } -//// ``` -//// -//// Notice how both documents have a `"type"` field, which is used to indicate which -//// variant the data is for. -//// -//// First, define decoders for each of the variants: -//// -//// ```gleam -//// let trainer_decoder = { -//// use name <- decode.field("name", decode.string) -//// use badge_count <- decode.field("badge-count", decode.int) -//// decode.success(Trainer(name, badge_count)) -//// } -//// -//// let gym_leader_decoder = { -//// use name <- decode.field("name", decode.string) -//// use speciality <- decode.field("speciality", pocket_monster_type_decoder) -//// decode.success(GymLeader(name, speciality)) -//// } -//// ``` -//// -//// A third decoder can be used to extract and decode the `"type"` field, and the -//// expression can evaluate to whichever decoder is suitable for the document. -//// -//// ```gleam -//// // Data: -//// // { -//// // "type" -> "gym-leader", -//// // "name" -> "Misty", -//// // "speciality" -> "water", -//// // } -//// -//// let decoder = { -//// use tag <- decode.field("type", decode.string) -//// case tag { -//// "gym-leader" -> gym_leader_decoder -//// _ -> trainer_decoder -//// } -//// } -//// -//// let result = decode.run(data, decoder) -//// assert result == Ok(GymLeader("Misty", Water)) -//// ``` - -import gleam/bit_array -import gleam/dict.{type Dict} -import gleam/dynamic -import gleam/int -import gleam/list -import gleam/option.{type Option, None, Some} - -/// `Dynamic` data is data that we don't know the type of yet, originating from -/// external untyped systems. -/// -/// You should never be converting your well typed data to dynamic data. -/// -pub type Dynamic = - dynamic.Dynamic - -/// Error returned when unexpected data is encountered -/// -pub type DecodeError { - DecodeError(expected: String, found: String, path: List(String)) -} - -/// A decoder is a value that can be used to turn dynamically typed `Dynamic` -/// data into typed data using the `run` function. -/// -/// Several smaller decoders can be combined to make larger decoders using -/// functions such as `list` and `field`. -/// -pub opaque type Decoder(t) { - Decoder(function: fn(Dynamic) -> #(t, List(DecodeError))) -} - -/// The same as [`field`](#field), except taking a path to the value rather -/// than a field name. -/// -/// This function will index into dictionaries with any key type, and if the key is -/// an int then it'll also index into Erlang tuples and JavaScript arrays, and -/// the first eight elements of Gleam lists. -/// -/// ## Examples -/// -/// ```gleam -/// let data = dynamic.properties([ -/// #(dynamic.string("data"), dynamic.properties([ -/// #(dynamic.string("email"), dynamic.string("lucy@example.com")), -/// #(dynamic.string("name"), dynamic.string("Lucy")), -/// ]) -/// ]) -/// -/// let decoder = { -/// use name <- decode.subfield(["data", "name"], decode.string) -/// use email <- decode.subfield(["data", "email"], decode.string) -/// decode.success(SignUp(name: name, email: email)) -/// } -/// let result = decode.run(data, decoder) -/// assert result == Ok(SignUp(name: "Lucy", email: "lucy@example.com")) -/// ``` -/// -pub fn subfield( - field_path: List(name), - field_decoder: Decoder(t), - next: fn(t) -> Decoder(final), -) -> Decoder(final) { - Decoder(function: fn(data) { - let #(out, errors1) = - index(field_path, [], field_decoder.function, data, fn(data, position) { - let #(default, _) = field_decoder.function(data) - #(default, [DecodeError("Field", "Nothing", [])]) - |> push_path(list.reverse(position)) - }) - let #(out, errors2) = next(out).function(data) - #(out, list.append(errors1, errors2)) - }) -} - -/// Run a decoder on a `Dynamic` value, decoding the value if it is of the -/// desired type, or returning errors. -/// -/// ## Examples -/// -/// ```gleam -/// let decoder = { -/// use name <- decode.field("name", decode.string) -/// use email <- decode.field("email", decode.string) -/// decode.success(SignUp(name: name, email: email)) -/// } -/// -/// decode.run(data, decoder) -/// ``` -/// -pub fn run(data: Dynamic, decoder: Decoder(t)) -> Result(t, List(DecodeError)) { - let #(maybe_invalid_data, errors) = decoder.function(data) - case errors { - [] -> Ok(maybe_invalid_data) - [_, ..] -> Error(errors) - } -} - -/// A decoder that decodes a value that is nested within other values. For -/// example, decoding a value that is within some deeply nested JSON objects. -/// -/// This function will index into dictionaries with any key type, and if the key is -/// an int then it'll also index into Erlang tuples and JavaScript arrays, and -/// the first eight elements of Gleam lists. -/// -/// ## Examples -/// -/// ```gleam -/// let decoder = decode.at(["one", "two"], decode.int) -/// -/// let data = dynamic.properties([ -/// #(dynamic.string("one"), dynamic.properties([ -/// #(dynamic.string("two"), dynamic.int(1000)), -/// ]), -/// ]) -/// -/// decode.run(data, decoder) -/// // -> Ok(1000) -/// ``` -/// -/// ```gleam -/// dynamic.nil() -/// |> decode.run(decode.optional(decode.int)) -/// // -> Ok(option.None) -/// ``` -/// -pub fn at(path: List(segment), inner: Decoder(a)) -> Decoder(a) { - Decoder(function: fn(data) { - index(path, [], inner.function, data, fn(data, position) { - let #(default, _) = inner.function(data) - #(default, [DecodeError("Field", "Nothing", [])]) - |> push_path(list.reverse(position)) - }) - }) -} - -fn index( - path: List(a), - position: List(a), - inner: fn(Dynamic) -> #(b, List(DecodeError)), - data: Dynamic, - handle_miss: fn(Dynamic, List(a)) -> #(b, List(DecodeError)), -) -> #(b, List(DecodeError)) { - case path { - [] -> { - data - |> inner - |> push_path(list.reverse(position)) - } - - [key, ..path] -> { - case bare_index(data, key) { - Ok(Some(data)) -> { - index(path, [key, ..position], inner, data, handle_miss) - } - Ok(None) -> { - handle_miss(data, [key, ..position]) - } - Error(kind) -> { - let #(default, _) = inner(data) - #(default, [DecodeError(kind, dynamic.classify(data), [])]) - |> push_path(list.reverse(position)) - } - } - } - } -} - -@external(erlang, "gleam_stdlib", "index") -@external(javascript, "../../gleam_stdlib.mjs", "index") -fn bare_index(data: Dynamic, key: anything) -> Result(Option(Dynamic), String) - -fn push_path( - layer: #(t, List(DecodeError)), - path: List(key), -) -> #(t, List(DecodeError)) { - let decoder = one_of(string, [int |> map(int.to_string)]) - let path = - list.map(path, fn(key) { - let key = cast(key) - case run(key, decoder) { - Ok(key) -> key - Error(_) -> "<" <> dynamic.classify(key) <> ">" - } - }) - let errors = - list.map(layer.1, fn(error) { - DecodeError(..error, path: list.append(path, error.path)) - }) - #(layer.0, errors) -} - -/// Finalise a decoder having successfully extracted a value. -/// -/// ## Examples -/// -/// ```gleam -/// let data = dynamic.properties([ -/// #(dynamic.string("email"), dynamic.string("lucy@example.com")), -/// #(dynamic.string("name"), dynamic.string("Lucy")), -/// ]) -/// -/// let decoder = { -/// use name <- decode.field("name", string) -/// use email <- decode.field("email", string) -/// decode.success(SignUp(name: name, email: email)) -/// } -/// -/// let result = decode.run(data, decoder) -/// assert result == Ok(SignUp(name: "Lucy", email: "lucy@example.com")) -/// ``` -/// -pub fn success(data: t) -> Decoder(t) { - Decoder(function: fn(_) { #(data, []) }) -} - -/// Construct a decode error for some unexpected dynamic data. -/// -pub fn decode_error( - expected expected: String, - found found: Dynamic, -) -> List(DecodeError) { - [DecodeError(expected: expected, found: dynamic.classify(found), path: [])] -} - -/// Run a decoder on a field of a `Dynamic` value, decoding the value if it is -/// of the desired type, or returning errors. An error is returned if there is -/// no field for the specified key. -/// -/// This function will index into dictionaries with any key type, and if the key is -/// an int then it'll also index into Erlang tuples and JavaScript arrays, and -/// the first eight elements of Gleam lists. -/// -/// ## Examples -/// -/// ```gleam -/// let data = dynamic.properties([ -/// #(dynamic.string("email"), dynamic.string("lucy@example.com")), -/// #(dynamic.string("name"), dynamic.string("Lucy")), -/// ]) -/// -/// let decoder = { -/// use name <- decode.field("name", string) -/// use email <- decode.field("email", string) -/// decode.success(SignUp(name: name, email: email)) -/// } -/// -/// let result = decode.run(data, decoder) -/// assert result == Ok(SignUp(name: "Lucy", email: "lucy@example.com")) -/// ``` -/// -/// If you wish to decode a value that is more deeply nested within the dynamic -/// data, see [`subfield`](#subfield) and [`at`](#at). -/// -/// If you wish to return a default in the event that a field is not present, -/// see [`optional_field`](#optional_field) and / [`optionally_at`](#optionally_at). -/// -pub fn field( - field_name: name, - field_decoder: Decoder(t), - next: fn(t) -> Decoder(final), -) -> Decoder(final) { - subfield([field_name], field_decoder, next) -} - -/// Run a decoder on a field of a `Dynamic` value, decoding the value if it is -/// of the desired type, or returning errors. The given default value is -/// returned if there is no field for the specified key. -/// -/// This function will index into dictionaries with any key type, and if the key is -/// an int then it'll also index into Erlang tuples and JavaScript arrays, and -/// the first eight elements of Gleam lists. -/// -/// ## Examples -/// -/// ```gleam -/// let data = dynamic.properties([ -/// #(dynamic.string("name"), dynamic.string("Lucy")), -/// ]) -/// -/// let decoder = { -/// use name <- decode.field("name", string) -/// use email <- decode.optional_field("email", "n/a", string) -/// decode.success(SignUp(name: name, email: email)) -/// } -/// -/// let result = decode.run(data, decoder) -/// assert result == Ok(SignUp(name: "Lucy", email: "n/a")) -/// ``` -/// -pub fn optional_field( - key: name, - default: t, - field_decoder: Decoder(t), - next: fn(t) -> Decoder(final), -) -> Decoder(final) { - Decoder(function: fn(data) { - let #(out, errors1) = - case bare_index(data, key) { - Ok(Some(data)) -> field_decoder.function(data) - Ok(None) -> #(default, []) - Error(kind) -> #(default, [ - DecodeError(kind, dynamic.classify(data), []), - ]) - } - |> push_path([key]) - let #(out, errors2) = next(out).function(data) - #(out, list.append(errors1, errors2)) - }) -} - -/// A decoder that decodes a value that is nested within other values. For -/// example, decoding a value that is within some deeply nested JSON objects. -/// -/// This function will index into dictionaries with any key type, and if the key is -/// an int then it'll also index into Erlang tuples and JavaScript arrays, and -/// the first eight elements of Gleam lists. -/// -/// ## Examples -/// -/// ```gleam -/// let decoder = decode.optionally_at(["one", "two"], 100, decode.int) -/// -/// let data = dynamic.properties([ -/// #(dynamic.string("one"), dynamic.properties([])), -/// ]) -/// -/// decode.run(data, decoder) -/// // -> Ok(100) -/// ``` -/// -pub fn optionally_at( - path: List(segment), - default: a, - inner: Decoder(a), -) -> Decoder(a) { - Decoder(function: fn(data) { - index(path, [], inner.function, data, fn(_, _) { #(default, []) }) - }) -} - -fn run_dynamic_function( - data: Dynamic, - name: String, - f: fn(Dynamic) -> Result(t, t), -) -> #(t, List(DecodeError)) { - case f(data) { - Ok(data) -> #(data, []) - Error(placeholder) -> #(placeholder, [ - DecodeError(name, dynamic.classify(data), []), - ]) - } -} - -/// A decoder that decodes `String` values. -/// -/// ## Examples -/// -/// ```gleam -/// let result = decode.run(dynamic.string("Hello!"), decode.string) -/// assert result == Ok("Hello!") -/// ``` -/// -pub const string: Decoder(String) = Decoder(decode_string) - -fn decode_string(data: Dynamic) -> #(String, List(DecodeError)) { - run_dynamic_function(data, "String", dynamic_string) -} - -@external(javascript, "../../gleam_stdlib.mjs", "string") -fn dynamic_string(from data: Dynamic) -> Result(String, String) { - case dynamic_bit_array(data) { - Ok(data) -> - case bit_array.to_string(data) { - Ok(string) -> Ok(string) - Error(_) -> Error("") - } - Error(_) -> Error("") - } -} - -/// A decoder that decodes `Bool` values. -/// -/// ## Examples -/// -/// ```gleam -/// let result = decode.run(dynamic.bool(True), decode.bool) -/// assert result == Ok(True) -/// ``` -/// -pub const bool: Decoder(Bool) = Decoder(decode_bool) - -fn decode_bool(data: Dynamic) -> #(Bool, List(DecodeError)) { - case cast(True) == data { - True -> #(True, []) - False -> - case cast(False) == data { - True -> #(False, []) - False -> #(False, decode_error("Bool", data)) - } - } -} - -/// A decoder that decodes `Int` values. -/// -/// This will not coerse float values into int values, so on platforms with -/// distinct runtime int and float types (Erlang, not JavaScript) it will fail, -/// even if the float is a whole number (e.g. 1.0). -/// -/// If you want to decode both ints and floats you may want to use the `one_of` -/// function. -/// -/// ## Examples -/// -/// ```gleam -/// let result = decode.run(dynamic.int(147), decode.int) -/// assert result == Ok(147) -/// ``` -/// -pub const int: Decoder(Int) = Decoder(decode_int) - -fn decode_int(data: Dynamic) -> #(Int, List(DecodeError)) { - run_dynamic_function(data, "Int", dynamic_int) -} - -@external(erlang, "gleam_stdlib", "int") -@external(javascript, "../../gleam_stdlib.mjs", "int") -fn dynamic_int(data: Dynamic) -> Result(Int, Int) - -/// A decoder that decodes `Float` values. -/// -/// This will not coerse int values into float values, so on platforms with -/// distinct runtime int and float types (Erlang, not JavaScript) it will fail -/// for ints. One time this may happen is when decoding JSON data. -/// -/// If you want to decode both ints and floats you may want to use the `one_of` -/// function. -/// -/// ## Examples -/// -/// ```gleam -/// let result = decode.run(dynamic.float(3.14), decode.float) -/// assert result == Ok(3.14) -/// ``` -/// -pub const float: Decoder(Float) = Decoder(decode_float) - -fn decode_float(data: Dynamic) -> #(Float, List(DecodeError)) { - run_dynamic_function(data, "Float", dynamic_float) -} - -@external(erlang, "gleam_stdlib", "float") -@external(javascript, "../../gleam_stdlib.mjs", "float") -fn dynamic_float(data: Dynamic) -> Result(Float, Float) - -/// A decoder that decodes `Dynamic` values. This decoder never returns an error. -/// -/// ## Examples -/// -/// ```gleam -/// let result = decode.run(dynamic.float(3.14), decode.dynamic) -/// assert result == Ok(dynamic.float(3.14)) -/// ``` -/// -pub const dynamic: Decoder(Dynamic) = Decoder(decode_dynamic) - -fn decode_dynamic(data: Dynamic) -> #(Dynamic, List(DecodeError)) { - #(data, []) -} - -/// A decoder that decodes `BitArray` values. This decoder never returns an error. -/// -/// ## Examples -/// -/// ```gleam -/// let result = decode.run(dynamic.bit_array(<<5, 7>>), decode.bit_array) -/// assert result == Ok(<<5, 7>>) -/// ``` -/// -pub const bit_array: Decoder(BitArray) = Decoder(decode_bit_array) - -fn decode_bit_array(data: Dynamic) -> #(BitArray, List(DecodeError)) { - run_dynamic_function(data, "BitArray", dynamic_bit_array) -} - -@external(erlang, "gleam_stdlib", "bit_array") -@external(javascript, "../../gleam_stdlib.mjs", "bit_array") -fn dynamic_bit_array(data: Dynamic) -> Result(BitArray, BitArray) - -/// A decoder that decodes lists where all elements are decoded with a given -/// decoder. -/// -/// ## Examples -/// -/// ```gleam -/// let result = -/// [1, 2, 3] -/// |> list.map(dynamic.int) -/// |> dynamic.list -/// |> decode.run(decode.list(of: decode.int)) -/// assert result == Ok([1, 2, 3]) -/// ``` -/// -pub fn list(of inner: Decoder(a)) -> Decoder(List(a)) { - Decoder(fn(data) { - decode_list(data, inner.function, fn(p, k) { push_path(p, [k]) }, 0, []) - }) -} - -@external(erlang, "gleam_stdlib", "list") -@external(javascript, "../../gleam_stdlib.mjs", "list") -fn decode_list( - data: Dynamic, - item: fn(Dynamic) -> #(t, List(DecodeError)), - push_path: fn(#(t, List(DecodeError)), key) -> #(t, List(DecodeError)), - index: Int, - acc: List(t), -) -> #(List(t), List(DecodeError)) - -/// A decoder that decodes dicts where all keys and values are decoded with -/// given decoders. -/// -/// ## Examples -/// -/// ```gleam -/// let values = dynamic.properties([ -/// #(dynamic.string("one"), dynamic.int(1)), -/// #(dynamic.string("two"), dynamic.int(2)), -/// ]) -/// -/// let result = -/// decode.run(values, decode.dict(decode.string, decode.int)) -/// assert result == Ok(values) -/// ``` -/// -pub fn dict( - key: Decoder(key), - value: Decoder(value), -) -> Decoder(Dict(key, value)) { - Decoder(fn(data) { - case decode_dict(data) { - Error(_) -> #(dict.new(), decode_error("Dict", data)) - Ok(dict) -> - dict.fold(dict, #(dict.new(), []), fn(a, k, v) { - // If there are any errors from previous key-value pairs then we - // don't need to run the decoders, instead return the existing acc. - case a.1 { - [] -> fold_dict(a, k, v, key.function, value.function) - [_, ..] -> a - } - }) - } - }) -} - -fn fold_dict( - acc: #(Dict(k, v), List(DecodeError)), - key: Dynamic, - value: Dynamic, - key_decoder: fn(Dynamic) -> #(k, List(DecodeError)), - value_decoder: fn(Dynamic) -> #(v, List(DecodeError)), -) -> #(Dict(k, v), List(DecodeError)) { - // First we decode the key. - case key_decoder(key) { - #(key, []) -> - // Then we decode the value. - case value_decoder(value) { - #(value, []) -> { - // It worked! Insert the new key-value pair so we can move onto the next. - let dict = dict.insert(acc.0, key, value) - #(dict, acc.1) - } - #(_, errors) -> push_path(#(dict.new(), errors), ["values"]) - } - #(_, errors) -> push_path(#(dict.new(), errors), ["keys"]) - } -} - -@external(erlang, "gleam_stdlib", "dict") -@external(javascript, "../../gleam_stdlib.mjs", "dict") -fn decode_dict(data: Dynamic) -> Result(Dict(Dynamic, Dynamic), Nil) - -/// A decoder that decodes nullable values of a type decoded by with a given -/// decoder. -/// -/// This function can handle common representations of null on all runtimes, such as -/// `nil`, `null`, and `undefined` on Erlang, and `undefined` and `null` on -/// JavaScript. -/// -/// ## Examples -/// -/// ```gleam -/// let result = decode.run(dynamic.int(100), decode.optional(decode.int)) -/// assert result == Ok(option.Some(100)) -/// ``` -/// -/// ```gleam -/// let result = decode.run(dynamic.nil(), decode.optional(decode.int)) -/// assert result == Ok(option.None) -/// ``` -/// -pub fn optional(inner: Decoder(a)) -> Decoder(Option(a)) { - Decoder(function: fn(data) { - case is_null(data) { - True -> #(option.None, []) - False -> { - let #(data, errors) = inner.function(data) - #(option.Some(data), errors) - } - } - }) -} - -/// Apply a transformation function to any value decoded by the decoder. -/// -/// ## Examples -/// -/// ```gleam -/// let decoder = decode.int |> decode.map(int.to_string) -/// let result = decode.run(dynamic.int(1000), decoder) -/// assert result == Ok("1000") -/// ``` -/// -pub fn map(decoder: Decoder(a), transformer: fn(a) -> b) -> Decoder(b) { - Decoder(function: fn(d) { - let #(data, errors) = decoder.function(d) - #(transformer(data), errors) - }) -} - -/// Apply a transformation function to any errors returned by the decoder. -/// -pub fn map_errors( - decoder: Decoder(a), - transformer: fn(List(DecodeError)) -> List(DecodeError), -) -> Decoder(a) { - Decoder(function: fn(d) { - let #(data, errors) = decoder.function(d) - #(data, transformer(errors)) - }) -} - -/// Replace all errors produced by a decoder with one single error for a named -/// expected type. -/// -/// This function may be useful if you wish to simplify errors before -/// presenting them to a user, particularly when using the `one_of` function. -/// -/// ## Examples -/// -/// ```gleam -/// let decoder = decode.string |> decode.collapse_errors("MyThing") -/// let result = decode.run(dynamic.int(1000), decoder) -/// assert result == Error([DecodeError("MyThing", "Int", [])]) -/// ``` -/// -pub fn collapse_errors(decoder: Decoder(a), name: String) -> Decoder(a) { - Decoder(function: fn(dynamic_data) { - let #(data, errors) as layer = decoder.function(dynamic_data) - case errors { - [] -> layer - [_, ..] -> #(data, decode_error(name, dynamic_data)) - } - }) -} - -/// Create a new decoder based upon the value of a previous decoder. -/// -/// This may be useful to run one previous decoder to use in further decoding. -/// -pub fn then(decoder: Decoder(a), next: fn(a) -> Decoder(b)) -> Decoder(b) { - Decoder(function: fn(dynamic_data) { - let #(data, errors) = decoder.function(dynamic_data) - let decoder = next(data) - let #(data, _) as layer = decoder.function(dynamic_data) - case errors { - [] -> layer - [_, ..] -> #(data, errors) - } - }) -} - -/// Create a new decoder from several other decoders. Each of the inner -/// decoders is run in turn, and the value from the first to succeed is used. -/// -/// If no decoder succeeds then the errors from the first decoder are used. -/// If you wish for different errors then you may wish to use the -/// `collapse_errors` or `map_errors` functions. -/// -/// ## Examples -/// -/// ```gleam -/// let decoder = decode.one_of(decode.string, or: [ -/// decode.int |> decode.map(int.to_string), -/// decode.float |> decode.map(float.to_string), -/// ]) -/// decode.run(dynamic.int(1000), decoder) -/// // -> Ok("1000") -/// ``` -/// -pub fn one_of( - first: Decoder(a), - or alternatives: List(Decoder(a)), -) -> Decoder(a) { - Decoder(function: fn(dynamic_data) { - let #(_, errors) as layer = first.function(dynamic_data) - case errors { - [] -> layer - [_, ..] -> run_decoders(dynamic_data, layer, alternatives) - } - }) -} - -fn run_decoders( - data: Dynamic, - failure: #(a, List(DecodeError)), - decoders: List(Decoder(a)), -) -> #(a, List(DecodeError)) { - case decoders { - [] -> failure - - [decoder, ..decoders] -> { - let #(_, errors) as layer = decoder.function(data) - case errors { - [] -> layer - [_, ..] -> run_decoders(data, failure, decoders) - } - } - } -} - -/// Define a decoder that always fails. -/// -/// The first parameter is a "placeholder" value, which is some default value that the -/// decoder uses internally in place of the value that would have been produced -/// if the decoder was successful. It doesn't matter what this value is, it is -/// never returned by the decoder or shown to the user, so pick some arbitrary -/// value. If it is an int you might pick `0`, if it is a list you might pick -/// `[]`. -/// -/// The second parameter is the name of the type that has failed to decode. -/// -/// ```gleam -/// decode.failure(User(name: "", score: 0, tags: []), expected: "User") -/// ``` -/// -pub fn failure(placeholder: a, expected name: String) -> Decoder(a) { - Decoder(function: fn(d) { #(placeholder, decode_error(name, d)) }) -} - -/// Create a decoder for a new data type from a decoding function. -/// -/// This function is used for new primitive types. For example, you might -/// define a decoder for Erlang's pid type. -/// -/// A default "placeholder" value is also required to make a decoder. When this -/// decoder is used as part of a larger decoder this placeholder value is used -/// so that the rest of the decoder can continue to run and -/// collect all decoding errors. It doesn't matter what this value is, it is -/// never returned by the decoder or shown to the user, so pick some arbitrary -/// value. If it is an int you might pick `0`, if it is a list you might pick -/// `[]`. -/// -/// If you were to make a decoder for the `Int` type (rather than using the -/// build-in `Int` decoder) you would define it like so: -/// -/// ```gleam -/// pub fn int_decoder() -> decode.Decoder(Int) { -/// let default = "" -/// decode.new_primitive_decoder("Int", int_from_dynamic) -/// } -/// -/// @external(erlang, "my_module", "int_from_dynamic") -/// fn int_from_dynamic(data: Int) -> Result(Int, Int) -/// ``` -/// -/// ```erlang -/// -module(my_module). -/// -export([int_from_dynamic/1]). -/// -/// int_from_dynamic(Data) -> -/// case is_integer(Data) of -/// true -> {ok, Data}; -/// false -> {error, 0} -/// end. -/// ``` -/// -pub fn new_primitive_decoder( - name: String, - decoding_function: fn(Dynamic) -> Result(t, t), -) -> Decoder(t) { - Decoder(function: fn(d) { - case decoding_function(d) { - Ok(t) -> #(t, []) - Error(placeholder) -> #(placeholder, [ - DecodeError(name, dynamic.classify(d), []), - ]) - } - }) -} - -/// Create a decoder that can refer to itself, useful for decoding deeply -/// nested data. -/// -/// Attempting to create a recursive decoder without this function could result -/// in an infinite loop. If you are using `field` or other `use`able functions -/// then you may not need to use this function. -/// -/// ## Examples -/// -/// ```gleam -/// type Nested { -/// Nested(List(Nested)) -/// Value(String) -/// } -/// -/// fn nested_decoder() -> decode.Decoder(Nested) { -/// use <- decode.recursive -/// decode.one_of(decode.string |> decode.map(Value), [ -/// decode.list(nested_decoder()) |> decode.map(Nested), -/// ]) -/// } -/// ``` -/// -pub fn recursive(inner: fn() -> Decoder(a)) -> Decoder(a) { - Decoder(function: fn(data) { - let decoder = inner() - decoder.function(data) - }) -} - -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../../gleam_stdlib.mjs", "identity") -fn cast(a: anything) -> Dynamic - -@external(erlang, "gleam_stdlib", "is_null") -@external(javascript, "../../gleam_stdlib.mjs", "is_null") -fn is_null(a: Dynamic) -> Bool diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/float.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/float.gleam deleted file mode 100644 index 599f857..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/float.gleam +++ /dev/null @@ -1,674 +0,0 @@ -//// Functions for working with floats. -//// -//// ## Float representation -//// -//// Floats are represented as 64 bit floating point numbers on both the Erlang -//// and JavaScript runtimes. The floating point behaviour is native to their -//// respective runtimes, so their exact behaviour will be slightly different on -//// the two runtimes. -//// -//// ### Infinity and NaN -//// -//// Under the JavaScript runtime, exceeding the maximum (or minimum) -//// representable value for a floating point value will result in Infinity (or -//// -Infinity). Should you try to divide two infinities you will get NaN as a -//// result. -//// -//// When running on BEAM, exceeding the maximum (or minimum) representable -//// value for a floating point value will raise an error. -//// -//// ## Division by zero -//// -//// Gleam runs on the Erlang virtual machine, which does not follow the IEEE -//// 754 standard for floating point arithmetic and does not have an `Infinity` -//// value. In Erlang division by zero results in a crash, however Gleam does -//// not have partial functions and operators in core so instead division by zero -//// returns zero, a behaviour taken from Pony, Coq, and Lean. -//// -//// This may seem unexpected at first, but it is no less mathematically valid -//// than crashing or returning a special value. Division by zero is undefined -//// in mathematics. - -import gleam/order.{type 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) -/// ``` -/// -@external(erlang, "gleam_stdlib", "parse_float") -@external(javascript, "../gleam_stdlib.mjs", "parse_float") -pub fn parse(string: String) -> Result(Float, Nil) - -/// Returns the string representation of the provided `Float`. -/// -/// ## Examples -/// -/// ```gleam -/// to_string(2.3) -/// // -> "2.3" -/// ``` -/// -@external(erlang, "gleam_stdlib", "float_to_string") -@external(javascript, "../gleam_stdlib.mjs", "float_to_string") -pub fn to_string(x: Float) -> String - -/// Restricts a float between two bounds. -/// -/// Note: If the `min` argument is larger than the `max` argument then they -/// will be swapped, so the minimum bound is always lower than the maximum -/// bound. -/// -/// -/// ## Examples -/// -/// ```gleam -/// clamp(1.2, min: 1.4, max: 1.6) -/// // -> 1.4 -/// ``` -/// -/// ```gleam -/// clamp(1.2, min: 1.4, max: 0.6) -/// // -> 1.2 -/// ``` -/// -pub fn clamp(x: Float, min min_bound: Float, max max_bound: Float) -> Float { - case min_bound >=. max_bound { - True -> x |> min(min_bound) |> max(max_bound) - False -> 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 a `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 -/// ``` -/// -@external(erlang, "math", "ceil") -@external(javascript, "../gleam_stdlib.mjs", "ceiling") -pub fn ceiling(x: Float) -> Float - -/// Rounds the value to the next lowest whole number as a `Float`. -/// -/// ## Examples -/// -/// ```gleam -/// floor(2.3) -/// // -> 2.0 -/// ``` -/// -@external(erlang, "math", "floor") -@external(javascript, "../gleam_stdlib.mjs", "floor") -pub fn floor(x: Float) -> Float - -/// Rounds the value to the nearest whole number as an `Int`. -/// -/// ## Examples -/// -/// ```gleam -/// round(2.3) -/// // -> 2 -/// ``` -/// -/// ```gleam -/// round(2.5) -/// // -> 3 -/// ``` -/// -@external(erlang, "erlang", "round") -pub fn round(x: Float) -> Int { - case x >=. 0.0 { - True -> js_round(x) - False -> 0 - js_round(negate(x)) - } -} - -@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 -/// ``` -/// -@external(erlang, "erlang", "trunc") -@external(javascript, "../gleam_stdlib.mjs", "truncate") -pub fn truncate(x: Float) -> Int - -/// Converts the value to a given precision as a `Float`. -/// The precision is the number of allowed decimal places. -/// Negative precisions are allowed and force rounding -/// to the nearest tenth, hundredth, thousandth etc. -/// -/// ## Examples -/// -/// ```gleam -/// to_precision(2.43434348473, precision: 2) -/// // -> 2.43 -/// ``` -/// -/// ```gleam -/// to_precision(547890.453444, precision: -3) -/// // -> 548000.0 -/// ``` -/// -pub fn to_precision(x: Float, precision: Int) -> Float { - case precision <= 0 { - True -> { - let factor = do_power(10.0, do_to_float(-precision)) - do_to_float(round(x /. factor)) *. factor - } - False -> { - let factor = do_power(10.0, do_to_float(precision)) - do_to_float(round(x *. factor)) /. factor - } - } -} - -@external(erlang, "erlang", "float") -@external(javascript, "../gleam_stdlib.mjs", "identity") -fn do_to_float(a: Int) -> Float - -/// 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 - False -> 0.0 -. x - } -} - -/// Returns the result 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 { - sum_loop(numbers, 0.0) -} - -fn sum_loop(numbers: List(Float), initial: Float) -> Float { - case numbers { - [first, ..rest] -> sum_loop(rest, first +. initial) - [] -> 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 { - product_loop(numbers, 1.0) -} - -fn product_loop(numbers: List(Float), initial: Float) -> Float { - case numbers { - [first, ..rest] -> product_loop(rest, first *. initial) - [] -> initial - } -} - -/// Generates a random float between the given zero (inclusive) and one -/// (exclusive). -/// -/// On Erlang this updates the random state in the process dictionary. -/// See: -/// -/// ## Examples -/// -/// ```gleam -/// random() -/// // -> 0.646355926896028 -/// ``` -/// -@external(erlang, "rand", "uniform") -@external(javascript, "../gleam_stdlib.mjs", "random_uniform") -pub fn random() -> Float - -/// Computes the modulo of a float 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`. -/// -/// The computed value will always have the same sign as the `divisor`. -/// -/// ## Examples -/// -/// ```gleam -/// modulo(13.3, by: 3.3) -/// // -> Ok(0.1) -/// ``` -/// -/// ```gleam -/// modulo(-13.3, by: 3.3) -/// // -> Ok(3.2) -/// ``` -/// -/// ```gleam -/// modulo(13.3, by: -3.3) -/// // -> Ok(-3.2) -/// ``` -/// -/// ```gleam -/// modulo(-13.3, by: -3.3) -/// // -> Ok(-0.1) -/// ``` -/// -pub fn modulo(dividend: Float, by divisor: Float) -> Result(Float, Nil) { - case divisor { - 0.0 -> Error(Nil) - _ -> Ok(dividend -. floor(dividend /. divisor) *. divisor) - } -} - -/// Returns division of the inputs as a `Result`. -/// -/// ## Examples -/// -/// ```gleam -/// divide(0.0, 1.0) -/// // -> Ok(0.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 -} - -/// Returns the natural logarithm (base e) of the given `Float` as a `Result`. If the -/// input is less than or equal to 0, returns `Error(Nil)`. -/// -/// ## Examples -/// -/// ```gleam -/// logarithm(1.0) -/// // -> Ok(0.0) -/// ``` -/// -/// ```gleam -/// logarithm(2.718281828459045) // e -/// // -> Ok(1.0) -/// ``` -/// -/// ```gleam -/// logarithm(0.0) -/// // -> Error(Nil) -/// ``` -/// -/// ```gleam -/// logarithm(-1.0) -/// // -> Error(Nil) -/// ``` -/// -pub fn logarithm(x: Float) -> Result(Float, Nil) { - // In the following check: - // 1. If x is negative then return an error as the natural logarithm - // of a negative number is undefined (would be a complex number) - // 2. If x is 0 then return an error as the natural logarithm of 0 - // approaches negative infinity - case x <=. 0.0 { - True -> Error(Nil) - False -> Ok(do_log(x)) - } -} - -@external(erlang, "math", "log") -@external(javascript, "../gleam_stdlib.mjs", "log") -fn do_log(x: Float) -> Float - -/// Returns e (Euler's number) raised to the power of the given exponent, as -/// a `Float`. -/// -/// ## Examples -/// -/// ```gleam -/// exponential(0.0) -/// // -> Ok(1.0) -/// ``` -/// -/// ```gleam -/// exponential(1.0) -/// // -> Ok(2.718281828459045) -/// ``` -/// -/// ```gleam -/// exponential(-1.0) -/// // -> Ok(0.36787944117144233) -/// ``` -/// -@external(erlang, "math", "exp") -@external(javascript, "../gleam_stdlib.mjs", "exp") -pub fn exponential(x: Float) -> Float diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/function.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/function.gleam deleted file mode 100644 index 3537579..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/function.gleam +++ /dev/null @@ -1,5 +0,0 @@ -/// Takes a single argument and always returns its input value. -/// -pub fn identity(x: a) -> a { - x -} diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/int.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/int.gleam deleted file mode 100644 index 804203e..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/int.gleam +++ /dev/null @@ -1,812 +0,0 @@ -//// Functions for working with integers. -//// -//// ## Division by zero -//// -//// In Erlang division by zero results in a crash, however Gleam does not have -//// partial functions and operators in core so instead division by zero returns -//// zero, a behaviour taken from Pony, Coq, and Lean. -//// -//// This may seem unexpected at first, but it is no less mathematically valid -//// than crashing or returning a special value. Division by zero is undefined -//// in mathematics. - -import gleam/float -import gleam/order.{type 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 result 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) -/// ``` -/// -@external(erlang, "gleam_stdlib", "parse_int") -@external(javascript, "../gleam_stdlib.mjs", "parse_int") -pub fn parse(string: 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) -/// ``` -/// -/// ```gleam -/// base_parse("30", 16) -/// // -> Ok(48) -/// ``` -/// -/// ```gleam -/// base_parse("1C", 36) -/// // -> Ok(48) -/// ``` -/// -/// ```gleam -/// base_parse("48", 1) -/// // -> Error(Nil) -/// ``` -/// -/// ```gleam -/// 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" -/// ``` -/// -@external(erlang, "erlang", "integer_to_binary") -@external(javascript, "../gleam_stdlib.mjs", "to_string") -pub fn to_string(x: Int) -> String - -/// 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(Nil)`. -/// 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(Nil) -/// ``` -/// -/// ```gleam -/// to_base_string(48, 37) -/// // -> Error(Nil) -/// ``` -/// -pub fn to_base_string(x: Int, base: Int) -> Result(String, Nil) { - case base >= 2 && base <= 36 { - True -> Ok(do_to_base_string(x, base)) - False -> Error(Nil) - } -} - -@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 -/// ``` -/// -@external(erlang, "erlang", "float") -@external(javascript, "../gleam_stdlib.mjs", "identity") -pub fn to_float(x: Int) -> Float - -/// Restricts an int between two bounds. -/// -/// Note: If the `min` argument is larger than the `max` argument then they -/// will be swapped, so the minimum bound is always lower than the maximum -/// bound. -/// -/// ## Examples -/// -/// ```gleam -/// clamp(40, min: 50, max: 60) -/// // -> 50 -/// ``` -/// -/// ```gleam -/// clamp(40, min: 50, max: 30) -/// // -> 40 -/// ``` -/// -pub fn clamp(x: Int, min min_bound: Int, max max_bound: Int) -> Int { - case min_bound >= max_bound { - True -> x |> min(min_bound) |> max(max_bound) - False -> 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 { - sum_loop(numbers, 0) -} - -fn sum_loop(numbers: List(Int), initial: Int) -> Int { - case numbers { - [first, ..rest] -> sum_loop(rest, first + initial) - [] -> initial - } -} - -/// Multiplies a list of ints and returns the product. -/// -/// ## Example -/// -/// ```gleam -/// product([2, 3, 4]) -/// // -> 24 -/// ``` -/// -pub fn product(numbers: List(Int)) -> Int { - product_loop(numbers, 1) -} - -fn product_loop(numbers: List(Int), initial: Int) -> Int { - case numbers { - [first, ..rest] -> product_loop(rest, first * initial) - [] -> initial - } -} - -/// Generates a random int between zero and the given maximum. -/// -/// The lower number is inclusive, the upper number is exclusive. -/// -/// ## Examples -/// -/// ```gleam -/// random(10) -/// // -> 4 -/// ``` -/// -/// ```gleam -/// random(1) -/// // -> 0 -/// ``` -/// -/// ```gleam -/// random(-1) -/// // -> -1 -/// ``` -/// -pub fn random(max: Int) -> Int { - { float.random() *. 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(0) -/// ``` -/// -/// ```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 of 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`. -/// -/// Note that this is different from `int.remainder` and `%` in that the -/// computed value will always have the same sign as the `divisor`. -/// -/// ## 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) -/// ``` -/// -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 -/// ``` -/// -/// ```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/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/io.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/io.gleam deleted file mode 100644 index 1020000..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/io.gleam +++ /dev/null @@ -1,59 +0,0 @@ -/// Writes a string to standard output (stdout). -/// -/// If you want your output to be printed on its own line see `println`. -/// -/// ## Example -/// -/// ```gleam -/// io.print("Hi mum") -/// // -> Nil -/// // Hi mum -/// ``` -/// -@external(erlang, "gleam_stdlib", "print") -@external(javascript, "../gleam_stdlib.mjs", "print") -pub fn print(string: String) -> Nil - -/// Writes a string to standard error (stderr). -/// -/// If you want your output to be printed on its own line see `println_error`. -/// -/// ## Example -/// -/// ```gleam -/// io.print_error("Hi pop") -/// // -> Nil -/// // Hi pop -/// ``` -/// -@external(erlang, "gleam_stdlib", "print_error") -@external(javascript, "../gleam_stdlib.mjs", "print_error") -pub fn print_error(string: String) -> Nil - -/// Writes a string to standard output (stdout), appending a newline to the end. -/// -/// ## Example -/// -/// ```gleam -/// io.println("Hi mum") -/// // -> Nil -/// // Hi mum -/// ``` -/// -@external(erlang, "gleam_stdlib", "println") -@external(javascript, "../gleam_stdlib.mjs", "console_log") -pub fn println(string: String) -> Nil - -/// Writes a string to standard error (stderr), appending a newline to the end. -/// -/// ## Example -/// -/// ```gleam -/// io.println_error("Hi pop") -/// // -> Nil -/// // Hi pop -/// ``` -/// -@external(erlang, "gleam_stdlib", "println_error") -@external(javascript, "../gleam_stdlib.mjs", "console_error") -pub fn println_error(string: String) -> Nil diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/list.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/list.gleam deleted file mode 100644 index ff2f1d2..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/list.gleam +++ /dev/null @@ -1,2407 +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 -//// and 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/dict.{type Dict} -import gleam/float -import gleam/int -import gleam/order.{type Order} - -/// 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 -/// ``` -/// -@external(erlang, "erlang", "length") -pub fn length(of list: List(a)) -> Int { - length_loop(list, 0) -} - -fn length_loop(list: List(a), count: Int) -> Int { - case list { - [_, ..list] -> length_loop(list, count + 1) - [] -> count - } -} - -/// Counts the number of elements in a given list satisfying a given predicate. -/// -/// This function has to traverse the list to determine the number of elements, -/// so it runs in linear time. -/// -/// ## Examples -/// -/// ```gleam -/// count([], fn(a) { a > 0 }) -/// // -> 0 -/// ``` -/// -/// ```gleam -/// count([1], fn(a) { a > 0 }) -/// // -> 1 -/// ``` -/// -/// ```gleam -/// count([1, 2, 3], int.is_odd) -/// // -> 2 -/// ``` -/// -pub fn count(list: List(a), where predicate: fn(a) -> Bool) -> Int { - count_loop(list, predicate, 0) -} - -fn count_loop(list: List(a), predicate: fn(a) -> Bool, acc: Int) -> Int { - case list { - [] -> acc - [first, ..rest] -> - case predicate(first) { - True -> count_loop(rest, predicate, acc + 1) - False -> count_loop(rest, predicate, acc) - } - } -} - -/// 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] -/// ``` -/// -@external(erlang, "lists", "reverse") -pub fn reverse(list: List(a)) -> List(a) { - reverse_and_prepend(list, []) -} - -/// Reverses a list and prepends it to another list. -/// This function runs in linear time, proportional to the length of the list -/// to prepend. -/// -@external(erlang, "lists", "reverse") -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]) - } -} - -/// 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) - [first, ..] -> Ok(first) - } -} - -/// 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) - [_, ..rest] -> Ok(rest) - } -} - -/// Groups the elements from the given list by the given key function. -/// -/// Does not preserve the initial value order. -/// -/// ## Examples -/// -/// ```gleam -/// import gleam/dict -/// -/// [Ok(3), Error("Wrong"), Ok(200), Ok(73)] -/// |> group(by: fn(i) { -/// case i { -/// Ok(_) -> "Successful" -/// Error(_) -> "Failed" -/// } -/// }) -/// |> dict.to_list -/// // -> [ -/// // #("Failed", [Error("Wrong")]), -/// // #("Successful", [Ok(73), Ok(200), Ok(3)]) -/// // ] -/// ``` -/// -/// ```gleam -/// import gleam/dict -/// -/// group([1,2,3,4,5], by: fn(i) { i - i / 3 * 3 }) -/// |> dict.to_list -/// // -> [#(0, [3]), #(1, [4, 1]), #(2, [5, 2])] -/// ``` -/// -pub fn group(list: List(v), by key: fn(v) -> k) -> Dict(k, List(v)) { - dict.group(key, list) -} - -/// 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), keeping predicate: fn(a) -> Bool) -> List(a) { - filter_loop(list, predicate, []) -} - -fn filter_loop(list: List(a), fun: fn(a) -> Bool, acc: List(a)) -> List(a) { - case list { - [] -> reverse(acc) - [first, ..rest] -> { - let new_acc = case fun(first) { - True -> [first, ..acc] - False -> acc - } - filter_loop(rest, 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) { - filter_map_loop(list, fun, []) -} - -fn filter_map_loop( - list: List(a), - fun: fn(a) -> Result(b, e), - acc: List(b), -) -> List(b) { - case list { - [] -> reverse(acc) - [first, ..rest] -> { - let new_acc = case fun(first) { - Ok(first) -> [first, ..acc] - Error(_) -> acc - } - filter_map_loop(rest, fun, new_acc) - } - } -} - -/// Returns a new list containing the results of applying the supplied function to each element. -/// -/// ## 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) { - map_loop(list, fun, []) -} - -fn map_loop(list: List(a), fun: fn(a) -> b, acc: List(b)) -> List(b) { - case list { - [] -> reverse(acc) - [first, ..rest] -> map_loop(rest, fun, [fun(first), ..acc]) - } -} - -/// 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) { - map2_loop(list1, list2, fun, []) -} - -fn map2_loop( - 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] -> map2_loop(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 initial: acc, - with fun: fn(acc, a) -> #(acc, b), -) -> #(acc, List(b)) { - map_fold_loop(list, fun, initial, []) -} - -fn map_fold_loop( - list: List(a), - fun: fn(acc, a) -> #(acc, b), - acc: acc, - list_acc: List(b), -) -> #(acc, List(b)) { - case list { - [] -> #(acc, reverse(list_acc)) - [first, ..rest] -> { - let #(acc, first) = fun(acc, first) - map_fold_loop(rest, fun, acc, [first, ..list_acc]) - } - } -} - -/// Similar to `map`, but the supplied function will also be passed the index -/// of the element being mapped as an additional argument. -/// -/// 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(x, i) { #(i, x) }) -/// // -> [#(0, "a"), #(1, "b")] -/// ``` -/// -pub fn index_map(list: List(a), with fun: fn(a, Int) -> b) -> List(b) { - index_map_loop(list, fun, 0, []) -} - -fn index_map_loop( - list: List(a), - fun: fn(a, Int) -> b, - index: Int, - acc: List(b), -) -> List(b) { - case list { - [] -> reverse(acc) - [first, ..rest] -> { - let acc = [fun(first, index), ..acc] - index_map_loop(rest, fun, index + 1, acc) - } - } -} - -/// 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) { - try_map_loop(list, fun, []) -} - -fn try_map_loop( - list: List(a), - fun: fn(a) -> Result(b, e), - acc: List(b), -) -> Result(List(b), e) { - case list { - [] -> Ok(reverse(acc)) - [first, ..rest] -> - case fun(first) { - Ok(first) -> try_map_loop(rest, fun, [first, ..acc]) - Error(error) -> Error(error) - } - } -} - -/// 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 list 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 { - [] -> [] - [_, ..rest] -> drop(rest, n - 1) - } - } -} - -/// Returns a list containing the first given number of elements from the given -/// list. -/// -/// If the list has less than the number of elements then the full list is -/// returned. -/// -/// This function runs in linear time. -/// -/// ## 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) { - take_loop(list, n, []) -} - -fn take_loop(list: List(a), n: Int, acc: List(a)) -> List(a) { - case n <= 0 { - True -> reverse(acc) - False -> - case list { - [] -> reverse(acc) - [first, ..rest] -> take_loop(rest, n - 1, [first, ..acc]) - } - } -} - -/// Returns a new empty list. -/// -/// ## Examples -/// -/// ```gleam -/// new() -/// // -> [] -/// ``` -/// -pub fn new() -> List(a) { - [] -} - -/// Returns the given item wrapped in a list. -/// -/// ## Examples -/// -/// ```gleam -/// wrap(1) -/// // -> [1] -/// -/// wrap(["a", "b", "c"]) -/// // -> [["a", "b", "c"]] -/// -/// wrap([[]]) -/// // -> [[[]]] -/// ``` -/// -/// -pub fn wrap(item: a) -> List(a) { - [item] -} - -/// 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] -/// ``` -/// -@external(erlang, "lists", "append") -pub fn append(first: List(a), second: List(a)) -> List(a) { - append_loop(reverse(first), second) -} - -fn append_loop(first: List(a), second: List(a)) -> List(a) { - case first { - [] -> second - [first, ..rest] -> append_loop(rest, [first, ..second]) - } -} - -/// Prefixes an item to a list. This can also be done using the dedicated -/// syntax instead. -/// -/// ```gleam -/// let existing_list = [2, 3, 4] -/// -/// [1, ..existing_list] -/// // -> [1, 2, 3, 4] -/// -/// prepend(to: existing_list, this: 1) -/// // -> [1, 2, 3, 4] -/// ``` -/// -pub fn prepend(to list: List(a), this item: a) -> List(a) { - [item, ..list] -} - -/// Joins a list of lists into a single list. -/// -/// This function traverses all elements twice on the JavaScript target. -/// This function traverses all elements once on the Erlang target. -/// -/// ## Examples -/// -/// ```gleam -/// flatten([[1], [2, 3], []]) -/// // -> [1, 2, 3] -/// ``` -/// -@external(erlang, "lists", "append") -pub fn flatten(lists: List(List(a))) -> List(a) { - flatten_loop(lists, []) -} - -fn flatten_loop(lists: List(List(a)), acc: List(a)) -> List(a) { - case lists { - [] -> reverse(acc) - [list, ..further_lists] -> - flatten_loop(further_lists, reverse_and_prepend(list, to: acc)) - } -} - -/// 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) { - flatten(map(list, fun)) -} - -/// 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 - [first, ..rest] -> fold(rest, fun(initial, first), 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 - [first, ..rest] -> fun(fold_right(rest, initial, fun), first) - } -} - -/// 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) { -/// acc <> int.to_string(index) <> ":" <> item <> " " -/// }) -/// // -> "0:a 1:b 2:c" -/// ``` -/// -/// ```gleam -/// [10, 20, 30] -/// |> index_fold(0, fn(acc, item, index) { acc + item * index }) -/// // -> 80 -/// ``` -/// -pub fn index_fold( - over list: List(a), - from initial: acc, - with fun: fn(acc, a, Int) -> acc, -) -> acc { - index_fold_loop(list, initial, fun, 0) -} - -fn index_fold_loop( - over: List(a), - acc: acc, - with: fn(acc, a, Int) -> acc, - index: Int, -) -> acc { - case over { - [] -> acc - [first, ..rest] -> - index_fold_loop(rest, with(acc, first, index), with, index + 1) - } -} - -/// 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) -/// } -/// }) -/// // -> Error(Nil) -/// ``` -/// -pub fn try_fold( - over list: List(a), - from initial: acc, - with fun: fn(acc, a) -> Result(acc, e), -) -> Result(acc, e) { - case list { - [] -> Ok(initial) - [first, ..rest] -> - case fun(initial, 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) -/// } -/// }) -/// // -> 3 -/// ``` -/// -pub fn fold_until( - over list: List(a), - from initial: acc, - with fun: fn(acc, a) -> ContinueOrStop(acc), -) -> acc { - case list { - [] -> initial - [first, ..rest] -> - case fun(initial, 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 list: List(a), - one_that is_desired: fn(a) -> Bool, -) -> Result(a, Nil) { - case list { - [] -> Error(Nil) - [first, ..rest] -> - case is_desired(first) { - True -> Ok(first) - False -> 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 list: List(a), - with fun: fn(a) -> Result(b, c), -) -> Result(b, Nil) { - case list { - [] -> Error(Nil) - [first, ..rest] -> - case fun(first) { - Ok(first) -> Ok(first) - Error(_) -> 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) - } - } -} - -/// 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)) { - zip_loop(list, other, []) -} - -fn zip_loop(one: List(a), other: List(b), acc: List(#(a, b))) -> List(#(a, b)) { - case one, other { - [first_one, ..rest_one], [first_other, ..rest_other] -> - zip_loop(rest_one, rest_other, [#(first_one, first_other), ..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, an `Error` is returned. -/// -/// ## Examples -/// -/// ```gleam -/// strict_zip([], []) -/// // -> Ok([]) -/// ``` -/// -/// ```gleam -/// strict_zip([1, 2], [3]) -/// // -> Error(Nil) -/// ``` -/// -/// ```gleam -/// strict_zip([1], [3, 4]) -/// // -> Error(Nil) -/// ``` -/// -/// ```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)), Nil) { - strict_zip_loop(list, other, []) -} - -fn strict_zip_loop( - one: List(a), - other: List(b), - acc: List(#(a, b)), -) -> Result(List(#(a, b)), Nil) { - case one, other { - [], [] -> Ok(reverse(acc)) - [], _ | _, [] -> Error(Nil) - [first_one, ..rest_one], [first_other, ..rest_other] -> - strict_zip_loop(rest_one, rest_other, [#(first_one, first_other), ..acc]) - } -} - -/// 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)) { - unzip_loop(input, [], []) -} - -fn unzip_loop( - input: List(#(a, b)), - one: List(a), - other: List(b), -) -> #(List(a), List(b)) { - case input { - [] -> #(reverse(one), reverse(other)) - [#(first_one, first_other), ..rest] -> - unzip_loop(rest, [first_one, ..one], [first_other, ..other]) - } -} - -/// 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 - [first, ..rest] -> intersperse_loop(rest, elem, [first]) - } -} - -fn intersperse_loop(list: List(a), separator: a, acc: List(a)) -> List(a) { - case list { - [] -> reverse(acc) - [first, ..rest] -> - intersperse_loop(rest, separator, [first, separator, ..acc]) - } -} - -/// 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) { - unique_loop(list, dict.new(), []) -} - -fn unique_loop(list: List(a), seen: Dict(a, Nil), acc: List(a)) -> List(a) { - case list { - [] -> reverse(acc) - [first, ..rest] -> - case dict.has_key(seen, first) { - True -> unique_loop(rest, seen, acc) - False -> - unique_loop(rest, dict.insert(seen, first, Nil), [first, ..acc]) - } - } -} - -/// Sorts from smallest to largest based upon the ordering specified by a given -/// function. -/// -/// ## Examples -/// -/// ```gleam -/// import gleam/int -/// -/// 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) { - // This is a natural, tail recursive, stable merge sort: - // - natural: it is very efficient if you call it on a list that is already - // (pre)sorted because it works on slices of the original list. - // - tail recursive: the stack won't grow linearly with the size of the list. - // - stable: if two items are considered to be equal then their original - // relative order is preserved. - case list { - // If the list has zero/one item then it's already sorted. - [] -> [] - [x] -> [x] - - // Otherwise the algorithm works as follow: we split the list in sequences - // of already sorted values as they appear in the list and then we merge - // those together two by two using `merge_all`. - [x, y, ..rest] -> { - // We need to compare the first two items to properly call `sequences` - // with the correct initial values. If the second item is <= than the - // first, then we know we'll start by growing a descending sequence - // (and an ascending one in the opposite case). - let direction = case compare(x, y) { - order.Lt | order.Eq -> Ascending - order.Gt -> Descending - } - - // `sequences` produces sequences in ascending order so we call the - // `merge_all` function saying it to expect all sequences to be sorted - // that way. - let sequences = sequences(rest, compare, [x], direction, y, []) - merge_all(sequences, Ascending, compare) - } - } -} - -type Sorting { - Ascending - Descending -} - -/// Given a list it returns slices of it that are locally sorted in ascending -/// order. -/// -/// Imagine you have this list: -/// -/// ``` -/// [1, 2, 3, 2, 1, 0] -/// ^^^^^^^ ^^^^^^^ This is a slice in descending order -/// | -/// | This is a slice that is sorted in ascending order -/// ``` -/// -/// So the produced result will contain these two slices, each one sorted in -/// ascending order: `[[1, 2, 3], [0, 1, 2]]`. -/// -/// - `growing` is an accumulator with the current slice being grown -/// - `direction` is the growing direction of the slice being grown, it could -/// either be ascending or strictly descending -/// - `prev` is the previous element that needs to be added to the growing slice -/// it is carried around to check whether we have to keep growing the current -/// slice or not -/// - `acc` is the accumulator containing the slices sorted in ascending order -/// -fn sequences( - list: List(a), - compare: fn(a, a) -> Order, - growing: List(a), - direction: Sorting, - prev: a, - acc: List(List(a)), -) -> List(List(a)) { - // First of all we must not forget to add the previous element to the - // currently growing slice. - let growing = [prev, ..growing] - - case list { - [] -> - case direction { - // Notice how we have to reverse the accumulator we're growing: since - // we always add items to the head, `growing` is built in the opposite - // sorting order of what it actually is in the original list. - Ascending -> [reverse(growing), ..acc] - Descending -> [growing, ..acc] - } - - [new, ..rest] -> - case compare(prev, new), direction { - // In case the new element respects the ordering of the growing - // sequence, then we just keep growing it. - // Notice how a growing sequence is weakly growing (that is it can have - // consecutive equal items) while a decreasing sequence is strictly - // decreasing (no consecutive equal items), this is needed to make the - // algorithm stable! - order.Gt, Descending | order.Lt, Ascending | order.Eq, Ascending -> - sequences(rest, compare, growing, direction, new, acc) - - // We were growing an ascending (descending) sequence and the new item - // is smaller (bigger) than the previous one, this means we have to stop - // growing this sequence and start with a new one whose first item will - // be the one we just found. - order.Gt, Ascending | order.Lt, Descending | order.Eq, Descending -> { - let acc = case direction { - Ascending -> [reverse(growing), ..acc] - Descending -> [growing, ..acc] - } - case rest { - // The list is over so we just create a sequence containing the last - // item we saw and add it to the accumulator before returning it. - [] -> [[new], ..acc] - - // If the list is not over we have a peek at the next item to decide - // in which direction is growing the new sequence and make the - // recursive call with the appropriate arguments. - [next, ..rest] -> { - let direction = case compare(new, next) { - order.Lt | order.Eq -> Ascending - order.Gt -> Descending - } - sequences(rest, compare, [new], direction, next, acc) - } - } - } - } - } -} - -/// Given some some sorted sequences (assumed to be sorted in `direction`) it -/// merges them all together until we're left with just a list sorted in -/// ascending order. -/// -fn merge_all( - sequences: List(List(a)), - direction: Sorting, - compare: fn(a, a) -> Order, -) -> List(a) { - case sequences, direction { - [], _ -> [] - - // If we have a single list in ascending order then we're done. - [sequence], Ascending -> sequence - - // If we have a single list in descending order, we reverse it to make sure - // it's in ascending order and we're done. - [sequence], Descending -> reverse(sequence) - - // Merging together sequences that are in ascending (descending) order - // reverses their order, so the recursive call will assume to be merging - // lists sorted in the opposite order! - _, Ascending -> { - let sequences = merge_ascending_pairs(sequences, compare, []) - merge_all(sequences, Descending, compare) - } - - _, Descending -> { - let sequences = merge_descending_pairs(sequences, compare, []) - merge_all(sequences, Ascending, compare) - } - } -} - -/// Given a list of ascending lists, it merges adjacent pairs into a single -/// descending list, halving their number. -/// It returns a list of the remaining descending lists. -/// -fn merge_ascending_pairs( - sequences: List(List(a)), - compare: fn(a, a) -> Order, - acc: List(List(a)), -) { - case sequences { - [] -> reverse(acc) - - // Beware, if we have just one item left we must reverse it: we take - // ascending lists as input and have to return descending ones. - // If we returned it like it is it would be sorted in ascending order. - [sequence] -> reverse([reverse(sequence), ..acc]) - - [ascending1, ascending2, ..rest] -> { - let descending = merge_ascendings(ascending1, ascending2, compare, []) - merge_ascending_pairs(rest, compare, [descending, ..acc]) - } - } -} - -/// This is the same as merge_ascending_pairs but flipped for descending lists. -/// -fn merge_descending_pairs( - sequences: List(List(a)), - compare: fn(a, a) -> Order, - acc: List(List(a)), -) { - case sequences { - [] -> reverse(acc) - - [sequence] -> reverse([reverse(sequence), ..acc]) - - [descending1, descending2, ..rest] -> { - let ascending = merge_descendings(descending1, descending2, compare, []) - merge_descending_pairs(rest, compare, [ascending, ..acc]) - } - } -} - -/// Merges two lists sorted in ascending order into a single list sorted in -/// descending order according to the given comparator function. -/// -/// This reversing of the sort order is not avoidable if we want to implement -/// merge as a tail recursive function. We could reverse the accumulator before -/// returning it but that would end up being less efficient; so the merging -/// algorithm has to play around this. -/// -fn merge_ascendings( - list1: List(a), - list2: List(a), - compare: fn(a, a) -> Order, - acc: List(a), -) -> List(a) { - case list1, list2 { - [], list | list, [] -> reverse_and_prepend(list, acc) - - [first1, ..rest1], [first2, ..rest2] -> - case compare(first1, first2) { - order.Lt -> merge_ascendings(rest1, list2, compare, [first1, ..acc]) - order.Gt | order.Eq -> - merge_ascendings(list1, rest2, compare, [first2, ..acc]) - } - } -} - -/// This is exactly the same as merge_ascendings but mirrored: it merges two -/// lists sorted in descending order into a single list sorted in ascending -/// order according to the given comparator function. -/// -/// This reversing of the sort order is not avoidable if we want to implement -/// merge as a tail recursive function. We could reverse the accumulator before -/// returning it but that would end up being less efficient; so the merging -/// algorithm has to play around this. -/// -fn merge_descendings( - list1: List(a), - list2: List(a), - compare: fn(a, a) -> Order, - acc: List(a), -) -> List(a) { - case list1, list2 { - [], list | list, [] -> reverse_and_prepend(list, acc) - [first1, ..rest1], [first2, ..rest2] -> - case compare(first1, first2) { - order.Lt -> merge_descendings(list1, rest2, compare, [first2, ..acc]) - order.Gt | order.Eq -> - merge_descendings(rest1, list2, compare, [first1, ..acc]) - } - } -} - -/// 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) { - range_loop(start, stop, []) -} - -fn range_loop(start: Int, stop: Int, acc: List(Int)) -> List(Int) { - case int.compare(start, stop) { - order.Eq -> [stop, ..acc] - order.Gt -> range_loop(start, stop + 1, [stop, ..acc]) - order.Lt -> range_loop(start, stop - 1, [stop, ..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) { - repeat_loop(a, times, []) -} - -fn repeat_loop(item: a, times: Int, acc: List(a)) -> List(a) { - case times <= 0 { - True -> acc - False -> repeat_loop(item, times - 1, [item, ..acc]) - } -} - -/// 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)) { - split_loop(list, index, []) -} - -fn split_loop(list: List(a), n: Int, taken: List(a)) -> #(List(a), List(a)) { - case n <= 0 { - True -> #(reverse(taken), list) - False -> - case list { - [] -> #(reverse(taken), []) - [first, ..rest] -> split_loop(rest, n - 1, [first, ..taken]) - } - } -} - -/// 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)) { - split_while_loop(list, predicate, []) -} - -fn split_while_loop( - list: List(a), - f: fn(a) -> Bool, - acc: List(a), -) -> #(List(a), List(a)) { - case list { - [] -> #(reverse(acc), []) - [first, ..rest] -> - case f(first) { - True -> split_while_loop(rest, f, [first, ..acc]) - False -> #(reverse(acc), list) - } - } -} - -/// 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) - } - }) -} - -/// Given a list of 2-element tuples, finds all tuples that have a given -/// key as the first element and returns the second element. -/// -/// This function may be useful for interacting with Erlang code where lists of -/// tuples are common. -/// -/// ## Examples -/// -/// ```gleam -/// key_filter([#("a", 0), #("b", 1), #("a", 2)], "a") -/// // -> [0, 2] -/// ``` -/// -/// ```gleam -/// key_filter([#("a", 0), #("b", 1)], "c") -/// // -> [] -/// ``` -/// -pub fn key_filter( - in keyword_list: List(#(k, v)), - find desired_key: k, -) -> List(v) { - filter_map(keyword_list, fn(keyword) { - let #(key, value) = keyword - case key == desired_key { - True -> Ok(value) - False -> Error(Nil) - } - }) -} - -/// 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(list: List(#(k, v)), key: k) -> Result(#(v, List(#(k, v))), Nil) { - key_pop_loop(list, key, []) -} - -fn key_pop_loop( - list: List(#(k, v)), - key: k, - checked: List(#(k, v)), -) -> Result(#(v, List(#(k, v))), Nil) { - case list { - [] -> Error(Nil) - [#(k, v), ..rest] if k == key -> - Ok(#(v, reverse_and_prepend(checked, rest))) - [first, ..rest] -> key_pop_loop(rest, key, [first, ..checked]) - } -} - -/// 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(#(k, v)), key: k, value: v) -> List(#(k, v)) { - key_set_loop(list, key, value, []) -} - -fn key_set_loop( - list: List(#(k, v)), - key: k, - value: v, - inspected: List(#(k, v)), -) -> List(#(k, v)) { - case list { - [#(k, _), ..rest] if k == key -> - reverse_and_prepend(inspected, [#(k, value), ..rest]) - [first, ..rest] -> key_set_loop(rest, key, value, [first, ..inspected]) - [] -> reverse([#(key, value), ..inspected]) - } -} - -/// 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 -/// import gleam/io -/// -/// each(["1", "2", "3"], io.println) -/// // -> Nil -/// // 1 -/// // 2 -/// // 3 -/// ``` -/// -pub fn each(list: List(a), f: fn(a) -> b) -> Nil { - case list { - [] -> Nil - [first, ..rest] -> { - f(first) - each(rest, 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) - [first, ..rest] -> - case fun(first) { - Ok(_) -> try_each(over: rest, with: fun) - Error(e) -> Error(e) - } - } -} - -/// Partitions a list into a tuple/pair of lists -/// by a given categorisation function. -/// -/// ## Examples -/// -/// ```gleam -/// import gleam/int -/// -/// [1, 2, 3, 4, 5] |> partition(int.is_odd) -/// // -> #([1, 3, 5], [2, 4]) -/// ``` -/// -pub fn partition( - list: List(a), - with categorise: fn(a) -> Bool, -) -> #(List(a), List(a)) { - partition_loop(list, categorise, [], []) -} - -fn partition_loop(list, categorise, trues, falses) { - case list { - [] -> #(reverse(trues), reverse(falses)) - [first, ..rest] -> - case categorise(first) { - True -> partition_loop(rest, categorise, [first, ..trues], falses) - False -> partition_loop(rest, categorise, trues, [first, ..falses]) - } - } -} - -/// Returns all the permutations of a list. -/// -/// ## Examples -/// -/// ```gleam -/// permutations([1, 2]) -/// // -> [[1, 2], [2, 1]] -/// ``` -/// -pub fn permutations(list: List(a)) -> List(List(a)) { - case list { - [] -> [[]] - l -> permutation_zip(l, [], []) - } -} - -fn permutation_zip( - list: List(a), - rest: List(a), - acc: List(List(a)), -) -> List(List(a)) { - case list { - [] -> reverse(acc) - [head, ..tail] -> - permutation_prepend( - head, - permutations(reverse_and_prepend(rest, tail)), - tail, - [head, ..rest], - acc, - ) - } -} - -fn permutation_prepend( - el: a, - permutations: List(List(a)), - list_1: List(a), - list_2: List(a), - acc: List(List(a)), -) -> List(List(a)) { - case permutations { - [] -> permutation_zip(list_1, list_2, acc) - [head, ..tail] -> - permutation_prepend(el, tail, list_1, list_2, [[el, ..head], ..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(list: List(a), by n: Int) -> List(List(a)) { - case n <= 0 { - True -> [] - False -> window_loop([], list, n) - } -} - -fn window_loop(acc: List(List(a)), list: List(a), n: Int) -> List(List(a)) { - let window = take(list, n) - - case length(window) == n { - True -> window_loop([window, ..acc], drop(list, 1), n) - False -> reverse(acc) - } -} - -/// 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(list: List(a)) -> List(#(a, a)) { - zip(list, drop(list, 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 { - [] -> [] - [first, ..rest] -> - case predicate(first) { - True -> drop_while(rest, predicate) - False -> [first, ..rest] - } - } -} - -/// 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) { - take_while_loop(list, predicate, []) -} - -fn take_while_loop( - list: List(a), - predicate: fn(a) -> Bool, - acc: List(a), -) -> List(a) { - case list { - [] -> reverse(acc) - [first, ..rest] -> - case predicate(first) { - True -> take_while_loop(rest, predicate, [first, ..acc]) - False -> reverse(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) -> k) -> List(List(a)) { - case list { - [] -> [] - [first, ..rest] -> chunk_loop(rest, f, f(first), [first], []) - } -} - -fn chunk_loop( - list: List(a), - f: fn(a) -> k, - previous_key: k, - current_chunk: List(a), - acc: List(List(a)), -) -> List(List(a)) { - case list { - [first, ..rest] -> { - let key = f(first) - case key == previous_key { - True -> chunk_loop(rest, f, key, [first, ..current_chunk], acc) - False -> { - let new_acc = [reverse(current_chunk), ..acc] - chunk_loop(rest, f, key, [first], new_acc) - } - } - } - [] -> reverse([reverse(current_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)) { - sized_chunk_loop(list, count, count, [], []) -} - -fn sized_chunk_loop( - 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 { - True -> sized_chunk_loop(rest, count, left - 1, chunk, acc) - False -> - sized_chunk_loop(rest, count, count, [], [reverse(chunk), ..acc]) - } - } - } -} - -/// 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)) - } -} - -/// 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) { - scan_loop(list, initial, [], fun) -} - -fn scan_loop( - list: List(a), - accumulator: acc, - accumulated: List(acc), - fun: fn(acc, a) -> acc, -) -> List(acc) { - case list { - [] -> reverse(accumulated) - [first, ..rest] -> { - let next = fun(accumulator, first) - scan_loop(rest, next, [next, ..accumulated], fun) - } - } -} - -/// Returns the last element in the given list. -/// -/// Returns `Error(Nil)` if the list is empty. -/// -/// This function runs in linear time. -/// -/// ## Examples -/// -/// ```gleam -/// last([]) -/// // -> Error(Nil) -/// ``` -/// -/// ```gleam -/// last([1, 2, 3, 4, 5]) -/// // -> Ok(5) -/// ``` -/// -pub fn last(list: List(a)) -> Result(a, Nil) { - case list { - [] -> Error(Nil) - [last] -> Ok(last) - [_, ..rest] -> last(rest) - } -} - -/// 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, items { - 0, _ -> [[]] - _, [] -> [] - _, [first, ..rest] -> - rest - |> combinations(n - 1) - |> map(fn(combination) { [first, ..combination] }) - |> reverse - |> fold(combinations(rest, n), fn(acc, c) { [c, ..acc] }) - } -} - -/// 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)) { - combination_pairs_loop(items, []) -} - -fn combination_pairs_loop(items: List(a), acc: List(#(a, a))) -> List(#(a, a)) { - case items { - [] -> reverse(acc) - [first, ..rest] -> { - let first_combinations = map(rest, with: fn(other) { #(first, other) }) - let acc = reverse_and_prepend(first_combinations, acc) - combination_pairs_loop(rest, acc) - } - } -} - -/// Make a list alternating the elements from the given lists -/// -/// ## Examples -/// -/// ```gleam -/// interleave([[1, 2], [101, 102], [201, 202]]) -/// // -> [1, 101, 201, 2, 102, 202] -/// ``` -/// -pub fn interleave(list: List(List(a))) -> List(a) { - list - |> transpose - |> flatten -} - -/// 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 the JavaScript target). -/// -/// ## Examples -/// -/// ```gleam -/// transpose([[1, 2, 3], [101, 102, 103]]) -/// // -> [[1, 101], [2, 102], [3, 103]] -/// ``` -/// -pub fn transpose(list_of_lists: List(List(a))) -> List(List(a)) { - transpose_loop(list_of_lists, []) -} - -fn transpose_loop(rows: List(List(a)), columns: List(List(a))) -> List(List(a)) { - case rows { - [] -> reverse(columns) - _ -> { - let #(column, rest) = take_firsts(rows, [], []) - case column { - [_, ..] -> transpose_loop(rest, [column, ..columns]) - [] -> transpose_loop(rest, columns) - } - } - } -} - -fn take_firsts( - rows: List(List(a)), - column: List(a), - remaining_rows: List(List(a)), -) -> #(List(a), List(List(a))) { - case rows { - [] -> #(reverse(column), reverse(remaining_rows)) - [[], ..rest] -> take_firsts(rest, column, remaining_rows) - [[first, ..remaining_row], ..rest_rows] -> { - let remaining_rows = [remaining_row, ..remaining_rows] - take_firsts(rest_rows, [first, ..column], remaining_rows) - } - } -} - -/// Takes a list, randomly sorts all items and returns the shuffled list. -/// -/// This function uses `float.random` to decide the order of the elements. -/// -/// ## 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(), a), ..acc] }) - |> do_shuffle_by_pair_indexes() - |> shuffle_pair_unwrap_loop([]) -} - -fn shuffle_pair_unwrap_loop(list: List(#(Float, a)), acc: List(a)) -> List(a) { - case list { - [] -> acc - [elem_pair, ..enumerable] -> - shuffle_pair_unwrap_loop(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 and a comparator, and returns the maximum element in the list -/// -/// ## Examples -/// -/// ```gleam -/// range(1, 10) |> list.max(int.compare) -/// // -> Ok(10) -/// ``` -/// -/// ```gleam -/// ["a", "c", "b"] |> list.max(string.compare) -/// // -> Ok("c") -/// ``` -/// -pub fn max( - over list: List(a), - with compare: fn(a, a) -> Order, -) -> Result(a, Nil) { - case list { - [] -> Error(Nil) - [first, ..rest] -> Ok(max_loop(rest, compare, first)) - } -} - -fn max_loop(list, compare, max) { - case list { - [] -> max - [first, ..rest] -> - case compare(first, max) { - order.Gt -> max_loop(rest, compare, first) - order.Lt | order.Eq -> max_loop(rest, compare, max) - } - } -} - -/// Returns a random sample of up to n elements from a list using reservoir -/// sampling via [Algorithm L](https://en.wikipedia.org/wiki/Reservoir_sampling#Optimal:_Algorithm_L). -/// Returns an empty list if the sample size is less than or equal to 0. -/// -/// Order is not random, only selection is. -/// -/// ## Examples -/// -/// ```gleam -/// reservoir_sample([1, 2, 3, 4, 5], 3) -/// // -> [2, 4, 5] // A random sample of 3 items -/// ``` -/// -pub fn sample(from list: List(a), up_to n: Int) -> List(a) { - let #(reservoir, rest) = build_reservoir(from: list, sized: n) - - case dict.is_empty(reservoir) { - // If the reservoire is empty that means we were asking to sample 0 or - // less items. That doesn't make much sense, so we just return an empty - // list. - True -> [] - - // Otherwise we keep looping over the remaining part of the list replacing - // random elements in the reservoir. - False -> { - let w = float.exponential(log_random() /. int.to_float(n)) - dict.values(sample_loop(rest, reservoir, n, w)) - } - } -} - -fn sample_loop( - list: List(a), - reservoir: Dict(Int, a), - n: Int, - w: Float, -) -> Dict(Int, a) { - let skip = { - let assert Ok(log) = float.logarithm(1.0 -. w) - float.round(float.floor(log_random() /. log)) - } - - case drop(list, skip) { - [] -> reservoir - [first, ..rest] -> { - let reservoir = dict.insert(reservoir, int.random(n), first) - let w = w *. float.exponential(log_random() /. int.to_float(n)) - sample_loop(rest, reservoir, n, w) - } - } -} - -const min_positive = 2.2250738585072014e-308 - -fn log_random() -> Float { - let assert Ok(random) = float.logarithm(float.random() +. min_positive) - random -} - -/// Builds the initial reservoir used by Algorithm L. -/// This is a dictionary with keys ranging from `0` up to `n - 1` where each -/// value is the corresponding element at that position in `list`. -/// -/// This also returns the remaining elements of `list` that didn't end up in -/// the reservoir. -/// -fn build_reservoir(from list: List(a), sized n: Int) -> #(Dict(Int, a), List(a)) { - build_reservoir_loop(list, n, dict.new()) -} - -fn build_reservoir_loop( - list: List(a), - size: Int, - reservoir: Dict(Int, a), -) -> #(Dict(Int, a), List(a)) { - let reservoir_size = dict.size(reservoir) - case reservoir_size >= size { - // The reservoir already has the size we wanted. - True -> #(reservoir, list) - - // Otherwise we add another element from the list to the reservoir - False -> - case list { - [] -> #(reservoir, []) - [first, ..rest] -> { - let reservoir = dict.insert(reservoir, reservoir_size, first) - build_reservoir_loop(rest, size, reservoir) - } - } - } -} diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/option.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/option.gleam deleted file mode 100644 index f5ae48b..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/option.gleam +++ /dev/null @@ -1,358 +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. -/// -/// ## `Option` and `Result` -/// -/// In other languages fallible functions may return either `Result` or -/// `Option` depending on whether there is more information to be given about the -/// failure. In Gleam all fallible functions return `Result`, and `Nil` is used -/// as the error if there is no extra detail to give. This consistency removes -/// the boilerplate that would otherwise be needed to convert between `Option` -/// and `Result` types, and makes APIs more predictable. -/// -/// The `Option` type should only be used for taking optional values as -/// function arguments, or for storing them in other data structures. -/// -pub type Option(a) { - Some(a) - None -} - -/// 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)) { - all_loop(list, []) -} - -fn all_loop(list: List(Option(a)), acc: List(a)) -> Option(List(a)) { - case list { - [] -> Some(reverse(acc)) - [None, ..] -> None - [Some(first), ..rest] -> all_loop(rest, [first, ..acc]) - } -} - -// This is copied from the list module and not imported as importing it would -// result in a circular dependency! -@external(erlang, "lists", "reverse") -fn reverse(list: List(a)) -> List(a) { - reverse_and_prepend(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]) - } -} - -/// 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) - None -> 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) - Error(_) -> 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() - } -} - -/// 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) { - values_loop(options, []) -} - -fn values_loop(list: List(Option(a)), acc: List(a)) -> List(a) { - case list { - [] -> reverse(acc) - [None, ..rest] -> values_loop(rest, acc) - [Some(first), ..rest] -> values_loop(rest, [first, ..acc]) - } -} diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/order.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/order.gleam deleted file mode 100644 index be8b599..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/order.gleam +++ /dev/null @@ -1,156 +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(Gt) -/// // -> Lt -/// ``` -/// -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 - } -} - -/// Inverts an ordering function, so less-than becomes greater-than and greater-than -/// becomes less-than. -/// -/// ## Examples -/// -/// ```gleam -/// import gleam/int -/// import gleam/list -/// -/// 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) } -} - -/// Return a fallback `Order` in case the first argument is `Eq`. -/// -/// ## Examples -/// -/// ```gleam -/// import gleam/int -/// -/// break_tie(in: int.compare(1, 1), with: Lt) -/// // -> Lt -/// ``` -/// -/// ```gleam -/// import gleam/int -/// -/// break_tie(in: int.compare(1, 0), with: Eq) -/// // -> Gt -/// ``` -/// -pub fn break_tie(in order: Order, with other: Order) -> Order { - case order { - Lt | Gt -> order - Eq -> other - } -} - -/// Invokes a fallback function returning an `Order` in case the first argument -/// is `Eq`. -/// -/// This can be useful when the fallback comparison might be expensive and it -/// needs to be delayed until strictly necessary. -/// -/// ## Examples -/// -/// ```gleam -/// import gleam/int -/// -/// lazy_break_tie(in: int.compare(1, 1), with: fn() { Lt }) -/// // -> Lt -/// ``` -/// -/// ```gleam -/// import gleam/int -/// -/// lazy_break_tie(in: int.compare(1, 0), with: fn() { Eq }) -/// // -> Gt -/// ``` -/// -pub fn lazy_break_tie(in order: Order, with comparison: fn() -> Order) -> Order { - case order { - Lt | Gt -> order - Eq -> comparison() - } -} diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/pair.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/pair.gleam deleted file mode 100644 index 7dc068c..0000000 --- a/lsp/bet-lsp/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/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/result.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/result.gleam deleted file mode 100644 index 0b87d28..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/result.gleam +++ /dev/null @@ -1,437 +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" an `Ok` result by passing its value to a function that yields a result, -/// and returning the yielded result. (This may "replace" the `Ok` with an `Error`.) -/// -/// If the input is an `Error` rather than an `Ok`, the function is not called and -/// the original `Error` is returned. -/// -/// 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) - } -} - -/// 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 - } -} - -/// 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. -/// -/// If you need access to the initial error value, use `result.try_recover`. -/// -/// ## 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(result) { result }) -} - -/// 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)) { - partition_loop(results, [], []) -} - -fn partition_loop(results: List(Result(a, e)), oks: List(a), errors: List(e)) { - case results { - [] -> #(oks, errors) - [Ok(a), ..rest] -> partition_loop(rest, [a, ..oks], errors) - [Error(e), ..rest] -> partition_loop(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, e), error: f) -> Result(a, f) { - 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(result) { result }) -} - -/// 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. -/// -/// If you do not need access to the initial error value, use `result.lazy_or`. -/// -/// ## 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/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/set.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/set.gleam deleted file mode 100644 index 593a8df..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/set.gleam +++ /dev/null @@ -1,413 +0,0 @@ -import gleam/dict.{type Dict} -import gleam/list -import gleam/result - -// A list is used as the dict 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/dict` module, so inserts and lookups have -/// logarithmic time complexity. -/// -pub opaque type Set(member) { - Set(dict: Dict(member, Token)) -} - -/// Creates a new empty set. -/// -pub fn new() -> Set(member) { - Set(dict.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 { - dict.size(set.dict) -} - -/// Determines whether or not the set is empty. -/// -/// ## Examples -/// -/// ```gleam -/// new() |> is_empty -/// // -> True -/// ``` -/// -/// ```gleam -/// new() |> insert(1) |> is_empty -/// // -> False -/// ``` -/// -pub fn is_empty(set: Set(member)) -> Bool { - set == new() -} - -/// Inserts a 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(dict: dict.insert(set.dict, 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.dict - |> dict.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(dict: dict.delete(set.dict, 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) { - dict.keys(set.dict) -} - -/// Creates a new set of the members in a given list. -/// -/// This function runs in loglinear time. -/// -/// ## Examples -/// -/// ```gleam -/// import gleam/int -/// import gleam/list -/// -/// [1, 1, 2, 4, 3, 2] |> from_list |> to_list |> list.sort(by: int.compare) -/// // -> [1, 2, 3, 4] -/// ``` -/// -pub fn from_list(members: List(member)) -> Set(member) { - let dict = - list.fold(over: members, from: dict.new(), with: fn(m, k) { - dict.insert(m, k, token) - }) - Set(dict) -} - -/// 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(accumulator, member) { accumulator + member }) -/// // -> 13 -/// ``` -/// -pub fn fold( - over set: Set(member), - from initial: acc, - with reducer: fn(acc, member) -> acc, -) -> acc { - dict.fold(over: set.dict, 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(keeping: int.is_even) -/// |> to_list -/// // -> [4, 6, 44] -/// ``` -/// -pub fn filter( - in set: Set(member), - keeping predicate: fn(member) -> Bool, -) -> Set(member) { - Set(dict.filter(in: set.dict, keeping: fn(m, _) { predicate(m) })) -} - -/// Creates a new set from a given set with the result of applying the given -/// function to each member. -/// -/// ## Examples -/// -/// ```gleam -/// from_list([1, 2, 3, 4]) -/// |> map(with: fn(x) { x * 2 }) -/// |> to_list -/// // -> [2, 4, 6, 8] -/// ``` -/// -pub fn map(set: Set(member), with fun: fn(member) -> mapped) -> Set(mapped) { - fold(over: set, from: new(), with: fn(acc, member) { - insert(acc, fun(member)) - }) -} - -/// Creates a new set from a given set with all the same entries except any -/// entry found on the given list. -/// -/// ## Examples -/// -/// ```gleam -/// from_list([1, 2, 3, 4]) -/// |> drop([1, 3]) -/// |> to_list -/// // -> [2, 4] -/// ``` -/// -pub fn drop(from set: Set(member), drop disallowed: List(member)) -> Set(member) { - list.fold(over: disallowed, from: set, with: delete) -} - -/// Creates a new set from a given set, 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(dict.take(from: set.dict, keeping: desired)) -} - -/// 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) -} - -fn order(first: Set(member), second: Set(member)) -> #(Set(member), Set(member)) { - case dict.size(first.dict) > dict.size(second.dict) { - True -> #(first, second) - False -> #(second, first) - } -} - -/// 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)) -} - -/// Creates a new set that contains members that are present in the first set -/// but not the second. -/// -/// ## Examples -/// -/// ```gleam -/// difference(from_list([1, 2]), from_list([2, 3, 4])) |> to_list -/// // -> [1] -/// ``` -/// -pub fn difference( - from first: Set(member), - minus second: Set(member), -) -> Set(member) { - drop(from: first, drop: to_list(second)) -} - -/// Determines if a set is fully contained by another. -/// -/// ## Examples -/// -/// ```gleam -/// is_subset(from_list([1]), from_list([1, 2])) -/// // -> True -/// ``` -/// -/// ```gleam -/// is_subset(from_list([1, 2, 3]), from_list([3, 4, 5])) -/// // -> False -/// ``` -/// -pub fn is_subset(first: Set(member), of second: Set(member)) -> Bool { - intersection(of: first, and: second) == first -} - -/// Determines if two sets contain no common members -/// -/// ## Examples -/// -/// ```gleam -/// is_disjoint(from_list([1, 2, 3]), from_list([4, 5, 6])) -/// // -> True -/// ``` -/// -/// ```gleam -/// is_disjoint(from_list([1, 2, 3]), from_list([3, 4, 5])) -/// // -> False -/// ``` -/// -pub fn is_disjoint(first: Set(member), from second: Set(member)) -> Bool { - intersection(of: first, and: second) == new() -} - -/// Creates a new set that contains members that are present in either set, but -/// not both. -/// -/// ## Examples -/// -/// ```gleam -/// symmetric_difference(from_list([1, 2, 3]), from_list([3, 4])) |> to_list -/// // -> [1, 2, 4] -/// ``` -/// -pub fn symmetric_difference( - of first: Set(member), - and second: Set(member), -) -> Set(member) { - difference( - from: union(of: first, and: second), - minus: intersection(of: first, and: second), - ) -} - -/// Calls a function for each member in a set, discarding the return -/// value. -/// -/// Useful for producing a side effect for every item of a set. -/// -/// The order of elements in the iteration is an implementation detail that -/// should not be relied upon. -/// -/// ## Examples -/// -/// ```gleam -/// let set = from_list(["apple", "banana", "cherry"]) -/// -/// each(set, io.println) -/// // -> Nil -/// // apple -/// // banana -/// // cherry -/// ``` -/// -pub fn each(set: Set(member), fun: fn(member) -> a) -> Nil { - fold(set, Nil, fn(nil, member) { - fun(member) - nil - }) -} diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/string.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/string.gleam deleted file mode 100644 index 86ac7f0..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/string.gleam +++ /dev/null @@ -1,900 +0,0 @@ -//// Strings in Gleam are UTF-8 binaries. They can be written in your code as -//// text surrounded by `"double quotes"`. - -import gleam/list -import gleam/option.{type Option, None, Some} -import gleam/order -import gleam/string_tree.{type StringTree} - -/// 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. Avoid using this in a loop. -/// -/// ## Examples -/// -/// ```gleam -/// length("Gleam") -/// // -> 5 -/// ``` -/// -/// ```gleam -/// length("ß↑e̊") -/// // -> 3 -/// ``` -/// -/// ```gleam -/// length("") -/// // -> 0 -/// ``` -/// -@external(erlang, "string", "length") -@external(javascript, "../gleam_stdlib.mjs", "string_length") -pub fn length(string: String) -> Int - -/// Reverses a `String`. -/// -/// This function has to iterate across the whole `String` so it runs in linear -/// time. Avoid using this in a loop. -/// -/// ## Examples -/// -/// ```gleam -/// reverse("stressed") -/// // -> "desserts" -/// ``` -/// -pub fn reverse(string: String) -> String { - string - |> string_tree.from_string - |> string_tree.reverse - |> string_tree.to_string -} - -/// 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_tree.from_string - |> string_tree.replace(each: pattern, with: substitute) - |> string_tree.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" -/// ``` -/// -@external(erlang, "string", "lowercase") -@external(javascript, "../gleam_stdlib.mjs", "lowercase") -pub fn lowercase(string: 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" -/// ``` -/// -@external(erlang, "string", "uppercase") -@external(javascript, "../gleam_stdlib.mjs", "uppercase") -pub fn uppercase(string: 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 - False -> 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 string. -/// -/// This function runs in linear time with the size of the index and the -/// length. Negative indexes are linear with the size of the input string in -/// addition to the other costs. -/// -/// ## 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 -> grapheme_slice(string, translated_idx, len) - } - } - False -> grapheme_slice(string, idx, len) - } - } -} - -@external(erlang, "gleam_stdlib", "slice") -@external(javascript, "../gleam_stdlib.mjs", "string_grapheme_slice") -fn grapheme_slice(string: String, index: Int, length: Int) -> String - -@external(erlang, "binary", "part") -@external(javascript, "../gleam_stdlib.mjs", "string_byte_slice") -fn unsafe_byte_slice(string: String, index: Int, length: Int) -> String - -/// 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" -/// ``` -/// -@external(erlang, "gleam_stdlib", "crop_string") -@external(javascript, "../gleam_stdlib.mjs", "crop_string") -pub fn crop(from string: String, before substring: String) -> String - -/// Drops *n* graphemes from the start of a `String`. -/// -/// This function runs in linear time with the number of graphemes to drop. -/// -/// ## Examples -/// -/// ```gleam -/// drop_start(from: "The Lone Gunmen", up_to: 2) -/// // -> "e Lone Gunmen" -/// ``` -/// -pub fn drop_start(from string: String, up_to num_graphemes: Int) -> String { - case num_graphemes <= 0 { - True -> string - False -> { - let prefix = grapheme_slice(string, 0, num_graphemes) - let prefix_size = byte_size(prefix) - unsafe_byte_slice(string, prefix_size, byte_size(string) - prefix_size) - } - } -} - -/// Drops *n* graphemes from the end of a `String`. -/// -/// This function traverses the full string, so it runs in linear time with the -/// size of the string. Avoid using this in a loop. -/// -/// ## Examples -/// -/// ```gleam -/// drop_end(from: "Cigarette Smoking Man", up_to: 2) -/// // -> "Cigarette Smoking M" -/// ``` -/// -pub fn drop_end(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 -/// ``` -/// -@external(erlang, "gleam_stdlib", "contains_string") -@external(javascript, "../gleam_stdlib.mjs", "contains_string") -pub fn contains(does haystack: String, contain needle: String) -> Bool - -/// Checks whether the first `String` starts with the second one. -/// -/// ## Examples -/// -/// ```gleam -/// starts_with("theory", "ory") -/// // -> False -/// ``` -/// -@external(erlang, "gleam_stdlib", "string_starts_with") -@external(javascript, "../gleam_stdlib.mjs", "starts_with") -pub fn starts_with(string: String, prefix: String) -> Bool - -/// Checks whether the first `String` ends with the second one. -/// -/// ## Examples -/// -/// ```gleam -/// ends_with("theory", "ory") -/// // -> True -/// ``` -/// -@external(erlang, "gleam_stdlib", "string_ends_with") -@external(javascript, "../gleam_stdlib.mjs", "ends_with") -pub fn ends_with(string: String, suffix: 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_tree.from_string - |> string_tree.split(on: substring) - |> list.map(with: string_tree.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) -/// ``` -/// -@external(javascript, "../gleam_stdlib.mjs", "split_once") -pub fn split_once( - string: String, - on substring: String, -) -> Result(#(String, String), Nil) { - case erl_split(string, substring) { - [first, rest] -> Ok(#(first, rest)) - _ -> Error(Nil) - } -} - -@external(erlang, "string", "split") -fn erl_split(a: String, b: String) -> List(String) - -/// Creates a new `String` by joining two `String`s together. -/// -/// This function typically copies both `String`s and runs in linear time, but -/// the exact behaviour will depend on how the runtime you are using optimises -/// your code. Benchmark and profile your code if you need to understand its -/// performance better. -/// -/// If you are joining together large string and want to avoid copying any data -/// you may want to investigate using the [`string_tree`](../gleam/string_tree.html) -/// module. -/// -/// ## Examples -/// -/// ```gleam -/// append(to: "butter", suffix: "fly") -/// // -> "butterfly" -/// ``` -/// -pub fn append(to first: String, suffix second: String) -> String { - first <> second -} - -/// Creates a new `String` by joining many `String`s together. -/// -/// This function copies all the `String`s and runs in linear time. -/// -/// ## Examples -/// -/// ```gleam -/// concat(["never", "the", "less"]) -/// // -> "nevertheless" -/// ``` -/// -@external(erlang, "erlang", "list_to_binary") -pub fn concat(strings: List(String)) -> String { - concat_loop(strings, "") -} - -fn concat_loop(strings: List(String), accumulator: String) -> String { - case strings { - [string, ..strings] -> concat_loop(strings, accumulator <> string) - [] -> accumulator - } -} - -/// Creates a new `String` by repeating a `String` a given number of times. -/// -/// This function runs in loglinear time. -/// -/// ## Examples -/// -/// ```gleam -/// repeat("ha", times: 3) -/// // -> "hahaha" -/// ``` -/// -pub fn repeat(string: String, times times: Int) -> String { - case times <= 0 { - True -> "" - False -> repeat_loop(times, string, "") - } -} - -fn repeat_loop(times: Int, doubling_acc: String, acc: String) -> String { - let acc = case times % 2 { - 0 -> acc - _ -> acc <> doubling_acc - } - let times = times / 2 - case times <= 0 { - True -> acc - False -> repeat_loop(times, doubling_acc <> doubling_acc, acc) - } -} - -/// 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 { - case strings { - [] -> "" - [first, ..rest] -> join_loop(rest, separator, first) - } -} - -fn join_loop( - strings: List(String), - separator: String, - accumulator: String, -) -> String { - case strings { - [] -> accumulator - [string, ..strings] -> - join_loop(strings, separator, accumulator <> separator <> string) - } -} - -/// Pads the start of a `String` until it has a given length. -/// -/// ## Examples -/// -/// ```gleam -/// pad_start("121", to: 5, with: ".") -/// // -> "..121" -/// ``` -/// -/// ```gleam -/// pad_start("121", to: 3, with: ".") -/// // -> "121" -/// ``` -/// -/// ```gleam -/// pad_start("121", to: 2, with: ".") -/// // -> "121" -/// ``` -/// -pub fn pad_start( - string: String, - to desired_length: Int, - with pad_string: String, -) -> String { - let current_length = length(string) - let to_pad_length = desired_length - current_length - - case to_pad_length <= 0 { - True -> string - False -> padding(to_pad_length, pad_string) <> string - } -} - -/// Pads the end of a `String` until it has a given length. -/// -/// ## Examples -/// -/// ```gleam -/// pad_end("123", to: 5, with: ".") -/// // -> "123.." -/// ``` -/// -/// ```gleam -/// pad_end("123", to: 3, with: ".") -/// // -> "123" -/// ``` -/// -/// ```gleam -/// pad_end("123", to: 2, with: ".") -/// // -> "123" -/// ``` -/// -pub fn pad_end( - string: String, - to desired_length: Int, - with pad_string: String, -) -> String { - let current_length = length(string) - let to_pad_length = desired_length - current_length - - case to_pad_length <= 0 { - True -> string - False -> string <> padding(to_pad_length, pad_string) - } -} - -fn padding(size: Int, pad_string: String) -> String { - let pad_string_length = length(pad_string) - let num_pads = size / pad_string_length - let extra = size % pad_string_length - - repeat(pad_string, num_pads) <> slice(pad_string, 0, extra) -} - -/// Removes whitespace on both sides of a `String`. -/// -/// Whitespace in this function is the set of nonbreakable whitespace -/// codepoints, defined as Pattern_White_Space in [Unicode Standard Annex #31][1]. -/// -/// [1]: https://unicode.org/reports/tr31/ -/// -/// ## Examples -/// -/// ```gleam -/// trim(" hats \n") -/// // -> "hats" -/// ``` -/// -pub fn trim(string: String) -> String { - string |> trim_start |> trim_end -} - -@external(erlang, "string", "trim") -fn erl_trim(a: String, b: Direction) -> String - -type Direction { - Leading - Trailing -} - -/// Removes whitespace at the start of a `String`. -/// -/// ## Examples -/// -/// ```gleam -/// trim_start(" hats \n") -/// // -> "hats \n" -/// ``` -/// -@external(javascript, "../gleam_stdlib.mjs", "trim_start") -pub fn trim_start(string: String) -> String { - erl_trim(string, Leading) -} - -/// Removes whitespace at the end of a `String`. -/// -/// ## Examples -/// -/// ```gleam -/// trim_end(" hats \n") -/// // -> " hats" -/// ``` -/// -@external(javascript, "../gleam_stdlib.mjs", "trim_end") -pub fn trim_end(string: String) -> String { - erl_trim(string, Trailing) -} - -/// 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. -/// -/// ## Performance -/// -/// There is a notable overhead to using this function, so you may not want to -/// use it in a tight loop. If you wish to efficiently parse a string you may -/// want to use alternatives such as the [splitter package](https://hex.pm/packages/splitter). -/// -/// ## Examples -/// -/// ```gleam -/// pop_grapheme("gleam") -/// // -> Ok(#("g", "leam")) -/// ``` -/// -/// ```gleam -/// pop_grapheme("") -/// // -> Error(Nil) -/// ``` -/// -@external(erlang, "gleam_stdlib", "string_pop_grapheme") -@external(javascript, "../gleam_stdlib.mjs", "pop_grapheme") -pub fn pop_grapheme(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"] -/// ``` -/// -@external(javascript, "../gleam_stdlib.mjs", "graphemes") -pub fn to_graphemes(string: String) -> List(String) { - string - |> to_graphemes_loop([]) - |> list.reverse -} - -fn to_graphemes_loop(string: String, acc: List(String)) -> List(String) { - case pop_grapheme(string) { - Ok(#(grapheme, rest)) -> to_graphemes_loop(rest, [grapheme, ..acc]) - Error(_) -> 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) { - to_utf_codepoints_loop(<>, []) -} - -@target(erlang) -fn to_utf_codepoints_loop( - bit_array: BitArray, - acc: List(UtfCodepoint), -) -> List(UtfCodepoint) { - case bit_array { - <> -> - to_utf_codepoints_loop(rest, [first, ..acc]) - _ -> list.reverse(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(string: 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) = utf_codepoint(97) -/// let assert Ok(b) = utf_codepoint(98) -/// let assert Ok(c) = utf_codepoint(99) -/// from_utf_codepoints([a, b, c]) -/// // -> "abc" -/// ``` -/// -@external(erlang, "gleam_stdlib", "utf_codepoint_list_to_string") -@external(javascript, "../gleam_stdlib.mjs", "utf_codepoint_list_to_string") -pub fn from_utf_codepoints(utf_codepoints: 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) - i if i >= 55_296 && i <= 57_343 -> Error(Nil) - i if i < 0 -> Error(Nil) - i -> Ok(unsafe_int_to_utf_codepoint(i)) - } -} - -/// Converts a `UtfCodepoint` to its ordinal code point value. -/// -/// ## Examples -/// -/// ```gleam -/// let assert [utf_codepoint, ..] = to_utf_codepoints("💜") -/// utf_codepoint_to_int(utf_codepoint) -/// // -> 128156 -/// ``` -/// -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "utf_codepoint_to_int") -pub fn utf_codepoint_to_int(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(string: String) -> Option(String) { - case string { - "" -> None - _ -> Some(string) - } -} - -/// 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(string: String) -> Result(String, Nil) { - case pop_grapheme(string) { - 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)`. -/// -/// This function traverses the full string, so it runs in linear time with the -/// length of the string. Avoid using this in a loop. -/// -/// ## Examples -/// -/// ```gleam -/// last("") -/// // -> Error(Nil) -/// ``` -/// -/// ```gleam -/// last("icecream") -/// // -> Ok("m") -/// ``` -/// -pub fn last(string: String) -> Result(String, Nil) { - case pop_grapheme(string) { - 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(string: String) -> String { - case pop_grapheme(string) { - Ok(#(first, rest)) -> append(to: uppercase(first), suffix: lowercase(rest)) - Error(_) -> "" - } -} - -/// Returns a `String` representation of a term in Gleam syntax. -/// -/// This may be occasionally useful for quick-and-dirty printing of values in -/// scripts. For error reporting and other uses prefer constructing strings by -/// pattern matching on the values. -/// -/// ## Limitations -/// -/// The output format of this function is not stable and could change at any -/// time. The output is not suitable for parsing. -/// -/// This function works using runtime reflection, so the output may not be -/// perfectly accurate for data structures where the runtime structure doesn't -/// hold enough information to determine the original syntax. For example, -/// tuples with an Erlang atom in the first position will be mistaken for Gleam -/// records. -/// -/// ## Security and safety -/// -/// There is no limit to how large the strings that this function can produce. -/// Be careful not to call this function with large data structures or you -/// could use very large amounts of memory, potentially causing runtime -/// problems. -/// -pub fn inspect(term: anything) -> String { - term - |> do_inspect - |> string_tree.to_string -} - -@external(erlang, "gleam_stdlib", "inspect") -@external(javascript, "../gleam_stdlib.mjs", "inspect") -fn do_inspect(term: anything) -> StringTree - -/// Returns the number of bytes in a `String`. -/// -/// This function runs in constant time on Erlang and in linear time on -/// JavaScript. -/// -/// ## Examples -/// -/// ```gleam -/// byte_size("🏳️‍⚧️🏳️‍🌈👩🏾‍❤️‍👨🏻") -/// // -> 58 -/// ``` -/// -@external(erlang, "erlang", "byte_size") -@external(javascript, "../gleam_stdlib.mjs", "byte_size") -pub fn byte_size(string: String) -> Int diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/string_tree.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/string_tree.gleam deleted file mode 100644 index 407d865..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/string_tree.gleam +++ /dev/null @@ -1,208 +0,0 @@ -import gleam/list - -/// `StringTree` is a type used for efficiently building text content to be -/// written to a file or a socket. Internally it is represented as a tree so to -/// append or prepend to a string tree is a constant time operation that -/// allocates a new node in the tree without copying any of the content. When -/// writing to an output stream the tree is traversed and the content is sent -/// directly rather than copying it into a single buffer beforehand. -/// -/// On Erlang this type is compatible with Erlang's iodata. On JavaScript this -/// type is compatible with normal strings. -/// -/// The BEAM virtual machine has an optimisation for appending strings, where it -/// will mutate the string buffer when safe to do so, so if you are looking to -/// build a string through appending many small strings then you may get better -/// performance by not using a string tree. Always benchmark your performance -/// sensitive code. -/// -pub type StringTree - -/// Create an empty `StringTree`. Useful as the start of a pipe chaining many -/// trees together. -/// -pub fn new() -> StringTree { - from_strings([]) -} - -/// Prepends a `String` onto the start of some `StringTree`. -/// -/// Runs in constant time. -/// -pub fn prepend(to tree: StringTree, prefix prefix: String) -> StringTree { - append_tree(from_string(prefix), tree) -} - -/// Appends a `String` onto the end of some `StringTree`. -/// -/// Runs in constant time. -/// -pub fn append(to tree: StringTree, suffix second: String) -> StringTree { - append_tree(tree, from_string(second)) -} - -/// Prepends some `StringTree` onto the start of another. -/// -/// Runs in constant time. -/// -pub fn prepend_tree( - to tree: StringTree, - prefix prefix: StringTree, -) -> StringTree { - append_tree(prefix, tree) -} - -/// Appends some `StringTree` onto the end of another. -/// -/// Runs in constant time. -/// -@external(erlang, "gleam_stdlib", "iodata_append") -@external(javascript, "../gleam_stdlib.mjs", "add") -pub fn append_tree(to tree: StringTree, suffix suffix: StringTree) -> StringTree - -/// Converts a list of strings into a `StringTree`. -/// -/// Runs in constant time. -/// -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "concat") -pub fn from_strings(strings: List(String)) -> StringTree - -/// Joins a list of trees into a single tree. -/// -/// Runs in constant time. -/// -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "concat") -pub fn concat(trees: List(StringTree)) -> StringTree - -/// Converts a string into a `StringTree`. -/// -/// Runs in constant time. -/// -@external(erlang, "gleam_stdlib", "identity") -@external(javascript, "../gleam_stdlib.mjs", "identity") -pub fn from_string(string: String) -> StringTree - -/// Turns a `StringTree` into a `String`. -/// -/// This function is implemented natively by the virtual machine and is highly -/// optimised. -/// -@external(erlang, "unicode", "characters_to_binary") -@external(javascript, "../gleam_stdlib.mjs", "identity") -pub fn to_string(tree: StringTree) -> String - -/// Returns the size of the `StringTree` in bytes. -/// -@external(erlang, "erlang", "iolist_size") -@external(javascript, "../gleam_stdlib.mjs", "length") -pub fn byte_size(tree: StringTree) -> Int - -/// Joins the given trees into a new tree separated with the given string. -/// -pub fn join(trees: List(StringTree), with sep: String) -> StringTree { - trees - |> list.intersperse(from_string(sep)) - |> concat -} - -/// Converts a `StringTree` to a new one where the contents have been -/// lowercased. -/// -@external(erlang, "string", "lowercase") -@external(javascript, "../gleam_stdlib.mjs", "lowercase") -pub fn lowercase(tree: StringTree) -> StringTree - -/// Converts a `StringTree` to a new one where the contents have been -/// uppercased. -/// -@external(erlang, "string", "uppercase") -@external(javascript, "../gleam_stdlib.mjs", "uppercase") -pub fn uppercase(tree: StringTree) -> StringTree - -/// Converts a `StringTree` to a new one with the contents reversed. -/// -@external(erlang, "string", "reverse") -pub fn reverse(tree: StringTree) -> StringTree { - tree - |> to_string - |> do_to_graphemes - |> list.reverse - |> from_strings -} - -@external(javascript, "../gleam_stdlib.mjs", "graphemes") -fn do_to_graphemes(string: String) -> List(String) - -type Direction { - All -} - -/// Splits a `StringTree` on a given pattern into a list of trees. -/// -@external(javascript, "../gleam_stdlib.mjs", "split") -pub fn split(tree: StringTree, on pattern: String) -> List(StringTree) { - erl_split(tree, pattern, All) -} - -@external(erlang, "string", "split") -fn erl_split(a: StringTree, b: String, c: Direction) -> List(StringTree) - -/// Replaces all instances of a pattern with a given string substitute. -/// -@external(erlang, "gleam_stdlib", "string_replace") -@external(javascript, "../gleam_stdlib.mjs", "string_replace") -pub fn replace( - in tree: StringTree, - each pattern: String, - with substitute: String, -) -> StringTree - -/// Compares two string trees to determine if they have the same textual -/// content. -/// -/// Comparing two string trees 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 -/// ``` -/// -@external(erlang, "string", "equal") -pub fn is_equal(a: StringTree, b: StringTree) -> Bool { - a == b -} - -/// Inspects a `StringTree` 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 -/// ``` -/// -@external(erlang, "string", "is_empty") -pub fn is_empty(tree: StringTree) -> Bool { - from_string("") == tree -} diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/uri.gleam b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/uri.gleam deleted file mode 100644 index 6ebb10f..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam/uri.gleam +++ /dev/null @@ -1,776 +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.{type Option, None, Some} -import gleam/string -import gleam/string_tree.{type StringTree} - -/// Type representing 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), - ) -} - -/// Constant representing an empty URI, equivalent to "". -/// -/// ## Examples -/// -/// ```gleam -/// let uri = Uri(..empty, scheme: Some("https"), host: Some("example.com")) -/// // -> Uri( -/// // scheme: Some("https"), -/// // userinfo: None, -/// // host: Some("example.com"), -/// // port: None, -/// // path: "", -/// // query: None, -/// // fragment: None, -/// // ) -/// ``` -/// -pub const empty = Uri( - scheme: None, - userinfo: None, - host: None, - port: None, - path: "", - query: None, - fragment: None, -) - -/// 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") -/// // ) -/// // ) -/// ``` -/// -@external(erlang, "gleam_stdlib", "uri_parse") -pub fn parse(uri_string: String) -> Result(Uri, Nil) { - // This parses a uri_string following the regex defined in - // https://tools.ietf.org/html/rfc3986#appendix-B - // - // TODO: This is not perfect and will be more permissive than its Erlang - // counterpart, ideally we want to replicate Erlang's implementation on the js - // target as well. - parse_scheme_loop(uri_string, uri_string, empty, 0) -} - -fn parse_scheme_loop( - original: String, - uri_string: String, - pieces: Uri, - size: Int, -) -> Result(Uri, Nil) { - case uri_string { - // `/` is not allowed to appear in a scheme so we know it's over and we can - // start parsing the authority with slashes. - "/" <> _ if size == 0 -> parse_authority_with_slashes(uri_string, pieces) - "/" <> _ -> { - let scheme = codeunit_slice(original, at_index: 0, length: size) - let pieces = Uri(..pieces, scheme: Some(string.lowercase(scheme))) - parse_authority_with_slashes(uri_string, pieces) - } - - // `?` is not allowed to appear in a schemem, in an authority, or in a path; - // so if we see it we know it marks the beginning of the query part. - "?" <> rest if size == 0 -> parse_query_with_question_mark(rest, pieces) - "?" <> rest -> { - let scheme = codeunit_slice(original, at_index: 0, length: size) - let pieces = Uri(..pieces, scheme: Some(string.lowercase(scheme))) - parse_query_with_question_mark(rest, pieces) - } - - // `#` is not allowed to appear in a scheme, in an authority, in a path or - // in a query; so if we see it we know it marks the beginning of the final - // fragment. - "#" <> rest if size == 0 -> parse_fragment(rest, pieces) - "#" <> rest -> { - let scheme = codeunit_slice(original, at_index: 0, length: size) - let pieces = Uri(..pieces, scheme: Some(string.lowercase(scheme))) - parse_fragment(rest, pieces) - } - - // A colon marks the end of a uri scheme, but if it is not preceded by any - // character then it's not a valid URI. - ":" <> _ if size == 0 -> Error(Nil) - ":" <> rest -> { - let scheme = codeunit_slice(original, at_index: 0, length: size) - let pieces = Uri(..pieces, scheme: Some(string.lowercase(scheme))) - parse_authority_with_slashes(rest, pieces) - } - - // If we could get to the end of the string and we've met no special - // chars whatsoever, that means the entire string is just a long path. - "" -> Ok(Uri(..pieces, path: original)) - - // In all other cases the first character is just a valid URI scheme - // character and we just keep munching characters until we reach the end of - // the uri scheme (or the end of the string and that would mean this is not - // a valid uri scheme since we found no `:`). - _ -> { - let #(_, rest) = pop_codeunit(uri_string) - parse_scheme_loop(original, rest, pieces, size + 1) - } - } -} - -fn parse_authority_with_slashes( - uri_string: String, - pieces: Uri, -) -> Result(Uri, Nil) { - case uri_string { - // To be a valid authority the string must start with a `//`, otherwise - // there's no authority and we just skip ahead to parsing the path. - "//" -> Ok(Uri(..pieces, host: Some(""))) - "//" <> rest -> parse_authority_pieces(rest, pieces) - _ -> parse_path(uri_string, pieces) - } -} - -fn parse_authority_pieces(string: String, pieces: Uri) -> Result(Uri, Nil) { - parse_userinfo_loop(string, string, pieces, 0) -} - -fn parse_userinfo_loop( - original: String, - uri_string: String, - pieces: Uri, - size: Int, -) -> Result(Uri, Nil) { - case uri_string { - // `@` marks the end of the userinfo and the start of the host part in the - // authority string. - "@" <> rest if size == 0 -> parse_host(rest, pieces) - "@" <> rest -> { - let userinfo = codeunit_slice(original, at_index: 0, length: size) - let pieces = Uri(..pieces, userinfo: Some(userinfo)) - parse_host(rest, pieces) - } - - // If we reach the end of the authority string without finding an `@` - // special character, then we know that the authority doesn't actually - // contain the userinfo part. - // The entire string we just went through was a host! So we parse it as - // such. - "" | "/" <> _ | "?" <> _ | "#" <> _ -> parse_host(original, pieces) - - // In all other cases we just keep munching characters increasing the size - // of the userinfo bit. - _ -> { - let #(_, rest) = pop_codeunit(uri_string) - parse_userinfo_loop(original, rest, pieces, size + 1) - } - } -} - -fn parse_host(uri_string: String, pieces: Uri) -> Result(Uri, Nil) { - // A host string can be in two formats: - // - \[[:.a-zA-Z0-9]*\] - // - [^:] - case uri_string { - // If we find an opening bracket we know it's the first format. - "[" <> _ -> parse_host_within_brackets(uri_string, pieces) - - // A `:` marks the beginning of the port part of the authority string. - ":" <> _ -> { - let pieces = Uri(..pieces, host: Some("")) - parse_port(uri_string, pieces) - } - - // If the string is empty then there's no need to keep going. The host is - // empty. - "" -> Ok(Uri(..pieces, host: Some(""))) - - // Otherwise it's the second format - _ -> parse_host_outside_of_brackets(uri_string, pieces) - } -} - -fn parse_host_within_brackets( - uri_string: String, - pieces: Uri, -) -> Result(Uri, Nil) { - parse_host_within_brackets_loop(uri_string, uri_string, pieces, 0) -} - -fn parse_host_within_brackets_loop( - original: String, - uri_string: String, - pieces: Uri, - size: Int, -) -> Result(Uri, Nil) { - case uri_string { - // If the string is over the entire string we were iterating through is the - // host part. - "" -> Ok(Uri(..pieces, host: Some(uri_string))) - - // A `]` marks the end of the host and the start of the port part. - "]" <> rest if size == 0 -> parse_port(rest, pieces) - "]" <> rest -> { - let host = codeunit_slice(original, at_index: 0, length: size + 1) - let pieces = Uri(..pieces, host: Some(host)) - parse_port(rest, pieces) - } - - // `/` marks the beginning of a path. - "/" <> _ if size == 0 -> parse_path(uri_string, pieces) - "/" <> _ -> { - let host = codeunit_slice(original, at_index: 0, length: size) - let pieces = Uri(..pieces, host: Some(host)) - parse_path(uri_string, pieces) - } - - // `?` marks the beginning of the query with question mark. - "?" <> rest if size == 0 -> parse_query_with_question_mark(rest, pieces) - "?" <> rest -> { - let host = codeunit_slice(original, at_index: 0, length: size) - let pieces = Uri(..pieces, host: Some(host)) - parse_query_with_question_mark(rest, pieces) - } - - // `#` marks the beginning of the fragment part. - "#" <> rest if size == 0 -> parse_fragment(rest, pieces) - "#" <> rest -> { - let host = codeunit_slice(original, at_index: 0, length: size) - let pieces = Uri(..pieces, host: Some(host)) - parse_fragment(rest, pieces) - } - - // In all other cases we just keep iterating. - _ -> { - let #(char, rest) = pop_codeunit(uri_string) - // Inside `[...]` there can only be some characters, if we find a special - // one then we know that we're actually parsing the other format for the - // host and we switch to that! - case is_valid_host_within_brackets_char(char) { - True -> - parse_host_within_brackets_loop(original, rest, pieces, size + 1) - - False -> - parse_host_outside_of_brackets_loop(original, original, pieces, 0) - } - } - } -} - -fn is_valid_host_within_brackets_char(char: Int) -> Bool { - // [0-9] - { 48 >= char && char <= 57 } - // [A-Z] - || { 65 >= char && char <= 90 } - // [a-z] - || { 97 >= char && char <= 122 } - // : - || char == 58 - // . - || char == 46 -} - -fn parse_host_outside_of_brackets( - uri_string: String, - pieces: Uri, -) -> Result(Uri, Nil) { - parse_host_outside_of_brackets_loop(uri_string, uri_string, pieces, 0) -} - -fn parse_host_outside_of_brackets_loop( - original: String, - uri_string: String, - pieces: Uri, - size: Int, -) -> Result(Uri, Nil) { - case uri_string { - "" -> Ok(Uri(..pieces, host: Some(original))) - - // `:` marks the beginning of the port. - ":" <> _ -> { - let host = codeunit_slice(original, at_index: 0, length: size) - let pieces = Uri(..pieces, host: Some(host)) - parse_port(uri_string, pieces) - } - - // `/` marks the beginning of a path. - "/" <> _ -> { - let host = codeunit_slice(original, at_index: 0, length: size) - let pieces = Uri(..pieces, host: Some(host)) - parse_path(uri_string, pieces) - } - - // `?` marks the beginning of the query with question mark. - "?" <> rest -> { - let host = codeunit_slice(original, at_index: 0, length: size) - let pieces = Uri(..pieces, host: Some(host)) - parse_query_with_question_mark(rest, pieces) - } - - // `#` marks the beginning of the fragment part. - "#" <> rest -> { - let host = codeunit_slice(original, at_index: 0, length: size) - let pieces = Uri(..pieces, host: Some(host)) - parse_fragment(rest, pieces) - } - - _ -> { - let #(_, rest) = pop_codeunit(uri_string) - parse_host_outside_of_brackets_loop(original, rest, pieces, size + 1) - } - } -} - -fn parse_port(uri_string: String, pieces: Uri) -> Result(Uri, Nil) { - case uri_string { - ":0" <> rest -> parse_port_loop(rest, pieces, 0) - ":1" <> rest -> parse_port_loop(rest, pieces, 1) - ":2" <> rest -> parse_port_loop(rest, pieces, 2) - ":3" <> rest -> parse_port_loop(rest, pieces, 3) - ":4" <> rest -> parse_port_loop(rest, pieces, 4) - ":5" <> rest -> parse_port_loop(rest, pieces, 5) - ":6" <> rest -> parse_port_loop(rest, pieces, 6) - ":7" <> rest -> parse_port_loop(rest, pieces, 7) - ":8" <> rest -> parse_port_loop(rest, pieces, 8) - ":9" <> rest -> parse_port_loop(rest, pieces, 9) - - // The port could be empty and be followed by any of the next delimiters. - // Like `:#`, `:?` or `:/` - ":" | "" -> Ok(pieces) - - // `?` marks the beginning of the query with question mark. - "?" <> rest | ":?" <> rest -> parse_query_with_question_mark(rest, pieces) - - // `#` marks the beginning of the fragment part. - "#" <> rest | ":#" <> rest -> parse_fragment(rest, pieces) - - // `/` marks the beginning of a path. - "/" <> _ -> parse_path(uri_string, pieces) - ":" <> rest -> - case rest { - "/" <> _ -> parse_path(rest, pieces) - _ -> Error(Nil) - } - - _ -> Error(Nil) - } -} - -fn parse_port_loop( - uri_string: String, - pieces: Uri, - port: Int, -) -> Result(Uri, Nil) { - case uri_string { - // As long as we find port numbers we keep accumulating those. - "0" <> rest -> parse_port_loop(rest, pieces, port * 10) - "1" <> rest -> parse_port_loop(rest, pieces, port * 10 + 1) - "2" <> rest -> parse_port_loop(rest, pieces, port * 10 + 2) - "3" <> rest -> parse_port_loop(rest, pieces, port * 10 + 3) - "4" <> rest -> parse_port_loop(rest, pieces, port * 10 + 4) - "5" <> rest -> parse_port_loop(rest, pieces, port * 10 + 5) - "6" <> rest -> parse_port_loop(rest, pieces, port * 10 + 6) - "7" <> rest -> parse_port_loop(rest, pieces, port * 10 + 7) - "8" <> rest -> parse_port_loop(rest, pieces, port * 10 + 8) - "9" <> rest -> parse_port_loop(rest, pieces, port * 10 + 9) - - // `?` marks the beginning of the query with question mark. - "?" <> rest -> { - let pieces = Uri(..pieces, port: Some(port)) - parse_query_with_question_mark(rest, pieces) - } - - // `#` marks the beginning of the fragment part. - "#" <> rest -> { - let pieces = Uri(..pieces, port: Some(port)) - parse_fragment(rest, pieces) - } - - // `/` marks the beginning of a path. - "/" <> _ -> { - let pieces = Uri(..pieces, port: Some(port)) - parse_path(uri_string, pieces) - } - - // The string (and so the port) is over, we return what we parsed so far. - "" -> Ok(Uri(..pieces, port: Some(port))) - - // In all other cases we've ran into some invalid character inside the port - // so the uri is invalid! - _ -> Error(Nil) - } -} - -fn parse_path(uri_string: String, pieces: Uri) -> Result(Uri, Nil) { - parse_path_loop(uri_string, uri_string, pieces, 0) -} - -fn parse_path_loop( - original: String, - uri_string: String, - pieces: Uri, - size: Int, -) -> Result(Uri, Nil) { - case uri_string { - // `?` marks the beginning of the query with question mark. - "?" <> rest -> { - let path = codeunit_slice(original, at_index: 0, length: size) - let pieces = Uri(..pieces, path: path) - parse_query_with_question_mark(rest, pieces) - } - - // `#` marks the beginning of the fragment part. - "#" <> rest -> { - let path = codeunit_slice(original, at_index: 0, length: size) - let pieces = Uri(..pieces, path: path) - parse_fragment(rest, pieces) - } - - // If the string is over that means the entirety of the string was the path - // and it has an empty query and fragment. - "" -> Ok(Uri(..pieces, path: original)) - - // In all other cases the character is allowed to be part of the path so we - // just keep munching until we reach to its end. - _ -> { - let #(_, rest) = pop_codeunit(uri_string) - parse_path_loop(original, rest, pieces, size + 1) - } - } -} - -fn parse_query_with_question_mark( - uri_string: String, - pieces: Uri, -) -> Result(Uri, Nil) { - parse_query_with_question_mark_loop(uri_string, uri_string, pieces, 0) -} - -fn parse_query_with_question_mark_loop( - original: String, - uri_string: String, - pieces: Uri, - size: Int, -) -> Result(Uri, Nil) { - case uri_string { - // `#` marks the beginning of the fragment part. - "#" <> rest if size == 0 -> parse_fragment(rest, pieces) - "#" <> rest -> { - let query = codeunit_slice(original, at_index: 0, length: size) - let pieces = Uri(..pieces, query: Some(query)) - parse_fragment(rest, pieces) - } - - // If the string is over that means the entirety of the string was the query - // and it has an empty fragment. - "" -> Ok(Uri(..pieces, query: Some(original))) - - // In all other cases the character is allowed to be part of the query so we - // just keep munching until we reach to its end. - _ -> { - let #(_, rest) = pop_codeunit(uri_string) - parse_query_with_question_mark_loop(original, rest, pieces, size + 1) - } - } -} - -fn parse_fragment(rest: String, pieces: Uri) -> Result(Uri, Nil) { - Ok(Uri(..pieces, fragment: Some(rest))) -} - -// WARN: this function returns invalid strings! -// We need to return a String anyways to have this as the representation on the -// JavaScript target. -// Alternatively, we could rewrite the entire code to use a single -// `fold_codeunits`-style loop and a state machine. -@external(erlang, "gleam_stdlib", "string_pop_codeunit") -@external(javascript, "../gleam_stdlib.mjs", "pop_codeunit") -fn pop_codeunit(str: String) -> #(Int, String) - -@external(erlang, "binary", "part") -@external(javascript, "../gleam_stdlib.mjs", "string_codeunit_slice") -fn codeunit_slice(str: String, at_index from: Int, length length: Int) -> String - -/// Parses an URL-encoded 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")]) -/// ``` -/// -@external(erlang, "gleam_stdlib", "parse_query") -@external(javascript, "../gleam_stdlib.mjs", "parse_query") -pub fn parse_query(query: 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_tree.from_string("&")) - |> string_tree.concat - |> string_tree.to_string -} - -fn query_pair(pair: #(String, String)) -> StringTree { - [percent_encode_query(pair.0), "=", percent_encode_query(pair.1)] - |> string_tree.from_strings -} - -fn percent_encode_query(part: String) -> String { - percent_encode(part) - |> string.replace(each: "+", with: "%2B") -} - -/// Encodes a string into a percent encoded representation. -/// -/// ## Examples -/// -/// ```gleam -/// percent_encode("100% great") -/// // -> "100%25%20great" -/// ``` -/// -@external(erlang, "gleam_stdlib", "percent_encode") -@external(javascript, "../gleam_stdlib.mjs", "percent_encode") -pub fn percent_encode(value: String) -> String - -/// Decodes a percent encoded string. -/// -/// ## Examples -/// -/// ```gleam -/// percent_decode("100%25%20great+fun") -/// // -> Ok("100% great+fun") -/// ``` -/// -@external(erlang, "gleam_stdlib", "percent_decode") -@external(javascript, "../gleam_stdlib.mjs", "percent_decode") -pub fn percent_decode(value: String) -> Result(String, Nil) - -/// Splits the path section of a URI into its 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, "/")) -} - -fn remove_dot_segments(input: List(String)) -> List(String) { - remove_dot_segments_loop(input, []) -} - -fn remove_dot_segments_loop( - 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] - } - remove_dot_segments_loop(rest, accumulator) - } - } -} - -/// Encodes a `Uri` value as a URI string. -/// -/// The opposite operation is `uri.parse`. -/// -/// ## Examples -/// -/// ```gleam -/// let uri = Uri(..empty, scheme: Some("https"), host: Some("example.com")) -/// to_string(uri) -/// // -> "https://example.com" -/// ``` -/// -pub fn to_string(uri: Uri) -> String { - let parts = case uri.fragment { - Some(fragment) -> ["#", fragment] - None -> [] - } - let parts = case uri.query { - Some(query) -> ["?", query, ..parts] - None -> 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] - _, _, _ -> 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("https://example.com/path?foo#bar") -/// origin(uri) -/// // -> Ok("https://example.com") -/// ``` -/// -pub fn origin(uri: Uri) -> Result(String, Nil) { - let Uri(scheme: scheme, host: host, port: port, ..) = uri - case host, scheme { - Some(h), Some("https") if port == Some(443) -> - Ok(string.concat(["https://", h])) - Some(h), Some("http") if port == Some(80) -> - Ok(string.concat(["http://", h])) - Some(h), Some(s) if s == "http" || s == "https" -> { - case port { - Some(p) -> Ok(string.concat([s, "://", h, ":", int.to_string(p)])) - None -> Ok(string.concat([s, "://", h])) - } - } - _, _ -> Error(Nil) - } -} - -/// 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 = - relative.path - |> string.split("/") - |> 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) - } - _ -> { - 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 -> - base.path - |> string.split("/") - |> 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) - } -} - -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], "/") -} diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@bit_array.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@bit_array.erl deleted file mode 100644 index 7df56ce..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@bit_array.erl +++ /dev/null @@ -1,347 +0,0 @@ --module(gleam@bit_array). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/bit_array.gleam"). --export([from_string/1, bit_size/1, byte_size/1, pad_to_bytes/1, slice/3, is_utf8/1, to_string/1, concat/1, append/2, base64_encode/2, base64_decode/1, base64_url_encode/2, base64_url_decode/1, base16_encode/1, base16_decode/1, inspect/1, compare/2, starts_with/2]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC(" BitArrays are a sequence of binary data of any length.\n"). - --file("src/gleam/bit_array.gleam", 11). -?DOC(" Converts a UTF-8 `String` type into a `BitArray`.\n"). --spec from_string(binary()) -> bitstring(). -from_string(X) -> - gleam_stdlib:identity(X). - --file("src/gleam/bit_array.gleam", 17). -?DOC(" Returns an integer which is the number of bits in the bit array.\n"). --spec bit_size(bitstring()) -> integer(). -bit_size(X) -> - erlang:bit_size(X). - --file("src/gleam/bit_array.gleam", 23). -?DOC(" Returns an integer which is the number of bytes in the bit array.\n"). --spec byte_size(bitstring()) -> integer(). -byte_size(X) -> - erlang:byte_size(X). - --file("src/gleam/bit_array.gleam", 29). -?DOC(" Pads a bit array with zeros so that it is a whole number of bytes.\n"). --spec pad_to_bytes(bitstring()) -> bitstring(). -pad_to_bytes(X) -> - gleam_stdlib:bit_array_pad_to_bytes(X). - --file("src/gleam/bit_array.gleam", 54). -?DOC( - " Extracts a sub-section of a bit array.\n" - "\n" - " The slice will start at given position and continue up to specified\n" - " length.\n" - " A negative length can be used to extract bytes at the end of a bit array.\n" - "\n" - " This function runs in constant time.\n" -). --spec slice(bitstring(), integer(), integer()) -> {ok, bitstring()} | - {error, nil}. -slice(String, Position, Length) -> - gleam_stdlib:bit_array_slice(String, Position, Length). - --file("src/gleam/bit_array.gleam", 67). --spec is_utf8_loop(bitstring()) -> boolean(). -is_utf8_loop(Bits) -> - case Bits of - <<>> -> - true; - - <<_/utf8, Rest/binary>> -> - is_utf8_loop(Rest); - - _ -> - false - end. - --file("src/gleam/bit_array.gleam", 62). -?DOC(" Tests to see whether a bit array is valid UTF-8.\n"). --spec is_utf8(bitstring()) -> boolean(). -is_utf8(Bits) -> - is_utf8_loop(Bits). - --file("src/gleam/bit_array.gleam", 88). -?DOC( - " Converts a bit array to a string.\n" - "\n" - " Returns an error if the bit array is invalid UTF-8 data.\n" -). --spec to_string(bitstring()) -> {ok, binary()} | {error, nil}. -to_string(Bits) -> - case is_utf8(Bits) of - true -> - {ok, gleam_stdlib:identity(Bits)}; - - false -> - {error, nil} - end. - --file("src/gleam/bit_array.gleam", 109). -?DOC( - " Creates a new bit array by joining multiple binaries.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " concat([from_string(\"butter\"), from_string(\"fly\")])\n" - " // -> from_string(\"butterfly\")\n" - " ```\n" -). --spec concat(list(bitstring())) -> bitstring(). -concat(Bit_arrays) -> - gleam_stdlib:bit_array_concat(Bit_arrays). - --file("src/gleam/bit_array.gleam", 40). -?DOC( - " Creates a new bit array by joining two bit arrays.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " append(to: from_string(\"butter\"), suffix: from_string(\"fly\"))\n" - " // -> from_string(\"butterfly\")\n" - " ```\n" -). --spec append(bitstring(), bitstring()) -> bitstring(). -append(First, Second) -> - gleam_stdlib:bit_array_concat([First, Second]). - --file("src/gleam/bit_array.gleam", 118). -?DOC( - " Encodes a BitArray into a base 64 encoded string.\n" - "\n" - " If the bit array does not contain a whole number of bytes then it is padded\n" - " with zero bits prior to being encoded.\n" -). --spec base64_encode(bitstring(), boolean()) -> binary(). -base64_encode(Input, Padding) -> - gleam_stdlib:base64_encode(Input, Padding). - --file("src/gleam/bit_array.gleam", 122). -?DOC(" Decodes a base 64 encoded string into a `BitArray`.\n"). --spec base64_decode(binary()) -> {ok, bitstring()} | {error, nil}. -base64_decode(Encoded) -> - Padded = case erlang:byte_size(gleam_stdlib:identity(Encoded)) rem 4 of - 0 -> - Encoded; - - N -> - gleam@string:append( - Encoded, - gleam@string:repeat(<<"="/utf8>>, 4 - N) - ) - end, - gleam_stdlib:base64_decode(Padded). - --file("src/gleam/bit_array.gleam", 140). -?DOC( - " Encodes a `BitArray` into a base 64 encoded string with URL and filename\n" - " safe alphabet.\n" - "\n" - " If the bit array does not contain a whole number of bytes then it is padded\n" - " with zero bits prior to being encoded.\n" -). --spec base64_url_encode(bitstring(), boolean()) -> binary(). -base64_url_encode(Input, Padding) -> - _pipe = Input, - _pipe@1 = gleam_stdlib:base64_encode(_pipe, Padding), - _pipe@2 = gleam@string:replace(_pipe@1, <<"+"/utf8>>, <<"-"/utf8>>), - gleam@string:replace(_pipe@2, <<"/"/utf8>>, <<"_"/utf8>>). - --file("src/gleam/bit_array.gleam", 150). -?DOC( - " Decodes a base 64 encoded string with URL and filename safe alphabet into a\n" - " `BitArray`.\n" -). --spec base64_url_decode(binary()) -> {ok, bitstring()} | {error, nil}. -base64_url_decode(Encoded) -> - _pipe = Encoded, - _pipe@1 = gleam@string:replace(_pipe, <<"-"/utf8>>, <<"+"/utf8>>), - _pipe@2 = gleam@string:replace(_pipe@1, <<"_"/utf8>>, <<"/"/utf8>>), - base64_decode(_pipe@2). - --file("src/gleam/bit_array.gleam", 164). -?DOC( - " Encodes a `BitArray` into a base 16 encoded string.\n" - "\n" - " If the bit array does not contain a whole number of bytes then it is padded\n" - " with zero bits prior to being encoded.\n" -). --spec base16_encode(bitstring()) -> binary(). -base16_encode(Input) -> - gleam_stdlib:base16_encode(Input). - --file("src/gleam/bit_array.gleam", 170). -?DOC(" Decodes a base 16 encoded string into a `BitArray`.\n"). --spec base16_decode(binary()) -> {ok, bitstring()} | {error, nil}. -base16_decode(Input) -> - gleam_stdlib:base16_decode(Input). - --file("src/gleam/bit_array.gleam", 191). --spec inspect_loop(bitstring(), binary()) -> binary(). -inspect_loop(Input, Accumulator) -> - case Input of - <<>> -> - Accumulator; - - <> -> - <<<>/binary, - ":size(1)"/utf8>>; - - <> -> - <<<>/binary, - ":size(2)"/utf8>>; - - <> -> - <<<>/binary, - ":size(3)"/utf8>>; - - <> -> - <<<>/binary, - ":size(4)"/utf8>>; - - <> -> - <<<>/binary, - ":size(5)"/utf8>>; - - <> -> - <<<>/binary, - ":size(6)"/utf8>>; - - <> -> - <<<>/binary, - ":size(7)"/utf8>>; - - <> -> - Suffix = case Rest of - <<>> -> - <<""/utf8>>; - - _ -> - <<", "/utf8>> - end, - Accumulator@1 = <<<>/binary, - Suffix/binary>>, - inspect_loop(Rest, Accumulator@1); - - _ -> - Accumulator - end. - --file("src/gleam/bit_array.gleam", 187). -?DOC( - " Converts a bit array to a string containing the decimal value of each byte.\n" - "\n" - " Use this over `string.inspect` when you have a bit array you want printed\n" - " in the array syntax even if it is valid UTF-8.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " inspect(<<0, 20, 0x20, 255>>)\n" - " // -> \"<<0, 20, 32, 255>>\"\n" - "\n" - " inspect(<<100, 5:3>>)\n" - " // -> \"<<100, 5:size(3)>>\"\n" - " ```\n" -). --spec inspect(bitstring()) -> binary(). -inspect(Input) -> - <<(inspect_loop(Input, <<"<<"/utf8>>))/binary, ">>"/utf8>>. - --file("src/gleam/bit_array.gleam", 232). -?DOC( - " Compare two bit arrays as sequences of bytes.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " compare(<<1>>, <<2>>)\n" - " // -> Lt\n" - "\n" - " compare(<<\"AB\":utf8>>, <<\"AA\":utf8>>)\n" - " // -> Gt\n" - "\n" - " compare(<<1, 2:size(2)>>, with: <<1, 2:size(2)>>)\n" - " // -> Eq\n" - " ```\n" -). --spec compare(bitstring(), bitstring()) -> gleam@order:order(). -compare(A, B) -> - case {A, B} of - {<>, - <>} -> - case {First_byte, Second_byte} of - {F, S} when F > S -> - gt; - - {F@1, S@1} when F@1 < S@1 -> - lt; - - {_, _} -> - compare(First_rest, Second_rest) - end; - - {<<>>, <<>>} -> - eq; - - {_, <<>>} -> - gt; - - {<<>>, _} -> - lt; - - {First, Second} -> - case {gleam_stdlib:bit_array_to_int_and_size(First), - gleam_stdlib:bit_array_to_int_and_size(Second)} of - {{A@1, _}, {B@1, _}} when A@1 > B@1 -> - gt; - - {{A@2, _}, {B@2, _}} when A@2 < B@2 -> - lt; - - {{_, Size_a}, {_, Size_b}} when Size_a > Size_b -> - gt; - - {{_, Size_a@1}, {_, Size_b@1}} when Size_a@1 < Size_b@1 -> - lt; - - {_, _} -> - eq - end - end. - --file("src/gleam/bit_array.gleam", 273). -?DOC( - " Checks whether the first `BitArray` starts with the second one.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " starts_with(<<1, 2, 3, 4>>, <<1, 2>>)\n" - " // -> True\n" - " ```\n" -). --spec starts_with(bitstring(), bitstring()) -> boolean(). -starts_with(Bits, Prefix) -> - Prefix_size = erlang:bit_size(Prefix), - case Bits of - <> when Pref =:= Prefix -> - true; - - _ -> - false - end. diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@bool.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@bool.erl deleted file mode 100644 index 36b5a0b..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@bool.erl +++ /dev/null @@ -1,352 +0,0 @@ --module(gleam@bool). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/bool.gleam"). --export(['and'/2, 'or'/2, negate/1, nor/2, nand/2, exclusive_or/2, exclusive_nor/2, to_string/1, guard/3, lazy_guard/3]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " A type with two possible values, `True` and `False`. Used to indicate whether\n" - " things are... true or false!\n" - "\n" - " It is often clearer and offers more type safety to define a custom type\n" - " than to use `Bool`. For example, rather than having a `is_teacher: Bool`\n" - " field consider having a `role: SchoolRole` field where `SchoolRole` is a custom\n" - " type that can be either `Student` or `Teacher`.\n" -). - --file("src/gleam/bool.gleam", 31). -?DOC( - " Returns the and of two bools, but it evaluates both arguments.\n" - "\n" - " It's the function equivalent of the `&&` operator.\n" - " This function is useful in higher order functions or pipes.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " and(True, True)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " and(False, True)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " False |> and(True)\n" - " // -> False\n" - " ```\n" -). --spec 'and'(boolean(), boolean()) -> boolean(). -'and'(A, B) -> - A andalso B. - --file("src/gleam/bool.gleam", 57). -?DOC( - " Returns the or of two bools, but it evaluates both arguments.\n" - "\n" - " It's the function equivalent of the `||` operator.\n" - " This function is useful in higher order functions or pipes.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " or(True, True)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " or(False, True)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " False |> or(True)\n" - " // -> True\n" - " ```\n" -). --spec 'or'(boolean(), boolean()) -> boolean(). -'or'(A, B) -> - A orelse B. - --file("src/gleam/bool.gleam", 77). -?DOC( - " Returns the opposite bool value.\n" - "\n" - " This is the same as the `!` or `not` operators in some other languages.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " negate(True)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " negate(False)\n" - " // -> True\n" - " ```\n" -). --spec negate(boolean()) -> boolean(). -negate(Bool) -> - not Bool. - --file("src/gleam/bool.gleam", 105). -?DOC( - " Returns the nor of two bools.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " nor(False, False)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " nor(False, True)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " nor(True, False)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " nor(True, True)\n" - " // -> False\n" - " ```\n" -). --spec nor(boolean(), boolean()) -> boolean(). -nor(A, B) -> - not (A orelse B). - --file("src/gleam/bool.gleam", 133). -?DOC( - " Returns the nand of two bools.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " nand(False, False)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " nand(False, True)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " nand(True, False)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " nand(True, True)\n" - " // -> False\n" - " ```\n" -). --spec nand(boolean(), boolean()) -> boolean(). -nand(A, B) -> - not (A andalso B). - --file("src/gleam/bool.gleam", 161). -?DOC( - " Returns the exclusive or of two bools.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " exclusive_or(False, False)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " exclusive_or(False, True)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " exclusive_or(True, False)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " exclusive_or(True, True)\n" - " // -> False\n" - " ```\n" -). --spec exclusive_or(boolean(), boolean()) -> boolean(). -exclusive_or(A, B) -> - A /= B. - --file("src/gleam/bool.gleam", 189). -?DOC( - " Returns the exclusive nor of two bools.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " exclusive_nor(False, False)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " exclusive_nor(False, True)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " exclusive_nor(True, False)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " exclusive_nor(True, True)\n" - " // -> True\n" - " ```\n" -). --spec exclusive_nor(boolean(), boolean()) -> boolean(). -exclusive_nor(A, B) -> - A =:= B. - --file("src/gleam/bool.gleam", 207). -?DOC( - " Returns a string representation of the given bool.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_string(True)\n" - " // -> \"True\"\n" - " ```\n" - "\n" - " ```gleam\n" - " to_string(False)\n" - " // -> \"False\"\n" - " ```\n" -). --spec to_string(boolean()) -> binary(). -to_string(Bool) -> - case Bool of - false -> - <<"False"/utf8>>; - - true -> - <<"True"/utf8>> - end. - --file("src/gleam/bool.gleam", 266). -?DOC( - " Run a callback function if the given bool is `False`, otherwise return a\n" - " default value.\n" - "\n" - " With a `use` expression this function can simulate the early-return pattern\n" - " found in some other programming languages.\n" - "\n" - " In a procedural language:\n" - "\n" - " ```js\n" - " if (predicate) return value;\n" - " // ...\n" - " ```\n" - "\n" - " In Gleam with a `use` expression:\n" - "\n" - " ```gleam\n" - " use <- guard(when: predicate, return: value)\n" - " // ...\n" - " ```\n" - "\n" - " Like everything in Gleam `use` is an expression, so it short circuits the\n" - " current block, not the entire function. As a result you can assign the value\n" - " to a variable:\n" - "\n" - " ```gleam\n" - " let x = {\n" - " use <- guard(when: predicate, return: value)\n" - " // ...\n" - " }\n" - " ```\n" - "\n" - " Note that unlike in procedural languages the `return` value is evaluated\n" - " even when the predicate is `False`, so it is advisable not to perform\n" - " expensive computation nor side-effects there.\n" - "\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let name = \"\"\n" - " use <- guard(when: name == \"\", return: \"Welcome!\")\n" - " \"Hello, \" <> name\n" - " // -> \"Welcome!\"\n" - " ```\n" - "\n" - " ```gleam\n" - " let name = \"Kamaka\"\n" - " use <- guard(when: name == \"\", return: \"Welcome!\")\n" - " \"Hello, \" <> name\n" - " // -> \"Hello, Kamaka\"\n" - " ```\n" -). --spec guard(boolean(), BTS, fun(() -> BTS)) -> BTS. -guard(Requirement, Consequence, Alternative) -> - case Requirement of - true -> - Consequence; - - false -> - Alternative() - end. - --file("src/gleam/bool.gleam", 307). -?DOC( - " Runs a callback function if the given bool is `True`, otherwise runs an\n" - " alternative callback function.\n" - "\n" - " Useful when further computation should be delayed regardless of the given\n" - " bool's value.\n" - "\n" - " See [`guard`](#guard) for more info.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let name = \"Kamaka\"\n" - " let inquiry = fn() { \"How may we address you?\" }\n" - " use <- lazy_guard(when: name == \"\", return: inquiry)\n" - " \"Hello, \" <> name\n" - " // -> \"Hello, Kamaka\"\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - "\n" - " let name = \"\"\n" - " let greeting = fn() { \"Hello, \" <> name }\n" - " use <- lazy_guard(when: name == \"\", otherwise: greeting)\n" - " let number = int.random(99)\n" - " let name = \"User \" <> int.to_string(number)\n" - " \"Welcome, \" <> name\n" - " // -> \"Welcome, User 54\"\n" - " ```\n" -). --spec lazy_guard(boolean(), fun(() -> BTT), fun(() -> BTT)) -> BTT. -lazy_guard(Requirement, Consequence, Alternative) -> - case Requirement of - true -> - Consequence(); - - false -> - Alternative() - end. diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@bytes_tree.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@bytes_tree.erl deleted file mode 100644 index e9c906b..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@bytes_tree.erl +++ /dev/null @@ -1,211 +0,0 @@ --module(gleam@bytes_tree). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/bytes_tree.gleam"). --export([append_tree/2, prepend_tree/2, concat/1, new/0, from_string/1, prepend_string/2, append_string/2, from_string_tree/1, from_bit_array/1, prepend/2, append/2, concat_bit_arrays/1, to_bit_array/1, byte_size/1]). --export_type([bytes_tree/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " `BytesTree` is a type used for efficiently building binary content to be\n" - " written to a file or a socket. Internally it is represented as a tree so to\n" - " append or prepend to a bytes tree is a constant time operation that\n" - " allocates a new node in the tree without copying any of the content. When\n" - " writing to an output stream the tree is traversed and the content is sent\n" - " directly rather than copying it into a single buffer beforehand.\n" - "\n" - " If we append one bit array to another the bit arrays must be copied to a\n" - " new location in memory so that they can sit together. This behaviour\n" - " enables efficient reading of the data but copying can be expensive,\n" - " especially if we want to join many bit arrays together.\n" - "\n" - " BytesTree is different in that it can be joined together in constant\n" - " time using minimal memory, and then can be efficiently converted to a\n" - " bit array using the `to_bit_array` function.\n" - "\n" - " Byte trees are always byte aligned, so that a number of bits that is not\n" - " divisible by 8 will be padded with 0s.\n" - "\n" - " On Erlang this type is compatible with Erlang's iolists.\n" -). - --opaque bytes_tree() :: {bytes, bitstring()} | - {text, gleam@string_tree:string_tree()} | - {many, list(bytes_tree())}. - --file("src/gleam/bytes_tree.gleam", 68). -?DOC( - " Appends a bytes tree onto the end of another.\n" - "\n" - " Runs in constant time.\n" -). --spec append_tree(bytes_tree(), bytes_tree()) -> bytes_tree(). -append_tree(First, Second) -> - gleam_stdlib:iodata_append(First, Second). - --file("src/gleam/bytes_tree.gleam", 59). -?DOC( - " Prepends a bytes tree onto the start of another.\n" - "\n" - " Runs in constant time.\n" -). --spec prepend_tree(bytes_tree(), bytes_tree()) -> bytes_tree(). -prepend_tree(Second, First) -> - gleam_stdlib:iodata_append(First, Second). - --file("src/gleam/bytes_tree.gleam", 98). -?DOC( - " Joins a list of bytes trees into a single one.\n" - "\n" - " Runs in constant time.\n" -). --spec concat(list(bytes_tree())) -> bytes_tree(). -concat(Trees) -> - gleam_stdlib:identity(Trees). - --file("src/gleam/bytes_tree.gleam", 35). -?DOC( - " Create an empty `BytesTree`. Useful as the start of a pipe chaining many\n" - " trees together.\n" -). --spec new() -> bytes_tree(). -new() -> - gleam_stdlib:identity([]). - --file("src/gleam/bytes_tree.gleam", 118). -?DOC( - " Creates a new bytes tree from a string.\n" - "\n" - " Runs in constant time when running on Erlang.\n" - " Runs in linear time otherwise.\n" -). --spec from_string(binary()) -> bytes_tree(). -from_string(String) -> - gleam_stdlib:wrap_list(String). - --file("src/gleam/bytes_tree.gleam", 80). -?DOC( - " Prepends a string onto the start of a bytes tree.\n" - "\n" - " Runs in constant time when running on Erlang.\n" - " Runs in linear time with the length of the string otherwise.\n" -). --spec prepend_string(bytes_tree(), binary()) -> bytes_tree(). -prepend_string(Second, First) -> - gleam_stdlib:iodata_append(gleam_stdlib:wrap_list(First), Second). - --file("src/gleam/bytes_tree.gleam", 89). -?DOC( - " Appends a string onto the end of a bytes tree.\n" - "\n" - " Runs in constant time when running on Erlang.\n" - " Runs in linear time with the length of the string otherwise.\n" -). --spec append_string(bytes_tree(), binary()) -> bytes_tree(). -append_string(First, Second) -> - gleam_stdlib:iodata_append(First, gleam_stdlib:wrap_list(Second)). - --file("src/gleam/bytes_tree.gleam", 128). -?DOC( - " Creates a new bytes tree from a string tree.\n" - "\n" - " Runs in constant time when running on Erlang.\n" - " Runs in linear time otherwise.\n" -). --spec from_string_tree(gleam@string_tree:string_tree()) -> bytes_tree(). -from_string_tree(Tree) -> - gleam_stdlib:wrap_list(Tree). - --file("src/gleam/bytes_tree.gleam", 136). -?DOC( - " Creates a new bytes tree from a bit array.\n" - "\n" - " Runs in constant time.\n" -). --spec from_bit_array(bitstring()) -> bytes_tree(). -from_bit_array(Bits) -> - _pipe = Bits, - _pipe@1 = gleam_stdlib:bit_array_pad_to_bytes(_pipe), - gleam_stdlib:wrap_list(_pipe@1). - --file("src/gleam/bytes_tree.gleam", 43). -?DOC( - " Prepends a bit array to the start of a bytes tree.\n" - "\n" - " Runs in constant time.\n" -). --spec prepend(bytes_tree(), bitstring()) -> bytes_tree(). -prepend(Second, First) -> - gleam_stdlib:iodata_append(from_bit_array(First), Second). - --file("src/gleam/bytes_tree.gleam", 51). -?DOC( - " Appends a bit array to the end of a bytes tree.\n" - "\n" - " Runs in constant time.\n" -). --spec append(bytes_tree(), bitstring()) -> bytes_tree(). -append(First, Second) -> - gleam_stdlib:iodata_append(First, from_bit_array(Second)). - --file("src/gleam/bytes_tree.gleam", 106). -?DOC( - " Joins a list of bit arrays into a single bytes tree.\n" - "\n" - " Runs in constant time.\n" -). --spec concat_bit_arrays(list(bitstring())) -> bytes_tree(). -concat_bit_arrays(Bits) -> - _pipe = Bits, - _pipe@1 = gleam@list:map(_pipe, fun from_bit_array/1), - gleam_stdlib:identity(_pipe@1). - --file("src/gleam/bytes_tree.gleam", 162). --spec to_list(list(list(bytes_tree())), list(bitstring())) -> list(bitstring()). -to_list(Stack, Acc) -> - case Stack of - [] -> - Acc; - - [[] | Remaining_stack] -> - to_list(Remaining_stack, Acc); - - [[{bytes, Bits} | Rest] | Remaining_stack@1] -> - to_list([Rest | Remaining_stack@1], [Bits | Acc]); - - [[{text, Tree} | Rest@1] | Remaining_stack@2] -> - Bits@1 = gleam_stdlib:identity(unicode:characters_to_binary(Tree)), - to_list([Rest@1 | Remaining_stack@2], [Bits@1 | Acc]); - - [[{many, Trees} | Rest@2] | Remaining_stack@3] -> - to_list([Trees, Rest@2 | Remaining_stack@3], Acc) - end. - --file("src/gleam/bytes_tree.gleam", 155). -?DOC( - " Turns a bytes tree into a bit array.\n" - "\n" - " Runs in linear time.\n" - "\n" - " When running on Erlang this function is implemented natively by the\n" - " virtual machine and is highly optimised.\n" -). --spec to_bit_array(bytes_tree()) -> bitstring(). -to_bit_array(Tree) -> - erlang:list_to_bitstring(Tree). - --file("src/gleam/bytes_tree.gleam", 186). -?DOC( - " Returns the size of the bytes tree's content in bytes.\n" - "\n" - " Runs in linear time.\n" -). --spec byte_size(bytes_tree()) -> integer(). -byte_size(Tree) -> - erlang:iolist_size(Tree). diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@dict.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@dict.erl deleted file mode 100644 index c2ae7b6..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@dict.erl +++ /dev/null @@ -1,521 +0,0 @@ --module(gleam@dict). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/dict.gleam"). --export([size/1, is_empty/1, has_key/2, new/0, get/2, insert/3, from_list/1, map_values/2, take/2, delete/2, drop/2, upsert/3, fold/3, to_list/1, keys/1, values/1, filter/2, each/2, combine/3, merge/2, group/2]). --export_type([dict/2, transient_dict/2]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --type dict(JG, JH) :: any() | {gleam_phantom, JG, JH}. - --type transient_dict(JI, JJ) :: any() | {gleam_phantom, JI, JJ}. - --file("src/gleam/dict.gleam", 55). -?DOC( - " Determines the number of key-value pairs in the dict.\n" - " This function runs in constant time and does not need to iterate the dict.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new() |> size\n" - " // -> 0\n" - " ```\n" - "\n" - " ```gleam\n" - " new() |> insert(\"key\", \"value\") |> size\n" - " // -> 1\n" - " ```\n" -). --spec size(dict(any(), any())) -> integer(). -size(Dict) -> - maps:size(Dict). - --file("src/gleam/dict.gleam", 71). -?DOC( - " Determines whether or not the dict is empty.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new() |> is_empty\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " new() |> insert(\"b\", 1) |> is_empty\n" - " // -> False\n" - " ```\n" -). --spec is_empty(dict(any(), any())) -> boolean(). -is_empty(Dict) -> - maps:size(Dict) =:= 0. - --file("src/gleam/dict.gleam", 138). -?DOC( - " Determines whether or not a value is present in the dict for a given key.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new() |> insert(\"a\", 0) |> has_key(\"a\")\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " new() |> insert(\"a\", 0) |> has_key(\"b\")\n" - " // -> False\n" - " ```\n" -). --spec has_key(dict(KV, any()), KV) -> boolean(). -has_key(Dict, Key) -> - maps:is_key(Key, Dict). - --file("src/gleam/dict.gleam", 149). -?DOC(" Creates a fresh dict that contains no values.\n"). --spec new() -> dict(any(), any()). -new() -> - maps:new(). - --file("src/gleam/dict.gleam", 170). -?DOC( - " Fetches a value from a dict for a given key.\n" - "\n" - " The dict may not have a value for the key, so the value is wrapped in a\n" - " `Result`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new() |> insert(\"a\", 0) |> get(\"a\")\n" - " // -> Ok(0)\n" - " ```\n" - "\n" - " ```gleam\n" - " new() |> insert(\"a\", 0) |> get(\"b\")\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec get(dict(LH, LI), LH) -> {ok, LI} | {error, nil}. -get(From, Get) -> - gleam_stdlib:map_get(From, Get). - --file("src/gleam/dict.gleam", 190). -?DOC( - " Inserts a value into the dict with the given key.\n" - "\n" - " If the dict already has a value for the given key then the value is\n" - " replaced with the new value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new() |> insert(\"a\", 0)\n" - " // -> from_list([#(\"a\", 0)])\n" - " ```\n" - "\n" - " ```gleam\n" - " new() |> insert(\"a\", 0) |> insert(\"a\", 5)\n" - " // -> from_list([#(\"a\", 5)])\n" - " ```\n" -). --spec insert(dict(LN, LO), LN, LO) -> dict(LN, LO). -insert(Dict, Key, Value) -> - maps:put(Key, Value, Dict). - --file("src/gleam/dict.gleam", 112). --spec from_list_loop(transient_dict(KO, KP), list({KO, KP})) -> dict(KO, KP). -from_list_loop(Transient, List) -> - case List of - [] -> - gleam_stdlib:identity(Transient); - - [{Key, Value} | Rest] -> - from_list_loop(maps:put(Key, Value, Transient), Rest) - end. - --file("src/gleam/dict.gleam", 108). -?DOC( - " Converts a list of 2-element tuples `#(key, value)` to a dict.\n" - "\n" - " If two tuples have the same key the last one in the list will be the one\n" - " that is present in the dict.\n" -). --spec from_list(list({KJ, KK})) -> dict(KJ, KK). -from_list(List) -> - maps:from_list(List). - --file("src/gleam/dict.gleam", 217). -?DOC( - " Updates all values in a given dict by calling a given function on each key\n" - " and value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([#(3, 3), #(2, 4)])\n" - " |> map_values(fn(key, value) { key * value })\n" - " // -> from_list([#(3, 9), #(2, 8)])\n" - " ```\n" -). --spec map_values(dict(MF, MG), fun((MF, MG) -> MJ)) -> dict(MF, MJ). -map_values(Dict, Fun) -> - maps:map(Fun, Dict). - --file("src/gleam/dict.gleam", 322). --spec do_take_loop(dict(OD, OE), list(OD), transient_dict(OD, OE)) -> dict(OD, OE). -do_take_loop(Dict, Desired_keys, Acc) -> - case Desired_keys of - [] -> - gleam_stdlib:identity(Acc); - - [Key | Rest] -> - case gleam_stdlib:map_get(Dict, Key) of - {ok, Value} -> - do_take_loop(Dict, Rest, maps:put(Key, Value, Acc)); - - {error, _} -> - do_take_loop(Dict, Rest, Acc) - end - end. - --file("src/gleam/dict.gleam", 313). -?DOC( - " Creates a new dict from a given dict, only including any entries for which the\n" - " keys are in a given list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " |> take([\"b\"])\n" - " // -> from_list([#(\"b\", 1)])\n" - " ```\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " |> take([\"a\", \"b\", \"c\"])\n" - " // -> from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " ```\n" -). --spec take(dict(NP, NQ), list(NP)) -> dict(NP, NQ). -take(Dict, Desired_keys) -> - maps:with(Desired_keys, Dict). - --file("src/gleam/dict.gleam", 371). -?DOC( - " Creates a new dict from a given dict with all the same entries except for the\n" - " one with a given key, if it exists.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)]) |> delete(\"a\")\n" - " // -> from_list([#(\"b\", 1)])\n" - " ```\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)]) |> delete(\"c\")\n" - " // -> from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " ```\n" -). --spec delete(dict(OU, OV), OU) -> dict(OU, OV). -delete(Dict, Key) -> - _pipe = gleam_stdlib:identity(Dict), - _pipe@1 = maps:remove(Key, _pipe), - gleam_stdlib:identity(_pipe@1). - --file("src/gleam/dict.gleam", 408). --spec drop_loop(transient_dict(PU, PV), list(PU)) -> dict(PU, PV). -drop_loop(Transient, Disallowed_keys) -> - case Disallowed_keys of - [] -> - gleam_stdlib:identity(Transient); - - [Key | Rest] -> - drop_loop(maps:remove(Key, Transient), Rest) - end. - --file("src/gleam/dict.gleam", 399). -?DOC( - " Creates a new dict from a given dict with all the same entries except any with\n" - " keys found in a given list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)]) |> drop([\"a\"])\n" - " // -> from_list([#(\"b\", 1)])\n" - " ```\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)]) |> drop([\"c\"])\n" - " // -> from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " ```\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)]) |> drop([\"a\", \"b\", \"c\"])\n" - " // -> from_list([])\n" - " ```\n" -). --spec drop(dict(PG, PH), list(PG)) -> dict(PG, PH). -drop(Dict, Disallowed_keys) -> - maps:without(Disallowed_keys, Dict). - --file("src/gleam/dict.gleam", 441). -?DOC( - " Creates a new dict with one entry inserted or updated using a given function.\n" - "\n" - " If there was not an entry in the dict for the given key then the function\n" - " gets `None` as its argument, otherwise it gets `Some(value)`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let dict = from_list([#(\"a\", 0)])\n" - " let increment = fn(x) {\n" - " case x {\n" - " Some(i) -> i + 1\n" - " None -> 0\n" - " }\n" - " }\n" - "\n" - " upsert(dict, \"a\", increment)\n" - " // -> from_list([#(\"a\", 1)])\n" - "\n" - " upsert(dict, \"b\", increment)\n" - " // -> from_list([#(\"a\", 0), #(\"b\", 0)])\n" - " ```\n" -). --spec upsert(dict(QB, QC), QB, fun((gleam@option:option(QC)) -> QC)) -> dict(QB, QC). -upsert(Dict, Key, Fun) -> - case gleam_stdlib:map_get(Dict, Key) of - {ok, Value} -> - insert(Dict, Key, Fun({some, Value})); - - {error, _} -> - insert(Dict, Key, Fun(none)) - end. - --file("src/gleam/dict.gleam", 478). -?DOC( - " Combines all entries into a single value by calling a given function on each\n" - " one.\n" - "\n" - " Dicts are not ordered so the values are not returned in any specific order. Do\n" - " not write code that relies on the order entries are used by this function\n" - " as it may change in later versions of Gleam or Erlang.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let dict = from_list([#(\"a\", 1), #(\"b\", 3), #(\"c\", 9)])\n" - " fold(dict, 0, fn(accumulator, key, value) { accumulator + value })\n" - " // -> 13\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/string\n" - "\n" - " let dict = from_list([#(\"a\", 1), #(\"b\", 3), #(\"c\", 9)])\n" - " fold(dict, \"\", fn(accumulator, key, value) {\n" - " string.append(accumulator, key)\n" - " })\n" - " // -> \"abc\"\n" - " ```\n" -). --spec fold(dict(QI, QJ), QM, fun((QM, QI, QJ) -> QM)) -> QM. -fold(Dict, Initial, Fun) -> - Fun@1 = fun(Key, Value, Acc) -> Fun(Acc, Key, Value) end, - maps:fold(Fun@1, Initial, Dict). - --file("src/gleam/dict.gleam", 98). -?DOC( - " Converts the dict to a list of 2-element tuples `#(key, value)`, one for\n" - " each key-value pair in the dict.\n" - "\n" - " The tuples in the list have no specific order.\n" - "\n" - " ## Examples\n" - "\n" - " Calling `to_list` on an empty `dict` returns an empty list.\n" - "\n" - " ```gleam\n" - " new() |> to_list\n" - " // -> []\n" - " ```\n" - "\n" - " The ordering of elements in the resulting list is an implementation detail\n" - " that should not be relied upon.\n" - "\n" - " ```gleam\n" - " new() |> insert(\"b\", 1) |> insert(\"a\", 0) |> insert(\"c\", 2) |> to_list\n" - " // -> [#(\"a\", 0), #(\"b\", 1), #(\"c\", 2)]\n" - " ```\n" -). --spec to_list(dict(KE, KF)) -> list({KE, KF}). -to_list(Dict) -> - maps:to_list(Dict). - --file("src/gleam/dict.gleam", 238). -?DOC( - " Gets a list of all keys in a given dict.\n" - "\n" - " Dicts are not ordered so the keys are not returned in any specific order. Do\n" - " not write code that relies on the order keys are returned by this function\n" - " as it may change in later versions of Gleam or Erlang.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)]) |> keys\n" - " // -> [\"a\", \"b\"]\n" - " ```\n" -). --spec keys(dict(MT, any())) -> list(MT). -keys(Dict) -> - maps:keys(Dict). - --file("src/gleam/dict.gleam", 256). -?DOC( - " Gets a list of all values in a given dict.\n" - "\n" - " Dicts are not ordered so the values are not returned in any specific order. Do\n" - " not write code that relies on the order values are returned by this function\n" - " as it may change in later versions of Gleam or Erlang.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)]) |> values\n" - " // -> [0, 1]\n" - " ```\n" -). --spec values(dict(any(), MZ)) -> list(MZ). -values(Dict) -> - maps:values(Dict). - --file("src/gleam/dict.gleam", 277). -?DOC( - " Creates a new dict from a given dict, minus any entries that a given function\n" - " returns `False` for.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " |> filter(fn(key, value) { value != 0 })\n" - " // -> from_list([#(\"b\", 1)])\n" - " ```\n" - "\n" - " ```gleam\n" - " from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " |> filter(fn(key, value) { True })\n" - " // -> from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " ```\n" -). --spec filter(dict(ND, NE), fun((ND, NE) -> boolean())) -> dict(ND, NE). -filter(Dict, Predicate) -> - maps:filter(Predicate, Dict). - --file("src/gleam/dict.gleam", 512). -?DOC( - " Calls a function for each key and value in a dict, discarding the return\n" - " value.\n" - "\n" - " Useful for producing a side effect for every item of a dict.\n" - "\n" - " ```gleam\n" - " import gleam/io\n" - "\n" - " let dict = from_list([#(\"a\", \"apple\"), #(\"b\", \"banana\"), #(\"c\", \"cherry\")])\n" - "\n" - " each(dict, fn(k, v) {\n" - " io.println(key <> \" => \" <> value)\n" - " })\n" - " // -> Nil\n" - " // a => apple\n" - " // b => banana\n" - " // c => cherry\n" - " ```\n" - "\n" - " The order of elements in the iteration is an implementation detail that\n" - " should not be relied upon.\n" -). --spec each(dict(QS, QT), fun((QS, QT) -> any())) -> nil. -each(Dict, Fun) -> - fold( - Dict, - nil, - fun(Nil, K, V) -> - Fun(K, V), - Nil - end - ). - --file("src/gleam/dict.gleam", 533). -?DOC( - " Creates a new dict from a pair of given dicts by combining their entries.\n" - "\n" - " If there are entries with the same keys in both dicts the given function is\n" - " used to determine the new value to use in the resulting dict.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let a = from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " let b = from_list([#(\"a\", 2), #(\"c\", 3)])\n" - " combine(a, b, fn(one, other) { one + other })\n" - " // -> from_list([#(\"a\", 2), #(\"b\", 1), #(\"c\", 3)])\n" - " ```\n" -). --spec combine(dict(QX, QY), dict(QX, QY), fun((QY, QY) -> QY)) -> dict(QX, QY). -combine(Dict, Other, Fun) -> - maps:merge_with(fun(_, L, R) -> Fun(L, R) end, Dict, Other). - --file("src/gleam/dict.gleam", 352). -?DOC( - " Creates a new dict from a pair of given dicts by combining their entries.\n" - "\n" - " If there are entries with the same keys in both dicts the entry from the\n" - " second dict takes precedence.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let a = from_list([#(\"a\", 0), #(\"b\", 1)])\n" - " let b = from_list([#(\"b\", 2), #(\"c\", 3)])\n" - " merge(a, b)\n" - " // -> from_list([#(\"a\", 0), #(\"b\", 2), #(\"c\", 3)])\n" - " ```\n" -). --spec merge(dict(OM, ON), dict(OM, ON)) -> dict(OM, ON). -merge(Dict, New_entries) -> - maps:merge(Dict, New_entries). - --file("src/gleam/dict.gleam", 574). --spec group_loop(transient_dict(RZ, list(SA)), fun((SA) -> RZ), list(SA)) -> dict(RZ, list(SA)). -group_loop(Transient, To_key, List) -> - case List of - [] -> - gleam_stdlib:identity(Transient); - - [Value | Rest] -> - Key = To_key(Value), - Update = fun(Existing) -> [Value | Existing] end, - _pipe = Transient, - _pipe@1 = maps:update_with(Key, Update, [Value], _pipe), - group_loop(_pipe@1, To_key, Rest) - end. - --file("src/gleam/dict.gleam", 570). -?DOC(false). --spec group(fun((RT) -> RU), list(RT)) -> dict(RU, list(RT)). -group(Key, List) -> - group_loop(gleam_stdlib:identity(maps:new()), Key, List). diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@dynamic.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@dynamic.erl deleted file mode 100644 index f11e4d2..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@dynamic.erl +++ /dev/null @@ -1,106 +0,0 @@ --module(gleam@dynamic). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/dynamic.gleam"). --export([classify/1, bool/1, string/1, float/1, int/1, bit_array/1, list/1, array/1, properties/1, nil/0]). --export_type([dynamic_/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --type dynamic_() :: any(). - --file("src/gleam/dynamic.gleam", 30). -?DOC( - " Return a string indicating the type of the dynamic value.\n" - "\n" - " This function may be useful for constructing error messages or logs. If you\n" - " want to turn dynamic data into well typed data then you want the\n" - " `gleam/dynamic/decode` module.\n" - "\n" - " ```gleam\n" - " classify(string(\"Hello\"))\n" - " // -> \"String\"\n" - " ```\n" -). --spec classify(dynamic_()) -> binary(). -classify(Data) -> - gleam_stdlib:classify_dynamic(Data). - --file("src/gleam/dynamic.gleam", 36). -?DOC(" Create a dynamic value from a bool.\n"). --spec bool(boolean()) -> dynamic_(). -bool(A) -> - gleam_stdlib:identity(A). - --file("src/gleam/dynamic.gleam", 44). -?DOC( - " Create a dynamic value from a string.\n" - "\n" - " On Erlang this will be a binary string rather than a character list.\n" -). --spec string(binary()) -> dynamic_(). -string(A) -> - gleam_stdlib:identity(A). - --file("src/gleam/dynamic.gleam", 50). -?DOC(" Create a dynamic value from a float.\n"). --spec float(float()) -> dynamic_(). -float(A) -> - gleam_stdlib:identity(A). - --file("src/gleam/dynamic.gleam", 56). -?DOC(" Create a dynamic value from an int.\n"). --spec int(integer()) -> dynamic_(). -int(A) -> - gleam_stdlib:identity(A). - --file("src/gleam/dynamic.gleam", 62). -?DOC(" Create a dynamic value from a bit array.\n"). --spec bit_array(bitstring()) -> dynamic_(). -bit_array(A) -> - gleam_stdlib:identity(A). - --file("src/gleam/dynamic.gleam", 68). -?DOC(" Create a dynamic value from a list.\n"). --spec list(list(dynamic_())) -> dynamic_(). -list(A) -> - gleam_stdlib:identity(A). - --file("src/gleam/dynamic.gleam", 77). -?DOC( - " Create a dynamic value from a list, converting it to a sequential runtime\n" - " format rather than the regular list format.\n" - "\n" - " On Erlang this will be a tuple, on JavaScript this will be an array.\n" -). --spec array(list(dynamic_())) -> dynamic_(). -array(A) -> - erlang:list_to_tuple(A). - --file("src/gleam/dynamic.gleam", 85). -?DOC( - " Create a dynamic value made of an unordered series of keys and values, where\n" - " the keys are unique.\n" - "\n" - " On Erlang this will be a map, on JavaScript this will be a Gleam dict\n" - " object.\n" -). --spec properties(list({dynamic_(), dynamic_()})) -> dynamic_(). -properties(Entries) -> - gleam_stdlib:identity(maps:from_list(Entries)). - --file("src/gleam/dynamic.gleam", 94). -?DOC( - " A dynamic value representing nothing.\n" - "\n" - " On Erlang this will be the atom `nil`, on JavaScript this will be\n" - " `undefined`.\n" -). --spec nil() -> dynamic_(). -nil() -> - gleam_stdlib:identity(nil). diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@dynamic@decode.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@dynamic@decode.erl deleted file mode 100644 index de8e932..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@dynamic@decode.erl +++ /dev/null @@ -1,1112 +0,0 @@ --module(gleam@dynamic@decode). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/dynamic/decode.gleam"). --export([run/2, success/1, decode_dynamic/1, map/2, map_errors/2, then/2, one_of/2, recursive/1, optional/1, decode_error/2, decode_bool/1, decode_int/1, decode_float/1, decode_bit_array/1, collapse_errors/2, failure/2, new_primitive_decoder/2, decode_string/1, dict/2, list/1, subfield/3, at/2, field/3, optional_field/4, optionally_at/3]). --export_type([decode_error/0, decoder/1]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " The `Dynamic` type is used to represent dynamically typed data. That is, data\n" - " that we don't know the precise type of yet, so we need to introspect the data to\n" - " see if it is of the desired type before we can use it. Typically data like this\n" - " would come from user input or from untyped languages such as Erlang or JavaScript.\n" - "\n" - " This module provides the `Decoder` type and associated functions, which provides\n" - " a type-safe and composable way to convert dynamic data into some desired type,\n" - " or into errors if the data doesn't have the desired structure.\n" - "\n" - " The `Decoder` type is generic and has 1 type parameter, which is the type that\n" - " it attempts to decode. A `Decoder(String)` can be used to decode strings, and a\n" - " `Decoder(Option(Int))` can be used to decode `Option(Int)`s\n" - "\n" - " Decoders work using _runtime reflection_ and the data structures of the target\n" - " platform. Differences between Erlang and JavaScript data structures may impact\n" - " your decoders, so it is important to test your decoders on all supported\n" - " platforms.\n" - "\n" - " The decoding technique used by this module was inspired by Juraj Petráš'\n" - " [Toy](https://github.com/Hackder/toy), Go's `encoding/json`, and Elm's\n" - " `Json.Decode`. Thank you to them!\n" - "\n" - " # Examples\n" - "\n" - " Dynamic data may come from various sources and so many different syntaxes could\n" - " be used to describe or construct them. In these examples a pseudocode\n" - " syntax is used to describe the data.\n" - "\n" - " ## Simple types\n" - "\n" - " This module defines decoders for simple data types such as [`string`](#string),\n" - " [`int`](#int), [`float`](#float), [`bit_array`](#bit_array), and [`bool`](#bool).\n" - "\n" - " ```gleam\n" - " // Data:\n" - " // \"Hello, Joe!\"\n" - "\n" - " let result = decode.run(data, decode.string)\n" - " assert result == Ok(\"Hello, Joe!\")\n" - " ```\n" - "\n" - " ## Lists\n" - "\n" - " The [`list`](#list) decoder decodes `List`s. To use it you must construct it by\n" - " passing in another decoder into the `list` function, which is the decoder that\n" - " is to be used for the elements of the list, type checking both the list and its\n" - " elements.\n" - "\n" - " ```gleam\n" - " // Data:\n" - " // [1, 2, 3, 4]\n" - "\n" - " let result = decode.run(data, decode.list(decode.int))\n" - " assert result == Ok([1, 2, 3, 4])\n" - " ```\n" - "\n" - " On Erlang this decoder can decode from lists, and on JavaScript it can\n" - " decode from lists as well as JavaScript arrays.\n" - "\n" - " ## Options\n" - "\n" - " The [`optional`](#optional) decoder is used to decode values that may or may not\n" - " be present. In other environments these might be called \"nullable\" values.\n" - "\n" - " Like the `list` decoder, the `optional` decoder takes another decoder,\n" - " which is used to decode the value if it is present.\n" - "\n" - " ```gleam\n" - " // Data:\n" - " // 12.45\n" - "\n" - " let result = decode.run(data, decode.optional(decode.float))\n" - " assert result == Ok(option.Some(12.45))\n" - " ```\n" - " ```gleam\n" - " // Data:\n" - " // null\n" - "\n" - " let result = decode.run(data, decode.optional(decode.int))\n" - " assert result == Ok(option.None)\n" - " ```\n" - "\n" - " This decoder knows how to handle multiple different runtime representations of\n" - " absent values, including `Nil`, `None`, `null`, and `undefined`.\n" - "\n" - " ## Dicts\n" - "\n" - " The [`dict`](#dict) decoder decodes `Dicts` and contains two other decoders, one\n" - " for the keys, one for the values.\n" - "\n" - " ```gleam\n" - " // Data:\n" - " // { \"Lucy\" -> 10, \"Nubi\" -> 20 }\n" - "\n" - " let result = decode.run(data, decode.dict(decode.string, decode.int))\n" - " assert result == Ok(dict.from_list([\n" - " #(\"Lucy\", 10),\n" - " #(\"Nubi\", 20),\n" - " ]))\n" - " ```\n" - "\n" - " ## Indexing objects\n" - "\n" - " The [`at`](#at) decoder can be used to decode a value that is nested within\n" - " key-value containers such as Gleam dicts, Erlang maps, or JavaScript objects.\n" - "\n" - " ```gleam\n" - " // Data:\n" - " // { \"one\" -> { \"two\" -> 123 } }\n" - "\n" - " let result = decode.run(data, decode.at([\"one\", \"two\"], decode.int))\n" - " assert result == Ok(123)\n" - " ```\n" - "\n" - " ## Indexing arrays\n" - "\n" - " If you use ints as keys then the [`at`](#at) decoder can be used to index into\n" - " array-like containers such as Gleam or Erlang tuples, or JavaScript arrays.\n" - "\n" - " ```gleam\n" - " // Data:\n" - " // [\"one\", \"two\", \"three\"]\n" - "\n" - " let result = decode.run(data, decode.at([1], decode.string))\n" - " assert result == Ok(\"two\")\n" - " ```\n" - "\n" - " ## Records\n" - "\n" - " Decoding records from dynamic data is more complex and requires combining a\n" - " decoder for each field and a special constructor that builds your records with\n" - " the decoded field values.\n" - "\n" - " ```gleam\n" - " // Data:\n" - " // {\n" - " // \"score\" -> 180,\n" - " // \"name\" -> \"Mel Smith\",\n" - " // \"is-admin\" -> false,\n" - " // \"enrolled\" -> true,\n" - " // \"colour\" -> \"Red\",\n" - " // }\n" - "\n" - " let decoder = {\n" - " use name <- decode.field(\"name\", decode.string)\n" - " use score <- decode.field(\"score\", decode.int)\n" - " use colour <- decode.field(\"colour\", decode.string)\n" - " use enrolled <- decode.field(\"enrolled\", decode.bool)\n" - " decode.success(Player(name:, score:, colour:, enrolled:))\n" - " }\n" - "\n" - " let result = decode.run(data, decoder)\n" - " assert result == Ok(Player(\"Mel Smith\", 180, \"Red\", True))\n" - " ```\n" - "\n" - " ## Enum variants\n" - "\n" - " Imagine you have a custom type where all the variants do not contain any values.\n" - "\n" - " ```gleam\n" - " pub type PocketMonsterType {\n" - " Fire\n" - " Water\n" - " Grass\n" - " Electric\n" - " }\n" - " ```\n" - "\n" - " You might choose to encode these variants as strings, `\"fire\"` for `Fire`,\n" - " `\"water\"` for `Water`, and so on. To decode them you'll need to decode the dynamic\n" - " data as a string, but then you'll need to decode it further still as not all\n" - " strings are valid values for the enum. This can be done with the `then`\n" - " function, which enables running a second decoder after the first one\n" - " succeeds.\n" - "\n" - " ```gleam\n" - " let decoder = {\n" - " use decoded_string <- decode.then(decode.string)\n" - " case decoded_string {\n" - " // Return succeeding decoders for valid strings\n" - " \"fire\" -> decode.success(Fire)\n" - " \"water\" -> decode.success(Water)\n" - " \"grass\" -> decode.success(Grass)\n" - " \"electric\" -> decode.success(Electric)\n" - " // Return a failing decoder for any other strings\n" - " _ -> decode.failure(Fire, expected: \"PocketMonsterType\")\n" - " }\n" - " }\n" - "\n" - " let result = decode.run(dynamic.string(\"water\"), decoder)\n" - " assert result == Ok(Water)\n" - "\n" - " let result = decode.run(dynamic.string(\"wobble\"), decoder)\n" - " assert result == Error([DecodeError(\"PocketMonsterType\", \"String\", [])])\n" - " ```\n" - "\n" - " ## Record variants\n" - "\n" - " Decoding type variants that contain other values is done by combining the\n" - " techniques from the \"enum variants\" and \"records\" examples. Imagine you have\n" - " this custom type that you want to decode:\n" - "\n" - " ```gleam\n" - " pub type PocketMonsterPerson {\n" - " Trainer(name: String, badge_count: Int)\n" - " GymLeader(name: String, speciality: PocketMonsterType)\n" - " }\n" - " ```\n" - " And you would like to be able to decode these from dynamic data like this:\n" - " ```erlang\n" - " {\n" - " \"type\" -> \"trainer\",\n" - " \"name\" -> \"Ash\",\n" - " \"badge-count\" -> 1,\n" - " }\n" - " ```\n" - " ```erlang\n" - " {\n" - " \"type\" -> \"gym-leader\",\n" - " \"name\" -> \"Misty\",\n" - " \"speciality\" -> \"water\",\n" - " }\n" - " ```\n" - "\n" - " Notice how both documents have a `\"type\"` field, which is used to indicate which\n" - " variant the data is for.\n" - "\n" - " First, define decoders for each of the variants:\n" - "\n" - " ```gleam\n" - " let trainer_decoder = {\n" - " use name <- decode.field(\"name\", decode.string)\n" - " use badge_count <- decode.field(\"badge-count\", decode.int)\n" - " decode.success(Trainer(name, badge_count))\n" - " }\n" - "\n" - " let gym_leader_decoder = {\n" - " use name <- decode.field(\"name\", decode.string)\n" - " use speciality <- decode.field(\"speciality\", pocket_monster_type_decoder)\n" - " decode.success(GymLeader(name, speciality))\n" - " }\n" - " ```\n" - "\n" - " A third decoder can be used to extract and decode the `\"type\"` field, and the\n" - " expression can evaluate to whichever decoder is suitable for the document.\n" - "\n" - " ```gleam\n" - " // Data:\n" - " // {\n" - " // \"type\" -> \"gym-leader\",\n" - " // \"name\" -> \"Misty\",\n" - " // \"speciality\" -> \"water\",\n" - " // }\n" - "\n" - " let decoder = {\n" - " use tag <- decode.field(\"type\", decode.string)\n" - " case tag {\n" - " \"gym-leader\" -> gym_leader_decoder\n" - " _ -> trainer_decoder\n" - " }\n" - " }\n" - "\n" - " let result = decode.run(data, decoder)\n" - " assert result == Ok(GymLeader(\"Misty\", Water))\n" - " ```\n" -). - --type decode_error() :: {decode_error, binary(), binary(), list(binary())}. - --opaque decoder(BVQ) :: {decoder, - fun((gleam@dynamic:dynamic_()) -> {BVQ, list(decode_error())})}. - --file("src/gleam/dynamic/decode.gleam", 356). -?DOC( - " Run a decoder on a `Dynamic` value, decoding the value if it is of the\n" - " desired type, or returning errors.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let decoder = {\n" - " use name <- decode.field(\"name\", decode.string)\n" - " use email <- decode.field(\"email\", decode.string)\n" - " decode.success(SignUp(name: name, email: email))\n" - " }\n" - "\n" - " decode.run(data, decoder)\n" - " ```\n" -). --spec run(gleam@dynamic:dynamic_(), decoder(BVY)) -> {ok, BVY} | - {error, list(decode_error())}. -run(Data, Decoder) -> - {Maybe_invalid_data, Errors} = (erlang:element(2, Decoder))(Data), - case Errors of - [] -> - {ok, Maybe_invalid_data}; - - [_ | _] -> - {error, Errors} - end. - --file("src/gleam/dynamic/decode.gleam", 478). -?DOC( - " Finalise a decoder having successfully extracted a value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let data = dynamic.properties([\n" - " #(dynamic.string(\"email\"), dynamic.string(\"lucy@example.com\")),\n" - " #(dynamic.string(\"name\"), dynamic.string(\"Lucy\")),\n" - " ])\n" - "\n" - " let decoder = {\n" - " use name <- decode.field(\"name\", string)\n" - " use email <- decode.field(\"email\", string)\n" - " decode.success(SignUp(name: name, email: email))\n" - " }\n" - "\n" - " let result = decode.run(data, decoder)\n" - " assert result == Ok(SignUp(name: \"Lucy\", email: \"lucy@example.com\"))\n" - " ```\n" -). --spec success(BWZ) -> decoder(BWZ). -success(Data) -> - {decoder, fun(_) -> {Data, []} end}. - --file("src/gleam/dynamic/decode.gleam", 732). --spec decode_dynamic(gleam@dynamic:dynamic_()) -> {gleam@dynamic:dynamic_(), - list(decode_error())}. -decode_dynamic(Data) -> - {Data, []}. - --file("src/gleam/dynamic/decode.gleam", 889). -?DOC( - " Apply a transformation function to any value decoded by the decoder.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let decoder = decode.int |> decode.map(int.to_string)\n" - " let result = decode.run(dynamic.int(1000), decoder)\n" - " assert result == Ok(\"1000\")\n" - " ```\n" -). --spec map(decoder(BZW), fun((BZW) -> BZY)) -> decoder(BZY). -map(Decoder, Transformer) -> - {decoder, - fun(D) -> - {Data, Errors} = (erlang:element(2, Decoder))(D), - {Transformer(Data), Errors} - end}. - --file("src/gleam/dynamic/decode.gleam", 898). -?DOC(" Apply a transformation function to any errors returned by the decoder.\n"). --spec map_errors( - decoder(CAA), - fun((list(decode_error())) -> list(decode_error())) -) -> decoder(CAA). -map_errors(Decoder, Transformer) -> - {decoder, - fun(D) -> - {Data, Errors} = (erlang:element(2, Decoder))(D), - {Data, Transformer(Errors)} - end}. - --file("src/gleam/dynamic/decode.gleam", 936). -?DOC( - " Create a new decoder based upon the value of a previous decoder.\n" - "\n" - " This may be useful to run one previous decoder to use in further decoding.\n" -). --spec then(decoder(CAI), fun((CAI) -> decoder(CAK))) -> decoder(CAK). -then(Decoder, Next) -> - {decoder, - fun(Dynamic_data) -> - {Data, Errors} = (erlang:element(2, Decoder))(Dynamic_data), - Decoder@1 = Next(Data), - {Data@1, _} = Layer = (erlang:element(2, Decoder@1))(Dynamic_data), - case Errors of - [] -> - Layer; - - [_ | _] -> - {Data@1, Errors} - end - end}. - --file("src/gleam/dynamic/decode.gleam", 979). --spec run_decoders( - gleam@dynamic:dynamic_(), - {CAS, list(decode_error())}, - list(decoder(CAS)) -) -> {CAS, list(decode_error())}. -run_decoders(Data, Failure, Decoders) -> - case Decoders of - [] -> - Failure; - - [Decoder | Decoders@1] -> - {_, Errors} = Layer = (erlang:element(2, Decoder))(Data), - case Errors of - [] -> - Layer; - - [_ | _] -> - run_decoders(Data, Failure, Decoders@1) - end - end. - --file("src/gleam/dynamic/decode.gleam", 966). -?DOC( - " Create a new decoder from several other decoders. Each of the inner\n" - " decoders is run in turn, and the value from the first to succeed is used.\n" - "\n" - " If no decoder succeeds then the errors from the first decoder are used.\n" - " If you wish for different errors then you may wish to use the\n" - " `collapse_errors` or `map_errors` functions.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let decoder = decode.one_of(decode.string, or: [\n" - " decode.int |> decode.map(int.to_string),\n" - " decode.float |> decode.map(float.to_string),\n" - " ])\n" - " decode.run(dynamic.int(1000), decoder)\n" - " // -> Ok(\"1000\")\n" - " ```\n" -). --spec one_of(decoder(CAN), list(decoder(CAN))) -> decoder(CAN). -one_of(First, Alternatives) -> - {decoder, - fun(Dynamic_data) -> - {_, Errors} = Layer = (erlang:element(2, First))(Dynamic_data), - case Errors of - [] -> - Layer; - - [_ | _] -> - run_decoders(Dynamic_data, Layer, Alternatives) - end - end}. - --file("src/gleam/dynamic/decode.gleam", 1090). -?DOC( - " Create a decoder that can refer to itself, useful for decoding deeply\n" - " nested data.\n" - "\n" - " Attempting to create a recursive decoder without this function could result\n" - " in an infinite loop. If you are using `field` or other `use`able functions\n" - " then you may not need to use this function.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " type Nested {\n" - " Nested(List(Nested))\n" - " Value(String)\n" - " }\n" - "\n" - " fn nested_decoder() -> decode.Decoder(Nested) {\n" - " use <- decode.recursive\n" - " decode.one_of(decode.string |> decode.map(Value), [\n" - " decode.list(nested_decoder()) |> decode.map(Nested),\n" - " ])\n" - " }\n" - " ```\n" -). --spec recursive(fun(() -> decoder(CBD))) -> decoder(CBD). -recursive(Inner) -> - {decoder, - fun(Data) -> - Decoder = Inner(), - (erlang:element(2, Decoder))(Data) - end}. - --file("src/gleam/dynamic/decode.gleam", 867). -?DOC( - " A decoder that decodes nullable values of a type decoded by with a given\n" - " decoder.\n" - "\n" - " This function can handle common representations of null on all runtimes, such as\n" - " `nil`, `null`, and `undefined` on Erlang, and `undefined` and `null` on\n" - " JavaScript.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let result = decode.run(dynamic.int(100), decode.optional(decode.int))\n" - " assert result == Ok(option.Some(100))\n" - " ```\n" - "\n" - " ```gleam\n" - " let result = decode.run(dynamic.nil(), decode.optional(decode.int))\n" - " assert result == Ok(option.None)\n" - " ```\n" -). --spec optional(decoder(BZS)) -> decoder(gleam@option:option(BZS)). -optional(Inner) -> - {decoder, fun(Data) -> case gleam_stdlib:is_null(Data) of - true -> - {none, []}; - - false -> - {Data@1, Errors} = (erlang:element(2, Inner))(Data), - {{some, Data@1}, Errors} - end end}. - --file("src/gleam/dynamic/decode.gleam", 484). -?DOC(" Construct a decode error for some unexpected dynamic data.\n"). --spec decode_error(binary(), gleam@dynamic:dynamic_()) -> list(decode_error()). -decode_error(Expected, Found) -> - [{decode_error, Expected, gleam_stdlib:classify_dynamic(Found), []}]. - --file("src/gleam/dynamic/decode.gleam", 607). --spec run_dynamic_function( - gleam@dynamic:dynamic_(), - binary(), - fun((gleam@dynamic:dynamic_()) -> {ok, BXT} | {error, BXT}) -) -> {BXT, list(decode_error())}. -run_dynamic_function(Data, Name, F) -> - case F(Data) of - {ok, Data@1} -> - {Data@1, []}; - - {error, Placeholder} -> - {Placeholder, - [{decode_error, Name, gleam_stdlib:classify_dynamic(Data), []}]} - end. - --file("src/gleam/dynamic/decode.gleam", 658). --spec decode_bool(gleam@dynamic:dynamic_()) -> {boolean(), list(decode_error())}. -decode_bool(Data) -> - case gleam_stdlib:identity(true) =:= Data of - true -> - {true, []}; - - false -> - case gleam_stdlib:identity(false) =:= Data of - true -> - {false, []}; - - false -> - {false, decode_error(<<"Bool"/utf8>>, Data)} - end - end. - --file("src/gleam/dynamic/decode.gleam", 687). --spec decode_int(gleam@dynamic:dynamic_()) -> {integer(), list(decode_error())}. -decode_int(Data) -> - run_dynamic_function(Data, <<"Int"/utf8>>, fun gleam_stdlib:int/1). - --file("src/gleam/dynamic/decode.gleam", 713). --spec decode_float(gleam@dynamic:dynamic_()) -> {float(), list(decode_error())}. -decode_float(Data) -> - run_dynamic_function(Data, <<"Float"/utf8>>, fun gleam_stdlib:float/1). - --file("src/gleam/dynamic/decode.gleam", 747). --spec decode_bit_array(gleam@dynamic:dynamic_()) -> {bitstring(), - list(decode_error())}. -decode_bit_array(Data) -> - run_dynamic_function( - Data, - <<"BitArray"/utf8>>, - fun gleam_stdlib:bit_array/1 - ). - --file("src/gleam/dynamic/decode.gleam", 922). -?DOC( - " Replace all errors produced by a decoder with one single error for a named\n" - " expected type.\n" - "\n" - " This function may be useful if you wish to simplify errors before\n" - " presenting them to a user, particularly when using the `one_of` function.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let decoder = decode.string |> decode.collapse_errors(\"MyThing\")\n" - " let result = decode.run(dynamic.int(1000), decoder)\n" - " assert result == Error([DecodeError(\"MyThing\", \"Int\", [])])\n" - " ```\n" -). --spec collapse_errors(decoder(CAF), binary()) -> decoder(CAF). -collapse_errors(Decoder, Name) -> - {decoder, - fun(Dynamic_data) -> - {Data, Errors} = Layer = (erlang:element(2, Decoder))(Dynamic_data), - case Errors of - [] -> - Layer; - - [_ | _] -> - {Data, decode_error(Name, Dynamic_data)} - end - end}. - --file("src/gleam/dynamic/decode.gleam", 1012). -?DOC( - " Define a decoder that always fails.\n" - "\n" - " The first parameter is a \"placeholder\" value, which is some default value that the\n" - " decoder uses internally in place of the value that would have been produced\n" - " if the decoder was successful. It doesn't matter what this value is, it is\n" - " never returned by the decoder or shown to the user, so pick some arbitrary\n" - " value. If it is an int you might pick `0`, if it is a list you might pick\n" - " `[]`.\n" - "\n" - " The second parameter is the name of the type that has failed to decode.\n" - "\n" - " ```gleam\n" - " decode.failure(User(name: \"\", score: 0, tags: []), expected: \"User\")\n" - " ```\n" -). --spec failure(CAX, binary()) -> decoder(CAX). -failure(Placeholder, Name) -> - {decoder, fun(D) -> {Placeholder, decode_error(Name, D)} end}. - --file("src/gleam/dynamic/decode.gleam", 1053). -?DOC( - " Create a decoder for a new data type from a decoding function.\n" - "\n" - " This function is used for new primitive types. For example, you might\n" - " define a decoder for Erlang's pid type.\n" - "\n" - " A default \"placeholder\" value is also required to make a decoder. When this\n" - " decoder is used as part of a larger decoder this placeholder value is used\n" - " so that the rest of the decoder can continue to run and\n" - " collect all decoding errors. It doesn't matter what this value is, it is\n" - " never returned by the decoder or shown to the user, so pick some arbitrary\n" - " value. If it is an int you might pick `0`, if it is a list you might pick\n" - " `[]`.\n" - "\n" - " If you were to make a decoder for the `Int` type (rather than using the\n" - " build-in `Int` decoder) you would define it like so:\n" - "\n" - " ```gleam\n" - " pub fn int_decoder() -> decode.Decoder(Int) {\n" - " let default = \"\"\n" - " decode.new_primitive_decoder(\"Int\", int_from_dynamic)\n" - " }\n" - "\n" - " @external(erlang, \"my_module\", \"int_from_dynamic\")\n" - " fn int_from_dynamic(data: Int) -> Result(Int, Int)\n" - " ```\n" - "\n" - " ```erlang\n" - " -module(my_module).\n" - " -export([int_from_dynamic/1]).\n" - "\n" - " int_from_dynamic(Data) ->\n" - " case is_integer(Data) of\n" - " true -> {ok, Data};\n" - " false -> {error, 0}\n" - " end.\n" - " ```\n" -). --spec new_primitive_decoder( - binary(), - fun((gleam@dynamic:dynamic_()) -> {ok, CAZ} | {error, CAZ}) -) -> decoder(CAZ). -new_primitive_decoder(Name, Decoding_function) -> - {decoder, fun(D) -> case Decoding_function(D) of - {ok, T} -> - {T, []}; - - {error, Placeholder} -> - {Placeholder, - [{decode_error, - Name, - gleam_stdlib:classify_dynamic(D), - []}]} - end end}. - --file("src/gleam/dynamic/decode.gleam", 636). --spec dynamic_string(gleam@dynamic:dynamic_()) -> {ok, binary()} | - {error, binary()}. -dynamic_string(Data) -> - case gleam_stdlib:bit_array(Data) of - {ok, Data@1} -> - case gleam@bit_array:to_string(Data@1) of - {ok, String} -> - {ok, String}; - - {error, _} -> - {error, <<""/utf8>>} - end; - - {error, _} -> - {error, <<""/utf8>>} - end. - --file("src/gleam/dynamic/decode.gleam", 631). --spec decode_string(gleam@dynamic:dynamic_()) -> {binary(), - list(decode_error())}. -decode_string(Data) -> - run_dynamic_function(Data, <<"String"/utf8>>, fun dynamic_string/1). - --file("src/gleam/dynamic/decode.gleam", 821). --spec fold_dict( - {gleam@dict:dict(BZE, BZF), list(decode_error())}, - gleam@dynamic:dynamic_(), - gleam@dynamic:dynamic_(), - fun((gleam@dynamic:dynamic_()) -> {BZE, list(decode_error())}), - fun((gleam@dynamic:dynamic_()) -> {BZF, list(decode_error())}) -) -> {gleam@dict:dict(BZE, BZF), list(decode_error())}. -fold_dict(Acc, Key, Value, Key_decoder, Value_decoder) -> - case Key_decoder(Key) of - {Key@1, []} -> - case Value_decoder(Value) of - {Value@1, []} -> - Dict = gleam@dict:insert( - erlang:element(1, Acc), - Key@1, - Value@1 - ), - {Dict, erlang:element(2, Acc)}; - - {_, Errors} -> - push_path({maps:new(), Errors}, [<<"values"/utf8>>]) - end; - - {_, Errors@1} -> - push_path({maps:new(), Errors@1}, [<<"keys"/utf8>>]) - end. - --file("src/gleam/dynamic/decode.gleam", 801). -?DOC( - " A decoder that decodes dicts where all keys and values are decoded with\n" - " given decoders.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let values = dynamic.properties([\n" - " #(dynamic.string(\"one\"), dynamic.int(1)),\n" - " #(dynamic.string(\"two\"), dynamic.int(2)),\n" - " ])\n" - "\n" - " let result =\n" - " decode.run(values, decode.dict(decode.string, decode.int))\n" - " assert result == Ok(values)\n" - " ```\n" -). --spec dict(decoder(BYX), decoder(BYZ)) -> decoder(gleam@dict:dict(BYX, BYZ)). -dict(Key, Value) -> - {decoder, fun(Data) -> case gleam_stdlib:dict(Data) of - {error, _} -> - {maps:new(), decode_error(<<"Dict"/utf8>>, Data)}; - - {ok, Dict} -> - gleam@dict:fold( - Dict, - {maps:new(), []}, - fun(A, K, V) -> case erlang:element(2, A) of - [] -> - fold_dict( - A, - K, - V, - erlang:element(2, Key), - erlang:element(2, Value) - ); - - [_ | _] -> - A - end end - ) - end end}. - --file("src/gleam/dynamic/decode.gleam", 769). -?DOC( - " A decoder that decodes lists where all elements are decoded with a given\n" - " decoder.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let result =\n" - " [1, 2, 3]\n" - " |> list.map(dynamic.int)\n" - " |> dynamic.list\n" - " |> decode.run(decode.list(of: decode.int))\n" - " assert result == Ok([1, 2, 3])\n" - " ```\n" -). --spec list(decoder(BYL)) -> decoder(list(BYL)). -list(Inner) -> - {decoder, - fun(Data) -> - gleam_stdlib:list( - Data, - erlang:element(2, Inner), - fun(P, K) -> push_path(P, [K]) end, - 0, - [] - ) - end}. - --file("src/gleam/dynamic/decode.gleam", 438). --spec push_path({BWU, list(decode_error())}, list(any())) -> {BWU, - list(decode_error())}. -push_path(Layer, Path) -> - Decoder = one_of( - {decoder, fun decode_string/1}, - [begin - _pipe = {decoder, fun decode_int/1}, - map(_pipe, fun erlang:integer_to_binary/1) - end] - ), - Path@1 = gleam@list:map( - Path, - fun(Key) -> - Key@1 = gleam_stdlib:identity(Key), - case run(Key@1, Decoder) of - {ok, Key@2} -> - Key@2; - - {error, _} -> - <<<<"<"/utf8, - (gleam_stdlib:classify_dynamic(Key@1))/binary>>/binary, - ">"/utf8>> - end - end - ), - Errors = gleam@list:map( - erlang:element(2, Layer), - fun(Error) -> - {decode_error, - erlang:element(2, Error), - erlang:element(3, Error), - lists:append(Path@1, erlang:element(4, Error))} - end - ), - {erlang:element(1, Layer), Errors}. - --file("src/gleam/dynamic/decode.gleam", 402). --spec index( - list(BWI), - list(BWI), - fun((gleam@dynamic:dynamic_()) -> {BWL, list(decode_error())}), - gleam@dynamic:dynamic_(), - fun((gleam@dynamic:dynamic_(), list(BWI)) -> {BWL, list(decode_error())}) -) -> {BWL, list(decode_error())}. -index(Path, Position, Inner, Data, Handle_miss) -> - case Path of - [] -> - _pipe = Data, - _pipe@1 = Inner(_pipe), - push_path(_pipe@1, lists:reverse(Position)); - - [Key | Path@1] -> - case gleam_stdlib:index(Data, Key) of - {ok, {some, Data@1}} -> - index(Path@1, [Key | Position], Inner, Data@1, Handle_miss); - - {ok, none} -> - Handle_miss(Data, [Key | Position]); - - {error, Kind} -> - {Default, _} = Inner(Data), - _pipe@2 = {Default, - [{decode_error, - Kind, - gleam_stdlib:classify_dynamic(Data), - []}]}, - push_path(_pipe@2, lists:reverse(Position)) - end - end. - --file("src/gleam/dynamic/decode.gleam", 324). -?DOC( - " The same as [`field`](#field), except taking a path to the value rather\n" - " than a field name.\n" - "\n" - " This function will index into dictionaries with any key type, and if the key is\n" - " an int then it'll also index into Erlang tuples and JavaScript arrays, and\n" - " the first eight elements of Gleam lists.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let data = dynamic.properties([\n" - " #(dynamic.string(\"data\"), dynamic.properties([\n" - " #(dynamic.string(\"email\"), dynamic.string(\"lucy@example.com\")),\n" - " #(dynamic.string(\"name\"), dynamic.string(\"Lucy\")),\n" - " ])\n" - " ])\n" - "\n" - " let decoder = {\n" - " use name <- decode.subfield([\"data\", \"name\"], decode.string)\n" - " use email <- decode.subfield([\"data\", \"email\"], decode.string)\n" - " decode.success(SignUp(name: name, email: email))\n" - " }\n" - " let result = decode.run(data, decoder)\n" - " assert result == Ok(SignUp(name: \"Lucy\", email: \"lucy@example.com\"))\n" - " ```\n" -). --spec subfield(list(any()), decoder(BVT), fun((BVT) -> decoder(BVV))) -> decoder(BVV). -subfield(Field_path, Field_decoder, Next) -> - {decoder, - fun(Data) -> - {Out, Errors1} = index( - Field_path, - [], - erlang:element(2, Field_decoder), - Data, - fun(Data@1, Position) -> - {Default, _} = (erlang:element(2, Field_decoder))(Data@1), - _pipe = {Default, - [{decode_error, - <<"Field"/utf8>>, - <<"Nothing"/utf8>>, - []}]}, - push_path(_pipe, lists:reverse(Position)) - end - ), - {Out@1, Errors2} = (erlang:element(2, Next(Out)))(Data), - {Out@1, lists:append(Errors1, Errors2)} - end}. - --file("src/gleam/dynamic/decode.gleam", 392). -?DOC( - " A decoder that decodes a value that is nested within other values. For\n" - " example, decoding a value that is within some deeply nested JSON objects.\n" - "\n" - " This function will index into dictionaries with any key type, and if the key is\n" - " an int then it'll also index into Erlang tuples and JavaScript arrays, and\n" - " the first eight elements of Gleam lists.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let decoder = decode.at([\"one\", \"two\"], decode.int)\n" - "\n" - " let data = dynamic.properties([\n" - " #(dynamic.string(\"one\"), dynamic.properties([\n" - " #(dynamic.string(\"two\"), dynamic.int(1000)),\n" - " ]),\n" - " ])\n" - "\n" - " decode.run(data, decoder)\n" - " // -> Ok(1000)\n" - " ```\n" - "\n" - " ```gleam\n" - " dynamic.nil()\n" - " |> decode.run(decode.optional(decode.int))\n" - " // -> Ok(option.None)\n" - " ```\n" -). --spec at(list(any()), decoder(BWF)) -> decoder(BWF). -at(Path, Inner) -> - {decoder, - fun(Data) -> - index( - Path, - [], - erlang:element(2, Inner), - Data, - fun(Data@1, Position) -> - {Default, _} = (erlang:element(2, Inner))(Data@1), - _pipe = {Default, - [{decode_error, - <<"Field"/utf8>>, - <<"Nothing"/utf8>>, - []}]}, - push_path(_pipe, lists:reverse(Position)) - end - ) - end}. - --file("src/gleam/dynamic/decode.gleam", 523). -?DOC( - " Run a decoder on a field of a `Dynamic` value, decoding the value if it is\n" - " of the desired type, or returning errors. An error is returned if there is\n" - " no field for the specified key.\n" - "\n" - " This function will index into dictionaries with any key type, and if the key is\n" - " an int then it'll also index into Erlang tuples and JavaScript arrays, and\n" - " the first eight elements of Gleam lists.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let data = dynamic.properties([\n" - " #(dynamic.string(\"email\"), dynamic.string(\"lucy@example.com\")),\n" - " #(dynamic.string(\"name\"), dynamic.string(\"Lucy\")),\n" - " ])\n" - "\n" - " let decoder = {\n" - " use name <- decode.field(\"name\", string)\n" - " use email <- decode.field(\"email\", string)\n" - " decode.success(SignUp(name: name, email: email))\n" - " }\n" - "\n" - " let result = decode.run(data, decoder)\n" - " assert result == Ok(SignUp(name: \"Lucy\", email: \"lucy@example.com\"))\n" - " ```\n" - "\n" - " If you wish to decode a value that is more deeply nested within the dynamic\n" - " data, see [`subfield`](#subfield) and [`at`](#at).\n" - "\n" - " If you wish to return a default in the event that a field is not present,\n" - " see [`optional_field`](#optional_field) and / [`optionally_at`](#optionally_at).\n" -). --spec field(any(), decoder(BXD), fun((BXD) -> decoder(BXF))) -> decoder(BXF). -field(Field_name, Field_decoder, Next) -> - subfield([Field_name], Field_decoder, Next). - --file("src/gleam/dynamic/decode.gleam", 556). -?DOC( - " Run a decoder on a field of a `Dynamic` value, decoding the value if it is\n" - " of the desired type, or returning errors. The given default value is\n" - " returned if there is no field for the specified key.\n" - "\n" - " This function will index into dictionaries with any key type, and if the key is\n" - " an int then it'll also index into Erlang tuples and JavaScript arrays, and\n" - " the first eight elements of Gleam lists.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let data = dynamic.properties([\n" - " #(dynamic.string(\"name\"), dynamic.string(\"Lucy\")),\n" - " ])\n" - "\n" - " let decoder = {\n" - " use name <- decode.field(\"name\", string)\n" - " use email <- decode.optional_field(\"email\", \"n/a\", string)\n" - " decode.success(SignUp(name: name, email: email))\n" - " }\n" - "\n" - " let result = decode.run(data, decoder)\n" - " assert result == Ok(SignUp(name: \"Lucy\", email: \"n/a\"))\n" - " ```\n" -). --spec optional_field(any(), BXJ, decoder(BXJ), fun((BXJ) -> decoder(BXL))) -> decoder(BXL). -optional_field(Key, Default, Field_decoder, Next) -> - {decoder, - fun(Data) -> - {Out, Errors1} = begin - _pipe = case gleam_stdlib:index(Data, Key) of - {ok, {some, Data@1}} -> - (erlang:element(2, Field_decoder))(Data@1); - - {ok, none} -> - {Default, []}; - - {error, Kind} -> - {Default, - [{decode_error, - Kind, - gleam_stdlib:classify_dynamic(Data), - []}]} - end, - push_path(_pipe, [Key]) - end, - {Out@1, Errors2} = (erlang:element(2, Next(Out)))(Data), - {Out@1, lists:append(Errors1, Errors2)} - end}. - --file("src/gleam/dynamic/decode.gleam", 597). -?DOC( - " A decoder that decodes a value that is nested within other values. For\n" - " example, decoding a value that is within some deeply nested JSON objects.\n" - "\n" - " This function will index into dictionaries with any key type, and if the key is\n" - " an int then it'll also index into Erlang tuples and JavaScript arrays, and\n" - " the first eight elements of Gleam lists.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let decoder = decode.optionally_at([\"one\", \"two\"], 100, decode.int)\n" - "\n" - " let data = dynamic.properties([\n" - " #(dynamic.string(\"one\"), dynamic.properties([])),\n" - " ])\n" - "\n" - " decode.run(data, decoder)\n" - " // -> Ok(100)\n" - " ```\n" -). --spec optionally_at(list(any()), BXQ, decoder(BXQ)) -> decoder(BXQ). -optionally_at(Path, Default, Inner) -> - {decoder, - fun(Data) -> - index( - Path, - [], - erlang:element(2, Inner), - Data, - fun(_, _) -> {Default, []} end - ) - end}. diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@float.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@float.erl deleted file mode 100644 index dd2d2e7..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@float.erl +++ /dev/null @@ -1,764 +0,0 @@ --module(gleam@float). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/float.gleam"). --export([parse/1, to_string/1, compare/2, min/2, max/2, clamp/3, ceiling/1, floor/1, truncate/1, absolute_value/1, loosely_compare/3, loosely_equals/3, power/2, square_root/1, negate/1, round/1, to_precision/2, sum/1, product/1, random/0, modulo/2, divide/2, add/2, multiply/2, subtract/2, logarithm/1, exponential/1]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " Functions for working with floats.\n" - "\n" - " ## Float representation\n" - "\n" - " Floats are represented as 64 bit floating point numbers on both the Erlang\n" - " and JavaScript runtimes. The floating point behaviour is native to their\n" - " respective runtimes, so their exact behaviour will be slightly different on\n" - " the two runtimes.\n" - "\n" - " ### Infinity and NaN\n" - "\n" - " Under the JavaScript runtime, exceeding the maximum (or minimum)\n" - " representable value for a floating point value will result in Infinity (or\n" - " -Infinity). Should you try to divide two infinities you will get NaN as a\n" - " result.\n" - "\n" - " When running on BEAM, exceeding the maximum (or minimum) representable\n" - " value for a floating point value will raise an error.\n" - "\n" - " ## Division by zero\n" - "\n" - " Gleam runs on the Erlang virtual machine, which does not follow the IEEE\n" - " 754 standard for floating point arithmetic and does not have an `Infinity`\n" - " value. In Erlang division by zero results in a crash, however Gleam does\n" - " not have partial functions and operators in core so instead division by zero\n" - " returns zero, a behaviour taken from Pony, Coq, and Lean.\n" - "\n" - " This may seem unexpected at first, but it is no less mathematically valid\n" - " than crashing or returning a special value. Division by zero is undefined\n" - " in mathematics.\n" -). - --file("src/gleam/float.gleam", 51). -?DOC( - " Attempts to parse a string as a `Float`, returning `Error(Nil)` if it was\n" - " not possible.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " parse(\"2.3\")\n" - " // -> Ok(2.3)\n" - " ```\n" - "\n" - " ```gleam\n" - " parse(\"ABC\")\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec parse(binary()) -> {ok, float()} | {error, nil}. -parse(String) -> - gleam_stdlib:parse_float(String). - --file("src/gleam/float.gleam", 64). -?DOC( - " Returns the string representation of the provided `Float`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_string(2.3)\n" - " // -> \"2.3\"\n" - " ```\n" -). --spec to_string(float()) -> binary(). -to_string(X) -> - gleam_stdlib:float_to_string(X). - --file("src/gleam/float.gleam", 106). -?DOC( - " Compares two `Float`s, returning an `Order`:\n" - " `Lt` for lower than, `Eq` for equals, or `Gt` for greater than.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " compare(2.0, 2.3)\n" - " // -> Lt\n" - " ```\n" - "\n" - " To handle\n" - " [Floating Point Imprecision](https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems)\n" - " you may use [`loosely_compare`](#loosely_compare) instead.\n" -). --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. - --file("src/gleam/float.gleam", 187). -?DOC( - " Compares two `Float`s, returning the smaller of the two.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " min(2.0, 2.3)\n" - " // -> 2.0\n" - " ```\n" -). --spec min(float(), float()) -> float(). -min(A, B) -> - case A < B of - true -> - A; - - false -> - B - end. - --file("src/gleam/float.gleam", 203). -?DOC( - " Compares two `Float`s, returning the larger of the two.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " max(2.0, 2.3)\n" - " // -> 2.3\n" - " ```\n" -). --spec max(float(), float()) -> float(). -max(A, B) -> - case A > B of - true -> - A; - - false -> - B - end. - --file("src/gleam/float.gleam", 85). -?DOC( - " Restricts a float between two bounds.\n" - "\n" - " Note: If the `min` argument is larger than the `max` argument then they\n" - " will be swapped, so the minimum bound is always lower than the maximum\n" - " bound.\n" - "\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " clamp(1.2, min: 1.4, max: 1.6)\n" - " // -> 1.4\n" - " ```\n" - "\n" - " ```gleam\n" - " clamp(1.2, min: 1.4, max: 0.6)\n" - " // -> 1.2\n" - " ```\n" -). --spec clamp(float(), float(), float()) -> float(). -clamp(X, Min_bound, Max_bound) -> - case Min_bound >= Max_bound of - true -> - _pipe = X, - _pipe@1 = min(_pipe, Min_bound), - max(_pipe@1, Max_bound); - - false -> - _pipe@2 = X, - _pipe@3 = min(_pipe@2, Max_bound), - max(_pipe@3, Min_bound) - end. - --file("src/gleam/float.gleam", 221). -?DOC( - " Rounds the value to the next highest whole number as a `Float`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " ceiling(2.3)\n" - " // -> 3.0\n" - " ```\n" -). --spec ceiling(float()) -> float(). -ceiling(X) -> - math:ceil(X). - --file("src/gleam/float.gleam", 234). -?DOC( - " Rounds the value to the next lowest whole number as a `Float`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " floor(2.3)\n" - " // -> 2.0\n" - " ```\n" -). --spec floor(float()) -> float(). -floor(X) -> - math:floor(X). - --file("src/gleam/float.gleam", 272). -?DOC( - " Returns the value as an `Int`, truncating all decimal digits.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " truncate(2.4343434847383438)\n" - " // -> 2\n" - " ```\n" -). --spec truncate(float()) -> integer(). -truncate(X) -> - erlang:trunc(X). - --file("src/gleam/float.gleam", 322). -?DOC( - " Returns the absolute value of the input as a `Float`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " absolute_value(-12.5)\n" - " // -> 12.5\n" - " ```\n" - "\n" - " ```gleam\n" - " absolute_value(10.2)\n" - " // -> 10.2\n" - " ```\n" -). --spec absolute_value(float()) -> float(). -absolute_value(X) -> - case X >= +0.0 of - true -> - X; - - false -> - +0.0 - X - end. - --file("src/gleam/float.gleam", 136). -?DOC( - " Compares two `Float`s within a tolerance, returning an `Order`:\n" - " `Lt` for lower than, `Eq` for equals, or `Gt` for greater than.\n" - "\n" - " This function allows Float comparison while handling\n" - " [Floating Point Imprecision](https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems).\n" - "\n" - " Notice: For `Float`s the tolerance won't be exact:\n" - " `5.3 - 5.0` is not exactly `0.3`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " loosely_compare(5.0, with: 5.3, tolerating: 0.5)\n" - " // -> Eq\n" - " ```\n" - "\n" - " If you want to check only for equality you may use\n" - " [`loosely_equals`](#loosely_equals) instead.\n" -). --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. - --file("src/gleam/float.gleam", 169). -?DOC( - " Checks for equality of two `Float`s within a tolerance,\n" - " returning a `Bool`.\n" - "\n" - " This function allows Float comparison while handling\n" - " [Floating Point Imprecision](https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems).\n" - "\n" - " Notice: For `Float`s the tolerance won't be exact:\n" - " `5.3 - 5.0` is not exactly `0.3`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " loosely_equals(5.0, with: 5.3, tolerating: 0.5)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " loosely_equals(5.0, with: 5.1, tolerating: 0.1)\n" - " // -> False\n" - " ```\n" -). --spec loosely_equals(float(), float(), float()) -> boolean(). -loosely_equals(A, B, Tolerance) -> - Difference = absolute_value(A - B), - Difference =< Tolerance. - --file("src/gleam/float.gleam", 359). -?DOC( - " Returns the result of the base being raised to the power of the\n" - " exponent, as a `Float`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " power(2.0, -1.0)\n" - " // -> Ok(0.5)\n" - " ```\n" - "\n" - " ```gleam\n" - " power(2.0, 2.0)\n" - " // -> Ok(4.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " power(8.0, 1.5)\n" - " // -> Ok(22.627416997969522)\n" - " ```\n" - "\n" - " ```gleam\n" - " 4.0 |> power(of: 2.0)\n" - " // -> Ok(16.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " power(-1.0, 0.5)\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec power(float(), float()) -> {ok, float()} | {error, nil}. -power(Base, Exponent) -> - Fractional = (math:ceil(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. - --file("src/gleam/float.gleam", 391). -?DOC( - " Returns the square root of the input as a `Float`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " square_root(4.0)\n" - " // -> Ok(2.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " square_root(-16.0)\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec square_root(float()) -> {ok, float()} | {error, nil}. -square_root(X) -> - power(X, 0.5). - --file("src/gleam/float.gleam", 404). -?DOC( - " Returns the negative of the value provided.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " negate(1.0)\n" - " // -> -1.0\n" - " ```\n" -). --spec negate(float()) -> float(). -negate(X) -> - -1.0 * X. - --file("src/gleam/float.gleam", 251). -?DOC( - " Rounds the value to the nearest whole number as an `Int`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " round(2.3)\n" - " // -> 2\n" - " ```\n" - "\n" - " ```gleam\n" - " round(2.5)\n" - " // -> 3\n" - " ```\n" -). --spec round(float()) -> integer(). -round(X) -> - erlang:round(X). - --file("src/gleam/float.gleam", 291). -?DOC( - " Converts the value to a given precision as a `Float`.\n" - " The precision is the number of allowed decimal places.\n" - " Negative precisions are allowed and force rounding\n" - " to the nearest tenth, hundredth, thousandth etc.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_precision(2.43434348473, precision: 2)\n" - " // -> 2.43\n" - " ```\n" - "\n" - " ```gleam\n" - " to_precision(547890.453444, precision: -3)\n" - " // -> 548000.0\n" - " ```\n" -). --spec to_precision(float(), integer()) -> float(). -to_precision(X, Precision) -> - case Precision =< 0 of - true -> - Factor = math:pow(10.0, erlang:float(- Precision)), - erlang:float(erlang:round(case Factor of - +0.0 -> +0.0; - -0.0 -> -0.0; - Gleam@denominator -> X / Gleam@denominator - end)) * Factor; - - false -> - Factor@1 = math:pow(10.0, erlang:float(Precision)), - case Factor@1 of - +0.0 -> +0.0; - -0.0 -> -0.0; - Gleam@denominator@1 -> erlang:float(erlang:round(X * Factor@1)) - / Gleam@denominator@1 - end - end. - --file("src/gleam/float.gleam", 421). --spec sum_loop(list(float()), float()) -> float(). -sum_loop(Numbers, Initial) -> - case Numbers of - [First | Rest] -> - sum_loop(Rest, First + Initial); - - [] -> - Initial - end. - --file("src/gleam/float.gleam", 417). -?DOC( - " Sums a list of `Float`s.\n" - "\n" - " ## Example\n" - "\n" - " ```gleam\n" - " sum([1.0, 2.2, 3.3])\n" - " // -> 6.5\n" - " ```\n" -). --spec sum(list(float())) -> float(). -sum(Numbers) -> - sum_loop(Numbers, +0.0). - --file("src/gleam/float.gleam", 441). --spec product_loop(list(float()), float()) -> float(). -product_loop(Numbers, Initial) -> - case Numbers of - [First | Rest] -> - product_loop(Rest, First * Initial); - - [] -> - Initial - end. - --file("src/gleam/float.gleam", 437). -?DOC( - " Multiplies a list of `Float`s and returns the product.\n" - "\n" - " ## Example\n" - "\n" - " ```gleam\n" - " product([2.5, 3.2, 4.2])\n" - " // -> 33.6\n" - " ```\n" -). --spec product(list(float())) -> float(). -product(Numbers) -> - product_loop(Numbers, 1.0). - --file("src/gleam/float.gleam", 463). -?DOC( - " Generates a random float between the given zero (inclusive) and one\n" - " (exclusive).\n" - "\n" - " On Erlang this updates the random state in the process dictionary.\n" - " See: \n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " random()\n" - " // -> 0.646355926896028\n" - " ```\n" -). --spec random() -> float(). -random() -> - rand:uniform(). - --file("src/gleam/float.gleam", 494). -?DOC( - " Computes the modulo of a float division of inputs as a `Result`.\n" - "\n" - " Returns division of the inputs as a `Result`: If the given divisor equals\n" - " `0`, this function returns an `Error`.\n" - "\n" - " The computed value will always have the same sign as the `divisor`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " modulo(13.3, by: 3.3)\n" - " // -> Ok(0.1)\n" - " ```\n" - "\n" - " ```gleam\n" - " modulo(-13.3, by: 3.3)\n" - " // -> Ok(3.2)\n" - " ```\n" - "\n" - " ```gleam\n" - " modulo(13.3, by: -3.3)\n" - " // -> Ok(-3.2)\n" - " ```\n" - "\n" - " ```gleam\n" - " modulo(-13.3, by: -3.3)\n" - " // -> Ok(-0.1)\n" - " ```\n" -). --spec modulo(float(), float()) -> {ok, float()} | {error, nil}. -modulo(Dividend, Divisor) -> - case Divisor of - +0.0 -> - {error, nil}; - - _ -> - {ok, Dividend - (math:floor(case Divisor of - +0.0 -> +0.0; - -0.0 -> -0.0; - Gleam@denominator -> Dividend / Gleam@denominator - end) * Divisor)} - end. - --file("src/gleam/float.gleam", 515). -?DOC( - " Returns division of the inputs as a `Result`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " divide(0.0, 1.0)\n" - " // -> Ok(0.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " divide(1.0, 0.0)\n" - " // -> Error(Nil)\n" - " ```\n" -). --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; - -0.0 -> -0.0; - Gleam@denominator -> A / Gleam@denominator - end} - end. - --file("src/gleam/float.gleam", 546). -?DOC( - " Adds two floats together.\n" - "\n" - " It's the function equivalent of the `+.` operator.\n" - " This function is useful in higher order functions or pipes.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " add(1.0, 2.0)\n" - " // -> 3.0\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/list\n" - "\n" - " list.fold([1.0, 2.0, 3.0], 0.0, add)\n" - " // -> 6.0\n" - " ```\n" - "\n" - " ```gleam\n" - " 3.0 |> add(2.0)\n" - " // -> 5.0\n" - " ```\n" -). --spec add(float(), float()) -> float(). -add(A, B) -> - A + B. - --file("src/gleam/float.gleam", 574). -?DOC( - " Multiplies two floats together.\n" - "\n" - " It's the function equivalent of the `*.` operator.\n" - " This function is useful in higher order functions or pipes.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " multiply(2.0, 4.0)\n" - " // -> 8.0\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/list\n" - "\n" - " list.fold([2.0, 3.0, 4.0], 1.0, multiply)\n" - " // -> 24.0\n" - " ```\n" - "\n" - " ```gleam\n" - " 3.0 |> multiply(2.0)\n" - " // -> 6.0\n" - " ```\n" -). --spec multiply(float(), float()) -> float(). -multiply(A, B) -> - A * B. - --file("src/gleam/float.gleam", 607). -?DOC( - " Subtracts one float from another.\n" - "\n" - " It's the function equivalent of the `-.` operator.\n" - " This function is useful in higher order functions or pipes.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " subtract(3.0, 1.0)\n" - " // -> 2.0\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/list\n" - "\n" - " list.fold([1.0, 2.0, 3.0], 10.0, subtract)\n" - " // -> 4.0\n" - " ```\n" - "\n" - " ```gleam\n" - " 3.0 |> subtract(_, 2.0)\n" - " // -> 1.0\n" - " ```\n" - "\n" - " ```gleam\n" - " 3.0 |> subtract(2.0, _)\n" - " // -> -1.0\n" - " ```\n" -). --spec subtract(float(), float()) -> float(). -subtract(A, B) -> - A - B. - --file("src/gleam/float.gleam", 636). -?DOC( - " Returns the natural logarithm (base e) of the given `Float` as a `Result`. If the\n" - " input is less than or equal to 0, returns `Error(Nil)`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " logarithm(1.0)\n" - " // -> Ok(0.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " logarithm(2.718281828459045) // e\n" - " // -> Ok(1.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " logarithm(0.0)\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " logarithm(-1.0)\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec logarithm(float()) -> {ok, float()} | {error, nil}. -logarithm(X) -> - case X =< +0.0 of - true -> - {error, nil}; - - false -> - {ok, math:log(X)} - end. - --file("src/gleam/float.gleam", 674). -?DOC( - " Returns e (Euler's number) raised to the power of the given exponent, as\n" - " a `Float`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " exponential(0.0)\n" - " // -> Ok(1.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " exponential(1.0)\n" - " // -> Ok(2.718281828459045)\n" - " ```\n" - "\n" - " ```gleam\n" - " exponential(-1.0)\n" - " // -> Ok(0.36787944117144233)\n" - " ```\n" -). --spec exponential(float()) -> float(). -exponential(X) -> - math:exp(X). diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@function.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@function.erl deleted file mode 100644 index fa5155d..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@function.erl +++ /dev/null @@ -1,18 +0,0 @@ --module(gleam@function). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/function.gleam"). --export([identity/1]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --file("src/gleam/function.gleam", 3). -?DOC(" Takes a single argument and always returns its input value.\n"). --spec identity(CLU) -> CLU. -identity(X) -> - X. diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@int.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@int.erl deleted file mode 100644 index 4452257..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@int.erl +++ /dev/null @@ -1,954 +0,0 @@ --module(gleam@int). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/int.gleam"). --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, random/1, 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]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " Functions for working with integers.\n" - "\n" - " ## Division by zero\n" - "\n" - " In Erlang division by zero results in a crash, however Gleam does not have\n" - " partial functions and operators in core so instead division by zero returns\n" - " zero, a behaviour taken from Pony, Coq, and Lean.\n" - "\n" - " This may seem unexpected at first, but it is no less mathematically valid\n" - " than crashing or returning a special value. Division by zero is undefined\n" - " in mathematics.\n" -). - --file("src/gleam/int.gleam", 30). -?DOC( - " Returns the absolute value of the input.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " absolute_value(-12)\n" - " // -> 12\n" - " ```\n" - "\n" - " ```gleam\n" - " absolute_value(10)\n" - " // -> 10\n" - " ```\n" -). --spec absolute_value(integer()) -> integer(). -absolute_value(X) -> - case X >= 0 of - true -> - X; - - false -> - X * -1 - end. - --file("src/gleam/int.gleam", 109). -?DOC( - " Parses a given string as an int if possible.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " parse(\"2\")\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " parse(\"ABC\")\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec parse(binary()) -> {ok, integer()} | {error, nil}. -parse(String) -> - gleam_stdlib:parse_int(String). - --file("src/gleam/int.gleam", 141). -?DOC( - " Parses a given string as an int in a given base if possible.\n" - " Supports only bases 2 to 36, for values outside of which this function returns an `Error(Nil)`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " base_parse(\"10\", 2)\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " base_parse(\"30\", 16)\n" - " // -> Ok(48)\n" - " ```\n" - "\n" - " ```gleam\n" - " base_parse(\"1C\", 36)\n" - " // -> Ok(48)\n" - " ```\n" - "\n" - " ```gleam\n" - " base_parse(\"48\", 1)\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " base_parse(\"48\", 37)\n" - " // -> Error(Nil)\n" - " ```\n" -). --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. - --file("src/gleam/int.gleam", 163). -?DOC( - " Prints a given int to a string.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_string(2)\n" - " // -> \"2\"\n" - " ```\n" -). --spec to_string(integer()) -> binary(). -to_string(X) -> - erlang:integer_to_binary(X). - --file("src/gleam/int.gleam", 196). -?DOC( - " Prints a given int to a string using the base number provided.\n" - " Supports only bases 2 to 36, for values outside of which this function returns an `Error(Nil)`.\n" - " For common bases (2, 8, 16, 36), use the `to_baseN` functions.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_base_string(2, 2)\n" - " // -> Ok(\"10\")\n" - " ```\n" - "\n" - " ```gleam\n" - " to_base_string(48, 16)\n" - " // -> Ok(\"30\")\n" - " ```\n" - "\n" - " ```gleam\n" - " to_base_string(48, 36)\n" - " // -> Ok(\"1C\")\n" - " ```\n" - "\n" - " ```gleam\n" - " to_base_string(48, 1)\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " to_base_string(48, 37)\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec to_base_string(integer(), integer()) -> {ok, binary()} | {error, nil}. -to_base_string(X, Base) -> - case (Base >= 2) andalso (Base =< 36) of - true -> - {ok, erlang:integer_to_binary(X, Base)}; - - false -> - {error, nil} - end. - --file("src/gleam/int.gleam", 216). -?DOC( - " Prints a given int to a string using base-2.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_base2(2)\n" - " // -> \"10\"\n" - " ```\n" -). --spec to_base2(integer()) -> binary(). -to_base2(X) -> - erlang:integer_to_binary(X, 2). - --file("src/gleam/int.gleam", 229). -?DOC( - " Prints a given int to a string using base-8.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_base8(15)\n" - " // -> \"17\"\n" - " ```\n" -). --spec to_base8(integer()) -> binary(). -to_base8(X) -> - erlang:integer_to_binary(X, 8). - --file("src/gleam/int.gleam", 242). -?DOC( - " Prints a given int to a string using base-16.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_base16(48)\n" - " // -> \"30\"\n" - " ```\n" -). --spec to_base16(integer()) -> binary(). -to_base16(X) -> - erlang:integer_to_binary(X, 16). - --file("src/gleam/int.gleam", 255). -?DOC( - " Prints a given int to a string using base-36.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_base36(48)\n" - " // -> \"1C\"\n" - " ```\n" -). --spec to_base36(integer()) -> binary(). -to_base36(X) -> - erlang:integer_to_binary(X, 36). - --file("src/gleam/int.gleam", 280). -?DOC( - " Takes an int and returns its value as a float.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_float(5)\n" - " // -> 5.0\n" - " ```\n" - "\n" - " ```gleam\n" - " to_float(0)\n" - " // -> 0.0\n" - " ```\n" - "\n" - " ```gleam\n" - " to_float(-3)\n" - " // -> -3.0\n" - " ```\n" -). --spec to_float(integer()) -> float(). -to_float(X) -> - erlang:float(X). - --file("src/gleam/int.gleam", 67). -?DOC( - " Returns the result of the base being raised to the power of the\n" - " exponent, as a `Float`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " power(2, -1.0)\n" - " // -> Ok(0.5)\n" - " ```\n" - "\n" - " ```gleam\n" - " power(2, 2.0)\n" - " // -> Ok(4.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " power(8, 1.5)\n" - " // -> Ok(22.627416997969522)\n" - " ```\n" - "\n" - " ```gleam\n" - " 4 |> power(of: 2.0)\n" - " // -> Ok(16.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " power(-1, 0.5)\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec power(integer(), float()) -> {ok, float()} | {error, nil}. -power(Base, Exponent) -> - _pipe = Base, - _pipe@1 = erlang:float(_pipe), - gleam@float:power(_pipe@1, Exponent). - --file("src/gleam/int.gleam", 87). -?DOC( - " Returns the square root of the input as a `Float`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " square_root(4)\n" - " // -> Ok(2.0)\n" - " ```\n" - "\n" - " ```gleam\n" - " square_root(-16)\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec square_root(integer()) -> {ok, float()} | {error, nil}. -square_root(X) -> - _pipe = X, - _pipe@1 = erlang:float(_pipe), - gleam@float:square_root(_pipe@1). - --file("src/gleam/int.gleam", 326). -?DOC( - " Compares two ints, returning an order.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " compare(2, 3)\n" - " // -> Lt\n" - " ```\n" - "\n" - " ```gleam\n" - " compare(4, 3)\n" - " // -> Gt\n" - " ```\n" - "\n" - " ```gleam\n" - " compare(3, 3)\n" - " // -> Eq\n" - " ```\n" -). --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. - --file("src/gleam/int.gleam", 346). -?DOC( - " Compares two ints, returning the smaller of the two.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " min(2, 3)\n" - " // -> 2\n" - " ```\n" -). --spec min(integer(), integer()) -> integer(). -min(A, B) -> - case A < B of - true -> - A; - - false -> - B - end. - --file("src/gleam/int.gleam", 362). -?DOC( - " Compares two ints, returning the larger of the two.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " max(2, 3)\n" - " // -> 3\n" - " ```\n" -). --spec max(integer(), integer()) -> integer(). -max(A, B) -> - case A > B of - true -> - A; - - false -> - B - end. - --file("src/gleam/int.gleam", 300). -?DOC( - " Restricts an int between two bounds.\n" - "\n" - " Note: If the `min` argument is larger than the `max` argument then they\n" - " will be swapped, so the minimum bound is always lower than the maximum\n" - " bound.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " clamp(40, min: 50, max: 60)\n" - " // -> 50\n" - " ```\n" - "\n" - " ```gleam\n" - " clamp(40, min: 50, max: 30)\n" - " // -> 40\n" - " ```\n" -). --spec clamp(integer(), integer(), integer()) -> integer(). -clamp(X, Min_bound, Max_bound) -> - case Min_bound >= Max_bound of - true -> - _pipe = X, - _pipe@1 = min(_pipe, Min_bound), - max(_pipe@1, Max_bound); - - false -> - _pipe@2 = X, - _pipe@3 = min(_pipe@2, Max_bound), - max(_pipe@3, Min_bound) - end. - --file("src/gleam/int.gleam", 383). -?DOC( - " Returns whether the value provided is even.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_even(2)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " is_even(3)\n" - " // -> False\n" - " ```\n" -). --spec is_even(integer()) -> boolean(). -is_even(X) -> - (X rem 2) =:= 0. - --file("src/gleam/int.gleam", 401). -?DOC( - " Returns whether the value provided is odd.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_odd(3)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " is_odd(2)\n" - " // -> False\n" - " ```\n" -). --spec is_odd(integer()) -> boolean(). -is_odd(X) -> - (X rem 2) /= 0. - --file("src/gleam/int.gleam", 414). -?DOC( - " Returns the negative of the value provided.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " negate(1)\n" - " // -> -1\n" - " ```\n" -). --spec negate(integer()) -> integer(). -negate(X) -> - -1 * X. - --file("src/gleam/int.gleam", 431). --spec sum_loop(list(integer()), integer()) -> integer(). -sum_loop(Numbers, Initial) -> - case Numbers of - [First | Rest] -> - sum_loop(Rest, First + Initial); - - [] -> - Initial - end. - --file("src/gleam/int.gleam", 427). -?DOC( - " Sums a list of ints.\n" - "\n" - " ## Example\n" - "\n" - " ```gleam\n" - " sum([1, 2, 3])\n" - " // -> 6\n" - " ```\n" -). --spec sum(list(integer())) -> integer(). -sum(Numbers) -> - sum_loop(Numbers, 0). - --file("src/gleam/int.gleam", 451). --spec product_loop(list(integer()), integer()) -> integer(). -product_loop(Numbers, Initial) -> - case Numbers of - [First | Rest] -> - product_loop(Rest, First * Initial); - - [] -> - Initial - end. - --file("src/gleam/int.gleam", 447). -?DOC( - " Multiplies a list of ints and returns the product.\n" - "\n" - " ## Example\n" - "\n" - " ```gleam\n" - " product([2, 3, 4])\n" - " // -> 24\n" - " ```\n" -). --spec product(list(integer())) -> integer(). -product(Numbers) -> - product_loop(Numbers, 1). - --file("src/gleam/int.gleam", 479). -?DOC( - " Generates a random int between zero and the given maximum.\n" - "\n" - " The lower number is inclusive, the upper number is exclusive.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " random(10)\n" - " // -> 4\n" - " ```\n" - "\n" - " ```gleam\n" - " random(1)\n" - " // -> 0\n" - " ```\n" - "\n" - " ```gleam\n" - " random(-1)\n" - " // -> -1\n" - " ```\n" -). --spec random(integer()) -> integer(). -random(Max) -> - _pipe = (rand:uniform() * erlang:float(Max)), - _pipe@1 = math:floor(_pipe), - erlang:round(_pipe@1). - --file("src/gleam/int.gleam", 512). -?DOC( - " Performs a truncated integer division.\n" - "\n" - " Returns division of the inputs as a `Result`: If the given divisor equals\n" - " `0`, this function returns an `Error`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " divide(0, 1)\n" - " // -> Ok(0)\n" - " ```\n" - "\n" - " ```gleam\n" - " divide(1, 0)\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " divide(5, 2)\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " divide(-99, 2)\n" - " // -> Ok(-49)\n" - " ```\n" -). --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. - --file("src/gleam/int.gleam", 564). -?DOC( - " Computes the remainder of an integer division of inputs as a `Result`.\n" - "\n" - " Returns division of the inputs as a `Result`: If the given divisor equals\n" - " `0`, this function returns an `Error`.\n" - "\n" - " Most of the time you will want to use the `%` operator instead of this\n" - " function.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " remainder(3, 2)\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " remainder(1, 0)\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " remainder(10, -1)\n" - " // -> Ok(0)\n" - " ```\n" - "\n" - " ```gleam\n" - " remainder(13, by: 3)\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " remainder(-13, by: 3)\n" - " // -> Ok(-1)\n" - " ```\n" - "\n" - " ```gleam\n" - " remainder(13, by: -3)\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " remainder(-13, by: -3)\n" - " // -> Ok(-1)\n" - " ```\n" -). --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. - --file("src/gleam/int.gleam", 611). -?DOC( - " Computes the modulo of an integer division of inputs as a `Result`.\n" - "\n" - " Returns division of the inputs as a `Result`: If the given divisor equals\n" - " `0`, this function returns an `Error`.\n" - "\n" - " Note that this is different from `int.remainder` and `%` in that the\n" - " computed value will always have the same sign as the `divisor`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " modulo(3, 2)\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " modulo(1, 0)\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " modulo(10, -1)\n" - " // -> Ok(0)\n" - " ```\n" - "\n" - " ```gleam\n" - " modulo(13, by: 3)\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " modulo(-13, by: 3)\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " modulo(13, by: -3)\n" - " // -> Ok(-2)\n" - " ```\n" -). --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. - --file("src/gleam/int.gleam", 655). -?DOC( - " Performs a *floored* integer division, which means that the result will\n" - " always be rounded towards negative infinity.\n" - "\n" - " If you want to perform truncated integer division (rounding towards zero),\n" - " use `int.divide()` or the `/` operator instead.\n" - "\n" - " Returns division of the inputs as a `Result`: If the given divisor equals\n" - " `0`, this function returns an `Error`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " floor_divide(1, 0)\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " floor_divide(5, 2)\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " floor_divide(6, -4)\n" - " // -> Ok(-2)\n" - " ```\n" - "\n" - " ```gleam\n" - " floor_divide(-99, 2)\n" - " // -> Ok(-50)\n" - " ```\n" -). --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. - --file("src/gleam/int.gleam", 689). -?DOC( - " Adds two integers together.\n" - "\n" - " It's the function equivalent of the `+` operator.\n" - " This function is useful in higher order functions or pipes.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " add(1, 2)\n" - " // -> 3\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/list\n" - " list.fold([1, 2, 3], 0, add)\n" - " // -> 6\n" - " ```\n" - "\n" - " ```gleam\n" - " 3 |> add(2)\n" - " // -> 5\n" - " ```\n" -). --spec add(integer(), integer()) -> integer(). -add(A, B) -> - A + B. - --file("src/gleam/int.gleam", 717). -?DOC( - " Multiplies two integers together.\n" - "\n" - " It's the function equivalent of the `*` operator.\n" - " This function is useful in higher order functions or pipes.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " multiply(2, 4)\n" - " // -> 8\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/list\n" - "\n" - " list.fold([2, 3, 4], 1, multiply)\n" - " // -> 24\n" - " ```\n" - "\n" - " ```gleam\n" - " 3 |> multiply(2)\n" - " // -> 6\n" - " ```\n" -). --spec multiply(integer(), integer()) -> integer(). -multiply(A, B) -> - A * B. - --file("src/gleam/int.gleam", 750). -?DOC( - " Subtracts one int from another.\n" - "\n" - " It's the function equivalent of the `-` operator.\n" - " This function is useful in higher order functions or pipes.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " subtract(3, 1)\n" - " // -> 2\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/list\n" - "\n" - " list.fold([1, 2, 3], 10, subtract)\n" - " // -> 4\n" - " ```\n" - "\n" - " ```gleam\n" - " 3 |> subtract(2)\n" - " // -> 1\n" - " ```\n" - "\n" - " ```gleam\n" - " 3 |> subtract(2, _)\n" - " // -> -1\n" - " ```\n" -). --spec subtract(integer(), integer()) -> integer(). -subtract(A, B) -> - A - B. - --file("src/gleam/int.gleam", 762). -?DOC( - " Calculates the bitwise AND of its arguments.\n" - "\n" - " The exact behaviour of this function depends on the target platform.\n" - " On Erlang it is equivalent to bitwise operations on ints, on JavaScript it\n" - " is equivalent to bitwise operations on big-ints.\n" -). --spec bitwise_and(integer(), integer()) -> integer(). -bitwise_and(X, Y) -> - erlang:'band'(X, Y). - --file("src/gleam/int.gleam", 772). -?DOC( - " Calculates the bitwise NOT of its argument.\n" - "\n" - " The exact behaviour of this function depends on the target platform.\n" - " On Erlang it is equivalent to bitwise operations on ints, on JavaScript it\n" - " is equivalent to bitwise operations on big-ints.\n" -). --spec bitwise_not(integer()) -> integer(). -bitwise_not(X) -> - erlang:'bnot'(X). - --file("src/gleam/int.gleam", 782). -?DOC( - " Calculates the bitwise OR of its arguments.\n" - "\n" - " The exact behaviour of this function depends on the target platform.\n" - " On Erlang it is equivalent to bitwise operations on ints, on JavaScript it\n" - " is equivalent to bitwise operations on big-ints.\n" -). --spec bitwise_or(integer(), integer()) -> integer(). -bitwise_or(X, Y) -> - erlang:'bor'(X, Y). - --file("src/gleam/int.gleam", 792). -?DOC( - " Calculates the bitwise XOR of its arguments.\n" - "\n" - " The exact behaviour of this function depends on the target platform.\n" - " On Erlang it is equivalent to bitwise operations on ints, on JavaScript it\n" - " is equivalent to bitwise operations on big-ints.\n" -). --spec bitwise_exclusive_or(integer(), integer()) -> integer(). -bitwise_exclusive_or(X, Y) -> - erlang:'bxor'(X, Y). - --file("src/gleam/int.gleam", 802). -?DOC( - " Calculates the result of an arithmetic left bitshift.\n" - "\n" - " The exact behaviour of this function depends on the target platform.\n" - " On Erlang it is equivalent to bitwise operations on ints, on JavaScript it\n" - " is equivalent to bitwise operations on big-ints.\n" -). --spec bitwise_shift_left(integer(), integer()) -> integer(). -bitwise_shift_left(X, Y) -> - erlang:'bsl'(X, Y). - --file("src/gleam/int.gleam", 812). -?DOC( - " Calculates the result of an arithmetic right bitshift.\n" - "\n" - " The exact behaviour of this function depends on the target platform.\n" - " On Erlang it is equivalent to bitwise operations on ints, on JavaScript it\n" - " is equivalent to bitwise operations on big-ints.\n" -). --spec bitwise_shift_right(integer(), integer()) -> integer(). -bitwise_shift_right(X, Y) -> - erlang:'bsr'(X, Y). diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@io.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@io.erl deleted file mode 100644 index dcf1a9f..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@io.erl +++ /dev/null @@ -1,80 +0,0 @@ --module(gleam@io). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/io.gleam"). --export([print/1, print_error/1, println/1, println_error/1]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --file("src/gleam/io.gleam", 15). -?DOC( - " Writes a string to standard output (stdout).\n" - "\n" - " If you want your output to be printed on its own line see `println`.\n" - "\n" - " ## Example\n" - "\n" - " ```gleam\n" - " io.print(\"Hi mum\")\n" - " // -> Nil\n" - " // Hi mum\n" - " ```\n" -). --spec print(binary()) -> nil. -print(String) -> - gleam_stdlib:print(String). - --file("src/gleam/io.gleam", 31). -?DOC( - " Writes a string to standard error (stderr).\n" - "\n" - " If you want your output to be printed on its own line see `println_error`.\n" - "\n" - " ## Example\n" - "\n" - " ```gleam\n" - " io.print_error(\"Hi pop\")\n" - " // -> Nil\n" - " // Hi pop\n" - " ```\n" -). --spec print_error(binary()) -> nil. -print_error(String) -> - gleam_stdlib:print_error(String). - --file("src/gleam/io.gleam", 45). -?DOC( - " Writes a string to standard output (stdout), appending a newline to the end.\n" - "\n" - " ## Example\n" - "\n" - " ```gleam\n" - " io.println(\"Hi mum\")\n" - " // -> Nil\n" - " // Hi mum\n" - " ```\n" -). --spec println(binary()) -> nil. -println(String) -> - gleam_stdlib:println(String). - --file("src/gleam/io.gleam", 59). -?DOC( - " Writes a string to standard error (stderr), appending a newline to the end.\n" - "\n" - " ## Example\n" - "\n" - " ```gleam\n" - " io.println_error(\"Hi pop\")\n" - " // -> Nil\n" - " // Hi pop\n" - " ```\n" -). --spec println_error(binary()) -> nil. -println_error(String) -> - gleam_stdlib:println_error(String). diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@list.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@list.erl deleted file mode 100644 index e10907d..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@list.erl +++ /dev/null @@ -1,2852 +0,0 @@ --module(gleam@list). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/list.gleam"). --export([length/1, count/2, reverse/1, is_empty/1, contains/2, first/1, rest/1, group/2, filter/2, filter_map/2, map/2, map2/3, map_fold/3, index_map/2, try_map/2, drop/2, take/2, new/0, wrap/1, append/2, prepend/2, flatten/1, flat_map/2, 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, unique/1, sort/2, range/2, repeat/2, split/2, split_while/2, key_find/2, key_filter/2, key_pop/2, key_set/3, each/2, try_each/2, partition/2, 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, max/2, sample/2, permutations/1]). --export_type([continue_or_stop/1, sorting/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " Lists are an ordered sequence of elements and are one of the most common\n" - " data types in Gleam.\n" - "\n" - " New elements can be added and removed from the front of a list in\n" - " constant time, while adding and removing from the end requires traversing\n" - " and copying the whole list, so keep this in mind when designing your\n" - " programs.\n" - "\n" - " There is a dedicated syntax for prefixing to a list:\n" - "\n" - " ```gleam\n" - " let new_list = [1, 2, ..existing_list]\n" - " ```\n" - "\n" - " And a matching syntax for getting the first elements of a list:\n" - "\n" - " ```gleam\n" - " case list {\n" - " [first_element, ..rest] -> first_element\n" - " _ -> \"this pattern matches when the list is empty\"\n" - " }\n" - " ```\n" - "\n" -). - --type continue_or_stop(YZ) :: {continue, YZ} | {stop, YZ}. - --type sorting() :: ascending | descending. - --file("src/gleam/list.gleam", 60). --spec length_loop(list(any()), integer()) -> integer(). -length_loop(List, Count) -> - case List of - [_ | List@1] -> - length_loop(List@1, Count + 1); - - [] -> - Count - end. - --file("src/gleam/list.gleam", 56). -?DOC( - " Counts the number of elements in a given list.\n" - "\n" - " This function has to traverse the list to determine the number of elements,\n" - " so it runs in linear time.\n" - "\n" - " This function is natively implemented by the virtual machine and is highly\n" - " optimised.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " length([])\n" - " // -> 0\n" - " ```\n" - "\n" - " ```gleam\n" - " length([1])\n" - " // -> 1\n" - " ```\n" - "\n" - " ```gleam\n" - " length([1, 2])\n" - " // -> 2\n" - " ```\n" -). --spec length(list(any())) -> integer(). -length(List) -> - erlang:length(List). - --file("src/gleam/list.gleam", 93). --spec count_loop(list(AAG), fun((AAG) -> boolean()), integer()) -> integer(). -count_loop(List, Predicate, Acc) -> - case List of - [] -> - Acc; - - [First | Rest] -> - case Predicate(First) of - true -> - count_loop(Rest, Predicate, Acc + 1); - - false -> - count_loop(Rest, Predicate, Acc) - end - end. - --file("src/gleam/list.gleam", 89). -?DOC( - " Counts the number of elements in a given list satisfying a given predicate.\n" - "\n" - " This function has to traverse the list to determine the number of elements,\n" - " so it runs in linear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " count([], fn(a) { a > 0 })\n" - " // -> 0\n" - " ```\n" - "\n" - " ```gleam\n" - " count([1], fn(a) { a > 0 })\n" - " // -> 1\n" - " ```\n" - "\n" - " ```gleam\n" - " count([1, 2, 3], int.is_odd)\n" - " // -> 2\n" - " ```\n" -). --spec count(list(AAE), fun((AAE) -> boolean())) -> integer(). -count(List, Predicate) -> - count_loop(List, Predicate, 0). - --file("src/gleam/list.gleam", 131). -?DOC( - " Creates a new list from a given list containing the same elements but in the\n" - " opposite order.\n" - "\n" - " This function has to traverse the list to create the new reversed list, so\n" - " it runs in linear time.\n" - "\n" - " This function is natively implemented by the virtual machine and is highly\n" - " optimised.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " reverse([])\n" - " // -> []\n" - " ```\n" - "\n" - " ```gleam\n" - " reverse([1])\n" - " // -> [1]\n" - " ```\n" - "\n" - " ```gleam\n" - " reverse([1, 2])\n" - " // -> [2, 1]\n" - " ```\n" -). --spec reverse(list(AAI)) -> list(AAI). -reverse(List) -> - lists:reverse(List). - --file("src/gleam/list.gleam", 168). -?DOC( - " Determines whether or not the list is empty.\n" - "\n" - " This function runs in constant time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_empty([])\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " is_empty([1])\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " is_empty([1, 1])\n" - " // -> False\n" - " ```\n" -). --spec is_empty(list(any())) -> boolean(). -is_empty(List) -> - List =:= []. - --file("src/gleam/list.gleam", 204). -?DOC( - " Determines whether or not a given element exists within a given list.\n" - "\n" - " This function traverses the list to find the element, so it runs in linear\n" - " time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " [] |> contains(any: 0)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " [0] |> contains(any: 0)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " [1] |> contains(any: 0)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " [1, 1] |> contains(any: 0)\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " [1, 0] |> contains(any: 0)\n" - " // -> True\n" - " ```\n" -). --spec contains(list(AAR), AAR) -> boolean(). -contains(List, Elem) -> - case List of - [] -> - false; - - [First | _] when First =:= Elem -> - true; - - [_ | Rest] -> - contains(Rest, Elem) - end. - --file("src/gleam/list.gleam", 231). -?DOC( - " Gets the first element from the start of the list, if there is one.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " first([])\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " first([0])\n" - " // -> Ok(0)\n" - " ```\n" - "\n" - " ```gleam\n" - " first([1, 2])\n" - " // -> Ok(1)\n" - " ```\n" -). --spec first(list(AAT)) -> {ok, AAT} | {error, nil}. -first(List) -> - case List of - [] -> - {error, nil}; - - [First | _] -> - {ok, First} - end. - --file("src/gleam/list.gleam", 260). -?DOC( - " Returns the list minus the first element. If the list is empty, `Error(Nil)` is\n" - " returned.\n" - "\n" - " This function runs in constant time and does not make a copy of the list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " rest([])\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " rest([0])\n" - " // -> Ok([])\n" - " ```\n" - "\n" - " ```gleam\n" - " rest([1, 2])\n" - " // -> Ok([2])\n" - " ```\n" -). --spec rest(list(AAX)) -> {ok, list(AAX)} | {error, nil}. -rest(List) -> - case List of - [] -> - {error, nil}; - - [_ | Rest] -> - {ok, Rest} - end. - --file("src/gleam/list.gleam", 298). -?DOC( - " Groups the elements from the given list by the given key function.\n" - "\n" - " Does not preserve the initial value order.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " import gleam/dict\n" - "\n" - " [Ok(3), Error(\"Wrong\"), Ok(200), Ok(73)]\n" - " |> group(by: fn(i) {\n" - " case i {\n" - " Ok(_) -> \"Successful\"\n" - " Error(_) -> \"Failed\"\n" - " }\n" - " })\n" - " |> dict.to_list\n" - " // -> [\n" - " // #(\"Failed\", [Error(\"Wrong\")]),\n" - " // #(\"Successful\", [Ok(73), Ok(200), Ok(3)])\n" - " // ]\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/dict\n" - "\n" - " group([1,2,3,4,5], by: fn(i) { i - i / 3 * 3 })\n" - " |> dict.to_list\n" - " // -> [#(0, [3]), #(1, [4, 1]), #(2, [5, 2])]\n" - " ```\n" -). --spec group(list(ABC), fun((ABC) -> ABE)) -> gleam@dict:dict(ABE, list(ABC)). -group(List, Key) -> - gleam@dict:group(Key, List). - --file("src/gleam/list.gleam", 321). --spec filter_loop(list(ABL), fun((ABL) -> boolean()), list(ABL)) -> list(ABL). -filter_loop(List, Fun, Acc) -> - case List of - [] -> - lists:reverse(Acc); - - [First | Rest] -> - New_acc = case Fun(First) of - true -> - [First | Acc]; - - false -> - Acc - end, - filter_loop(Rest, Fun, New_acc) - end. - --file("src/gleam/list.gleam", 317). -?DOC( - " Returns a new list containing only the elements from the first list for\n" - " which the given functions returns `True`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " filter([2, 4, 6, 1], fn(x) { x > 2 })\n" - " // -> [4, 6]\n" - " ```\n" - "\n" - " ```gleam\n" - " filter([2, 4, 6, 1], fn(x) { x > 6 })\n" - " // -> []\n" - " ```\n" -). --spec filter(list(ABI), fun((ABI) -> boolean())) -> list(ABI). -filter(List, Predicate) -> - filter_loop(List, Predicate, []). - --file("src/gleam/list.gleam", 353). --spec filter_map_loop( - list(ABW), - fun((ABW) -> {ok, ABY} | {error, any()}), - list(ABY) -) -> list(ABY). -filter_map_loop(List, Fun, Acc) -> - case List of - [] -> - lists:reverse(Acc); - - [First | Rest] -> - New_acc = case Fun(First) of - {ok, First@1} -> - [First@1 | Acc]; - - {error, _} -> - Acc - end, - filter_map_loop(Rest, Fun, New_acc) - end. - --file("src/gleam/list.gleam", 349). -?DOC( - " Returns a new list containing only the elements from the first list for\n" - " which the given functions returns `Ok(_)`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " filter_map([2, 4, 6, 1], Error)\n" - " // -> []\n" - " ```\n" - "\n" - " ```gleam\n" - " filter_map([2, 4, 6, 1], fn(x) { Ok(x + 1) })\n" - " // -> [3, 5, 7, 2]\n" - " ```\n" -). --spec filter_map(list(ABP), fun((ABP) -> {ok, ABR} | {error, any()})) -> list(ABR). -filter_map(List, Fun) -> - filter_map_loop(List, Fun, []). - --file("src/gleam/list.gleam", 383). --spec map_loop(list(ACI), fun((ACI) -> ACK), list(ACK)) -> list(ACK). -map_loop(List, Fun, Acc) -> - case List of - [] -> - lists:reverse(Acc); - - [First | Rest] -> - map_loop(Rest, Fun, [Fun(First) | Acc]) - end. - --file("src/gleam/list.gleam", 379). -?DOC( - " Returns a new list containing the results of applying the supplied function to each element.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " map([2, 4, 6], fn(x) { x * 2 })\n" - " // -> [4, 8, 12]\n" - " ```\n" -). --spec map(list(ACE), fun((ACE) -> ACG)) -> list(ACG). -map(List, Fun) -> - map_loop(List, Fun, []). - --file("src/gleam/list.gleam", 410). --spec map2_loop(list(ACT), list(ACV), fun((ACT, ACV) -> ACX), list(ACX)) -> list(ACX). -map2_loop(List1, List2, Fun, Acc) -> - case {List1, List2} of - {[], _} -> - lists:reverse(Acc); - - {_, []} -> - lists:reverse(Acc); - - {[A | As_], [B | Bs]} -> - map2_loop(As_, Bs, Fun, [Fun(A, B) | Acc]) - end. - --file("src/gleam/list.gleam", 406). -?DOC( - " Combines two lists into a single list using the given function.\n" - "\n" - " If a list is longer than the other, the extra elements are dropped.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " map2([1, 2, 3], [4, 5, 6], fn(x, y) { x + y })\n" - " // -> [5, 7, 9]\n" - " ```\n" - "\n" - " ```gleam\n" - " map2([1, 2], [\"a\", \"b\", \"c\"], fn(i, x) { #(i, x) })\n" - " // -> [#(1, \"a\"), #(2, \"b\")]\n" - " ```\n" -). --spec map2(list(ACN), list(ACP), fun((ACN, ACP) -> ACR)) -> list(ACR). -map2(List1, List2, Fun) -> - map2_loop(List1, List2, Fun, []). - --file("src/gleam/list.gleam", 443). --spec map_fold_loop(list(ADF), fun((ADH, ADF) -> {ADH, ADI}), ADH, list(ADI)) -> {ADH, - list(ADI)}. -map_fold_loop(List, Fun, Acc, List_acc) -> - case List of - [] -> - {Acc, lists:reverse(List_acc)}; - - [First | Rest] -> - {Acc@1, First@1} = Fun(Acc, First), - map_fold_loop(Rest, Fun, Acc@1, [First@1 | List_acc]) - end. - --file("src/gleam/list.gleam", 435). -?DOC( - " Similar to `map` but also lets you pass around an accumulated value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " map_fold(\n" - " over: [1, 2, 3],\n" - " from: 100,\n" - " with: fn(memo, i) { #(memo + i, i * 2) }\n" - " )\n" - " // -> #(106, [2, 4, 6])\n" - " ```\n" -). --spec map_fold(list(ADA), ADC, fun((ADC, ADA) -> {ADC, ADD})) -> {ADC, - list(ADD)}. -map_fold(List, Initial, Fun) -> - map_fold_loop(List, Fun, Initial, []). - --file("src/gleam/list.gleam", 475). --spec index_map_loop( - list(ADP), - fun((ADP, integer()) -> ADR), - integer(), - list(ADR) -) -> list(ADR). -index_map_loop(List, Fun, Index, Acc) -> - case List of - [] -> - lists:reverse(Acc); - - [First | Rest] -> - Acc@1 = [Fun(First, Index) | Acc], - index_map_loop(Rest, Fun, Index + 1, Acc@1) - end. - --file("src/gleam/list.gleam", 471). -?DOC( - " Similar to `map`, but the supplied function will also be passed the index\n" - " of the element being mapped as an additional argument.\n" - "\n" - " The index starts at 0, so the first element is 0, the second is 1, and so\n" - " on.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " index_map([\"a\", \"b\"], fn(x, i) { #(i, x) })\n" - " // -> [#(0, \"a\"), #(1, \"b\")]\n" - " ```\n" -). --spec index_map(list(ADL), fun((ADL, integer()) -> ADN)) -> list(ADN). -index_map(List, Fun) -> - index_map_loop(List, Fun, 0, []). - --file("src/gleam/list.gleam", 529). --spec try_map_loop(list(AED), fun((AED) -> {ok, AEF} | {error, AEG}), list(AEF)) -> {ok, - list(AEF)} | - {error, AEG}. -try_map_loop(List, Fun, Acc) -> - case List of - [] -> - {ok, lists:reverse(Acc)}; - - [First | Rest] -> - case Fun(First) of - {ok, First@1} -> - try_map_loop(Rest, Fun, [First@1 | Acc]); - - {error, Error} -> - {error, Error} - end - end. - --file("src/gleam/list.gleam", 522). -?DOC( - " Takes a function that returns a `Result` and applies it to each element in a\n" - " given list in turn.\n" - "\n" - " If the function returns `Ok(new_value)` for all elements in the list then a\n" - " list of the new values is returned.\n" - "\n" - " If the function returns `Error(reason)` for any of the elements then it is\n" - " returned immediately. None of the elements in the list are processed after\n" - " one returns an `Error`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " try_map([1, 2, 3], fn(x) { Ok(x + 2) })\n" - " // -> Ok([3, 4, 5])\n" - " ```\n" - "\n" - " ```gleam\n" - " try_map([1, 2, 3], fn(_) { Error(0) })\n" - " // -> Error(0)\n" - " ```\n" - "\n" - " ```gleam\n" - " try_map([[1], [2, 3]], first)\n" - " // -> Ok([1, 2])\n" - " ```\n" - "\n" - " ```gleam\n" - " try_map([[1], [], [2]], first)\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec try_map(list(ADU), fun((ADU) -> {ok, ADW} | {error, ADX})) -> {ok, - list(ADW)} | - {error, ADX}. -try_map(List, Fun) -> - try_map_loop(List, Fun, []). - --file("src/gleam/list.gleam", 564). -?DOC( - " Returns a list that is the given list with up to the given number of\n" - " elements removed from the front of the list.\n" - "\n" - " If the list has less than the number of elements an empty list is\n" - " returned.\n" - "\n" - " This function runs in linear time but does not copy the list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " drop([1, 2, 3, 4], 2)\n" - " // -> [3, 4]\n" - " ```\n" - "\n" - " ```gleam\n" - " drop([1, 2, 3, 4], 9)\n" - " // -> []\n" - " ```\n" -). --spec drop(list(AEN), integer()) -> list(AEN). -drop(List, N) -> - case N =< 0 of - true -> - List; - - false -> - case List of - [] -> - []; - - [_ | Rest] -> - drop(Rest, N - 1) - end - end. - --file("src/gleam/list.gleam", 599). --spec take_loop(list(AET), integer(), list(AET)) -> list(AET). -take_loop(List, N, Acc) -> - case N =< 0 of - true -> - lists:reverse(Acc); - - false -> - case List of - [] -> - lists:reverse(Acc); - - [First | Rest] -> - take_loop(Rest, N - 1, [First | Acc]) - end - end. - --file("src/gleam/list.gleam", 595). -?DOC( - " Returns a list containing the first given number of elements from the given\n" - " list.\n" - "\n" - " If the list has less than the number of elements then the full list is\n" - " returned.\n" - "\n" - " This function runs in linear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " take([1, 2, 3, 4], 2)\n" - " // -> [1, 2]\n" - " ```\n" - "\n" - " ```gleam\n" - " take([1, 2, 3, 4], 9)\n" - " // -> [1, 2, 3, 4]\n" - " ```\n" -). --spec take(list(AEQ), integer()) -> list(AEQ). -take(List, N) -> - take_loop(List, N, []). - --file("src/gleam/list.gleam", 619). -?DOC( - " Returns a new empty list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new()\n" - " // -> []\n" - " ```\n" -). --spec new() -> list(any()). -new() -> - []. - --file("src/gleam/list.gleam", 639). -?DOC( - " Returns the given item wrapped in a list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " wrap(1)\n" - " // -> [1]\n" - "\n" - " wrap([\"a\", \"b\", \"c\"])\n" - " // -> [[\"a\", \"b\", \"c\"]]\n" - "\n" - " wrap([[]])\n" - " // -> [[[]]]\n" - " ```\n" -). --spec wrap(AEZ) -> list(AEZ). -wrap(Item) -> - [Item]. - --file("src/gleam/list.gleam", 660). --spec append_loop(list(AFF), list(AFF)) -> list(AFF). -append_loop(First, Second) -> - case First of - [] -> - Second; - - [First@1 | Rest] -> - append_loop(Rest, [First@1 | Second]) - end. - --file("src/gleam/list.gleam", 656). -?DOC( - " Joins one list onto the end of another.\n" - "\n" - " This function runs in linear time, and it traverses and copies the first\n" - " list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " append([1, 2], [3])\n" - " // -> [1, 2, 3]\n" - " ```\n" -). --spec append(list(AFB), list(AFB)) -> list(AFB). -append(First, Second) -> - lists:append(First, Second). - --file("src/gleam/list.gleam", 680). -?DOC( - " Prefixes an item to a list. This can also be done using the dedicated\n" - " syntax instead.\n" - "\n" - " ```gleam\n" - " let existing_list = [2, 3, 4]\n" - "\n" - " [1, ..existing_list]\n" - " // -> [1, 2, 3, 4]\n" - "\n" - " prepend(to: existing_list, this: 1)\n" - " // -> [1, 2, 3, 4]\n" - " ```\n" -). --spec prepend(list(AFJ), AFJ) -> list(AFJ). -prepend(List, Item) -> - [Item | List]. - --file("src/gleam/list.gleam", 701). --spec flatten_loop(list(list(AFQ)), list(AFQ)) -> list(AFQ). -flatten_loop(Lists, Acc) -> - case Lists of - [] -> - lists:reverse(Acc); - - [List | Further_lists] -> - flatten_loop(Further_lists, lists:reverse(List, Acc)) - end. - --file("src/gleam/list.gleam", 697). -?DOC( - " Joins a list of lists into a single list.\n" - "\n" - " This function traverses all elements twice on the JavaScript target.\n" - " This function traverses all elements once on the Erlang target.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " flatten([[1], [2, 3], []])\n" - " // -> [1, 2, 3]\n" - " ```\n" -). --spec flatten(list(list(AFM))) -> list(AFM). -flatten(Lists) -> - lists:append(Lists). - --file("src/gleam/list.gleam", 718). -?DOC( - " Maps the list with the given function into a list of lists, and then flattens it.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " flat_map([2, 4, 6], fn(x) { [x, x + 1] })\n" - " // -> [2, 3, 4, 5, 6, 7]\n" - " ```\n" -). --spec flat_map(list(AFV), fun((AFV) -> list(AFX))) -> list(AFX). -flat_map(List, Fun) -> - lists:append(map(List, Fun)). - --file("src/gleam/list.gleam", 730). -?DOC( - " Reduces a list of elements into a single value by calling a given function\n" - " on each element, going from left to right.\n" - "\n" - " `fold([1, 2, 3], 0, add)` is the equivalent of\n" - " `add(add(add(0, 1), 2), 3)`.\n" - "\n" - " This function runs in linear time.\n" -). --spec fold(list(AGA), AGC, fun((AGC, AGA) -> AGC)) -> AGC. -fold(List, Initial, Fun) -> - case List of - [] -> - Initial; - - [First | Rest] -> - fold(Rest, Fun(Initial, First), Fun) - end. - --file("src/gleam/list.gleam", 752). -?DOC( - " Reduces a list of elements into a single value by calling a given function\n" - " on each element, going from right to left.\n" - "\n" - " `fold_right([1, 2, 3], 0, add)` is the equivalent of\n" - " `add(add(add(0, 3), 2), 1)`.\n" - "\n" - " This function runs in linear time.\n" - "\n" - " Unlike `fold` this function is not tail recursive. Where possible use\n" - " `fold` instead as it will use less memory.\n" -). --spec fold_right(list(AGD), AGF, fun((AGF, AGD) -> AGF)) -> AGF. -fold_right(List, Initial, Fun) -> - case List of - [] -> - Initial; - - [First | Rest] -> - Fun(fold_right(Rest, Initial, Fun), First) - end. - --file("src/gleam/list.gleam", 789). --spec index_fold_loop( - list(AGJ), - AGL, - fun((AGL, AGJ, integer()) -> AGL), - integer() -) -> AGL. -index_fold_loop(Over, Acc, With, Index) -> - case Over of - [] -> - Acc; - - [First | Rest] -> - index_fold_loop(Rest, With(Acc, First, Index), With, Index + 1) - end. - --file("src/gleam/list.gleam", 781). -?DOC( - " Like `fold` but the folding function also receives the index of the current element.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " [\"a\", \"b\", \"c\"]\n" - " |> index_fold(\"\", fn(acc, item, index) {\n" - " acc <> int.to_string(index) <> \":\" <> item <> \" \"\n" - " })\n" - " // -> \"0:a 1:b 2:c\"\n" - " ```\n" - "\n" - " ```gleam\n" - " [10, 20, 30]\n" - " |> index_fold(0, fn(acc, item, index) { acc + item * index })\n" - " // -> 80\n" - " ```\n" -). --spec index_fold(list(AGG), AGI, fun((AGI, AGG, integer()) -> AGI)) -> AGI. -index_fold(List, Initial, Fun) -> - index_fold_loop(List, Initial, Fun, 0). - --file("src/gleam/list.gleam", 821). -?DOC( - " A variant of fold that might fail.\n" - "\n" - " The folding function should return `Result(accumulator, error)`.\n" - " If the returned value is `Ok(accumulator)` try_fold will try the next value in the list.\n" - " If the returned value is `Error(error)` try_fold will stop and return that error.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " [1, 2, 3, 4]\n" - " |> try_fold(0, fn(acc, i) {\n" - " case i < 3 {\n" - " True -> Ok(acc + i)\n" - " False -> Error(Nil)\n" - " }\n" - " })\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec try_fold(list(AGM), AGO, fun((AGO, AGM) -> {ok, AGO} | {error, AGP})) -> {ok, - AGO} | - {error, AGP}. -try_fold(List, Initial, Fun) -> - case List of - [] -> - {ok, Initial}; - - [First | Rest] -> - case Fun(Initial, First) of - {ok, Result} -> - try_fold(Rest, Result, Fun); - - {error, _} = Error -> - Error - end - end. - --file("src/gleam/list.gleam", 860). -?DOC( - " A variant of fold that allows to stop folding earlier.\n" - "\n" - " The folding function should return `ContinueOrStop(accumulator)`.\n" - " If the returned value is `Continue(accumulator)` fold_until will try the next value in the list.\n" - " If the returned value is `Stop(accumulator)` fold_until will stop and return that accumulator.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " [1, 2, 3, 4]\n" - " |> fold_until(0, fn(acc, i) {\n" - " case i < 3 {\n" - " True -> Continue(acc + i)\n" - " False -> Stop(acc)\n" - " }\n" - " })\n" - " // -> 3\n" - " ```\n" -). --spec fold_until(list(AGU), AGW, fun((AGW, AGU) -> continue_or_stop(AGW))) -> AGW. -fold_until(List, Initial, Fun) -> - case List of - [] -> - Initial; - - [First | Rest] -> - case Fun(Initial, First) of - {continue, Next_accumulator} -> - fold_until(Rest, Next_accumulator, Fun); - - {stop, B} -> - B - end - end. - --file("src/gleam/list.gleam", 897). -?DOC( - " Finds the first element in a given list for which the given function returns\n" - " `True`.\n" - "\n" - " Returns `Error(Nil)` if no such element is found.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " find([1, 2, 3], fn(x) { x > 2 })\n" - " // -> Ok(3)\n" - " ```\n" - "\n" - " ```gleam\n" - " find([1, 2, 3], fn(x) { x > 4 })\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " find([], fn(_) { True })\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec find(list(AGY), fun((AGY) -> boolean())) -> {ok, AGY} | {error, nil}. -find(List, Is_desired) -> - case List of - [] -> - {error, nil}; - - [First | Rest] -> - case Is_desired(First) of - true -> - {ok, First}; - - false -> - find(Rest, Is_desired) - end - end. - --file("src/gleam/list.gleam", 933). -?DOC( - " Finds the first element in a given list for which the given function returns\n" - " `Ok(new_value)`, then returns the wrapped `new_value`.\n" - "\n" - " Returns `Error(Nil)` if no such element is found.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " find_map([[], [2], [3]], first)\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " find_map([[], []], first)\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " find_map([], first)\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec find_map(list(AHC), fun((AHC) -> {ok, AHE} | {error, any()})) -> {ok, AHE} | - {error, nil}. -find_map(List, Fun) -> - case List of - [] -> - {error, nil}; - - [First | Rest] -> - case Fun(First) of - {ok, First@1} -> - {ok, First@1}; - - {error, _} -> - find_map(Rest, Fun) - end - end. - --file("src/gleam/list.gleam", 968). -?DOC( - " Returns `True` if the given function returns `True` for all the elements in\n" - " the given list. If the function returns `False` for any of the elements it\n" - " immediately returns `False` without checking the rest of the list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " all([], fn(x) { x > 3 })\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " all([4, 5], fn(x) { x > 3 })\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " all([4, 3], fn(x) { x > 3 })\n" - " // -> False\n" - " ```\n" -). --spec all(list(AHK), fun((AHK) -> boolean())) -> boolean(). -all(List, Predicate) -> - case List of - [] -> - true; - - [First | Rest] -> - case Predicate(First) of - true -> - all(Rest, Predicate); - - false -> - false - end - end. - --file("src/gleam/list.gleam", 1005). -?DOC( - " Returns `True` if the given function returns `True` for any the elements in\n" - " the given list. If the function returns `True` for any of the elements it\n" - " immediately returns `True` without checking the rest of the list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " any([], fn(x) { x > 3 })\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " any([4, 5], fn(x) { x > 3 })\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " any([4, 3], fn(x) { x > 4 })\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " any([3, 4], fn(x) { x > 3 })\n" - " // -> True\n" - " ```\n" -). --spec any(list(AHM), fun((AHM) -> boolean())) -> boolean(). -any(List, Predicate) -> - case List of - [] -> - false; - - [First | Rest] -> - case Predicate(First) of - true -> - true; - - false -> - any(Rest, Predicate) - end - end. - --file("src/gleam/list.gleam", 1047). --spec zip_loop(list(AHT), list(AHV), list({AHT, AHV})) -> list({AHT, AHV}). -zip_loop(One, Other, Acc) -> - case {One, Other} of - {[First_one | Rest_one], [First_other | Rest_other]} -> - zip_loop(Rest_one, Rest_other, [{First_one, First_other} | Acc]); - - {_, _} -> - lists:reverse(Acc) - end. - --file("src/gleam/list.gleam", 1043). -?DOC( - " Takes two lists and returns a single list of 2-element tuples.\n" - "\n" - " If one of the lists is longer than the other, the remaining elements from\n" - " the longer list are not used.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " zip([], [])\n" - " // -> []\n" - " ```\n" - "\n" - " ```gleam\n" - " zip([1, 2], [3])\n" - " // -> [#(1, 3)]\n" - " ```\n" - "\n" - " ```gleam\n" - " zip([1], [3, 4])\n" - " // -> [#(1, 3)]\n" - " ```\n" - "\n" - " ```gleam\n" - " zip([1, 2], [3, 4])\n" - " // -> [#(1, 3), #(2, 4)]\n" - " ```\n" -). --spec zip(list(AHO), list(AHQ)) -> list({AHO, AHQ}). -zip(List, Other) -> - zip_loop(List, Other, []). - --file("src/gleam/list.gleam", 1088). --spec strict_zip_loop(list(AIG), list(AII), list({AIG, AII})) -> {ok, - list({AIG, AII})} | - {error, nil}. -strict_zip_loop(One, Other, Acc) -> - case {One, Other} of - {[], []} -> - {ok, lists:reverse(Acc)}; - - {[], _} -> - {error, nil}; - - {_, []} -> - {error, nil}; - - {[First_one | Rest_one], [First_other | Rest_other]} -> - strict_zip_loop( - Rest_one, - Rest_other, - [{First_one, First_other} | Acc] - ) - end. - --file("src/gleam/list.gleam", 1081). -?DOC( - " Takes two lists and returns a single list of 2-element tuples.\n" - "\n" - " If one of the lists is longer than the other, an `Error` is returned.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " strict_zip([], [])\n" - " // -> Ok([])\n" - " ```\n" - "\n" - " ```gleam\n" - " strict_zip([1, 2], [3])\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " strict_zip([1], [3, 4])\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " strict_zip([1, 2], [3, 4])\n" - " // -> Ok([#(1, 3), #(2, 4)])\n" - " ```\n" -). --spec strict_zip(list(AHZ), list(AIB)) -> {ok, list({AHZ, AIB})} | {error, nil}. -strict_zip(List, Other) -> - strict_zip_loop(List, Other, []). - --file("src/gleam/list.gleam", 1119). --spec unzip_loop(list({AIT, AIU}), list(AIT), list(AIU)) -> {list(AIT), - list(AIU)}. -unzip_loop(Input, One, Other) -> - case Input of - [] -> - {lists:reverse(One), lists:reverse(Other)}; - - [{First_one, First_other} | Rest] -> - unzip_loop(Rest, [First_one | One], [First_other | Other]) - end. - --file("src/gleam/list.gleam", 1115). -?DOC( - " Takes a single list of 2-element tuples and returns two lists.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " unzip([#(1, 2), #(3, 4)])\n" - " // -> #([1, 3], [2, 4])\n" - " ```\n" - "\n" - " ```gleam\n" - " unzip([])\n" - " // -> #([], [])\n" - " ```\n" -). --spec unzip(list({AIO, AIP})) -> {list(AIO), list(AIP)}. -unzip(Input) -> - unzip_loop(Input, [], []). - --file("src/gleam/list.gleam", 1154). --spec intersperse_loop(list(AJD), AJD, list(AJD)) -> list(AJD). -intersperse_loop(List, Separator, Acc) -> - case List of - [] -> - lists:reverse(Acc); - - [First | Rest] -> - intersperse_loop(Rest, Separator, [First, Separator | Acc]) - end. - --file("src/gleam/list.gleam", 1147). -?DOC( - " Inserts a given value between each existing element in a given list.\n" - "\n" - " This function runs in linear time and copies the list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " intersperse([1, 1, 1], 2)\n" - " // -> [1, 2, 1, 2, 1]\n" - " ```\n" - "\n" - " ```gleam\n" - " intersperse([], 2)\n" - " // -> []\n" - " ```\n" -). --spec intersperse(list(AJA), AJA) -> list(AJA). -intersperse(List, Elem) -> - case List of - [] -> - List; - - [_] -> - List; - - [First | Rest] -> - intersperse_loop(Rest, Elem, [First]) - end. - --file("src/gleam/list.gleam", 1177). --spec unique_loop(list(AJK), gleam@dict:dict(AJK, nil), list(AJK)) -> list(AJK). -unique_loop(List, Seen, Acc) -> - case List of - [] -> - lists:reverse(Acc); - - [First | Rest] -> - case gleam@dict:has_key(Seen, First) of - true -> - unique_loop(Rest, Seen, Acc); - - false -> - unique_loop( - Rest, - gleam@dict:insert(Seen, First, nil), - [First | Acc] - ) - end - end. - --file("src/gleam/list.gleam", 1173). -?DOC( - " Removes any duplicate elements from a given list.\n" - "\n" - " This function returns in loglinear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " unique([1, 1, 1, 4, 7, 3, 3, 4])\n" - " // -> [1, 4, 7, 3]\n" - " ```\n" -). --spec unique(list(AJH)) -> list(AJH). -unique(List) -> - unique_loop(List, maps:new(), []). - --file("src/gleam/list.gleam", 1263). -?DOC( - " Given a list it returns slices of it that are locally sorted in ascending\n" - " order.\n" - "\n" - " Imagine you have this list:\n" - "\n" - " ```\n" - " [1, 2, 3, 2, 1, 0]\n" - " ^^^^^^^ ^^^^^^^ This is a slice in descending order\n" - " |\n" - " | This is a slice that is sorted in ascending order\n" - " ```\n" - "\n" - " So the produced result will contain these two slices, each one sorted in\n" - " ascending order: `[[1, 2, 3], [0, 1, 2]]`.\n" - "\n" - " - `growing` is an accumulator with the current slice being grown\n" - " - `direction` is the growing direction of the slice being grown, it could\n" - " either be ascending or strictly descending\n" - " - `prev` is the previous element that needs to be added to the growing slice\n" - " it is carried around to check whether we have to keep growing the current\n" - " slice or not\n" - " - `acc` is the accumulator containing the slices sorted in ascending order\n" -). --spec sequences( - list(AJT), - fun((AJT, AJT) -> gleam@order:order()), - list(AJT), - sorting(), - AJT, - list(list(AJT)) -) -> list(list(AJT)). -sequences(List, Compare, Growing, Direction, Prev, Acc) -> - Growing@1 = [Prev | Growing], - case List of - [] -> - case Direction of - ascending -> - [lists:reverse(Growing@1) | Acc]; - - descending -> - [Growing@1 | Acc] - end; - - [New | Rest] -> - case {Compare(Prev, New), Direction} of - {gt, descending} -> - sequences(Rest, Compare, Growing@1, Direction, New, Acc); - - {lt, ascending} -> - sequences(Rest, Compare, Growing@1, Direction, New, Acc); - - {eq, ascending} -> - sequences(Rest, Compare, Growing@1, Direction, New, Acc); - - {gt, ascending} -> - Acc@1 = case Direction of - ascending -> - [lists:reverse(Growing@1) | Acc]; - - descending -> - [Growing@1 | Acc] - end, - case Rest of - [] -> - [[New] | Acc@1]; - - [Next | Rest@1] -> - Direction@1 = case Compare(New, Next) of - lt -> - ascending; - - eq -> - ascending; - - gt -> - descending - end, - sequences( - Rest@1, - Compare, - [New], - Direction@1, - Next, - Acc@1 - ) - end; - - {lt, descending} -> - Acc@1 = case Direction of - ascending -> - [lists:reverse(Growing@1) | Acc]; - - descending -> - [Growing@1 | Acc] - end, - case Rest of - [] -> - [[New] | Acc@1]; - - [Next | Rest@1] -> - Direction@1 = case Compare(New, Next) of - lt -> - ascending; - - eq -> - ascending; - - gt -> - descending - end, - sequences( - Rest@1, - Compare, - [New], - Direction@1, - Next, - Acc@1 - ) - end; - - {eq, descending} -> - Acc@1 = case Direction of - ascending -> - [lists:reverse(Growing@1) | Acc]; - - descending -> - [Growing@1 | Acc] - end, - case Rest of - [] -> - [[New] | Acc@1]; - - [Next | Rest@1] -> - Direction@1 = case Compare(New, Next) of - lt -> - ascending; - - eq -> - ascending; - - gt -> - descending - end, - sequences( - Rest@1, - Compare, - [New], - Direction@1, - Next, - Acc@1 - ) - end - end - end. - --file("src/gleam/list.gleam", 1411). -?DOC( - " Merges two lists sorted in ascending order into a single list sorted in\n" - " descending order according to the given comparator function.\n" - "\n" - " This reversing of the sort order is not avoidable if we want to implement\n" - " merge as a tail recursive function. We could reverse the accumulator before\n" - " returning it but that would end up being less efficient; so the merging\n" - " algorithm has to play around this.\n" -). --spec merge_ascendings( - list(AKQ), - list(AKQ), - fun((AKQ, AKQ) -> gleam@order:order()), - list(AKQ) -) -> list(AKQ). -merge_ascendings(List1, List2, Compare, Acc) -> - case {List1, List2} of - {[], List} -> - lists:reverse(List, Acc); - - {List, []} -> - lists:reverse(List, Acc); - - {[First1 | Rest1], [First2 | Rest2]} -> - case Compare(First1, First2) of - lt -> - merge_ascendings(Rest1, List2, Compare, [First1 | Acc]); - - gt -> - merge_ascendings(List1, Rest2, Compare, [First2 | Acc]); - - eq -> - merge_ascendings(List1, Rest2, Compare, [First2 | Acc]) - end - end. - --file("src/gleam/list.gleam", 1364). -?DOC( - " Given a list of ascending lists, it merges adjacent pairs into a single\n" - " descending list, halving their number.\n" - " It returns a list of the remaining descending lists.\n" -). --spec merge_ascending_pairs( - list(list(AKE)), - fun((AKE, AKE) -> gleam@order:order()), - list(list(AKE)) -) -> list(list(AKE)). -merge_ascending_pairs(Sequences, Compare, Acc) -> - case Sequences of - [] -> - lists:reverse(Acc); - - [Sequence] -> - lists:reverse([lists:reverse(Sequence) | Acc]); - - [Ascending1, Ascending2 | Rest] -> - Descending = merge_ascendings(Ascending1, Ascending2, Compare, []), - merge_ascending_pairs(Rest, Compare, [Descending | Acc]) - end. - --file("src/gleam/list.gleam", 1438). -?DOC( - " This is exactly the same as merge_ascendings but mirrored: it merges two\n" - " lists sorted in descending order into a single list sorted in ascending\n" - " order according to the given comparator function.\n" - "\n" - " This reversing of the sort order is not avoidable if we want to implement\n" - " merge as a tail recursive function. We could reverse the accumulator before\n" - " returning it but that would end up being less efficient; so the merging\n" - " algorithm has to play around this.\n" -). --spec merge_descendings( - list(AKV), - list(AKV), - fun((AKV, AKV) -> gleam@order:order()), - list(AKV) -) -> list(AKV). -merge_descendings(List1, List2, Compare, Acc) -> - case {List1, List2} of - {[], List} -> - lists:reverse(List, Acc); - - {List, []} -> - lists:reverse(List, Acc); - - {[First1 | Rest1], [First2 | Rest2]} -> - case Compare(First1, First2) of - lt -> - merge_descendings(List1, Rest2, Compare, [First2 | Acc]); - - gt -> - merge_descendings(Rest1, List2, Compare, [First1 | Acc]); - - eq -> - merge_descendings(Rest1, List2, Compare, [First1 | Acc]) - end - end. - --file("src/gleam/list.gleam", 1386). -?DOC(" This is the same as merge_ascending_pairs but flipped for descending lists.\n"). --spec merge_descending_pairs( - list(list(AKK)), - fun((AKK, AKK) -> gleam@order:order()), - list(list(AKK)) -) -> list(list(AKK)). -merge_descending_pairs(Sequences, Compare, Acc) -> - case Sequences of - [] -> - lists:reverse(Acc); - - [Sequence] -> - lists:reverse([lists:reverse(Sequence) | Acc]); - - [Descending1, Descending2 | Rest] -> - Ascending = merge_descendings(Descending1, Descending2, Compare, []), - merge_descending_pairs(Rest, Compare, [Ascending | Acc]) - end. - --file("src/gleam/list.gleam", 1330). -?DOC( - " Given some some sorted sequences (assumed to be sorted in `direction`) it\n" - " merges them all together until we're left with just a list sorted in\n" - " ascending order.\n" -). --spec merge_all( - list(list(AKA)), - sorting(), - fun((AKA, AKA) -> gleam@order:order()) -) -> list(AKA). -merge_all(Sequences, Direction, Compare) -> - case {Sequences, Direction} of - {[], _} -> - []; - - {[Sequence], ascending} -> - Sequence; - - {[Sequence@1], descending} -> - lists:reverse(Sequence@1); - - {_, ascending} -> - Sequences@1 = merge_ascending_pairs(Sequences, Compare, []), - merge_all(Sequences@1, descending, Compare); - - {_, descending} -> - Sequences@2 = merge_descending_pairs(Sequences, Compare, []), - merge_all(Sequences@2, ascending, Compare) - end. - --file("src/gleam/list.gleam", 1201). -?DOC( - " Sorts from smallest to largest based upon the ordering specified by a given\n" - " function.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - "\n" - " sort([4, 3, 6, 5, 4, 1, 2], by: int.compare)\n" - " // -> [1, 2, 3, 4, 4, 5, 6]\n" - " ```\n" -). --spec sort(list(AJQ), fun((AJQ, AJQ) -> gleam@order:order())) -> list(AJQ). -sort(List, Compare) -> - case List of - [] -> - []; - - [X] -> - [X]; - - [X@1, Y | Rest] -> - Direction = case Compare(X@1, Y) of - lt -> - ascending; - - eq -> - ascending; - - gt -> - descending - end, - Sequences = sequences(Rest, Compare, [X@1], Direction, Y, []), - merge_all(Sequences, ascending, Compare) - end. - --file("src/gleam/list.gleam", 1478). --spec range_loop(integer(), integer(), list(integer())) -> list(integer()). -range_loop(Start, Stop, Acc) -> - case gleam@int:compare(Start, Stop) of - eq -> - [Stop | Acc]; - - gt -> - range_loop(Start, Stop + 1, [Stop | Acc]); - - lt -> - range_loop(Start, Stop - 1, [Stop | Acc]) - end. - --file("src/gleam/list.gleam", 1474). -?DOC( - " Creates a list of ints ranging from a given start and finish.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " range(0, 0)\n" - " // -> [0]\n" - " ```\n" - "\n" - " ```gleam\n" - " range(0, 5)\n" - " // -> [0, 1, 2, 3, 4, 5]\n" - " ```\n" - "\n" - " ```gleam\n" - " range(1, -5)\n" - " // -> [1, 0, -1, -2, -3, -4, -5]\n" - " ```\n" -). --spec range(integer(), integer()) -> list(integer()). -range(Start, Stop) -> - range_loop(Start, Stop, []). - --file("src/gleam/list.gleam", 1504). --spec repeat_loop(ALF, integer(), list(ALF)) -> list(ALF). -repeat_loop(Item, Times, Acc) -> - case Times =< 0 of - true -> - Acc; - - false -> - repeat_loop(Item, Times - 1, [Item | Acc]) - end. - --file("src/gleam/list.gleam", 1500). -?DOC( - " Builds a list of a given value a given number of times.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " repeat(\"a\", times: 0)\n" - " // -> []\n" - " ```\n" - "\n" - " ```gleam\n" - " repeat(\"a\", times: 5)\n" - " // -> [\"a\", \"a\", \"a\", \"a\", \"a\"]\n" - " ```\n" -). --spec repeat(ALD, integer()) -> list(ALD). -repeat(A, Times) -> - repeat_loop(A, Times, []). - --file("src/gleam/list.gleam", 1537). --spec split_loop(list(ALM), integer(), list(ALM)) -> {list(ALM), list(ALM)}. -split_loop(List, N, Taken) -> - case N =< 0 of - true -> - {lists:reverse(Taken), List}; - - false -> - case List of - [] -> - {lists:reverse(Taken), []}; - - [First | Rest] -> - split_loop(Rest, N - 1, [First | Taken]) - end - end. - --file("src/gleam/list.gleam", 1533). -?DOC( - " Splits a list in two before the given index.\n" - "\n" - " If the list is not long enough to have the given index the before list will\n" - " be the input list, and the after list will be empty.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " split([6, 7, 8, 9], 0)\n" - " // -> #([], [6, 7, 8, 9])\n" - " ```\n" - "\n" - " ```gleam\n" - " split([6, 7, 8, 9], 2)\n" - " // -> #([6, 7], [8, 9])\n" - " ```\n" - "\n" - " ```gleam\n" - " split([6, 7, 8, 9], 4)\n" - " // -> #([6, 7, 8, 9], [])\n" - " ```\n" -). --spec split(list(ALI), integer()) -> {list(ALI), list(ALI)}. -split(List, Index) -> - split_loop(List, Index, []). - --file("src/gleam/list.gleam", 1573). --spec split_while_loop(list(ALV), fun((ALV) -> boolean()), list(ALV)) -> {list(ALV), - list(ALV)}. -split_while_loop(List, F, Acc) -> - case List of - [] -> - {lists:reverse(Acc), []}; - - [First | Rest] -> - case F(First) of - true -> - split_while_loop(Rest, F, [First | Acc]); - - false -> - {lists:reverse(Acc), List} - end - end. - --file("src/gleam/list.gleam", 1566). -?DOC( - " Splits a list in two before the first element that a given function returns\n" - " `False` for.\n" - "\n" - " If the function returns `True` for all elements the first list will be the\n" - " input list, and the second list will be empty.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " split_while([1, 2, 3, 4, 5], fn(x) { x <= 3 })\n" - " // -> #([1, 2, 3], [4, 5])\n" - " ```\n" - "\n" - " ```gleam\n" - " split_while([1, 2, 3, 4, 5], fn(x) { x <= 5 })\n" - " // -> #([1, 2, 3, 4, 5], [])\n" - " ```\n" -). --spec split_while(list(ALR), fun((ALR) -> boolean())) -> {list(ALR), list(ALR)}. -split_while(List, Predicate) -> - split_while_loop(List, Predicate, []). - --file("src/gleam/list.gleam", 1613). -?DOC( - " Given a list of 2-element tuples, finds the first tuple that has a given\n" - " key as the first element and returns the second element.\n" - "\n" - " If no tuple is found with the given key then `Error(Nil)` is returned.\n" - "\n" - " This function may be useful for interacting with Erlang code where lists of\n" - " tuples are common.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " key_find([#(\"a\", 0), #(\"b\", 1)], \"a\")\n" - " // -> Ok(0)\n" - " ```\n" - "\n" - " ```gleam\n" - " key_find([#(\"a\", 0), #(\"b\", 1)], \"b\")\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " key_find([#(\"a\", 0), #(\"b\", 1)], \"c\")\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec key_find(list({AMA, AMB}), AMA) -> {ok, AMB} | {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 - ). - --file("src/gleam/list.gleam", 1644). -?DOC( - " Given a list of 2-element tuples, finds all tuples that have a given\n" - " key as the first element and returns the second element.\n" - "\n" - " This function may be useful for interacting with Erlang code where lists of\n" - " tuples are common.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " key_filter([#(\"a\", 0), #(\"b\", 1), #(\"a\", 2)], \"a\")\n" - " // -> [0, 2]\n" - " ```\n" - "\n" - " ```gleam\n" - " key_filter([#(\"a\", 0), #(\"b\", 1)], \"c\")\n" - " // -> []\n" - " ```\n" -). --spec key_filter(list({AMF, AMG}), AMF) -> list(AMG). -key_filter(Keyword_list, Desired_key) -> - filter_map( - Keyword_list, - fun(Keyword) -> - {Key, Value} = Keyword, - case Key =:= Desired_key of - true -> - {ok, Value}; - - false -> - {error, nil} - end - end - ). - --file("src/gleam/list.gleam", 1684). --spec key_pop_loop(list({AMP, AMQ}), AMP, list({AMP, AMQ})) -> {ok, - {AMQ, list({AMP, AMQ})}} | - {error, nil}. -key_pop_loop(List, Key, Checked) -> - case List of - [] -> - {error, nil}; - - [{K, V} | Rest] when K =:= Key -> - {ok, {V, lists:reverse(Checked, Rest)}}; - - [First | Rest@1] -> - key_pop_loop(Rest@1, Key, [First | Checked]) - end. - --file("src/gleam/list.gleam", 1680). -?DOC( - " Given a list of 2-element tuples, finds the first tuple that has a given\n" - " key as the first element. This function will return the second element\n" - " of the found tuple and list with tuple removed.\n" - "\n" - " If no tuple is found with the given key then `Error(Nil)` is returned.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " key_pop([#(\"a\", 0), #(\"b\", 1)], \"a\")\n" - " // -> Ok(#(0, [#(\"b\", 1)]))\n" - " ```\n" - "\n" - " ```gleam\n" - " key_pop([#(\"a\", 0), #(\"b\", 1)], \"b\")\n" - " // -> Ok(#(1, [#(\"a\", 0)]))\n" - " ```\n" - "\n" - " ```gleam\n" - " key_pop([#(\"a\", 0), #(\"b\", 1)], \"c\")\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec key_pop(list({AMJ, AMK}), AMJ) -> {ok, {AMK, list({AMJ, AMK})}} | - {error, nil}. -key_pop(List, Key) -> - key_pop_loop(List, Key, []). - --file("src/gleam/list.gleam", 1718). --spec key_set_loop(list({ANA, ANB}), ANA, ANB, list({ANA, ANB})) -> list({ANA, - ANB}). -key_set_loop(List, Key, Value, Inspected) -> - case List of - [{K, _} | Rest] when K =:= Key -> - lists:reverse(Inspected, [{K, Value} | Rest]); - - [First | Rest@1] -> - key_set_loop(Rest@1, Key, Value, [First | Inspected]); - - [] -> - lists:reverse([{Key, Value} | Inspected]) - end. - --file("src/gleam/list.gleam", 1714). -?DOC( - " Given a list of 2-element tuples, inserts a key and value into the list.\n" - "\n" - " If there was already a tuple with the key then it is replaced, otherwise it\n" - " is added to the end of the list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " key_set([#(5, 0), #(4, 1)], 4, 100)\n" - " // -> [#(5, 0), #(4, 100)]\n" - " ```\n" - "\n" - " ```gleam\n" - " key_set([#(5, 0), #(4, 1)], 1, 100)\n" - " // -> [#(5, 0), #(4, 1), #(1, 100)]\n" - " ```\n" -). --spec key_set(list({AMW, AMX}), AMW, AMX) -> list({AMW, AMX}). -key_set(List, Key, Value) -> - key_set_loop(List, Key, Value, []). - --file("src/gleam/list.gleam", 1746). -?DOC( - " Calls a function for each element in a list, discarding the return value.\n" - "\n" - " Useful for calling a side effect for every item of a list.\n" - "\n" - " ```gleam\n" - " import gleam/io\n" - "\n" - " each([\"1\", \"2\", \"3\"], io.println)\n" - " // -> Nil\n" - " // 1\n" - " // 2\n" - " // 3\n" - " ```\n" -). --spec each(list(ANF), fun((ANF) -> any())) -> nil. -each(List, F) -> - case List of - [] -> - nil; - - [First | Rest] -> - F(First), - each(Rest, F) - end. - --file("src/gleam/list.gleam", 1772). -?DOC( - " Calls a `Result` returning function for each element in a list, discarding\n" - " the return value. If the function returns `Error` then the iteration is\n" - " stopped and the error is returned.\n" - "\n" - " Useful for calling a side effect for every item of a list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " try_each(\n" - " over: [1, 2, 3],\n" - " with: function_that_might_fail,\n" - " )\n" - " // -> Ok(Nil)\n" - " ```\n" -). --spec try_each(list(ANI), fun((ANI) -> {ok, any()} | {error, ANL})) -> {ok, nil} | - {error, ANL}. -try_each(List, Fun) -> - case List of - [] -> - {ok, nil}; - - [First | Rest] -> - case Fun(First) of - {ok, _} -> - try_each(Rest, Fun); - - {error, E} -> - {error, E} - end - end. - --file("src/gleam/list.gleam", 1805). --spec partition_loop(list(BGL), fun((BGL) -> boolean()), list(BGL), list(BGL)) -> {list(BGL), - list(BGL)}. -partition_loop(List, Categorise, Trues, Falses) -> - case List of - [] -> - {lists:reverse(Trues), lists:reverse(Falses)}; - - [First | Rest] -> - case Categorise(First) of - true -> - partition_loop(Rest, Categorise, [First | Trues], Falses); - - false -> - partition_loop(Rest, Categorise, Trues, [First | Falses]) - end - end. - --file("src/gleam/list.gleam", 1798). -?DOC( - " Partitions a list into a tuple/pair of lists\n" - " by a given categorisation function.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - "\n" - " [1, 2, 3, 4, 5] |> partition(int.is_odd)\n" - " // -> #([1, 3, 5], [2, 4])\n" - " ```\n" -). --spec partition(list(ANQ), fun((ANQ) -> boolean())) -> {list(ANQ), list(ANQ)}. -partition(List, Categorise) -> - partition_loop(List, Categorise, [], []). - --file("src/gleam/list.gleam", 1885). --spec window_loop(list(list(AOX)), list(AOX), integer()) -> list(list(AOX)). -window_loop(Acc, List, N) -> - Window = take(List, N), - case erlang:length(Window) =:= N of - true -> - window_loop([Window | Acc], drop(List, 1), N); - - false -> - lists:reverse(Acc) - end. - --file("src/gleam/list.gleam", 1878). -?DOC( - " Returns a list of sliding windows.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " window([1,2,3,4,5], 3)\n" - " // -> [[1, 2, 3], [2, 3, 4], [3, 4, 5]]\n" - " ```\n" - "\n" - " ```gleam\n" - " window([1, 2], 4)\n" - " // -> []\n" - " ```\n" -). --spec window(list(AOT), integer()) -> list(list(AOT)). -window(List, N) -> - case N =< 0 of - true -> - []; - - false -> - window_loop([], List, N) - end. - --file("src/gleam/list.gleam", 1908). -?DOC( - " Returns a list of tuples containing two contiguous elements.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " window_by_2([1,2,3,4])\n" - " // -> [#(1, 2), #(2, 3), #(3, 4)]\n" - " ```\n" - "\n" - " ```gleam\n" - " window_by_2([1])\n" - " // -> []\n" - " ```\n" -). --spec window_by_2(list(APD)) -> list({APD, APD}). -window_by_2(List) -> - zip(List, drop(List, 1)). - --file("src/gleam/list.gleam", 1921). -?DOC( - " Drops the first elements in a given list for which the predicate function returns `True`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " drop_while([1, 2, 3, 4], fn (x) { x < 3 })\n" - " // -> [3, 4]\n" - " ```\n" -). --spec drop_while(list(APG), fun((APG) -> boolean())) -> list(APG). -drop_while(List, Predicate) -> - case List of - [] -> - []; - - [First | Rest] -> - case Predicate(First) of - true -> - drop_while(Rest, Predicate); - - false -> - [First | Rest] - end - end. - --file("src/gleam/list.gleam", 1951). --spec take_while_loop(list(APM), fun((APM) -> boolean()), list(APM)) -> list(APM). -take_while_loop(List, Predicate, Acc) -> - case List of - [] -> - lists:reverse(Acc); - - [First | Rest] -> - case Predicate(First) of - true -> - take_while_loop(Rest, Predicate, [First | Acc]); - - false -> - lists:reverse(Acc) - end - end. - --file("src/gleam/list.gleam", 1944). -?DOC( - " Takes the first elements in a given list for which the predicate function returns `True`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " take_while([1, 2, 3, 2, 4], fn (x) { x < 3 })\n" - " // -> [1, 2]\n" - " ```\n" -). --spec take_while(list(APJ), fun((APJ) -> boolean())) -> list(APJ). -take_while(List, Predicate) -> - take_while_loop(List, Predicate, []). - --file("src/gleam/list.gleam", 1983). --spec chunk_loop(list(APV), fun((APV) -> APX), APX, list(APV), list(list(APV))) -> list(list(APV)). -chunk_loop(List, F, Previous_key, Current_chunk, Acc) -> - case List of - [First | Rest] -> - Key = F(First), - case Key =:= Previous_key of - true -> - chunk_loop(Rest, F, Key, [First | Current_chunk], Acc); - - false -> - New_acc = [lists:reverse(Current_chunk) | Acc], - chunk_loop(Rest, F, Key, [First], New_acc) - end; - - [] -> - lists:reverse([lists:reverse(Current_chunk) | Acc]) - end. - --file("src/gleam/list.gleam", 1976). -?DOC( - " Returns a list of chunks in which\n" - " the return value of calling `f` on each element is the same.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " [1, 2, 2, 3, 4, 4, 6, 7, 7] |> chunk(by: fn(n) { n % 2 })\n" - " // -> [[1], [2, 2], [3], [4, 4, 6], [7, 7]]\n" - " ```\n" -). --spec chunk(list(APQ), fun((APQ) -> any())) -> list(list(APQ)). -chunk(List, F) -> - case List of - [] -> - []; - - [First | Rest] -> - chunk_loop(Rest, F, F(First), [First], []) - end. - --file("src/gleam/list.gleam", 2028). --spec sized_chunk_loop( - list(AQH), - integer(), - integer(), - list(AQH), - list(list(AQH)) -) -> list(list(AQH)). -sized_chunk_loop(List, Count, Left, Current_chunk, Acc) -> - case List of - [] -> - case Current_chunk of - [] -> - lists:reverse(Acc); - - Remaining -> - lists:reverse([lists:reverse(Remaining) | Acc]) - end; - - [First | Rest] -> - Chunk = [First | Current_chunk], - case Left > 1 of - true -> - sized_chunk_loop(Rest, Count, Left - 1, Chunk, Acc); - - false -> - sized_chunk_loop( - Rest, - Count, - Count, - [], - [lists:reverse(Chunk) | Acc] - ) - end - end. - --file("src/gleam/list.gleam", 2024). -?DOC( - " Returns a list of chunks containing `count` elements each.\n" - "\n" - " If the last chunk does not have `count` elements, it is instead\n" - " a partial chunk, with less than `count` elements.\n" - "\n" - " For any `count` less than 1 this function behaves as if it was set to 1.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " [1, 2, 3, 4, 5, 6] |> sized_chunk(into: 2)\n" - " // -> [[1, 2], [3, 4], [5, 6]]\n" - " ```\n" - "\n" - " ```gleam\n" - " [1, 2, 3, 4, 5, 6, 7, 8] |> sized_chunk(into: 3)\n" - " // -> [[1, 2, 3], [4, 5, 6], [7, 8]]\n" - " ```\n" -). --spec sized_chunk(list(AQD), integer()) -> list(list(AQD)). -sized_chunk(List, Count) -> - sized_chunk_loop(List, Count, Count, [], []). - --file("src/gleam/list.gleam", 2072). -?DOC( - " This function acts similar to fold, but does not take an initial state.\n" - " Instead, it starts from the first element in the list\n" - " and combines it with each subsequent element in turn using the given\n" - " function. The function is called as `fun(accumulator, current_element)`.\n" - "\n" - " Returns `Ok` to indicate a successful run, and `Error` if called on an\n" - " empty list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " [] |> reduce(fn(acc, x) { acc + x })\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " [1, 2, 3, 4, 5] |> reduce(fn(acc, x) { acc + x })\n" - " // -> Ok(15)\n" - " ```\n" -). --spec reduce(list(AQO), fun((AQO, AQO) -> AQO)) -> {ok, AQO} | {error, nil}. -reduce(List, Fun) -> - case List of - [] -> - {error, nil}; - - [First | Rest] -> - {ok, fold(Rest, First, Fun)} - end. - --file("src/gleam/list.gleam", 2096). --spec scan_loop(list(AQW), AQY, list(AQY), fun((AQY, AQW) -> AQY)) -> list(AQY). -scan_loop(List, Accumulator, Accumulated, Fun) -> - case List of - [] -> - lists:reverse(Accumulated); - - [First | Rest] -> - Next = Fun(Accumulator, First), - scan_loop(Rest, Next, [Next | Accumulated], Fun) - end. - --file("src/gleam/list.gleam", 2088). -?DOC( - " Similar to `fold`, but yields the state of the accumulator at each stage.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " scan(over: [1, 2, 3], from: 100, with: fn(acc, i) { acc + i })\n" - " // -> [101, 103, 106]\n" - " ```\n" -). --spec scan(list(AQS), AQU, fun((AQU, AQS) -> AQU)) -> list(AQU). -scan(List, Initial, Fun) -> - scan_loop(List, Initial, [], Fun). - --file("src/gleam/list.gleam", 2129). -?DOC( - " Returns the last element in the given list.\n" - "\n" - " Returns `Error(Nil)` if the list is empty.\n" - "\n" - " This function runs in linear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " last([])\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " last([1, 2, 3, 4, 5])\n" - " // -> Ok(5)\n" - " ```\n" -). --spec last(list(ARB)) -> {ok, ARB} | {error, nil}. -last(List) -> - case List of - [] -> - {error, nil}; - - [Last] -> - {ok, Last}; - - [_ | Rest] -> - last(Rest) - end. - --file("src/gleam/list.gleam", 2151). -?DOC( - " Return unique combinations of elements in the list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " combinations([1, 2, 3], 2)\n" - " // -> [[1, 2], [1, 3], [2, 3]]\n" - " ```\n" - "\n" - " ```gleam\n" - " combinations([1, 2, 3, 4], 3)\n" - " // -> [[1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4]]\n" - " ```\n" -). --spec combinations(list(ARF), integer()) -> list(list(ARF)). -combinations(Items, N) -> - case {N, Items} of - {0, _} -> - [[]]; - - {_, []} -> - []; - - {_, [First | Rest]} -> - _pipe = Rest, - _pipe@1 = combinations(_pipe, N - 1), - _pipe@2 = map( - _pipe@1, - fun(Combination) -> [First | Combination] end - ), - _pipe@3 = lists:reverse(_pipe@2), - fold(_pipe@3, combinations(Rest, N), fun(Acc, C) -> [C | Acc] end) - end. - --file("src/gleam/list.gleam", 2177). --spec combination_pairs_loop(list(ARM), list({ARM, ARM})) -> list({ARM, ARM}). -combination_pairs_loop(Items, Acc) -> - case Items of - [] -> - lists:reverse(Acc); - - [First | Rest] -> - First_combinations = map(Rest, fun(Other) -> {First, Other} end), - Acc@1 = lists:reverse(First_combinations, Acc), - combination_pairs_loop(Rest, Acc@1) - end. - --file("src/gleam/list.gleam", 2173). -?DOC( - " Return unique pair combinations of elements in the list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " combination_pairs([1, 2, 3])\n" - " // -> [#(1, 2), #(1, 3), #(2, 3)]\n" - " ```\n" -). --spec combination_pairs(list(ARJ)) -> list({ARJ, ARJ}). -combination_pairs(Items) -> - combination_pairs_loop(Items, []). - --file("src/gleam/list.gleam", 2233). --spec take_firsts(list(list(ASG)), list(ASG), list(list(ASG))) -> {list(ASG), - list(list(ASG))}. -take_firsts(Rows, Column, Remaining_rows) -> - case Rows of - [] -> - {lists:reverse(Column), lists:reverse(Remaining_rows)}; - - [[] | Rest] -> - take_firsts(Rest, Column, Remaining_rows); - - [[First | Remaining_row] | Rest_rows] -> - Remaining_rows@1 = [Remaining_row | Remaining_rows], - take_firsts(Rest_rows, [First | Column], Remaining_rows@1) - end. - --file("src/gleam/list.gleam", 2220). --spec transpose_loop(list(list(ARZ)), list(list(ARZ))) -> list(list(ARZ)). -transpose_loop(Rows, Columns) -> - case Rows of - [] -> - lists:reverse(Columns); - - _ -> - {Column, Rest} = take_firsts(Rows, [], []), - case Column of - [_ | _] -> - transpose_loop(Rest, [Column | Columns]); - - [] -> - transpose_loop(Rest, Columns) - end - end. - --file("src/gleam/list.gleam", 2216). -?DOC( - " Transpose rows and columns of the list of lists.\n" - "\n" - " Notice: This function is not tail recursive,\n" - " and thus may exceed stack size if called,\n" - " with large lists (on the JavaScript target).\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " transpose([[1, 2, 3], [101, 102, 103]])\n" - " // -> [[1, 101], [2, 102], [3, 103]]\n" - " ```\n" -). --spec transpose(list(list(ARU))) -> list(list(ARU)). -transpose(List_of_lists) -> - transpose_loop(List_of_lists, []). - --file("src/gleam/list.gleam", 2197). -?DOC( - " Make a list alternating the elements from the given lists\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " interleave([[1, 2], [101, 102], [201, 202]])\n" - " // -> [1, 101, 201, 2, 102, 202]\n" - " ```\n" -). --spec interleave(list(list(ARQ))) -> list(ARQ). -interleave(List) -> - _pipe = List, - _pipe@1 = transpose(_pipe), - lists:append(_pipe@1). - --file("src/gleam/list.gleam", 2266). --spec shuffle_pair_unwrap_loop(list({float(), ASS}), list(ASS)) -> list(ASS). -shuffle_pair_unwrap_loop(List, Acc) -> - case List of - [] -> - Acc; - - [Elem_pair | Enumerable] -> - shuffle_pair_unwrap_loop( - Enumerable, - [erlang:element(2, Elem_pair) | Acc] - ) - end. - --file("src/gleam/list.gleam", 2274). --spec do_shuffle_by_pair_indexes(list({float(), ASW})) -> list({float(), ASW}). -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 - ). - --file("src/gleam/list.gleam", 2259). -?DOC( - " Takes a list, randomly sorts all items and returns the shuffled list.\n" - "\n" - " This function uses `float.random` to decide the order of the elements.\n" - "\n" - " ## Example\n" - "\n" - " ```gleam\n" - " range(1, 10) |> shuffle()\n" - " // -> [1, 6, 9, 10, 3, 8, 4, 2, 7, 5]\n" - " ```\n" -). --spec shuffle(list(ASP)) -> list(ASP). -shuffle(List) -> - _pipe = List, - _pipe@1 = fold(_pipe, [], fun(Acc, A) -> [{rand:uniform(), A} | Acc] end), - _pipe@2 = do_shuffle_by_pair_indexes(_pipe@1), - shuffle_pair_unwrap_loop(_pipe@2, []). - --file("src/gleam/list.gleam", 2306). --spec max_loop(list(ATG), fun((ATG, ATG) -> gleam@order:order()), ATG) -> ATG. -max_loop(List, Compare, Max) -> - case List of - [] -> - Max; - - [First | Rest] -> - case Compare(First, Max) of - gt -> - max_loop(Rest, Compare, First); - - lt -> - max_loop(Rest, Compare, Max); - - eq -> - max_loop(Rest, Compare, Max) - end - end. - --file("src/gleam/list.gleam", 2296). -?DOC( - " Takes a list and a comparator, and returns the maximum element in the list\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " range(1, 10) |> list.max(int.compare)\n" - " // -> Ok(10)\n" - " ```\n" - "\n" - " ```gleam\n" - " [\"a\", \"c\", \"b\"] |> list.max(string.compare)\n" - " // -> Ok(\"c\")\n" - " ```\n" -). --spec max(list(ASZ), fun((ASZ, ASZ) -> gleam@order:order())) -> {ok, ASZ} | - {error, nil}. -max(List, Compare) -> - case List of - [] -> - {error, nil}; - - [First | Rest] -> - {ok, max_loop(Rest, Compare, First)} - end. - --file("src/gleam/list.gleam", 2387). --spec build_reservoir_loop( - list(ATV), - integer(), - gleam@dict:dict(integer(), ATV) -) -> {gleam@dict:dict(integer(), ATV), list(ATV)}. -build_reservoir_loop(List, Size, Reservoir) -> - Reservoir_size = maps:size(Reservoir), - case Reservoir_size >= Size of - true -> - {Reservoir, List}; - - false -> - case List of - [] -> - {Reservoir, []}; - - [First | Rest] -> - Reservoir@1 = gleam@dict:insert( - Reservoir, - Reservoir_size, - First - ), - build_reservoir_loop(Rest, Size, Reservoir@1) - end - end. - --file("src/gleam/list.gleam", 2383). -?DOC( - " Builds the initial reservoir used by Algorithm L.\n" - " This is a dictionary with keys ranging from `0` up to `n - 1` where each\n" - " value is the corresponding element at that position in `list`.\n" - "\n" - " This also returns the remaining elements of `list` that didn't end up in\n" - " the reservoir.\n" -). --spec build_reservoir(list(ATQ), integer()) -> {gleam@dict:dict(integer(), ATQ), - list(ATQ)}. -build_reservoir(List, N) -> - build_reservoir_loop(List, N, maps:new()). - --file("src/gleam/list.gleam", 2371). --spec log_random() -> float(). -log_random() -> - Random@1 = case gleam@float:logarithm( - rand:uniform() + 2.2250738585072014e-308 - ) of - {ok, Random} -> Random; - _assert_fail -> - erlang:error(#{gleam_error => let_assert, - message => <<"Pattern match failed, no pattern matched the value."/utf8>>, - file => <>, - module => <<"gleam/list"/utf8>>, - function => <<"log_random"/utf8>>, - line => 2372, - value => _assert_fail, - start => 55613, - 'end' => 55684, - pattern_start => 55624, - pattern_end => 55634}) - end, - Random@1. - --file("src/gleam/list.gleam", 2348). --spec sample_loop( - list(ATK), - gleam@dict:dict(integer(), ATK), - integer(), - float() -) -> gleam@dict:dict(integer(), ATK). -sample_loop(List, Reservoir, N, W) -> - Skip = begin - Log@1 = case gleam@float:logarithm(1.0 - W) of - {ok, Log} -> Log; - _assert_fail -> - erlang:error(#{gleam_error => let_assert, - message => <<"Pattern match failed, no pattern matched the value."/utf8>>, - file => <>, - module => <<"gleam/list"/utf8>>, - function => <<"sample_loop"/utf8>>, - line => 2355, - value => _assert_fail, - start => 55174, - 'end' => 55220, - pattern_start => 55185, - pattern_end => 55192}) - end, - erlang:round(math:floor(case Log@1 of - +0.0 -> +0.0; - -0.0 -> -0.0; - Gleam@denominator -> log_random() / Gleam@denominator - end)) - end, - case drop(List, Skip) of - [] -> - Reservoir; - - [First | Rest] -> - Reservoir@1 = gleam@dict:insert( - Reservoir, - gleam@int:random(N), - First - ), - W@1 = W * math:exp(case erlang:float(N) of - +0.0 -> +0.0; - -0.0 -> -0.0; - Gleam@denominator@1 -> log_random() / Gleam@denominator@1 - end), - sample_loop(Rest, Reservoir@1, N, W@1) - end. - --file("src/gleam/list.gleam", 2330). -?DOC( - " Returns a random sample of up to n elements from a list using reservoir\n" - " sampling via [Algorithm L](https://en.wikipedia.org/wiki/Reservoir_sampling#Optimal:_Algorithm_L).\n" - " Returns an empty list if the sample size is less than or equal to 0.\n" - "\n" - " Order is not random, only selection is.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " reservoir_sample([1, 2, 3, 4, 5], 3)\n" - " // -> [2, 4, 5] // A random sample of 3 items\n" - " ```\n" -). --spec sample(list(ATH), integer()) -> list(ATH). -sample(List, N) -> - {Reservoir, Rest} = build_reservoir(List, N), - case gleam@dict:is_empty(Reservoir) of - true -> - []; - - false -> - W = math:exp(case erlang:float(N) of - +0.0 -> +0.0; - -0.0 -> -0.0; - Gleam@denominator -> log_random() / Gleam@denominator - end), - maps:values(sample_loop(Rest, Reservoir, N, W)) - end. - --file("src/gleam/list.gleam", 1832). --spec permutation_zip(list(AOD), list(AOD), list(list(AOD))) -> list(list(AOD)). -permutation_zip(List, Rest, Acc) -> - case List of - [] -> - lists:reverse(Acc); - - [Head | Tail] -> - permutation_prepend( - Head, - permutations(lists:reverse(Rest, Tail)), - Tail, - [Head | Rest], - Acc - ) - end. - --file("src/gleam/list.gleam", 1825). -?DOC( - " Returns all the permutations of a list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " permutations([1, 2])\n" - " // -> [[1, 2], [2, 1]]\n" - " ```\n" -). --spec permutations(list(ANZ)) -> list(list(ANZ)). -permutations(List) -> - case List of - [] -> - [[]]; - - L -> - permutation_zip(L, [], []) - end. - --file("src/gleam/list.gleam", 1850). --spec permutation_prepend( - AOK, - list(list(AOK)), - list(AOK), - list(AOK), - list(list(AOK)) -) -> list(list(AOK)). -permutation_prepend(El, Permutations, List_1, List_2, Acc) -> - case Permutations of - [] -> - permutation_zip(List_1, List_2, Acc); - - [Head | Tail] -> - permutation_prepend(El, Tail, List_1, List_2, [[El | Head] | Acc]) - end. diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@option.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@option.erl deleted file mode 100644 index 5cee861..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@option.erl +++ /dev/null @@ -1,413 +0,0 @@ --module(gleam@option). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/option.gleam"). --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]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --type option(EG) :: {some, EG} | none. - --file("src/gleam/option.gleam", 59). --spec reverse_and_prepend(list(EV), list(EV)) -> list(EV). -reverse_and_prepend(Prefix, Suffix) -> - case Prefix of - [] -> - Suffix; - - [First | Rest] -> - reverse_and_prepend(Rest, [First | Suffix]) - end. - --file("src/gleam/option.gleam", 44). --spec all_loop(list(option(EM)), list(EM)) -> option(list(EM)). -all_loop(List, Acc) -> - case List of - [] -> - {some, lists:reverse(Acc)}; - - [none | _] -> - none; - - [{some, First} | Rest] -> - all_loop(Rest, [First | Acc]) - end. - --file("src/gleam/option.gleam", 40). -?DOC( - " Combines a list of `Option`s into a single `Option`.\n" - " If all elements in the list are `Some` then returns a `Some` holding the list of values.\n" - " If any element is `None` then returns `None`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " all([Some(1), Some(2)])\n" - " // -> Some([1, 2])\n" - " ```\n" - "\n" - " ```gleam\n" - " all([Some(1), None])\n" - " // -> None\n" - " ```\n" -). --spec all(list(option(EH))) -> option(list(EH)). -all(List) -> - all_loop(List, []). - --file("src/gleam/option.gleam", 80). -?DOC( - " Checks whether the `Option` is a `Some` value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_some(Some(1))\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " is_some(None)\n" - " // -> False\n" - " ```\n" -). --spec is_some(option(any())) -> boolean(). -is_some(Option) -> - Option /= none. - --file("src/gleam/option.gleam", 98). -?DOC( - " Checks whether the `Option` is a `None` value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_none(Some(1))\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " is_none(None)\n" - " // -> True\n" - " ```\n" -). --spec is_none(option(any())) -> boolean(). -is_none(Option) -> - Option =:= none. - --file("src/gleam/option.gleam", 116). -?DOC( - " Converts an `Option` type to a `Result` type.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_result(Some(1), \"some_error\")\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " to_result(None, \"some_error\")\n" - " // -> Error(\"some_error\")\n" - " ```\n" -). --spec to_result(option(FD), FG) -> {ok, FD} | {error, FG}. -to_result(Option, E) -> - case Option of - {some, A} -> - {ok, A}; - - none -> - {error, E} - end. - --file("src/gleam/option.gleam", 137). -?DOC( - " Converts a `Result` type to an `Option` type.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_result(Ok(1))\n" - " // -> Some(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " from_result(Error(\"some_error\"))\n" - " // -> None\n" - " ```\n" -). --spec from_result({ok, FJ} | {error, any()}) -> option(FJ). -from_result(Result) -> - case Result of - {ok, A} -> - {some, A}; - - {error, _} -> - none - end. - --file("src/gleam/option.gleam", 158). -?DOC( - " Extracts the value from an `Option`, returning a default value if there is none.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " unwrap(Some(1), 0)\n" - " // -> 1\n" - " ```\n" - "\n" - " ```gleam\n" - " unwrap(None, 0)\n" - " // -> 0\n" - " ```\n" -). --spec unwrap(option(FO), FO) -> FO. -unwrap(Option, Default) -> - case Option of - {some, X} -> - X; - - none -> - Default - end. - --file("src/gleam/option.gleam", 179). -?DOC( - " Extracts the value from an `Option`, evaluating the default function if the option is `None`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " lazy_unwrap(Some(1), fn() { 0 })\n" - " // -> 1\n" - " ```\n" - "\n" - " ```gleam\n" - " lazy_unwrap(None, fn() { 0 })\n" - " // -> 0\n" - " ```\n" -). --spec lazy_unwrap(option(FQ), fun(() -> FQ)) -> FQ. -lazy_unwrap(Option, Default) -> - case Option of - {some, X} -> - X; - - none -> - Default() - end. - --file("src/gleam/option.gleam", 204). -?DOC( - " Updates a value held within the `Some` of an `Option` by calling a given function\n" - " on it.\n" - "\n" - " If the `Option` is a `None` rather than `Some`, the function is not called and the\n" - " `Option` stays the same.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " map(over: Some(1), with: fn(x) { x + 1 })\n" - " // -> Some(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " map(over: None, with: fn(x) { x + 1 })\n" - " // -> None\n" - " ```\n" -). --spec map(option(FS), fun((FS) -> FU)) -> option(FU). -map(Option, Fun) -> - case Option of - {some, X} -> - {some, Fun(X)}; - - none -> - none - end. - --file("src/gleam/option.gleam", 230). -?DOC( - " Merges a nested `Option` into a single layer.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " flatten(Some(Some(1)))\n" - " // -> Some(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " flatten(Some(None))\n" - " // -> None\n" - " ```\n" - "\n" - " ```gleam\n" - " flatten(None)\n" - " // -> None\n" - " ```\n" -). --spec flatten(option(option(FW))) -> option(FW). -flatten(Option) -> - case Option of - {some, X} -> - X; - - none -> - none - end. - --file("src/gleam/option.gleam", 269). -?DOC( - " Updates a value held within the `Some` of an `Option` by calling a given function\n" - " on it, where the given function also returns an `Option`. The two options are\n" - " then merged together into one `Option`.\n" - "\n" - " If the `Option` is a `None` rather than `Some` the function is not called and the\n" - " option stays the same.\n" - "\n" - " This function is the equivalent of calling `map` followed by `flatten`, and\n" - " it is useful for chaining together multiple functions that return `Option`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " then(Some(1), fn(x) { Some(x + 1) })\n" - " // -> Some(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " then(Some(1), fn(x) { Some(#(\"a\", x)) })\n" - " // -> Some(#(\"a\", 1))\n" - " ```\n" - "\n" - " ```gleam\n" - " then(Some(1), fn(_) { None })\n" - " // -> None\n" - " ```\n" - "\n" - " ```gleam\n" - " then(None, fn(x) { Some(x + 1) })\n" - " // -> None\n" - " ```\n" -). --spec then(option(GA), fun((GA) -> option(GC))) -> option(GC). -then(Option, Fun) -> - case Option of - {some, X} -> - Fun(X); - - none -> - none - end. - --file("src/gleam/option.gleam", 300). -?DOC( - " Returns the first value if it is `Some`, otherwise returns the second value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " or(Some(1), Some(2))\n" - " // -> Some(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " or(Some(1), None)\n" - " // -> Some(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " or(None, Some(2))\n" - " // -> Some(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " or(None, None)\n" - " // -> None\n" - " ```\n" -). --spec 'or'(option(GF), option(GF)) -> option(GF). -'or'(First, Second) -> - case First of - {some, _} -> - First; - - none -> - Second - end. - --file("src/gleam/option.gleam", 331). -?DOC( - " Returns the first value if it is `Some`, otherwise evaluates the given function for a fallback value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " lazy_or(Some(1), fn() { Some(2) })\n" - " // -> Some(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " lazy_or(Some(1), fn() { None })\n" - " // -> Some(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " lazy_or(None, fn() { Some(2) })\n" - " // -> Some(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " lazy_or(None, fn() { None })\n" - " // -> None\n" - " ```\n" -). --spec lazy_or(option(GJ), fun(() -> option(GJ))) -> option(GJ). -lazy_or(First, Second) -> - case First of - {some, _} -> - First; - - none -> - Second() - end. - --file("src/gleam/option.gleam", 352). --spec values_loop(list(option(GR)), list(GR)) -> list(GR). -values_loop(List, Acc) -> - case List of - [] -> - lists:reverse(Acc); - - [none | Rest] -> - values_loop(Rest, Acc); - - [{some, First} | Rest@1] -> - values_loop(Rest@1, [First | Acc]) - end. - --file("src/gleam/option.gleam", 348). -?DOC( - " Given a list of `Option`s,\n" - " returns only the values inside `Some`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " values([Some(1), None, Some(3)])\n" - " // -> [1, 3]\n" - " ```\n" -). --spec values(list(option(GN))) -> list(GN). -values(Options) -> - values_loop(Options, []). diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@order.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@order.erl deleted file mode 100644 index ec2bb84..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@order.erl +++ /dev/null @@ -1,200 +0,0 @@ --module(gleam@order). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/order.gleam"). --export([negate/1, to_int/1, compare/2, reverse/1, break_tie/2, lazy_break_tie/2]). --export_type([order/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --type order() :: lt | eq | gt. - --file("src/gleam/order.gleam", 35). -?DOC( - " Inverts an order, so less-than becomes greater-than and greater-than\n" - " becomes less-than.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " negate(Lt)\n" - " // -> Gt\n" - " ```\n" - "\n" - " ```gleam\n" - " negate(Eq)\n" - " // -> Eq\n" - " ```\n" - "\n" - " ```gleam\n" - " negate(Gt)\n" - " // -> Lt\n" - " ```\n" -). --spec negate(order()) -> order(). -negate(Order) -> - case Order of - lt -> - gt; - - eq -> - eq; - - gt -> - lt - end. - --file("src/gleam/order.gleam", 62). -?DOC( - " Produces a numeric representation of the order.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_int(Lt)\n" - " // -> -1\n" - " ```\n" - "\n" - " ```gleam\n" - " to_int(Eq)\n" - " // -> 0\n" - " ```\n" - "\n" - " ```gleam\n" - " to_int(Gt)\n" - " // -> 1\n" - " ```\n" -). --spec to_int(order()) -> integer(). -to_int(Order) -> - case Order of - lt -> - -1; - - eq -> - 0; - - gt -> - 1 - end. - --file("src/gleam/order.gleam", 79). -?DOC( - " Compares two `Order` values to one another, producing a new `Order`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " compare(Eq, with: Lt)\n" - " // -> Gt\n" - " ```\n" -). --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. - --file("src/gleam/order.gleam", 100). -?DOC( - " Inverts an ordering function, so less-than becomes greater-than and greater-than\n" - " becomes less-than.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - " import gleam/list\n" - "\n" - " list.sort([1, 5, 4], by: reverse(int.compare))\n" - " // -> [5, 4, 1]\n" - " ```\n" -). --spec reverse(fun((I, I) -> order())) -> fun((I, I) -> order()). -reverse(Orderer) -> - fun(A, B) -> Orderer(B, A) end. - --file("src/gleam/order.gleam", 122). -?DOC( - " Return a fallback `Order` in case the first argument is `Eq`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - "\n" - " break_tie(in: int.compare(1, 1), with: Lt)\n" - " // -> Lt\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - "\n" - " break_tie(in: int.compare(1, 0), with: Eq)\n" - " // -> Gt\n" - " ```\n" -). --spec break_tie(order(), order()) -> order(). -break_tie(Order, Other) -> - case Order of - lt -> - Order; - - gt -> - Order; - - eq -> - Other - end. - --file("src/gleam/order.gleam", 151). -?DOC( - " Invokes a fallback function returning an `Order` in case the first argument\n" - " is `Eq`.\n" - "\n" - " This can be useful when the fallback comparison might be expensive and it\n" - " needs to be delayed until strictly necessary.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - "\n" - " lazy_break_tie(in: int.compare(1, 1), with: fn() { Lt })\n" - " // -> Lt\n" - " ```\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - "\n" - " lazy_break_tie(in: int.compare(1, 0), with: fn() { Eq })\n" - " // -> Gt\n" - " ```\n" -). --spec lazy_break_tie(order(), fun(() -> order())) -> order(). -lazy_break_tie(Order, Comparison) -> - case Order of - lt -> - Order; - - gt -> - Order; - - eq -> - Comparison() - end. diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@pair.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@pair.erl deleted file mode 100644 index 96de923..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@pair.erl +++ /dev/null @@ -1,110 +0,0 @@ --module(gleam@pair). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/pair.gleam"). --export([first/1, second/1, swap/1, map_first/2, map_second/2, new/2]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --file("src/gleam/pair.gleam", 10). -?DOC( - " Returns the first element in a pair.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " first(#(1, 2))\n" - " // -> 1\n" - " ```\n" -). --spec first({CLX, any()}) -> CLX. -first(Pair) -> - {A, _} = Pair, - A. - --file("src/gleam/pair.gleam", 24). -?DOC( - " Returns the second element in a pair.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " second(#(1, 2))\n" - " // -> 2\n" - " ```\n" -). --spec second({any(), CMA}) -> CMA. -second(Pair) -> - {_, A} = Pair, - A. - --file("src/gleam/pair.gleam", 38). -?DOC( - " Returns a new pair with the elements swapped.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " swap(#(1, 2))\n" - " // -> #(2, 1)\n" - " ```\n" -). --spec swap({CMB, CMC}) -> {CMC, CMB}. -swap(Pair) -> - {A, B} = Pair, - {B, A}. - --file("src/gleam/pair.gleam", 53). -?DOC( - " Returns a new pair with the first element having had `with` applied to\n" - " it.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " #(1, 2) |> map_first(fn(n) { n * 2 })\n" - " // -> #(2, 2)\n" - " ```\n" -). --spec map_first({CMD, CME}, fun((CMD) -> CMF)) -> {CMF, CME}. -map_first(Pair, Fun) -> - {A, B} = Pair, - {Fun(A), B}. - --file("src/gleam/pair.gleam", 68). -?DOC( - " Returns a new pair with the second element having had `with` applied to\n" - " it.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " #(1, 2) |> map_second(fn(n) { n * 2 })\n" - " // -> #(1, 4)\n" - " ```\n" -). --spec map_second({CMG, CMH}, fun((CMH) -> CMI)) -> {CMG, CMI}. -map_second(Pair, Fun) -> - {A, B} = Pair, - {A, Fun(B)}. - --file("src/gleam/pair.gleam", 83). -?DOC( - " Returns a new pair with the given elements. This can also be done using the dedicated\n" - " syntax instead: `new(1, 2) == #(1, 2)`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new(1, 2)\n" - " // -> #(1, 2)\n" - " ```\n" -). --spec new(CMJ, CMK) -> {CMJ, CMK}. -new(First, Second) -> - {First, Second}. diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@result.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@result.erl deleted file mode 100644 index 76e5dc8..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@result.erl +++ /dev/null @@ -1,532 +0,0 @@ --module(gleam@result). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/result.gleam"). --export([is_ok/1, is_error/1, map/2, map_error/2, flatten/1, 'try'/2, unwrap/2, lazy_unwrap/2, unwrap_error/2, 'or'/2, lazy_or/2, all/1, partition/1, replace/2, replace_error/2, values/1, try_recover/2]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " Result represents the result of something that may succeed or not.\n" - " `Ok` means it was successful, `Error` means it was not successful.\n" -). - --file("src/gleam/result.gleam", 20). -?DOC( - " Checks whether the result is an `Ok` value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_ok(Ok(1))\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " is_ok(Error(Nil))\n" - " // -> False\n" - " ```\n" -). --spec is_ok({ok, any()} | {error, any()}) -> boolean(). -is_ok(Result) -> - case Result of - {error, _} -> - false; - - {ok, _} -> - true - end. - --file("src/gleam/result.gleam", 41). -?DOC( - " Checks whether the result is an `Error` value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_error(Ok(1))\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " is_error(Error(Nil))\n" - " // -> True\n" - " ```\n" -). --spec is_error({ok, any()} | {error, any()}) -> boolean(). -is_error(Result) -> - case Result of - {ok, _} -> - false; - - {error, _} -> - true - end. - --file("src/gleam/result.gleam", 66). -?DOC( - " Updates a value held within the `Ok` of a result by calling a given function\n" - " on it.\n" - "\n" - " If the result is an `Error` rather than `Ok` the function is not called and the\n" - " result stays the same.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " map(over: Ok(1), with: fn(x) { x + 1 })\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " map(over: Error(1), with: fn(x) { x + 1 })\n" - " // -> Error(1)\n" - " ```\n" -). --spec map({ok, CMU} | {error, CMV}, fun((CMU) -> CMY)) -> {ok, CMY} | - {error, CMV}. -map(Result, Fun) -> - case Result of - {ok, X} -> - {ok, Fun(X)}; - - {error, E} -> - {error, E} - end. - --file("src/gleam/result.gleam", 91). -?DOC( - " Updates a value held within the `Error` of a result by calling a given function\n" - " on it.\n" - "\n" - " If the result is `Ok` rather than `Error` the function is not called and the\n" - " result stays the same.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " map_error(over: Error(1), with: fn(x) { x + 1 })\n" - " // -> Error(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " map_error(over: Ok(1), with: fn(x) { x + 1 })\n" - " // -> Ok(1)\n" - " ```\n" -). --spec map_error({ok, CNB} | {error, CNC}, fun((CNC) -> CNF)) -> {ok, CNB} | - {error, CNF}. -map_error(Result, Fun) -> - case Result of - {ok, X} -> - {ok, X}; - - {error, Error} -> - {error, Fun(Error)} - end. - --file("src/gleam/result.gleam", 120). -?DOC( - " Merges a nested `Result` into a single layer.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " flatten(Ok(Ok(1)))\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " flatten(Ok(Error(\"\")))\n" - " // -> Error(\"\")\n" - " ```\n" - "\n" - " ```gleam\n" - " flatten(Error(Nil))\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec flatten({ok, {ok, CNI} | {error, CNJ}} | {error, CNJ}) -> {ok, CNI} | - {error, CNJ}. -flatten(Result) -> - case Result of - {ok, X} -> - X; - - {error, Error} -> - {error, Error} - end. - --file("src/gleam/result.gleam", 158). -?DOC( - " \"Updates\" an `Ok` result by passing its value to a function that yields a result,\n" - " and returning the yielded result. (This may \"replace\" the `Ok` with an `Error`.)\n" - "\n" - " If the input is an `Error` rather than an `Ok`, the function is not called and\n" - " the original `Error` is returned.\n" - "\n" - " This function is the equivalent of calling `map` followed by `flatten`, and\n" - " it is useful for chaining together multiple functions that may fail.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " try(Ok(1), fn(x) { Ok(x + 1) })\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " try(Ok(1), fn(x) { Ok(#(\"a\", x)) })\n" - " // -> Ok(#(\"a\", 1))\n" - " ```\n" - "\n" - " ```gleam\n" - " try(Ok(1), fn(_) { Error(\"Oh no\") })\n" - " // -> Error(\"Oh no\")\n" - " ```\n" - "\n" - " ```gleam\n" - " try(Error(Nil), fn(x) { Ok(x + 1) })\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec 'try'({ok, CNQ} | {error, CNR}, fun((CNQ) -> {ok, CNU} | {error, CNR})) -> {ok, - CNU} | - {error, CNR}. -'try'(Result, Fun) -> - case Result of - {ok, X} -> - Fun(X); - - {error, E} -> - {error, E} - end. - --file("src/gleam/result.gleam", 183). -?DOC( - " Extracts the `Ok` value from a result, returning a default value if the result\n" - " is an `Error`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " unwrap(Ok(1), 0)\n" - " // -> 1\n" - " ```\n" - "\n" - " ```gleam\n" - " unwrap(Error(\"\"), 0)\n" - " // -> 0\n" - " ```\n" -). --spec unwrap({ok, CNZ} | {error, any()}, CNZ) -> CNZ. -unwrap(Result, Default) -> - case Result of - {ok, V} -> - V; - - {error, _} -> - Default - end. - --file("src/gleam/result.gleam", 205). -?DOC( - " Extracts the `Ok` value from a result, evaluating the default function if the result\n" - " is an `Error`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " lazy_unwrap(Ok(1), fn() { 0 })\n" - " // -> 1\n" - " ```\n" - "\n" - " ```gleam\n" - " lazy_unwrap(Error(\"\"), fn() { 0 })\n" - " // -> 0\n" - " ```\n" -). --spec lazy_unwrap({ok, COD} | {error, any()}, fun(() -> COD)) -> COD. -lazy_unwrap(Result, Default) -> - case Result of - {ok, V} -> - V; - - {error, _} -> - Default() - end. - --file("src/gleam/result.gleam", 227). -?DOC( - " Extracts the `Error` value from a result, returning a default value if the result\n" - " is an `Ok`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " unwrap_error(Error(1), 0)\n" - " // -> 1\n" - " ```\n" - "\n" - " ```gleam\n" - " unwrap_error(Ok(\"\"), 0)\n" - " // -> 0\n" - " ```\n" -). --spec unwrap_error({ok, any()} | {error, COI}, COI) -> COI. -unwrap_error(Result, Default) -> - case Result of - {ok, _} -> - Default; - - {error, E} -> - E - end. - --file("src/gleam/result.gleam", 258). -?DOC( - " Returns the first value if it is `Ok`, otherwise returns the second value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " or(Ok(1), Ok(2))\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " or(Ok(1), Error(\"Error 2\"))\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " or(Error(\"Error 1\"), Ok(2))\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " or(Error(\"Error 1\"), Error(\"Error 2\"))\n" - " // -> Error(\"Error 2\")\n" - " ```\n" -). --spec 'or'({ok, COL} | {error, COM}, {ok, COL} | {error, COM}) -> {ok, COL} | - {error, COM}. -'or'(First, Second) -> - case First of - {ok, _} -> - First; - - {error, _} -> - Second - end. - --file("src/gleam/result.gleam", 291). -?DOC( - " Returns the first value if it is `Ok`, otherwise evaluates the given function for a fallback value.\n" - "\n" - " If you need access to the initial error value, use `result.try_recover`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " lazy_or(Ok(1), fn() { Ok(2) })\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " lazy_or(Ok(1), fn() { Error(\"Error 2\") })\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " lazy_or(Error(\"Error 1\"), fn() { Ok(2) })\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " lazy_or(Error(\"Error 1\"), fn() { Error(\"Error 2\") })\n" - " // -> Error(\"Error 2\")\n" - " ```\n" -). --spec lazy_or({ok, COT} | {error, COU}, fun(() -> {ok, COT} | {error, COU})) -> {ok, - COT} | - {error, COU}. -lazy_or(First, Second) -> - case First of - {ok, _} -> - First; - - {error, _} -> - Second() - end. - --file("src/gleam/result.gleam", 317). -?DOC( - " Combines a list of results into a single result.\n" - " If all elements in the list are `Ok` then returns an `Ok` holding the list of values.\n" - " If any element is `Error` then returns the first error.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " all([Ok(1), Ok(2)])\n" - " // -> Ok([1, 2])\n" - " ```\n" - "\n" - " ```gleam\n" - " all([Ok(1), Error(\"e\")])\n" - " // -> Error(\"e\")\n" - " ```\n" -). --spec all(list({ok, CPB} | {error, CPC})) -> {ok, list(CPB)} | {error, CPC}. -all(Results) -> - gleam@list:try_map(Results, fun(Result) -> Result end). - --file("src/gleam/result.gleam", 337). --spec partition_loop(list({ok, CPQ} | {error, CPR}), list(CPQ), list(CPR)) -> {list(CPQ), - list(CPR)}. -partition_loop(Results, Oks, Errors) -> - case Results of - [] -> - {Oks, Errors}; - - [{ok, A} | Rest] -> - partition_loop(Rest, [A | Oks], Errors); - - [{error, E} | Rest@1] -> - partition_loop(Rest@1, Oks, [E | Errors]) - end. - --file("src/gleam/result.gleam", 333). -?DOC( - " Given a list of results, returns a pair where the first element is a list\n" - " of all the values inside `Ok` and the second element is a list with all the\n" - " values inside `Error`. The values in both lists appear in reverse order with\n" - " respect to their position in the original list of results.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " partition([Ok(1), Error(\"a\"), Error(\"b\"), Ok(2)])\n" - " // -> #([2, 1], [\"b\", \"a\"])\n" - " ```\n" -). --spec partition(list({ok, CPJ} | {error, CPK})) -> {list(CPJ), list(CPK)}. -partition(Results) -> - partition_loop(Results, [], []). - --file("src/gleam/result.gleam", 359). -?DOC( - " Replace the value within a result\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " replace(Ok(1), Nil)\n" - " // -> Ok(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " replace(Error(1), Nil)\n" - " // -> Error(1)\n" - " ```\n" -). --spec replace({ok, any()} | {error, CPZ}, CQC) -> {ok, CQC} | {error, CPZ}. -replace(Result, Value) -> - case Result of - {ok, _} -> - {ok, Value}; - - {error, Error} -> - {error, Error} - end. - --file("src/gleam/result.gleam", 380). -?DOC( - " Replace the error within a result\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " replace_error(Error(1), Nil)\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " replace_error(Ok(1), Nil)\n" - " // -> Ok(1)\n" - " ```\n" -). --spec replace_error({ok, CQF} | {error, any()}, CQJ) -> {ok, CQF} | {error, CQJ}. -replace_error(Result, Error) -> - case Result of - {ok, X} -> - {ok, X}; - - {error, _} -> - {error, Error} - end. - --file("src/gleam/result.gleam", 396). -?DOC( - " Given a list of results, returns only the values inside `Ok`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " values([Ok(1), Error(\"a\"), Ok(3)])\n" - " // -> [1, 3]\n" - " ```\n" -). --spec values(list({ok, CQM} | {error, any()})) -> list(CQM). -values(Results) -> - gleam@list:filter_map(Results, fun(Result) -> Result end). - --file("src/gleam/result.gleam", 429). -?DOC( - " Updates a value held within the `Error` of a result by calling a given function\n" - " on it, where the given function also returns a result. The two results are\n" - " then merged together into one result.\n" - "\n" - " If the result is an `Ok` rather than `Error` the function is not called and the\n" - " result stays the same.\n" - "\n" - " This function is useful for chaining together computations that may fail\n" - " and trying to recover from possible errors.\n" - "\n" - " If you do not need access to the initial error value, use `result.lazy_or`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " Ok(1) |> try_recover(with: fn(_) { Error(\"failed to recover\") })\n" - " // -> Ok(1)\n" - " ```\n" - "\n" - " ```gleam\n" - " Error(1) |> try_recover(with: fn(error) { Ok(error + 1) })\n" - " // -> Ok(2)\n" - " ```\n" - "\n" - " ```gleam\n" - " Error(1) |> try_recover(with: fn(error) { Error(\"failed to recover\") })\n" - " // -> Error(\"failed to recover\")\n" - " ```\n" -). --spec try_recover( - {ok, CQS} | {error, CQT}, - fun((CQT) -> {ok, CQS} | {error, CQW}) -) -> {ok, CQS} | {error, CQW}. -try_recover(Result, Fun) -> - case Result of - {ok, Value} -> - {ok, Value}; - - {error, Error} -> - Fun(Error) - end. diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@set.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@set.erl deleted file mode 100644 index 041d326..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@set.erl +++ /dev/null @@ -1,433 +0,0 @@ --module(gleam@set). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/set.gleam"). --export([new/0, size/1, is_empty/1, contains/2, delete/2, to_list/1, fold/3, filter/2, drop/2, take/2, intersection/2, difference/2, is_subset/2, is_disjoint/2, each/2, insert/2, from_list/1, map/2, union/2, symmetric_difference/2]). --export_type([set/1]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --opaque set(CVJ) :: {set, gleam@dict:dict(CVJ, list(nil))}. - --file("src/gleam/set.gleam", 32). -?DOC(" Creates a new empty set.\n"). --spec new() -> set(any()). -new() -> - {set, maps:new()}. - --file("src/gleam/set.gleam", 50). -?DOC( - " Gets the number of members in a set.\n" - "\n" - " This function runs in constant time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new()\n" - " |> insert(1)\n" - " |> insert(2)\n" - " |> size\n" - " // -> 2\n" - " ```\n" -). --spec size(set(any())) -> integer(). -size(Set) -> - maps:size(erlang:element(2, Set)). - --file("src/gleam/set.gleam", 68). -?DOC( - " Determines whether or not the set is empty.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new() |> is_empty\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " new() |> insert(1) |> is_empty\n" - " // -> False\n" - " ```\n" -). --spec is_empty(set(any())) -> boolean(). -is_empty(Set) -> - Set =:= new(). - --file("src/gleam/set.gleam", 110). -?DOC( - " Checks whether a set contains a given member.\n" - "\n" - " This function runs in logarithmic time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new()\n" - " |> insert(2)\n" - " |> contains(2)\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " new()\n" - " |> insert(2)\n" - " |> contains(1)\n" - " // -> False\n" - " ```\n" -). --spec contains(set(CVU), CVU) -> boolean(). -contains(Set, Member) -> - _pipe = erlang:element(2, Set), - _pipe@1 = gleam_stdlib:map_get(_pipe, Member), - gleam@result:is_ok(_pipe@1). - --file("src/gleam/set.gleam", 131). -?DOC( - " Removes a member from a set. If the set does not contain the member then\n" - " the set is returned unchanged.\n" - "\n" - " This function runs in logarithmic time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new()\n" - " |> insert(2)\n" - " |> delete(2)\n" - " |> contains(1)\n" - " // -> False\n" - " ```\n" -). --spec delete(set(CVW), CVW) -> set(CVW). -delete(Set, Member) -> - {set, gleam@dict:delete(erlang:element(2, Set), Member)}. - --file("src/gleam/set.gleam", 149). -?DOC( - " Converts the set into a list of the contained members.\n" - "\n" - " The list has no specific ordering, any unintentional ordering may change in\n" - " future versions of Gleam or Erlang.\n" - "\n" - " This function runs in linear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new() |> insert(2) |> to_list\n" - " // -> [2]\n" - " ```\n" -). --spec to_list(set(CVZ)) -> list(CVZ). -to_list(Set) -> - maps:keys(erlang:element(2, Set)). - --file("src/gleam/set.gleam", 190). -?DOC( - " Combines all entries into a single value by calling a given function on each\n" - " one.\n" - "\n" - " Sets are not ordered so the values are not returned in any specific order.\n" - " Do not write code that relies on the order entries are used by this\n" - " function as it may change in later versions of Gleam or Erlang.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([1, 3, 9])\n" - " |> fold(0, fn(accumulator, member) { accumulator + member })\n" - " // -> 13\n" - " ```\n" -). --spec fold(set(CWF), CWH, fun((CWH, CWF) -> CWH)) -> CWH. -fold(Set, Initial, Reducer) -> - gleam@dict:fold( - erlang:element(2, Set), - Initial, - fun(A, K, _) -> Reducer(A, K) end - ). - --file("src/gleam/set.gleam", 214). -?DOC( - " Creates a new set from an existing set, minus any members that a given\n" - " function returns `False` for.\n" - "\n" - " This function runs in loglinear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - "\n" - " from_list([1, 4, 6, 3, 675, 44, 67])\n" - " |> filter(keeping: int.is_even)\n" - " |> to_list\n" - " // -> [4, 6, 44]\n" - " ```\n" -). --spec filter(set(CWI), fun((CWI) -> boolean())) -> set(CWI). -filter(Set, Predicate) -> - {set, - gleam@dict:filter(erlang:element(2, Set), fun(M, _) -> Predicate(M) end)}. - --file("src/gleam/set.gleam", 251). -?DOC( - " Creates a new set from a given set with all the same entries except any\n" - " entry found on the given list.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([1, 2, 3, 4])\n" - " |> drop([1, 3])\n" - " |> to_list\n" - " // -> [2, 4]\n" - " ```\n" -). --spec drop(set(CWP), list(CWP)) -> set(CWP). -drop(Set, Disallowed) -> - gleam@list:fold(Disallowed, Set, fun delete/2). - --file("src/gleam/set.gleam", 269). -?DOC( - " Creates a new set from a given set, only including any members which are in\n" - " a given list.\n" - "\n" - " This function runs in loglinear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([1, 2, 3])\n" - " |> take([1, 3, 5])\n" - " |> to_list\n" - " // -> [1, 3]\n" - " ```\n" -). --spec take(set(CWT), list(CWT)) -> set(CWT). -take(Set, Desired) -> - {set, gleam@dict:take(erlang:element(2, Set), Desired)}. - --file("src/gleam/set.gleam", 289). --spec order(set(CXB), set(CXB)) -> {set(CXB), set(CXB)}. -order(First, Second) -> - case maps:size(erlang:element(2, First)) > maps:size( - erlang:element(2, Second) - ) of - true -> - {First, Second}; - - false -> - {Second, First} - end. - --file("src/gleam/set.gleam", 307). -?DOC( - " Creates a new set that contains members that are present in both given sets.\n" - "\n" - " This function runs in loglinear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " intersection(from_list([1, 2]), from_list([2, 3])) |> to_list\n" - " // -> [2]\n" - " ```\n" -). --spec intersection(set(CXG), set(CXG)) -> set(CXG). -intersection(First, Second) -> - {Larger, Smaller} = order(First, Second), - take(Larger, to_list(Smaller)). - --file("src/gleam/set.gleam", 325). -?DOC( - " Creates a new set that contains members that are present in the first set\n" - " but not the second.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " difference(from_list([1, 2]), from_list([2, 3, 4])) |> to_list\n" - " // -> [1]\n" - " ```\n" -). --spec difference(set(CXK), set(CXK)) -> set(CXK). -difference(First, Second) -> - drop(First, to_list(Second)). - --file("src/gleam/set.gleam", 346). -?DOC( - " Determines if a set is fully contained by another.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_subset(from_list([1]), from_list([1, 2]))\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " is_subset(from_list([1, 2, 3]), from_list([3, 4, 5]))\n" - " // -> False\n" - " ```\n" -). --spec is_subset(set(CXO), set(CXO)) -> boolean(). -is_subset(First, Second) -> - intersection(First, Second) =:= First. - --file("src/gleam/set.gleam", 364). -?DOC( - " Determines if two sets contain no common members\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_disjoint(from_list([1, 2, 3]), from_list([4, 5, 6]))\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " is_disjoint(from_list([1, 2, 3]), from_list([3, 4, 5]))\n" - " // -> False\n" - " ```\n" -). --spec is_disjoint(set(CXR), set(CXR)) -> boolean(). -is_disjoint(First, Second) -> - intersection(First, Second) =:= new(). - --file("src/gleam/set.gleam", 408). -?DOC( - " Calls a function for each member in a set, discarding the return\n" - " value.\n" - "\n" - " Useful for producing a side effect for every item of a set.\n" - "\n" - " The order of elements in the iteration is an implementation detail that\n" - " should not be relied upon.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let set = from_list([\"apple\", \"banana\", \"cherry\"])\n" - "\n" - " each(set, io.println)\n" - " // -> Nil\n" - " // apple\n" - " // banana\n" - " // cherry\n" - " ```\n" -). --spec each(set(CXY), fun((CXY) -> any())) -> nil. -each(Set, Fun) -> - fold( - Set, - nil, - fun(Nil, Member) -> - Fun(Member), - Nil - end - ). - --file("src/gleam/set.gleam", 86). -?DOC( - " Inserts a member into the set.\n" - "\n" - " This function runs in logarithmic time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " new()\n" - " |> insert(1)\n" - " |> insert(2)\n" - " |> size\n" - " // -> 2\n" - " ```\n" -). --spec insert(set(CVR), CVR) -> set(CVR). -insert(Set, Member) -> - {set, gleam@dict:insert(erlang:element(2, Set), Member, [])}. - --file("src/gleam/set.gleam", 167). -?DOC( - " Creates a new set of the members in a given list.\n" - "\n" - " This function runs in loglinear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " import gleam/int\n" - " import gleam/list\n" - "\n" - " [1, 1, 2, 4, 3, 2] |> from_list |> to_list |> list.sort(by: int.compare)\n" - " // -> [1, 2, 3, 4]\n" - " ```\n" -). --spec from_list(list(CWC)) -> set(CWC). -from_list(Members) -> - Dict = gleam@list:fold( - Members, - maps:new(), - fun(M, K) -> gleam@dict:insert(M, K, []) end - ), - {set, Dict}. - --file("src/gleam/set.gleam", 233). -?DOC( - " Creates a new set from a given set with the result of applying the given\n" - " function to each member.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_list([1, 2, 3, 4])\n" - " |> map(with: fn(x) { x * 2 })\n" - " |> to_list\n" - " // -> [2, 4, 6, 8]\n" - " ```\n" -). --spec map(set(CWL), fun((CWL) -> CWN)) -> set(CWN). -map(Set, Fun) -> - fold(Set, new(), fun(Acc, Member) -> insert(Acc, Fun(Member)) end). - --file("src/gleam/set.gleam", 284). -?DOC( - " Creates a new set that contains all members of both given sets.\n" - "\n" - " This function runs in loglinear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " union(from_list([1, 2]), from_list([2, 3])) |> to_list\n" - " // -> [1, 2, 3]\n" - " ```\n" -). --spec union(set(CWX), set(CWX)) -> set(CWX). -union(First, Second) -> - {Larger, Smaller} = order(First, Second), - fold(Smaller, Larger, fun insert/2). - --file("src/gleam/set.gleam", 378). -?DOC( - " Creates a new set that contains members that are present in either set, but\n" - " not both.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " symmetric_difference(from_list([1, 2, 3]), from_list([3, 4])) |> to_list\n" - " // -> [1, 2, 4]\n" - " ```\n" -). --spec symmetric_difference(set(CXU), set(CXU)) -> set(CXU). -symmetric_difference(First, Second) -> - difference(union(First, Second), intersection(First, Second)). diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@string.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@string.erl deleted file mode 100644 index d6465db..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@string.erl +++ /dev/null @@ -1,1012 +0,0 @@ --module(gleam@string). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/string.gleam"). --export([is_empty/1, length/1, reverse/1, replace/3, lowercase/1, uppercase/1, compare/2, slice/3, crop/2, drop_end/2, contains/2, starts_with/2, ends_with/2, split_once/2, append/2, concat/1, repeat/2, join/2, pad_start/3, pad_end/3, trim_start/1, trim_end/1, trim/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, drop_start/2]). --export_type([direction/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " Strings in Gleam are UTF-8 binaries. They can be written in your code as\n" - " text surrounded by `\"double quotes\"`.\n" -). - --type direction() :: leading | trailing. - --file("src/gleam/string.gleam", 23). -?DOC( - " Determines if a `String` is empty.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " is_empty(\"\")\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " is_empty(\"the world\")\n" - " // -> False\n" - " ```\n" -). --spec is_empty(binary()) -> boolean(). -is_empty(Str) -> - Str =:= <<""/utf8>>. - --file("src/gleam/string.gleam", 51). -?DOC( - " Gets the number of grapheme clusters in a given `String`.\n" - "\n" - " This function has to iterate across the whole string to count the number of\n" - " graphemes, so it runs in linear time. Avoid using this in a loop.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " length(\"Gleam\")\n" - " // -> 5\n" - " ```\n" - "\n" - " ```gleam\n" - " length(\"ß↑e̊\")\n" - " // -> 3\n" - " ```\n" - "\n" - " ```gleam\n" - " length(\"\")\n" - " // -> 0\n" - " ```\n" -). --spec length(binary()) -> integer(). -length(String) -> - string:length(String). - --file("src/gleam/string.gleam", 65). -?DOC( - " Reverses a `String`.\n" - "\n" - " This function has to iterate across the whole `String` so it runs in linear\n" - " time. Avoid using this in a loop.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " reverse(\"stressed\")\n" - " // -> \"desserts\"\n" - " ```\n" -). --spec reverse(binary()) -> binary(). -reverse(String) -> - _pipe = String, - _pipe@1 = gleam_stdlib:identity(_pipe), - _pipe@2 = string:reverse(_pipe@1), - unicode:characters_to_binary(_pipe@2). - --file("src/gleam/string.gleam", 86). -?DOC( - " Creates a new `String` by replacing all occurrences of a given substring.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " replace(\"www.example.com\", each: \".\", with: \"-\")\n" - " // -> \"www-example-com\"\n" - " ```\n" - "\n" - " ```gleam\n" - " replace(\"a,b,c,d,e\", each: \",\", with: \"/\")\n" - " // -> \"a/b/c/d/e\"\n" - " ```\n" -). --spec replace(binary(), binary(), binary()) -> binary(). -replace(String, Pattern, Substitute) -> - _pipe = String, - _pipe@1 = gleam_stdlib:identity(_pipe), - _pipe@2 = gleam_stdlib:string_replace(_pipe@1, Pattern, Substitute), - unicode:characters_to_binary(_pipe@2). - --file("src/gleam/string.gleam", 111). -?DOC( - " Creates a new `String` with all the graphemes in the input `String` converted to\n" - " lowercase.\n" - "\n" - " Useful for case-insensitive comparisons.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " lowercase(\"X-FILES\")\n" - " // -> \"x-files\"\n" - " ```\n" -). --spec lowercase(binary()) -> binary(). -lowercase(String) -> - string:lowercase(String). - --file("src/gleam/string.gleam", 127). -?DOC( - " Creates a new `String` with all the graphemes in the input `String` converted to\n" - " uppercase.\n" - "\n" - " Useful for case-insensitive comparisons and VIRTUAL YELLING.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " uppercase(\"skinner\")\n" - " // -> \"SKINNER\"\n" - " ```\n" -). --spec uppercase(binary()) -> binary(). -uppercase(String) -> - string:uppercase(String). - --file("src/gleam/string.gleam", 145). -?DOC( - " Compares two `String`s to see which is \"larger\" by comparing their graphemes.\n" - "\n" - " This does not compare the size or length of the given `String`s.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " compare(\"Anthony\", \"Anthony\")\n" - " // -> order.Eq\n" - " ```\n" - "\n" - " ```gleam\n" - " compare(\"A\", \"B\")\n" - " // -> order.Lt\n" - " ```\n" -). --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; - - false -> - gt - end - end. - --file("src/gleam/string.gleam", 194). -?DOC( - " Takes a substring given a start grapheme index and a length. Negative indexes\n" - " are taken starting from the *end* of the string.\n" - "\n" - " This function runs in linear time with the size of the index and the\n" - " length. Negative indexes are linear with the size of the input string in\n" - " addition to the other costs.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " slice(from: \"gleam\", at_index: 1, length: 2)\n" - " // -> \"le\"\n" - " ```\n" - "\n" - " ```gleam\n" - " slice(from: \"gleam\", at_index: 1, length: 10)\n" - " // -> \"leam\"\n" - " ```\n" - "\n" - " ```gleam\n" - " slice(from: \"gleam\", at_index: 10, length: 3)\n" - " // -> \"\"\n" - " ```\n" - "\n" - " ```gleam\n" - " slice(from: \"gleam\", at_index: -2, length: 2)\n" - " // -> \"am\"\n" - " ```\n" - "\n" - " ```gleam\n" - " slice(from: \"gleam\", at_index: -12, length: 2)\n" - " // -> \"\"\n" - " ```\n" -). --spec slice(binary(), integer(), integer()) -> binary(). -slice(String, Idx, Len) -> - case Len =< 0 of - true -> - <<""/utf8>>; - - false -> - case Idx < 0 of - true -> - Translated_idx = string:length(String) + Idx, - case Translated_idx < 0 of - true -> - <<""/utf8>>; - - false -> - gleam_stdlib:slice(String, Translated_idx, Len) - end; - - false -> - gleam_stdlib:slice(String, Idx, Len) - end - end. - --file("src/gleam/string.gleam", 232). -?DOC( - " Drops contents of the first `String` that occur before the second `String`.\n" - " If the `from` string does not contain the `before` string, `from` is\n" - " returned unchanged.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " crop(from: \"The Lone Gunmen\", before: \"Lone\")\n" - " // -> \"Lone Gunmen\"\n" - " ```\n" -). --spec crop(binary(), binary()) -> binary(). -crop(String, Substring) -> - gleam_stdlib:crop_string(String, Substring). - --file("src/gleam/string.gleam", 268). -?DOC( - " Drops *n* graphemes from the end of a `String`.\n" - "\n" - " This function traverses the full string, so it runs in linear time with the\n" - " size of the string. Avoid using this in a loop.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " drop_end(from: \"Cigarette Smoking Man\", up_to: 2)\n" - " // -> \"Cigarette Smoking M\"\n" - " ```\n" -). --spec drop_end(binary(), integer()) -> binary(). -drop_end(String, Num_graphemes) -> - case Num_graphemes =< 0 of - true -> - String; - - false -> - slice(String, 0, string:length(String) - Num_graphemes) - end. - --file("src/gleam/string.gleam", 296). -?DOC( - " Checks if the first `String` contains the second.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " contains(does: \"theory\", contain: \"ory\")\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " contains(does: \"theory\", contain: \"the\")\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " contains(does: \"theory\", contain: \"THE\")\n" - " // -> False\n" - " ```\n" -). --spec contains(binary(), binary()) -> boolean(). -contains(Haystack, Needle) -> - gleam_stdlib:contains_string(Haystack, Needle). - --file("src/gleam/string.gleam", 309). -?DOC( - " Checks whether the first `String` starts with the second one.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " starts_with(\"theory\", \"ory\")\n" - " // -> False\n" - " ```\n" -). --spec starts_with(binary(), binary()) -> boolean(). -starts_with(String, Prefix) -> - gleam_stdlib:string_starts_with(String, Prefix). - --file("src/gleam/string.gleam", 322). -?DOC( - " Checks whether the first `String` ends with the second one.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " ends_with(\"theory\", \"ory\")\n" - " // -> True\n" - " ```\n" -). --spec ends_with(binary(), binary()) -> boolean(). -ends_with(String, Suffix) -> - gleam_stdlib:string_ends_with(String, Suffix). - --file("src/gleam/string.gleam", 361). -?DOC( - " Splits a `String` a single time on the given substring.\n" - "\n" - " Returns an `Error` if substring not present.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " split_once(\"home/gleam/desktop/\", on: \"/\")\n" - " // -> Ok(#(\"home\", \"gleam/desktop/\"))\n" - " ```\n" - "\n" - " ```gleam\n" - " split_once(\"home/gleam/desktop/\", on: \"?\")\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec split_once(binary(), binary()) -> {ok, {binary(), binary()}} | - {error, nil}. -split_once(String, Substring) -> - case string:split(String, Substring) of - [First, Rest] -> - {ok, {First, Rest}}; - - _ -> - {error, nil} - end. - --file("src/gleam/string.gleam", 392). -?DOC( - " Creates a new `String` by joining two `String`s together.\n" - "\n" - " This function typically copies both `String`s and runs in linear time, but\n" - " the exact behaviour will depend on how the runtime you are using optimises\n" - " your code. Benchmark and profile your code if you need to understand its\n" - " performance better.\n" - "\n" - " If you are joining together large string and want to avoid copying any data\n" - " you may want to investigate using the [`string_tree`](../gleam/string_tree.html)\n" - " module.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " append(to: \"butter\", suffix: \"fly\")\n" - " // -> \"butterfly\"\n" - " ```\n" -). --spec append(binary(), binary()) -> binary(). -append(First, Second) -> - <>. - --file("src/gleam/string.gleam", 412). --spec concat_loop(list(binary()), binary()) -> binary(). -concat_loop(Strings, Accumulator) -> - case Strings of - [String | Strings@1] -> - concat_loop(Strings@1, <>); - - [] -> - Accumulator - end. - --file("src/gleam/string.gleam", 408). -?DOC( - " Creates a new `String` by joining many `String`s together.\n" - "\n" - " This function copies all the `String`s and runs in linear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " concat([\"never\", \"the\", \"less\"])\n" - " // -> \"nevertheless\"\n" - " ```\n" -). --spec concat(list(binary())) -> binary(). -concat(Strings) -> - erlang:list_to_binary(Strings). - --file("src/gleam/string.gleam", 437). --spec repeat_loop(integer(), binary(), binary()) -> binary(). -repeat_loop(Times, Doubling_acc, Acc) -> - Acc@1 = case Times rem 2 of - 0 -> - Acc; - - _ -> - <> - end, - Times@1 = Times div 2, - case Times@1 =< 0 of - true -> - Acc@1; - - false -> - repeat_loop( - Times@1, - <>, - Acc@1 - ) - end. - --file("src/gleam/string.gleam", 430). -?DOC( - " Creates a new `String` by repeating a `String` a given number of times.\n" - "\n" - " This function runs in loglinear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " repeat(\"ha\", times: 3)\n" - " // -> \"hahaha\"\n" - " ```\n" -). --spec repeat(binary(), integer()) -> binary(). -repeat(String, Times) -> - case Times =< 0 of - true -> - <<""/utf8>>; - - false -> - repeat_loop(Times, String, <<""/utf8>>) - end. - --file("src/gleam/string.gleam", 467). --spec join_loop(list(binary()), binary(), binary()) -> binary(). -join_loop(Strings, Separator, Accumulator) -> - case Strings of - [] -> - Accumulator; - - [String | Strings@1] -> - join_loop( - Strings@1, - Separator, - <<<>/binary, - String/binary>> - ) - end. - --file("src/gleam/string.gleam", 460). -?DOC( - " Joins many `String`s together with a given separator.\n" - "\n" - " This function runs in linear time.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " join([\"home\",\"evan\",\"Desktop\"], with: \"/\")\n" - " // -> \"home/evan/Desktop\"\n" - " ```\n" -). --spec join(list(binary()), binary()) -> binary(). -join(Strings, Separator) -> - case Strings of - [] -> - <<""/utf8>>; - - [First | Rest] -> - join_loop(Rest, Separator, First) - end. - --file("src/gleam/string.gleam", 545). --spec padding(integer(), binary()) -> binary(). -padding(Size, Pad_string) -> - Pad_string_length = string:length(Pad_string), - Num_pads = case Pad_string_length of - 0 -> 0; - Gleam@denominator -> Size div Gleam@denominator - end, - Extra = case Pad_string_length of - 0 -> 0; - Gleam@denominator@1 -> Size rem Gleam@denominator@1 - end, - <<(repeat(Pad_string, Num_pads))/binary, - (slice(Pad_string, 0, Extra))/binary>>. - --file("src/gleam/string.gleam", 498). -?DOC( - " Pads the start of a `String` until it has a given length.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " pad_start(\"121\", to: 5, with: \".\")\n" - " // -> \"..121\"\n" - " ```\n" - "\n" - " ```gleam\n" - " pad_start(\"121\", to: 3, with: \".\")\n" - " // -> \"121\"\n" - " ```\n" - "\n" - " ```gleam\n" - " pad_start(\"121\", to: 2, with: \".\")\n" - " // -> \"121\"\n" - " ```\n" -). --spec pad_start(binary(), integer(), binary()) -> binary(). -pad_start(String, Desired_length, Pad_string) -> - Current_length = string:length(String), - To_pad_length = Desired_length - Current_length, - case To_pad_length =< 0 of - true -> - String; - - false -> - <<(padding(To_pad_length, Pad_string))/binary, String/binary>> - end. - --file("src/gleam/string.gleam", 531). -?DOC( - " Pads the end of a `String` until it has a given length.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " pad_end(\"123\", to: 5, with: \".\")\n" - " // -> \"123..\"\n" - " ```\n" - "\n" - " ```gleam\n" - " pad_end(\"123\", to: 3, with: \".\")\n" - " // -> \"123\"\n" - " ```\n" - "\n" - " ```gleam\n" - " pad_end(\"123\", to: 2, with: \".\")\n" - " // -> \"123\"\n" - " ```\n" -). --spec pad_end(binary(), integer(), binary()) -> binary(). -pad_end(String, Desired_length, Pad_string) -> - Current_length = string:length(String), - To_pad_length = Desired_length - Current_length, - case To_pad_length =< 0 of - true -> - String; - - false -> - <> - end. - --file("src/gleam/string.gleam", 589). -?DOC( - " Removes whitespace at the start of a `String`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " trim_start(\" hats \\n\")\n" - " // -> \"hats \\n\"\n" - " ```\n" -). --spec trim_start(binary()) -> binary(). -trim_start(String) -> - string:trim(String, leading). - --file("src/gleam/string.gleam", 603). -?DOC( - " Removes whitespace at the end of a `String`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " trim_end(\" hats \\n\")\n" - " // -> \" hats\"\n" - " ```\n" -). --spec trim_end(binary()) -> binary(). -trim_end(String) -> - string:trim(String, trailing). - --file("src/gleam/string.gleam", 567). -?DOC( - " Removes whitespace on both sides of a `String`.\n" - "\n" - " Whitespace in this function is the set of nonbreakable whitespace\n" - " codepoints, defined as Pattern_White_Space in [Unicode Standard Annex #31][1].\n" - "\n" - " [1]: https://unicode.org/reports/tr31/\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " trim(\" hats \\n\")\n" - " // -> \"hats\"\n" - " ```\n" -). --spec trim(binary()) -> binary(). -trim(String) -> - _pipe = String, - _pipe@1 = trim_start(_pipe), - trim_end(_pipe@1). - --file("src/gleam/string.gleam", 630). -?DOC( - " Splits a non-empty `String` into its first element (head) and rest (tail).\n" - " This lets you pattern match on `String`s exactly as you would with lists.\n" - "\n" - " ## Performance\n" - "\n" - " There is a notable overhead to using this function, so you may not want to\n" - " use it in a tight loop. If you wish to efficiently parse a string you may\n" - " want to use alternatives such as the [splitter package](https://hex.pm/packages/splitter).\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " pop_grapheme(\"gleam\")\n" - " // -> Ok(#(\"g\", \"leam\"))\n" - " ```\n" - "\n" - " ```gleam\n" - " pop_grapheme(\"\")\n" - " // -> Error(Nil)\n" - " ```\n" -). --spec pop_grapheme(binary()) -> {ok, {binary(), binary()}} | {error, nil}. -pop_grapheme(String) -> - gleam_stdlib:string_pop_grapheme(String). - --file("src/gleam/string.gleam", 647). --spec to_graphemes_loop(binary(), list(binary())) -> list(binary()). -to_graphemes_loop(String, Acc) -> - case gleam_stdlib:string_pop_grapheme(String) of - {ok, {Grapheme, Rest}} -> - to_graphemes_loop(Rest, [Grapheme | Acc]); - - {error, _} -> - Acc - end. - --file("src/gleam/string.gleam", 641). -?DOC( - " Converts a `String` to a list of\n" - " [graphemes](https://en.wikipedia.org/wiki/Grapheme).\n" - "\n" - " ```gleam\n" - " to_graphemes(\"abc\")\n" - " // -> [\"a\", \"b\", \"c\"]\n" - " ```\n" -). --spec to_graphemes(binary()) -> list(binary()). -to_graphemes(String) -> - _pipe = String, - _pipe@1 = to_graphemes_loop(_pipe, []), - lists:reverse(_pipe@1). - --file("src/gleam/string.gleam", 333). -?DOC( - " Creates a list of `String`s by splitting a given string on a given substring.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " split(\"home/gleam/desktop/\", on: \"/\")\n" - " // -> [\"home\", \"gleam\", \"desktop\", \"\"]\n" - " ```\n" -). --spec split(binary(), binary()) -> list(binary()). -split(X, Substring) -> - case Substring of - <<""/utf8>> -> - to_graphemes(X); - - _ -> - _pipe = X, - _pipe@1 = gleam_stdlib:identity(_pipe), - _pipe@2 = gleam@string_tree:split(_pipe@1, Substring), - gleam@list:map(_pipe@2, fun unicode:characters_to_binary/1) - end. - --file("src/gleam/string.gleam", 694). --spec to_utf_codepoints_loop(bitstring(), list(integer())) -> list(integer()). -to_utf_codepoints_loop(Bit_array, Acc) -> - case Bit_array of - <> -> - to_utf_codepoints_loop(Rest, [First | Acc]); - - _ -> - lists:reverse(Acc) - end. - --file("src/gleam/string.gleam", 689). --spec do_to_utf_codepoints(binary()) -> list(integer()). -do_to_utf_codepoints(String) -> - to_utf_codepoints_loop(<>, []). - --file("src/gleam/string.gleam", 684). -?DOC( - " Converts a `String` to a `List` of `UtfCodepoint`.\n" - "\n" - " See and\n" - " for an\n" - " explanation on code points.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " \"a\" |> to_utf_codepoints\n" - " // -> [UtfCodepoint(97)]\n" - " ```\n" - "\n" - " ```gleam\n" - " // Semantically the same as:\n" - " // [\"🏳\", \"️\", \"‍\", \"🌈\"] or:\n" - " // [waving_white_flag, variant_selector_16, zero_width_joiner, rainbow]\n" - " \"🏳️‍🌈\" |> to_utf_codepoints\n" - " // -> [\n" - " // UtfCodepoint(127987),\n" - " // UtfCodepoint(65039),\n" - " // UtfCodepoint(8205),\n" - " // UtfCodepoint(127752),\n" - " // ]\n" - " ```\n" -). --spec to_utf_codepoints(binary()) -> list(integer()). -to_utf_codepoints(String) -> - do_to_utf_codepoints(String). - --file("src/gleam/string.gleam", 734). -?DOC( - " Converts a `List` of `UtfCodepoint`s to a `String`.\n" - "\n" - " See and\n" - " for an\n" - " explanation on code points.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let assert Ok(a) = utf_codepoint(97)\n" - " let assert Ok(b) = utf_codepoint(98)\n" - " let assert Ok(c) = utf_codepoint(99)\n" - " from_utf_codepoints([a, b, c])\n" - " // -> \"abc\"\n" - " ```\n" -). --spec from_utf_codepoints(list(integer())) -> binary(). -from_utf_codepoints(Utf_codepoints) -> - gleam_stdlib:utf_codepoint_list_to_string(Utf_codepoints). - --file("src/gleam/string.gleam", 740). -?DOC( - " Converts an integer to a `UtfCodepoint`.\n" - "\n" - " Returns an `Error` if the integer does not represent a valid UTF codepoint.\n" -). --spec utf_codepoint(integer()) -> {ok, integer()} | {error, nil}. -utf_codepoint(Value) -> - case Value of - I when I > 1114111 -> - {error, nil}; - - I@1 when (I@1 >= 55296) andalso (I@1 =< 57343) -> - {error, nil}; - - I@2 when I@2 < 0 -> - {error, nil}; - - I@3 -> - {ok, gleam_stdlib:identity(I@3)} - end. - --file("src/gleam/string.gleam", 761). -?DOC( - " Converts a `UtfCodepoint` to its ordinal code point value.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let assert [utf_codepoint, ..] = to_utf_codepoints(\"💜\")\n" - " utf_codepoint_to_int(utf_codepoint)\n" - " // -> 128156\n" - " ```\n" -). --spec utf_codepoint_to_int(integer()) -> integer(). -utf_codepoint_to_int(Cp) -> - gleam_stdlib:identity(Cp). - --file("src/gleam/string.gleam", 778). -?DOC( - " Converts a `String` into `Option(String)` where an empty `String` becomes\n" - " `None`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " to_option(\"\")\n" - " // -> None\n" - " ```\n" - "\n" - " ```gleam\n" - " to_option(\"hats\")\n" - " // -> Some(\"hats\")\n" - " ```\n" -). --spec to_option(binary()) -> gleam@option:option(binary()). -to_option(String) -> - case String of - <<""/utf8>> -> - none; - - _ -> - {some, String} - end. - --file("src/gleam/string.gleam", 801). -?DOC( - " Returns the first grapheme cluster in a given `String` and wraps it in a\n" - " `Result(String, Nil)`. If the `String` is empty, it returns `Error(Nil)`.\n" - " Otherwise, it returns `Ok(String)`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " first(\"\")\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " first(\"icecream\")\n" - " // -> Ok(\"i\")\n" - " ```\n" -). --spec first(binary()) -> {ok, binary()} | {error, nil}. -first(String) -> - case gleam_stdlib:string_pop_grapheme(String) of - {ok, {First, _}} -> - {ok, First}; - - {error, E} -> - {error, E} - end. - --file("src/gleam/string.gleam", 827). -?DOC( - " Returns the last grapheme cluster in a given `String` and wraps it in a\n" - " `Result(String, Nil)`. If the `String` is empty, it returns `Error(Nil)`.\n" - " Otherwise, it returns `Ok(String)`.\n" - "\n" - " This function traverses the full string, so it runs in linear time with the\n" - " length of the string. Avoid using this in a loop.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " last(\"\")\n" - " // -> Error(Nil)\n" - " ```\n" - "\n" - " ```gleam\n" - " last(\"icecream\")\n" - " // -> Ok(\"m\")\n" - " ```\n" -). --spec last(binary()) -> {ok, binary()} | {error, nil}. -last(String) -> - case gleam_stdlib:string_pop_grapheme(String) of - {ok, {First, <<""/utf8>>}} -> - {ok, First}; - - {ok, {_, Rest}} -> - {ok, slice(Rest, -1, 1)}; - - {error, E} -> - {error, E} - end. - --file("src/gleam/string.gleam", 845). -?DOC( - " Creates a new `String` with the first grapheme in the input `String`\n" - " converted to uppercase and the remaining graphemes to lowercase.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " capitalise(\"mamouna\")\n" - " // -> \"Mamouna\"\n" - " ```\n" -). --spec capitalise(binary()) -> binary(). -capitalise(String) -> - case gleam_stdlib:string_pop_grapheme(String) of - {ok, {First, Rest}} -> - append(string:uppercase(First), string:lowercase(Rest)); - - {error, _} -> - <<""/utf8>> - end. - --file("src/gleam/string.gleam", 876). -?DOC( - " Returns a `String` representation of a term in Gleam syntax.\n" - "\n" - " This may be occasionally useful for quick-and-dirty printing of values in\n" - " scripts. For error reporting and other uses prefer constructing strings by\n" - " pattern matching on the values.\n" - "\n" - " ## Limitations\n" - "\n" - " The output format of this function is not stable and could change at any\n" - " time. The output is not suitable for parsing.\n" - "\n" - " This function works using runtime reflection, so the output may not be\n" - " perfectly accurate for data structures where the runtime structure doesn't\n" - " hold enough information to determine the original syntax. For example,\n" - " tuples with an Erlang atom in the first position will be mistaken for Gleam\n" - " records.\n" - "\n" - " ## Security and safety\n" - "\n" - " There is no limit to how large the strings that this function can produce.\n" - " Be careful not to call this function with large data structures or you\n" - " could use very large amounts of memory, potentially causing runtime\n" - " problems.\n" -). --spec inspect(any()) -> binary(). -inspect(Term) -> - _pipe = Term, - _pipe@1 = gleam_stdlib:inspect(_pipe), - unicode:characters_to_binary(_pipe@1). - --file("src/gleam/string.gleam", 900). -?DOC( - " Returns the number of bytes in a `String`.\n" - "\n" - " This function runs in constant time on Erlang and in linear time on\n" - " JavaScript.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " byte_size(\"🏳️‍⚧️🏳️‍🌈👩🏾‍❤️‍👨🏻\")\n" - " // -> 58\n" - " ```\n" -). --spec byte_size(binary()) -> integer(). -byte_size(String) -> - erlang:byte_size(String). - --file("src/gleam/string.gleam", 245). -?DOC( - " Drops *n* graphemes from the start of a `String`.\n" - "\n" - " This function runs in linear time with the number of graphemes to drop.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " drop_start(from: \"The Lone Gunmen\", up_to: 2)\n" - " // -> \"e Lone Gunmen\"\n" - " ```\n" -). --spec drop_start(binary(), integer()) -> binary(). -drop_start(String, Num_graphemes) -> - case Num_graphemes =< 0 of - true -> - String; - - false -> - Prefix = gleam_stdlib:slice(String, 0, Num_graphemes), - Prefix_size = erlang:byte_size(Prefix), - binary:part( - String, - Prefix_size, - erlang:byte_size(String) - Prefix_size - ) - end. diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@string_tree.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@string_tree.erl deleted file mode 100644 index ec26f26..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@string_tree.erl +++ /dev/null @@ -1,207 +0,0 @@ --module(gleam@string_tree). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/string_tree.gleam"). --export([append_tree/2, prepend_tree/2, from_strings/1, new/0, 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_tree/0, direction/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --type string_tree() :: any(). - --type direction() :: all. - --file("src/gleam/string_tree.gleam", 61). -?DOC( - " Appends some `StringTree` onto the end of another.\n" - "\n" - " Runs in constant time.\n" -). --spec append_tree(string_tree(), string_tree()) -> string_tree(). -append_tree(Tree, Suffix) -> - gleam_stdlib:iodata_append(Tree, Suffix). - --file("src/gleam/string_tree.gleam", 48). -?DOC( - " Prepends some `StringTree` onto the start of another.\n" - "\n" - " Runs in constant time.\n" -). --spec prepend_tree(string_tree(), string_tree()) -> string_tree(). -prepend_tree(Tree, Prefix) -> - gleam_stdlib:iodata_append(Prefix, Tree). - --file("src/gleam/string_tree.gleam", 69). -?DOC( - " Converts a list of strings into a `StringTree`.\n" - "\n" - " Runs in constant time.\n" -). --spec from_strings(list(binary())) -> string_tree(). -from_strings(Strings) -> - gleam_stdlib:identity(Strings). - --file("src/gleam/string_tree.gleam", 24). -?DOC( - " Create an empty `StringTree`. Useful as the start of a pipe chaining many\n" - " trees together.\n" -). --spec new() -> string_tree(). -new() -> - gleam_stdlib:identity([]). - --file("src/gleam/string_tree.gleam", 77). -?DOC( - " Joins a list of trees into a single tree.\n" - "\n" - " Runs in constant time.\n" -). --spec concat(list(string_tree())) -> string_tree(). -concat(Trees) -> - gleam_stdlib:identity(Trees). - --file("src/gleam/string_tree.gleam", 85). -?DOC( - " Converts a string into a `StringTree`.\n" - "\n" - " Runs in constant time.\n" -). --spec from_string(binary()) -> string_tree(). -from_string(String) -> - gleam_stdlib:identity(String). - --file("src/gleam/string_tree.gleam", 32). -?DOC( - " Prepends a `String` onto the start of some `StringTree`.\n" - "\n" - " Runs in constant time.\n" -). --spec prepend(string_tree(), binary()) -> string_tree(). -prepend(Tree, Prefix) -> - gleam_stdlib:iodata_append(gleam_stdlib:identity(Prefix), Tree). - --file("src/gleam/string_tree.gleam", 40). -?DOC( - " Appends a `String` onto the end of some `StringTree`.\n" - "\n" - " Runs in constant time.\n" -). --spec append(string_tree(), binary()) -> string_tree(). -append(Tree, Second) -> - gleam_stdlib:iodata_append(Tree, gleam_stdlib:identity(Second)). - --file("src/gleam/string_tree.gleam", 94). -?DOC( - " Turns a `StringTree` into a `String`.\n" - "\n" - " This function is implemented natively by the virtual machine and is highly\n" - " optimised.\n" -). --spec to_string(string_tree()) -> binary(). -to_string(Tree) -> - unicode:characters_to_binary(Tree). - --file("src/gleam/string_tree.gleam", 100). -?DOC(" Returns the size of the `StringTree` in bytes.\n"). --spec byte_size(string_tree()) -> integer(). -byte_size(Tree) -> - erlang:iolist_size(Tree). - --file("src/gleam/string_tree.gleam", 104). -?DOC(" Joins the given trees into a new tree separated with the given string.\n"). --spec join(list(string_tree()), binary()) -> string_tree(). -join(Trees, Sep) -> - _pipe = Trees, - _pipe@1 = gleam@list:intersperse(_pipe, gleam_stdlib:identity(Sep)), - gleam_stdlib:identity(_pipe@1). - --file("src/gleam/string_tree.gleam", 115). -?DOC( - " Converts a `StringTree` to a new one where the contents have been\n" - " lowercased.\n" -). --spec lowercase(string_tree()) -> string_tree(). -lowercase(Tree) -> - string:lowercase(Tree). - --file("src/gleam/string_tree.gleam", 122). -?DOC( - " Converts a `StringTree` to a new one where the contents have been\n" - " uppercased.\n" -). --spec uppercase(string_tree()) -> string_tree(). -uppercase(Tree) -> - string:uppercase(Tree). - --file("src/gleam/string_tree.gleam", 127). -?DOC(" Converts a `StringTree` to a new one with the contents reversed.\n"). --spec reverse(string_tree()) -> string_tree(). -reverse(Tree) -> - string:reverse(Tree). - --file("src/gleam/string_tree.gleam", 145). -?DOC(" Splits a `StringTree` on a given pattern into a list of trees.\n"). --spec split(string_tree(), binary()) -> list(string_tree()). -split(Tree, Pattern) -> - string:split(Tree, Pattern, all). - --file("src/gleam/string_tree.gleam", 156). -?DOC(" Replaces all instances of a pattern with a given string substitute.\n"). --spec replace(string_tree(), binary(), binary()) -> string_tree(). -replace(Tree, Pattern, Substitute) -> - gleam_stdlib:string_replace(Tree, Pattern, Substitute). - --file("src/gleam/string_tree.gleam", 182). -?DOC( - " Compares two string trees to determine if they have the same textual\n" - " content.\n" - "\n" - " Comparing two string trees using the `==` operator may return `False` even\n" - " if they have the same content as they may have been build in different ways,\n" - " so using this function is often preferred.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_strings([\"a\", \"b\"]) == from_string(\"ab\")\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " is_equal(from_strings([\"a\", \"b\"]), from_string(\"ab\"))\n" - " // -> True\n" - " ```\n" -). --spec is_equal(string_tree(), string_tree()) -> boolean(). -is_equal(A, B) -> - string:equal(A, B). - --file("src/gleam/string_tree.gleam", 206). -?DOC( - " Inspects a `StringTree` to determine if it is equivalent to an empty string.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " from_string(\"ok\") |> is_empty\n" - " // -> False\n" - " ```\n" - "\n" - " ```gleam\n" - " from_string(\"\") |> is_empty\n" - " // -> True\n" - " ```\n" - "\n" - " ```gleam\n" - " from_strings([]) |> is_empty\n" - " // -> True\n" - " ```\n" -). --spec is_empty(string_tree()) -> boolean(). -is_empty(Tree) -> - string:is_empty(Tree). diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@uri.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@uri.erl deleted file mode 100644 index c27d1d2..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam@uri.erl +++ /dev/null @@ -1,1049 +0,0 @@ --module(gleam@uri). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleam/uri.gleam"). --export([parse_query/1, percent_encode/1, query_to_string/1, percent_decode/1, path_segments/1, to_string/1, origin/1, merge/2, parse/1]). --export_type([uri/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC( - " Utilities for working with URIs\n" - "\n" - " This module provides functions for working with URIs (for example, parsing\n" - " URIs or encoding query strings). The functions in this module are implemented\n" - " according to [RFC 3986](https://tools.ietf.org/html/rfc3986).\n" - "\n" - " Query encoding (Form encoding) is defined in the\n" - " [W3C specification](https://www.w3.org/TR/html52/sec-forms.html#urlencoded-form-data).\n" -). - --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())}. - --file("src/gleam/uri.gleam", 289). --spec is_valid_host_within_brackets_char(integer()) -> boolean(). -is_valid_host_within_brackets_char(Char) -> - (((((48 >= Char) andalso (Char =< 57)) orelse ((65 >= Char) andalso (Char =< 90))) - orelse ((97 >= Char) andalso (Char =< 122))) - orelse (Char =:= 58)) - orelse (Char =:= 46). - --file("src/gleam/uri.gleam", 506). --spec parse_fragment(binary(), uri()) -> {ok, uri()} | {error, nil}. -parse_fragment(Rest, Pieces) -> - {ok, - {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - {some, Rest}}}. - --file("src/gleam/uri.gleam", 478). --spec parse_query_with_question_mark_loop(binary(), binary(), uri(), integer()) -> {ok, - uri()} | - {error, nil}. -parse_query_with_question_mark_loop(Original, Uri_string, Pieces, Size) -> - case Uri_string of - <<"#"/utf8, Rest/binary>> when Size =:= 0 -> - parse_fragment(Rest, Pieces); - - <<"#"/utf8, Rest@1/binary>> -> - Query = binary:part(Original, 0, Size), - Pieces@1 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - erlang:element(6, Pieces), - {some, Query}, - erlang:element(8, Pieces)}, - parse_fragment(Rest@1, Pieces@1); - - <<""/utf8>> -> - {ok, - {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - erlang:element(6, Pieces), - {some, Original}, - erlang:element(8, Pieces)}}; - - _ -> - {_, Rest@2} = gleam_stdlib:string_pop_codeunit(Uri_string), - parse_query_with_question_mark_loop( - Original, - Rest@2, - Pieces, - Size + 1 - ) - end. - --file("src/gleam/uri.gleam", 471). --spec parse_query_with_question_mark(binary(), uri()) -> {ok, uri()} | - {error, nil}. -parse_query_with_question_mark(Uri_string, Pieces) -> - parse_query_with_question_mark_loop(Uri_string, Uri_string, Pieces, 0). - --file("src/gleam/uri.gleam", 437). --spec parse_path_loop(binary(), binary(), uri(), integer()) -> {ok, uri()} | - {error, nil}. -parse_path_loop(Original, Uri_string, Pieces, Size) -> - case Uri_string of - <<"?"/utf8, Rest/binary>> -> - Path = binary:part(Original, 0, Size), - Pieces@1 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - Path, - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_query_with_question_mark(Rest, Pieces@1); - - <<"#"/utf8, Rest@1/binary>> -> - Path@1 = binary:part(Original, 0, Size), - Pieces@2 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - Path@1, - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_fragment(Rest@1, Pieces@2); - - <<""/utf8>> -> - {ok, - {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - Original, - erlang:element(7, Pieces), - erlang:element(8, Pieces)}}; - - _ -> - {_, Rest@2} = gleam_stdlib:string_pop_codeunit(Uri_string), - parse_path_loop(Original, Rest@2, Pieces, Size + 1) - end. - --file("src/gleam/uri.gleam", 433). --spec parse_path(binary(), uri()) -> {ok, uri()} | {error, nil}. -parse_path(Uri_string, Pieces) -> - parse_path_loop(Uri_string, Uri_string, Pieces, 0). - --file("src/gleam/uri.gleam", 388). --spec parse_port_loop(binary(), uri(), integer()) -> {ok, uri()} | {error, nil}. -parse_port_loop(Uri_string, Pieces, Port) -> - case Uri_string of - <<"0"/utf8, Rest/binary>> -> - parse_port_loop(Rest, Pieces, Port * 10); - - <<"1"/utf8, Rest@1/binary>> -> - parse_port_loop(Rest@1, Pieces, (Port * 10) + 1); - - <<"2"/utf8, Rest@2/binary>> -> - parse_port_loop(Rest@2, Pieces, (Port * 10) + 2); - - <<"3"/utf8, Rest@3/binary>> -> - parse_port_loop(Rest@3, Pieces, (Port * 10) + 3); - - <<"4"/utf8, Rest@4/binary>> -> - parse_port_loop(Rest@4, Pieces, (Port * 10) + 4); - - <<"5"/utf8, Rest@5/binary>> -> - parse_port_loop(Rest@5, Pieces, (Port * 10) + 5); - - <<"6"/utf8, Rest@6/binary>> -> - parse_port_loop(Rest@6, Pieces, (Port * 10) + 6); - - <<"7"/utf8, Rest@7/binary>> -> - parse_port_loop(Rest@7, Pieces, (Port * 10) + 7); - - <<"8"/utf8, Rest@8/binary>> -> - parse_port_loop(Rest@8, Pieces, (Port * 10) + 8); - - <<"9"/utf8, Rest@9/binary>> -> - parse_port_loop(Rest@9, Pieces, (Port * 10) + 9); - - <<"?"/utf8, Rest@10/binary>> -> - Pieces@1 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - {some, Port}, - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_query_with_question_mark(Rest@10, Pieces@1); - - <<"#"/utf8, Rest@11/binary>> -> - Pieces@2 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - {some, Port}, - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_fragment(Rest@11, Pieces@2); - - <<"/"/utf8, _/binary>> -> - Pieces@3 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - {some, Port}, - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_path(Uri_string, Pieces@3); - - <<""/utf8>> -> - {ok, - {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - {some, Port}, - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}}; - - _ -> - {error, nil} - end. - --file("src/gleam/uri.gleam", 353). --spec parse_port(binary(), uri()) -> {ok, uri()} | {error, nil}. -parse_port(Uri_string, Pieces) -> - case Uri_string of - <<":0"/utf8, Rest/binary>> -> - parse_port_loop(Rest, Pieces, 0); - - <<":1"/utf8, Rest@1/binary>> -> - parse_port_loop(Rest@1, Pieces, 1); - - <<":2"/utf8, Rest@2/binary>> -> - parse_port_loop(Rest@2, Pieces, 2); - - <<":3"/utf8, Rest@3/binary>> -> - parse_port_loop(Rest@3, Pieces, 3); - - <<":4"/utf8, Rest@4/binary>> -> - parse_port_loop(Rest@4, Pieces, 4); - - <<":5"/utf8, Rest@5/binary>> -> - parse_port_loop(Rest@5, Pieces, 5); - - <<":6"/utf8, Rest@6/binary>> -> - parse_port_loop(Rest@6, Pieces, 6); - - <<":7"/utf8, Rest@7/binary>> -> - parse_port_loop(Rest@7, Pieces, 7); - - <<":8"/utf8, Rest@8/binary>> -> - parse_port_loop(Rest@8, Pieces, 8); - - <<":9"/utf8, Rest@9/binary>> -> - parse_port_loop(Rest@9, Pieces, 9); - - <<":"/utf8>> -> - {ok, Pieces}; - - <<""/utf8>> -> - {ok, Pieces}; - - <<"?"/utf8, Rest@10/binary>> -> - parse_query_with_question_mark(Rest@10, Pieces); - - <<":?"/utf8, Rest@10/binary>> -> - parse_query_with_question_mark(Rest@10, Pieces); - - <<"#"/utf8, Rest@11/binary>> -> - parse_fragment(Rest@11, Pieces); - - <<":#"/utf8, Rest@11/binary>> -> - parse_fragment(Rest@11, Pieces); - - <<"/"/utf8, _/binary>> -> - parse_path(Uri_string, Pieces); - - <<":"/utf8, Rest@12/binary>> -> - case Rest@12 of - <<"/"/utf8, _/binary>> -> - parse_path(Rest@12, Pieces); - - _ -> - {error, nil} - end; - - _ -> - {error, nil} - end. - --file("src/gleam/uri.gleam", 309). --spec parse_host_outside_of_brackets_loop(binary(), binary(), uri(), integer()) -> {ok, - uri()} | - {error, nil}. -parse_host_outside_of_brackets_loop(Original, Uri_string, Pieces, Size) -> - case Uri_string of - <<""/utf8>> -> - {ok, - {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Original}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}}; - - <<":"/utf8, _/binary>> -> - Host = binary:part(Original, 0, Size), - Pieces@1 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Host}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_port(Uri_string, Pieces@1); - - <<"/"/utf8, _/binary>> -> - Host@1 = binary:part(Original, 0, Size), - Pieces@2 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Host@1}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_path(Uri_string, Pieces@2); - - <<"?"/utf8, Rest/binary>> -> - Host@2 = binary:part(Original, 0, Size), - Pieces@3 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Host@2}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_query_with_question_mark(Rest, Pieces@3); - - <<"#"/utf8, Rest@1/binary>> -> - Host@3 = binary:part(Original, 0, Size), - Pieces@4 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Host@3}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_fragment(Rest@1, Pieces@4); - - _ -> - {_, Rest@2} = gleam_stdlib:string_pop_codeunit(Uri_string), - parse_host_outside_of_brackets_loop( - Original, - Rest@2, - Pieces, - Size + 1 - ) - end. - --file("src/gleam/uri.gleam", 229). --spec parse_host_within_brackets_loop(binary(), binary(), uri(), integer()) -> {ok, - uri()} | - {error, nil}. -parse_host_within_brackets_loop(Original, Uri_string, Pieces, Size) -> - case Uri_string of - <<""/utf8>> -> - {ok, - {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Uri_string}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}}; - - <<"]"/utf8, Rest/binary>> when Size =:= 0 -> - parse_port(Rest, Pieces); - - <<"]"/utf8, Rest@1/binary>> -> - Host = binary:part(Original, 0, Size + 1), - Pieces@1 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Host}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_port(Rest@1, Pieces@1); - - <<"/"/utf8, _/binary>> when Size =:= 0 -> - parse_path(Uri_string, Pieces); - - <<"/"/utf8, _/binary>> -> - Host@1 = binary:part(Original, 0, Size), - Pieces@2 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Host@1}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_path(Uri_string, Pieces@2); - - <<"?"/utf8, Rest@2/binary>> when Size =:= 0 -> - parse_query_with_question_mark(Rest@2, Pieces); - - <<"?"/utf8, Rest@3/binary>> -> - Host@2 = binary:part(Original, 0, Size), - Pieces@3 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Host@2}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_query_with_question_mark(Rest@3, Pieces@3); - - <<"#"/utf8, Rest@4/binary>> when Size =:= 0 -> - parse_fragment(Rest@4, Pieces); - - <<"#"/utf8, Rest@5/binary>> -> - Host@3 = binary:part(Original, 0, Size), - Pieces@4 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, Host@3}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_fragment(Rest@5, Pieces@4); - - _ -> - {Char, Rest@6} = gleam_stdlib:string_pop_codeunit(Uri_string), - case is_valid_host_within_brackets_char(Char) of - true -> - parse_host_within_brackets_loop( - Original, - Rest@6, - Pieces, - Size + 1 - ); - - false -> - parse_host_outside_of_brackets_loop( - Original, - Original, - Pieces, - 0 - ) - end - end. - --file("src/gleam/uri.gleam", 222). --spec parse_host_within_brackets(binary(), uri()) -> {ok, uri()} | {error, nil}. -parse_host_within_brackets(Uri_string, Pieces) -> - parse_host_within_brackets_loop(Uri_string, Uri_string, Pieces, 0). - --file("src/gleam/uri.gleam", 302). --spec parse_host_outside_of_brackets(binary(), uri()) -> {ok, uri()} | - {error, nil}. -parse_host_outside_of_brackets(Uri_string, Pieces) -> - parse_host_outside_of_brackets_loop(Uri_string, Uri_string, Pieces, 0). - --file("src/gleam/uri.gleam", 199). --spec parse_host(binary(), uri()) -> {ok, uri()} | {error, nil}. -parse_host(Uri_string, Pieces) -> - case Uri_string of - <<"["/utf8, _/binary>> -> - parse_host_within_brackets(Uri_string, Pieces); - - <<":"/utf8, _/binary>> -> - Pieces@1 = {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, <<""/utf8>>}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_port(Uri_string, Pieces@1); - - <<""/utf8>> -> - {ok, - {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, <<""/utf8>>}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}}; - - _ -> - parse_host_outside_of_brackets(Uri_string, Pieces) - end. - --file("src/gleam/uri.gleam", 167). --spec parse_userinfo_loop(binary(), binary(), uri(), integer()) -> {ok, uri()} | - {error, nil}. -parse_userinfo_loop(Original, Uri_string, Pieces, Size) -> - case Uri_string of - <<"@"/utf8, Rest/binary>> when Size =:= 0 -> - parse_host(Rest, Pieces); - - <<"@"/utf8, Rest@1/binary>> -> - Userinfo = binary:part(Original, 0, Size), - Pieces@1 = {uri, - erlang:element(2, Pieces), - {some, Userinfo}, - erlang:element(4, Pieces), - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_host(Rest@1, Pieces@1); - - <<""/utf8>> -> - parse_host(Original, Pieces); - - <<"/"/utf8, _/binary>> -> - parse_host(Original, Pieces); - - <<"?"/utf8, _/binary>> -> - parse_host(Original, Pieces); - - <<"#"/utf8, _/binary>> -> - parse_host(Original, Pieces); - - _ -> - {_, Rest@2} = gleam_stdlib:string_pop_codeunit(Uri_string), - parse_userinfo_loop(Original, Rest@2, Pieces, Size + 1) - end. - --file("src/gleam/uri.gleam", 163). --spec parse_authority_pieces(binary(), uri()) -> {ok, uri()} | {error, nil}. -parse_authority_pieces(String, Pieces) -> - parse_userinfo_loop(String, String, Pieces, 0). - --file("src/gleam/uri.gleam", 150). --spec parse_authority_with_slashes(binary(), uri()) -> {ok, uri()} | - {error, nil}. -parse_authority_with_slashes(Uri_string, Pieces) -> - case Uri_string of - <<"//"/utf8>> -> - {ok, - {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - {some, <<""/utf8>>}, - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}}; - - <<"//"/utf8, Rest/binary>> -> - parse_authority_pieces(Rest, Pieces); - - _ -> - parse_path(Uri_string, Pieces) - end. - --file("src/gleam/uri.gleam", 91). --spec parse_scheme_loop(binary(), binary(), uri(), integer()) -> {ok, uri()} | - {error, nil}. -parse_scheme_loop(Original, Uri_string, Pieces, Size) -> - case Uri_string of - <<"/"/utf8, _/binary>> when Size =:= 0 -> - parse_authority_with_slashes(Uri_string, Pieces); - - <<"/"/utf8, _/binary>> -> - Scheme = binary:part(Original, 0, Size), - Pieces@1 = {uri, - {some, string:lowercase(Scheme)}, - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_authority_with_slashes(Uri_string, Pieces@1); - - <<"?"/utf8, Rest/binary>> when Size =:= 0 -> - parse_query_with_question_mark(Rest, Pieces); - - <<"?"/utf8, Rest@1/binary>> -> - Scheme@1 = binary:part(Original, 0, Size), - Pieces@2 = {uri, - {some, string:lowercase(Scheme@1)}, - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_query_with_question_mark(Rest@1, Pieces@2); - - <<"#"/utf8, Rest@2/binary>> when Size =:= 0 -> - parse_fragment(Rest@2, Pieces); - - <<"#"/utf8, Rest@3/binary>> -> - Scheme@2 = binary:part(Original, 0, Size), - Pieces@3 = {uri, - {some, string:lowercase(Scheme@2)}, - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_fragment(Rest@3, Pieces@3); - - <<":"/utf8, _/binary>> when Size =:= 0 -> - {error, nil}; - - <<":"/utf8, Rest@4/binary>> -> - Scheme@3 = binary:part(Original, 0, Size), - Pieces@4 = {uri, - {some, string:lowercase(Scheme@3)}, - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - erlang:element(6, Pieces), - erlang:element(7, Pieces), - erlang:element(8, Pieces)}, - parse_authority_with_slashes(Rest@4, Pieces@4); - - <<""/utf8>> -> - {ok, - {uri, - erlang:element(2, Pieces), - erlang:element(3, Pieces), - erlang:element(4, Pieces), - erlang:element(5, Pieces), - Original, - erlang:element(7, Pieces), - erlang:element(8, Pieces)}}; - - _ -> - {_, Rest@5} = gleam_stdlib:string_pop_codeunit(Uri_string), - parse_scheme_loop(Original, Rest@5, Pieces, Size + 1) - end. - --file("src/gleam/uri.gleam", 537). -?DOC( - " Parses an URL-encoded query string into a list of key value pairs.\n" - " Returns an error for invalid encoding.\n" - "\n" - " The opposite operation is `uri.query_to_string`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " parse_query(\"a=1&b=2\")\n" - " // -> Ok([#(\"a\", \"1\"), #(\"b\", \"2\")])\n" - " ```\n" -). --spec parse_query(binary()) -> {ok, list({binary(), binary()})} | {error, nil}. -parse_query(Query) -> - gleam_stdlib:parse_query(Query). - --file("src/gleam/uri.gleam", 579). -?DOC( - " Encodes a string into a percent encoded representation.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " percent_encode(\"100% great\")\n" - " // -> \"100%25%20great\"\n" - " ```\n" -). --spec percent_encode(binary()) -> binary(). -percent_encode(Value) -> - gleam_stdlib:percent_encode(Value). - --file("src/gleam/uri.gleam", 563). --spec percent_encode_query(binary()) -> binary(). -percent_encode_query(Part) -> - _pipe = gleam_stdlib:percent_encode(Part), - gleam@string:replace(_pipe, <<"+"/utf8>>, <<"%2B"/utf8>>). - --file("src/gleam/uri.gleam", 558). --spec query_pair({binary(), binary()}) -> gleam@string_tree:string_tree(). -query_pair(Pair) -> - _pipe = [percent_encode_query(erlang:element(1, Pair)), - <<"="/utf8>>, - percent_encode_query(erlang:element(2, Pair))], - gleam_stdlib:identity(_pipe). - --file("src/gleam/uri.gleam", 550). -?DOC( - " Encodes a list of key value pairs as a URI query string.\n" - "\n" - " The opposite operation is `uri.parse_query`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " query_to_string([#(\"a\", \"1\"), #(\"b\", \"2\")])\n" - " // -> \"a=1&b=2\"\n" - " ```\n" -). --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_stdlib:identity(<<"&"/utf8>>) - ), - _pipe@3 = gleam_stdlib:identity(_pipe@2), - unicode:characters_to_binary(_pipe@3). - --file("src/gleam/uri.gleam", 592). -?DOC( - " Decodes a percent encoded string.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " percent_decode(\"100%25%20great+fun\")\n" - " // -> Ok(\"100% great+fun\")\n" - " ```\n" -). --spec percent_decode(binary()) -> {ok, binary()} | {error, nil}. -percent_decode(Value) -> - gleam_stdlib:percent_decode(Value). - --file("src/gleam/uri.gleam", 614). --spec remove_dot_segments_loop(list(binary()), list(binary())) -> list(binary()). -remove_dot_segments_loop(Input, Accumulator) -> - case Input of - [] -> - lists: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, - remove_dot_segments_loop(Rest, Accumulator@5) - end. - --file("src/gleam/uri.gleam", 610). --spec remove_dot_segments(list(binary())) -> list(binary()). -remove_dot_segments(Input) -> - remove_dot_segments_loop(Input, []). - --file("src/gleam/uri.gleam", 606). -?DOC( - " Splits the path section of a URI into its constituent segments.\n" - "\n" - " Removes empty segments and resolves dot-segments as specified in\n" - " [section 5.2](https://www.ietf.org/rfc/rfc3986.html#section-5.2) of the RFC.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " path_segments(\"/users/1\")\n" - " // -> [\"users\" ,\"1\"]\n" - " ```\n" -). --spec path_segments(binary()) -> list(binary()). -path_segments(Path) -> - remove_dot_segments(gleam@string:split(Path, <<"/"/utf8>>)). - --file("src/gleam/uri.gleam", 645). -?DOC( - " Encodes a `Uri` value as a URI string.\n" - "\n" - " The opposite operation is `uri.parse`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let uri = Uri(..empty, scheme: Some(\"https\"), host: Some(\"example.com\"))\n" - " to_string(uri)\n" - " // -> \"https://example.com\"\n" - " ```\n" -). --spec to_string(uri()) -> binary(). -to_string(Uri) -> - Parts = case erlang:element(8, Uri) of - {some, Fragment} -> - [<<"#"/utf8>>, Fragment]; - - none -> - [] - end, - Parts@1 = case erlang:element(7, Uri) of - {some, Query} -> - [<<"?"/utf8>>, Query | Parts]; - - none -> - Parts - end, - Parts@2 = [erlang:element(6, Uri) | Parts@1], - Parts@3 = case {erlang:element(4, Uri), - gleam_stdlib: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>>, erlang:integer_to_binary(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]; - - {_, _, _} -> - Parts@4 - end, - erlang:list_to_binary(Parts@5). - --file("src/gleam/uri.gleam", 689). -?DOC( - " Fetches the origin of a URI.\n" - "\n" - " Returns the origin of a uri as defined in\n" - " [RFC 6454](https://tools.ietf.org/html/rfc6454)\n" - "\n" - " The supported URI schemes are `http` and `https`.\n" - " URLs without a scheme will return `Error`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " let assert Ok(uri) = parse(\"https://example.com/path?foo#bar\")\n" - " origin(uri)\n" - " // -> Ok(\"https://example.com\")\n" - " ```\n" -). --spec origin(uri()) -> {ok, binary()} | {error, nil}. -origin(Uri) -> - {uri, Scheme, _, Host, Port, _, _, _} = Uri, - case {Host, Scheme} of - {{some, H}, {some, <<"https"/utf8>>}} when Port =:= {some, 443} -> - {ok, erlang:list_to_binary([<<"https://"/utf8>>, H])}; - - {{some, H@1}, {some, <<"http"/utf8>>}} when Port =:= {some, 80} -> - {ok, erlang:list_to_binary([<<"http://"/utf8>>, H@1])}; - - {{some, H@2}, {some, S}} when (S =:= <<"http"/utf8>>) orelse (S =:= <<"https"/utf8>>) -> - case Port of - {some, P} -> - {ok, - erlang:list_to_binary( - [S, - <<"://"/utf8>>, - H@2, - <<":"/utf8>>, - erlang:integer_to_binary(P)] - )}; - - none -> - {ok, erlang:list_to_binary([S, <<"://"/utf8>>, H@2])} - end; - - {_, _} -> - {error, nil} - end. - --file("src/gleam/uri.gleam", 770). --spec drop_last(list(DDM)) -> list(DDM). -drop_last(Elements) -> - gleam@list:take(Elements, erlang:length(Elements) - 1). - --file("src/gleam/uri.gleam", 774). --spec join_segments(list(binary())) -> binary(). -join_segments(Segments) -> - gleam@string:join([<<""/utf8>> | Segments], <<"/"/utf8>>). - --file("src/gleam/uri.gleam", 712). -?DOC( - " Resolves a URI with respect to the given base URI.\n" - "\n" - " The base URI must be an absolute URI or this function will return an error.\n" - " The algorithm for merging URIs is described in\n" - " [RFC 3986](https://tools.ietf.org/html/rfc3986#section-5.2).\n" -). --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 = erlang:element(6, Relative), - _pipe@1 = gleam@string:split(_pipe, <<"/"/utf8>>), - _pipe@2 = remove_dot_segments(_pipe@1), - join_segments(_pipe@2) - 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}; - - _ -> - {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_stdlib:string_starts_with( - erlang:element(6, Relative), - <<"/"/utf8>> - ) of - true -> - gleam@string:split( - erlang:element(6, Relative), - <<"/"/utf8>> - ); - - false -> - _pipe@3 = erlang:element(6, Base), - _pipe@4 = gleam@string:split( - _pipe@3, - <<"/"/utf8>> - ), - _pipe@5 = drop_last(_pipe@4), - lists:append( - _pipe@5, - gleam@string:split( - erlang:element(6, Relative), - <<"/"/utf8>> - ) - ) - end, - Path@1 = begin - _pipe@6 = Path_segments, - _pipe@7 = remove_dot_segments(_pipe@6), - join_segments(_pipe@7) - 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. - --file("src/gleam/uri.gleam", 81). -?DOC( - " Parses a compliant URI string into the `Uri` type.\n" - " If the string is not a valid URI string then an error is returned.\n" - "\n" - " The opposite operation is `uri.to_string`.\n" - "\n" - " ## Examples\n" - "\n" - " ```gleam\n" - " parse(\"https://example.com:1234/a/b?query=true#fragment\")\n" - " // -> Ok(\n" - " // Uri(\n" - " // scheme: Some(\"https\"),\n" - " // userinfo: None,\n" - " // host: Some(\"example.com\"),\n" - " // port: Some(1234),\n" - " // path: \"/a/b\",\n" - " // query: Some(\"query=true\"),\n" - " // fragment: Some(\"fragment\")\n" - " // )\n" - " // )\n" - " ```\n" -). --spec parse(binary()) -> {ok, uri()} | {error, nil}. -parse(Uri_string) -> - gleam_stdlib:uri_parse(Uri_string). diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam_stdlib.app.src b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam_stdlib.app.src deleted file mode 100644 index 5ddb882..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam_stdlib.app.src +++ /dev/null @@ -1,31 +0,0 @@ -{application, gleam_stdlib, [ - {vsn, "0.68.1"}, - {applications, []}, - {description, "A standard library for the Gleam programming language"}, - {modules, [gleam@bit_array, - gleam@bool, - gleam@bytes_tree, - gleam@dict, - gleam@dynamic, - gleam@dynamic@decode, - gleam@float, - gleam@function, - gleam@int, - gleam@io, - gleam@list, - gleam@option, - gleam@order, - gleam@pair, - gleam@result, - gleam@set, - gleam@string, - gleam@string_tree, - gleam@uri, - gleam_stdlib, - gleam_stdlib@@main, - gleam_stdlib_test_ffi, - gleeunit_ffi, - gleeunit_gleam_panic_ffi, - gleeunit_progress]}, - {registered, []} -]}. diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam_stdlib.erl b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam_stdlib.erl deleted file mode 100644 index 2c416f4..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam_stdlib.erl +++ /dev/null @@ -1,534 +0,0 @@ --module(gleam_stdlib). - --export([ - map_get/2, iodata_append/2, identity/1, parse_int/1, parse_float/1, - less_than/2, string_pop_grapheme/1, string_pop_codeunit/1, - string_starts_with/2, wrap_list/1, string_ends_with/2, string_pad/4, - uri_parse/1, bit_array_slice/3, percent_encode/1, percent_decode/1, - base64_decode/1, parse_query/1, bit_array_concat/1, - base64_encode/2, 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, utf_codepoint_list_to_string/1, contains_string/2, - crop_string/2, base16_encode/1, base16_decode/1, string_replace/3, slice/3, - bit_array_to_int_and_size/1, bit_array_pad_to_bytes/1, index/2, list/5, - dict/1, int/1, float/1, bit_array/1, is_null/1 -]). - -%% 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)). --define(is_ascii_character(X), - (erlang:is_integer(X) andalso X >= 32 andalso X =< 126)). - -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. - -classify_dynamic(nil) -> <<"Nil">>; -classify_dynamic(null) -> <<"Nil">>; -classify_dynamic(undefined) -> <<"Nil">>; -classify_dynamic(X) when is_boolean(X) -> <<"Bool">>; -classify_dynamic(X) when is_atom(X) -> <<"Atom">>; -classify_dynamic(X) when is_binary(X) -> <<"String">>; -classify_dynamic(X) when is_bitstring(X) -> <<"BitArray">>; -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_map(X) -> <<"Dict">>; -classify_dynamic(X) when is_tuple(X) -> <<"Array">>; -classify_dynamic(X) when is_reference(X) -> <<"Reference">>; -classify_dynamic(X) when is_pid(X) -> <<"Pid">>; -classify_dynamic(X) when is_port(X) -> <<"Port">>; -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(_) -> <<"Unknown">>. - -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)}. - -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 ] when is_binary(Rest) -> - {ok, {unicode:characters_to_binary([Next]), Rest}}; - - [ Next | Rest ] -> - {ok, {unicode:characters_to_binary([Next]), unicode:characters_to_binary(Rest)}}; - - _ -> {error, nil} - end. - -string_pop_codeunit(<>) -> {Cp, Rest}; -string_pop_codeunit(Binary) -> {0, Binary}. - -bit_array_pad_to_bytes(Bin) -> - case erlang:bit_size(Bin) rem 8 of - 0 -> Bin; - TrailingBits -> - PaddingBits = 8 - TrailingBits, - <> - end. - -bit_array_concat(BitArrays) -> - list_to_bitstring(BitArrays). - --if(?OTP_RELEASE >= 26). -base64_encode(Bin, Padding) -> - PaddedBin = bit_array_pad_to_bytes(Bin), - base64:encode(PaddedBin, #{padding => Padding}). --else. -base64_encode(_Bin, _Padding) -> - erlang:error(<<"Erlang OTP/26 or higher is required to use base64:encode">>). --endif. - -bit_array_slice(Bin, Pos, Len) -> - try {ok, binary:part(Bin, Pos, Len)} - catch error:badarg -> {error, nil} - end. - -base64_decode(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 -> - Port = - try maps:get(port, Uri) of - undefined -> none; - Value -> {some, Value} - catch _:_ -> none - end, - {ok, {uri, - maps_get_optional(Uri, scheme), - maps_get_optional(Uri, userinfo), - maps_get_optional(Uri, host), - 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(Data) when is_map(Data) -> - Fields = [ - [<<"#(">>, inspect(Key), <<", ">>, inspect(Value), <<")">>] - || {Key, Value} <- maps:to_list(Data) - ], - ["dict.from_list([", lists:join(", ", Fields), "])"]; -inspect(Atom) when is_atom(Atom) -> - erlang:element(2, inspect_atom(Atom)); -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(Bits) when is_bitstring(Bits) -> - inspect_bit_array(Bits); -inspect(List) when is_list(List) -> - case inspect_list(List, true) of - {charlist, _} -> ["charlist.from_string(\"", list_to_binary(List), "\")"]; - {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), - InspectedArgs = lists:map(fun inspect/1, ArgsList), - case inspect_atom(Atom) of - {gleam_atom, GleamAtom} -> - Args = lists:join(<<", ">>, InspectedArgs), - [GleamAtom, "(", Args, ")"]; - {erlang_atom, ErlangAtom} -> - Args = lists:join(<<", ">>, [ErlangAtom | InspectedArgs]), - ["#(", Args, ")"] - end; -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_atom(Atom) -> - Binary = erlang:atom_to_binary(Atom), - case inspect_maybe_gleam_atom(Binary, none, <<>>) of - {ok, Inspected} -> {gleam_atom, Inspected}; - {error, _} -> {erlang_atom, ["atom.create(\"", Binary, "\")"]} - end. - -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], true) when ?is_ascii_character(First) -> - {charlist, nil}; -inspect_list([First], _) -> - {proper, [inspect(First)]}; -inspect_list([First | Rest], ValidCharlist) when is_list(Rest) -> - StillValidCharlist = ValidCharlist andalso ?is_ascii_character(First), - {Kind, Inspected} = inspect_list(Rest, StillValidCharlist), - {Kind, [inspect(First), <<", ">> | Inspected]}; -inspect_list([First | ImproperTail], _) -> - {improper, [inspect(First), <<" | ">>, inspect(ImproperTail)]}. - -inspect_bit_array(Bits) -> - Text = inspect_bit_array(Bits, <<"<<">>), - <>">>. - -inspect_bit_array(<<>>, Acc) -> - Acc; -inspect_bit_array(<>, Acc) -> - inspect_bit_array(Rest, append_segment(Acc, erlang:integer_to_binary(X))); -inspect_bit_array(Rest, Acc) -> - Size = bit_size(Rest), - <> = Rest, - X1 = erlang:integer_to_binary(X), - Size1 = erlang:integer_to_binary(Size), - Segment = <>, - inspect_bit_array(<<>>, append_segment(Acc, Segment)). - -bit_array_to_int_and_size(A) -> - Size = bit_size(A), - <> = A, - {A1, Size}. - -append_segment(<<"<<">>, Segment) -> - <<"<<", Segment/binary>>; -append_segment(Acc, Segment) -> - <>. - - -inspect_maybe_utf8_string(Binary, Acc) -> - case Binary of - <<>> -> {ok, <<$", Acc/binary, $">>}; - <> -> - Escaped = case First of - $" -> <<$\\, $">>; - $\\ -> <<$\\, $\\>>; - $\r -> <<$\\, $r>>; - $\n -> <<$\\, $n>>; - $\t -> <<$\\, $t>>; - $\f -> <<$\\, $f>>; - X when X > 126, X < 160 -> convert_to_u(X); - X when X < 32 -> convert_to_u(X); - Other -> <> - end, - inspect_maybe_utf8_string(Rest, <>); - _ -> {error, not_a_utf8_string} - end. - -convert_to_u(Code) -> - list_to_binary(io_lib:format("\\u{~4.16.0B}", [Code])). - -float_to_string(Float) when is_float(Float) -> - erlang:iolist_to_binary(io_lib_format:fwrite_g(Float)). - -utf_codepoint_list_to_string(List) -> - case unicode:characters_to_binary(List) of - {error, _} -> erlang:error({gleam_error, {string_invalid_utf8, List}}); - Binary -> Binary - end. - -crop_string(String, Prefix) -> - case string:find(String, Prefix) of - nomatch -> String; - New -> New - end. - -contains_string(String, Substring) -> - is_bitstring(string:find(String, Substring)). - -base16_encode(Bin) -> - PaddedBin = bit_array_pad_to_bytes(Bin), - binary:encode_hex(PaddedBin). - -base16_decode(String) -> - try - {ok, binary:decode_hex(String)} - catch - _:_ -> {error, nil} - end. - -string_replace(String, Pattern, Replacement) -> - string:replace(String, Pattern, Replacement, all). - -slice(String, Index, Length) -> - case string:slice(String, Index, Length) of - X when is_binary(X) -> X; - X when is_list(X) -> unicode:characters_to_binary(X) - end. - -index([X | _], 0) -> - {ok, {some, X}}; -index([_, X | _], 1) -> - {ok, {some, X}}; -index([_, _, X | _], 2) -> - {ok, {some, X}}; -index([_, _, _, X | _], 3) -> - {ok, {some, X}}; -index([_, _, _, _, X | _], 4) -> - {ok, {some, X}}; -index([_, _, _, _, _, X | _], 5) -> - {ok, {some, X}}; -index([_, _, _, _, _, _, X | _], 6) -> - {ok, {some, X}}; -index([_, _, _, _, _, _, _, X | _], 7) -> - {ok, {some, X}}; -index(Tuple, Index) when is_tuple(Tuple) andalso is_integer(Index) -> - {ok, try - {some, element(Index + 1, Tuple)} - catch _:_ -> - none - end}; -index(Map, Key) when is_map(Map) -> - {ok, try - {some, maps:get(Key, Map)} - catch _:_ -> - none - end}; -index(_, Index) when is_integer(Index) -> - {error, <<"Indexable">>}; -index(_, _) -> - {error, <<"Dict">>}. - -list(T, A, B, C, D) when is_tuple(T) -> - list(tuple_to_list(T), A, B, C, D); -list([], _, _, _, Acc) -> - {lists:reverse(Acc), []}; -list([X | Xs], Decode, PushPath, Index, Acc) -> - {Out, Errors} = Decode(X), - case Errors of - [] -> list(Xs, Decode, PushPath, Index + 1, [Out | Acc]); - _ -> PushPath({[], Errors}, integer_to_binary(Index)) - end; -list(Unexpected, _, _, _, []) -> - Found = gleam@dynamic:classify(Unexpected), - Error = {decode_error, <<"List"/utf8>>, Found, []}, - {[], [Error]}; -list(_, _, _, _, Acc) -> - {lists:reverse(Acc), []}. - -dict(#{} = Data) -> {ok, Data}; -dict(_) -> {error, nil}. - -int(I) when is_integer(I) -> {ok, I}; -int(_) -> {error, 0}. - -float(F) when is_float(F) -> {ok, F}; -float(_) -> {error, 0.0}. - -bit_array(B) when is_bitstring(B) -> {ok, B}; -bit_array(_) -> {error, <<>>}. - -is_null(X) -> - X =:= undefined orelse X =:= null orelse X =:= nil. diff --git a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam_stdlib.mjs b/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam_stdlib.mjs deleted file mode 100644 index 490443f..0000000 --- a/lsp/bet-lsp/build/packages/gleam_stdlib/src/gleam_stdlib.mjs +++ /dev/null @@ -1,1026 +0,0 @@ -import { - BitArray, - Error, - List, - Ok, - Result, - UtfCodepoint, - stringBits, - toBitArray, - bitArraySlice, - NonEmpty, - Empty, - CustomType, -} from "./gleam.mjs"; -import { Some, None } from "./gleam/option.mjs"; -import { default as Dict, fold as dict_fold, get as dict_get, from as dict_from_iterable } from "./dict.mjs"; -import { classify } from "./gleam/dynamic.mjs"; -import { DecodeError } from "./gleam/dynamic/decode.mjs"; - -const Nil = undefined; - -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+)([eE][-+]?\d+)?$/.test(value)) { - return new Ok(parseFloat(value)); - } else { - return new Error(Nil); - } -} - -export function to_string(term) { - return term.toString(); -} - -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) { - return string.replaceAll(target, 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) { - const iterator = graphemes_iterator(string); - if (iterator) { - return List.fromArray(Array.from(iterator).map((item) => item.segment)); - } else { - return List.fromArray(string.match(/./gsu)); - } -} - -let segmenter = undefined; - -function graphemes_iterator(string) { - if (globalThis.Intl && Intl.Segmenter) { - segmenter ||= new Intl.Segmenter(); - return 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 pop_codeunit(str) { - return [str.charCodeAt(0) | 0, str.slice(1)]; -} - -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 split(xs, pattern) { - return List.fromArray(xs.split(pattern)); -} - -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 string_byte_slice(string, index, length) { - return string.slice(index, index + length); -} - -export function string_grapheme_slice(string, idx, len) { - if (len <= 0 || idx >= string.length) { - return ""; - } - - const iterator = graphemes_iterator(string); - if (iterator) { - while (idx-- > 0) { - iterator.next(); - } - - let result = ""; - - while (len-- > 0) { - const v = iterator.next().value; - if (v === undefined) { - break; - } - - result += v.segment; - } - - return result; - } else { - return string - .match(/./gsu) - .slice(idx, idx + len) - .join(""); - } -} - -export function string_codeunit_slice(str, from, length) { - return str.slice(from, from + length); -} -export function crop_string(string, substring) { - return string.substring(string.indexOf(substring)); -} - -export function contains_string(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); - } -} - -const unicode_whitespaces = [ - "\u0020", // Space - "\u0009", // Horizontal tab - "\u000A", // Line feed - "\u000B", // Vertical tab - "\u000C", // Form feed - "\u000D", // Carriage return - "\u0085", // Next line - "\u2028", // Line separator - "\u2029", // Paragraph separator -].join(""); - -const trim_start_regex = /* @__PURE__ */ new RegExp( - `^[${unicode_whitespaces}]*`, -); -const trim_end_regex = /* @__PURE__ */ new RegExp(`[${unicode_whitespaces}]*$`); - -export function trim_start(string) { - return string.replace(trim_start_regex, ""); -} - -export function trim_end(string) { - return string.replace(trim_end_regex, ""); -} - -export function bit_array_from_string(string) { - return toBitArray([stringBits(string)]); -} - -export function bit_array_bit_size(bit_array) { - return bit_array.bitSize; -} - -export function bit_array_byte_size(bit_array) { - return bit_array.byteSize; -} - -export function bit_array_pad_to_bytes(bit_array) { - const trailingBitsCount = bit_array.bitSize % 8; - - // If the bit array is a whole number of bytes it can be returned unchanged - if (trailingBitsCount === 0) { - return bit_array; - } - - const finalByte = bit_array.byteAt(bit_array.byteSize - 1); - - // The required final byte has its unused trailing bits set to zero - const unusedBitsCount = 8 - trailingBitsCount; - const correctFinalByte = (finalByte >> unusedBitsCount) << unusedBitsCount; - - // If the unused bits in the final byte are already set to zero then the - // existing buffer can be re-used, avoiding a copy - if (finalByte === correctFinalByte) { - return new BitArray( - bit_array.rawBuffer, - bit_array.byteSize * 8, - bit_array.bitOffset, - ); - } - - // Copy the bit array into a new aligned buffer and set the correct final byte - const buffer = new Uint8Array(bit_array.byteSize); - for (let i = 0; i < buffer.length - 1; i++) { - buffer[i] = bit_array.byteAt(i); - } - buffer[buffer.length - 1] = correctFinalByte; - - return new BitArray(buffer); -} - -export function bit_array_concat(bit_arrays) { - return toBitArray(bit_arrays.toArray()); -} - -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_array_to_string(bit_array) { - // If the bit array isn't a whole number of bytes then return an error - if (bit_array.bitSize % 8 !== 0) { - return new Error(Nil); - } - - try { - const decoder = new TextDecoder("utf-8", { fatal: true }); - - if (bit_array.bitOffset === 0) { - return new Ok(decoder.decode(bit_array.rawBuffer)); - } else { - // The input data isn't aligned, so copy it into a new aligned buffer so - // that TextDecoder can be used - const buffer = new Uint8Array(bit_array.byteSize); - for (let i = 0; i < buffer.length; i++) { - buffer[i] = bit_array.byteAt(i); - } - return new Ok(decoder.decode(buffer)); - } - } catch { - return new Error(Nil); - } -} - -export function print(string) { - if (typeof process === "object" && process.stdout?.write) { - 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_array_slice(bits, position, length) { - const start = Math.min(position, position + length); - const end = Math.max(position, position + length); - - if (start < 0 || end * 8 > bits.bitSize) { - return new Error(Nil); - } - - return new Ok(bitArraySlice(bits, start * 8, end * 8)); -} - -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; -} - -function unsafe_percent_decode(string) { - return decodeURIComponent(string || ""); -} - -function unsafe_percent_decode_query(string) { - return decodeURIComponent((string || "").replace("+", " ")); -} - -export function percent_decode(string) { - try { - return new Ok(unsafe_percent_decode(string)); - } catch { - return new Error(Nil); - } -} - -export function percent_encode(string) { - return encodeURIComponent(string).replace("%2B", "+"); -} - -export function parse_query(query) { - try { - const pairs = []; - for (const section of query.split("&")) { - const [key, value] = section.split("="); - if (!key) continue; - - const decodedKey = unsafe_percent_decode_query(key); - const decodedValue = unsafe_percent_decode_query(value); - pairs.push([decodedKey, decodedValue]); - } - return new Ok(List.fromArray(pairs)); - } catch { - return new Error(Nil); - } -} - -const b64EncodeLookup = [ - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47, -]; - -let b64TextDecoder; - -// Implementation based on https://github.com/mitschabaude/fast-base64/blob/main/js.js -export function base64_encode(bit_array, padding) { - b64TextDecoder ??= new TextDecoder(); - - bit_array = bit_array_pad_to_bytes(bit_array); - - const m = bit_array.byteSize; - const k = m % 3; - const n = Math.floor(m / 3) * 4 + (k && k + 1); - const N = Math.ceil(m / 3) * 4; - const encoded = new Uint8Array(N); - - for (let i = 0, j = 0; j < m; i += 4, j += 3) { - const y = - (bit_array.byteAt(j) << 16) + - (bit_array.byteAt(j + 1) << 8) + - (bit_array.byteAt(j + 2) | 0); - - encoded[i] = b64EncodeLookup[y >> 18]; - encoded[i + 1] = b64EncodeLookup[(y >> 12) & 0x3f]; - encoded[i + 2] = b64EncodeLookup[(y >> 6) & 0x3f]; - encoded[i + 3] = b64EncodeLookup[y & 0x3f]; - } - - let base64 = b64TextDecoder.decode(new Uint8Array(encoded.buffer, 0, n)); - - if (padding) { - if (k === 1) { - base64 += "=="; - } else if (k === 2) { - base64 += "="; - } - } - - return base64; -} - -// From https://developer.mozilla.org/en-US/docs/Glossary/Base64 -export function base64_decode(sBase64) { - try { - const binString = atob(sBase64); - const length = binString.length; - const array = new Uint8Array(length); - for (let i = 0; i < length; i++) { - array[i] = binString.charCodeAt(i); - } - return new Ok(new BitArray(array)); - } catch { - return new Error(Nil); - } -} - -export function classify_dynamic(data) { - if (typeof data === "string") { - return "String"; - } else if (typeof data === "boolean") { - return "Bool"; - } else if (data instanceof Result) { - return "Result"; - } else if (data instanceof List) { - return "List"; - } else if (data instanceof BitArray) { - return "BitArray"; - } else if (data instanceof Dict) { - return "Dict"; - } else if (Number.isInteger(data)) { - return "Int"; - } else if (Array.isArray(data)) { - return `Array`; - } else if (typeof data === "number") { - return "Float"; - } else if (data === null) { - return "Nil"; - } else if (data === undefined) { - return "Nil"; - } else { - const type = typeof data; - return type.charAt(0).toUpperCase() + type.slice(1); - } -} - -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)); -} - -export function inspect(v) { - return new Inspector().inspect(v); -} - -export function float_to_string(float) { - const string = float.toString().replace("+", ""); - if (string.indexOf(".") >= 0) { - return string; - } else { - const index = string.indexOf("e"); - if (index >= 0) { - return string.slice(0, index) + ".0" + string.slice(index); - } else { - return string + ".0"; - } - } -} - -class Inspector { - #references = new Set(); - - inspect(v) { - const 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 this.#string(v); - if (t === "bigint" || Number.isInteger(v)) return v.toString(); - if (t === "number") return float_to_string(v); - if (v instanceof UtfCodepoint) return this.#utfCodepoint(v); - if (v instanceof BitArray) return this.#bit_array(v); - if (v instanceof RegExp) return `//js(${v})`; - if (v instanceof Date) return `//js(Date("${v.toISOString()}"))`; - if (v instanceof globalThis.Error) return `//js(${v.toString()})`; - if (v instanceof Function) { - const args = []; - for (const i of Array(v.length).keys()) - args.push(String.fromCharCode(i + 97)); - return `//fn(${args.join(", ")}) { ... }`; - } - - if (this.#references.size === this.#references.add(v).size) { - return "//js(circular reference)"; - } - - let printed; - if (Array.isArray(v)) { - printed = `#(${v.map((v) => this.inspect(v)).join(", ")})`; - } else if (v instanceof List) { - printed = this.#list(v); - } else if (v instanceof CustomType) { - printed = this.#customType(v); - } else if (v instanceof Dict) { - printed = this.#dict(v); - } else if (v instanceof Set) { - return `//js(Set(${[...v].map((v) => this.inspect(v)).join(", ")}))`; - } else { - printed = this.#object(v); - } - this.#references.delete(v); - return printed; - } - - #object(v) { - const name = Object.getPrototypeOf(v)?.constructor?.name || "Object"; - const props = []; - for (const k of Object.keys(v)) { - props.push(`${this.inspect(k)}: ${this.inspect(v[k])}`); - } - const body = props.length ? " " + props.join(", ") + " " : ""; - const head = name === "Object" ? "" : name + " "; - return `//js(${head}{${body}})`; - } - - #dict(map) { - let body = "dict.from_list(["; - let first = true; - - body = dict_fold(map, body, (body, key, value) => { - if (!first) body = body + ", "; - first = false; - return body + "#(" + this.inspect(key) + ", " + this.inspect(value) + ")"; - }); - - return body + "])"; - } - - #customType(record) { - const props = Object.keys(record) - .map((label) => { - const value = this.inspect(record[label]); - return isNaN(parseInt(label)) ? `${label}: ${value}` : value; - }) - .join(", "); - return props - ? `${record.constructor.name}(${props})` - : record.constructor.name; - } - - #list(list) { - if (list instanceof Empty) { - return "[]"; - } - - let char_out = 'charlist.from_string("'; - let list_out = "["; - - let current = list; - while (current instanceof NonEmpty) { - let element = current.head; - current = current.tail; - - if (list_out !== "[") { - list_out += ", "; - } - list_out += this.inspect(element); - - if (char_out) { - if (Number.isInteger(element) && element >= 32 && element <= 126) { - char_out += String.fromCharCode(element); - } else { - char_out = null; - } - } - } - - if (char_out) { - return char_out + '")'; - } else { - return list_out + "]"; - } - } - - #string(str) { - let new_str = '"'; - for (let i = 0; i < str.length; i++) { - const char = str[i]; - switch (char) { - case "\n": - new_str += "\\n"; - break; - case "\r": - new_str += "\\r"; - break; - case "\t": - new_str += "\\t"; - break; - case "\f": - new_str += "\\f"; - break; - case "\\": - new_str += "\\\\"; - break; - case '"': - new_str += '\\"'; - break; - default: - if (char < " " || (char > "~" && char < "\u{00A0}")) { - new_str += - "\\u{" + - char.charCodeAt(0).toString(16).toUpperCase().padStart(4, "0") + - "}"; - } else { - new_str += char; - } - } - } - new_str += '"'; - return new_str; - } - - #utfCodepoint(codepoint) { - return `//utfcodepoint(${String.fromCodePoint(codepoint.value)})`; - } - - #bit_array(bits) { - if (bits.bitSize === 0) { - return "<<>>"; - } - - let acc = "<<"; - - for (let i = 0; i < bits.byteSize - 1; i++) { - acc += bits.byteAt(i).toString(); - acc += ", "; - } - - if (bits.byteSize * 8 === bits.bitSize) { - acc += bits.byteAt(bits.byteSize - 1).toString(); - } else { - const trailingBitsCount = bits.bitSize % 8; - acc += bits.byteAt(bits.byteSize - 1) >> (8 - trailingBitsCount); - acc += `:size(${trailingBitsCount})`; - } - - acc += ">>"; - return acc; - } -} - -export function base16_encode(bit_array) { - const trailingBitsCount = bit_array.bitSize % 8; - - let result = ""; - - for (let i = 0; i < bit_array.byteSize; i++) { - let byte = bit_array.byteAt(i); - - if (i === bit_array.byteSize - 1 && trailingBitsCount !== 0) { - const unusedBitsCount = 8 - trailingBitsCount; - byte = (byte >> unusedBitsCount) << unusedBitsCount; - } - - result += byte.toString(16).padStart(2, "0").toUpperCase(); - } - - return result; -} - -export function base16_decode(string) { - const bytes = new Uint8Array(string.length / 2); - for (let i = 0; i < string.length; i += 2) { - const a = parseInt(string[i], 16); - const b = parseInt(string[i + 1], 16); - if (isNaN(a) || isNaN(b)) return new Error(Nil); - bytes[i / 2] = a * 16 + b; - } - return new Ok(new BitArray(bytes)); -} - -export function bit_array_to_int_and_size(bits) { - const trailingBitsCount = bits.bitSize % 8; - const unusedBitsCount = trailingBitsCount === 0 ? 0 : 8 - trailingBitsCount; - - return [bits.byteAt(0) >> unusedBitsCount, bits.bitSize]; -} - -export function bit_array_starts_with(bits, prefix) { - if (prefix.bitSize > bits.bitSize) { - return false; - } - - // Check any whole bytes - const byteCount = Math.trunc(prefix.bitSize / 8); - for (let i = 0; i < byteCount; i++) { - if (bits.byteAt(i) !== prefix.byteAt(i)) { - return false; - } - } - - // Check any trailing bits at the end of the prefix - if (prefix.bitSize % 8 !== 0) { - const unusedBitsCount = 8 - (prefix.bitSize % 8); - if ( - bits.byteAt(byteCount) >> unusedBitsCount !== - prefix.byteAt(byteCount) >> unusedBitsCount - ) { - return false; - } - } - - return true; -} - -export function log(x) { - // It is checked in Gleam that: - // - The input is strictly positive (x > 0) - // - This ensures that Math.log will never return NaN or -Infinity - // The function can thus safely pass the input to Math.log - // and a valid finite float will always be produced. - return Math.log(x); -} - -export function exp(x) { - return Math.exp(x); -} - -export function list_to_array(list) { - let current = list; - let array = []; - while (current instanceof NonEmpty) { - array.push(current.head); - current = current.tail; - } - return array; -} - -export function index(data, key) { - // Dictionaries and dictionary-like objects can be indexed - if (data instanceof Dict) { - const result = dict_get(data, key); - return new Ok(result.isOk() ? new Some(result[0]) : new None()); - } - - if (data instanceof WeakMap || data instanceof Map) { - const token = {}; - const entry = data.get(key, token); - if (entry === token) return new Ok(new None()); - return new Ok(new Some(entry)); - } - - const key_is_int = Number.isInteger(key); - - // Only elements 0-7 of lists can be indexed, negative indices are not allowed - if (key_is_int && key >= 0 && key < 8 && data instanceof List) { - let i = 0; - for (const value of data) { - if (i === key) return new Ok(new Some(value)); - i++; - } - return new Error("Indexable"); - } - - // Arrays and objects can be indexed - if ( - (key_is_int && Array.isArray(data)) || - (data && typeof data === "object") || - (data && Object.getPrototypeOf(data) === Object.prototype) - ) { - if (key in data) return new Ok(new Some(data[key])); - return new Ok(new None()); - } - - return new Error(key_is_int ? "Indexable" : "Dict"); -} - -export function list(data, decode, pushPath, index, emptyList) { - if (!(data instanceof List || Array.isArray(data))) { - const error = new DecodeError("List", classify(data), emptyList); - return [emptyList, List.fromArray([error])]; - } - - const decoded = []; - - for (const element of data) { - const layer = decode(element); - const [out, errors] = layer; - - if (errors instanceof NonEmpty) { - const [_, errors] = pushPath(layer, index.toString()); - return [emptyList, errors]; - } - decoded.push(out); - index++; - } - - return [List.fromArray(decoded), emptyList]; -} - -export function dict(data) { - if (data instanceof Dict) { - return new Ok(data); - } - if (data instanceof Map || data instanceof WeakMap) { - return new Ok(dict_from_iterable(data)); - } - if (data == null) { - return new Error("Dict"); - } - if (typeof data !== "object") { - return new Error("Dict"); - } - const proto = Object.getPrototypeOf(data); - if (proto === Object.prototype || proto === null) { - return new Ok(dict_from_iterable(Object.entries(data))); - } - return new Error("Dict"); -} - -export function bit_array(data) { - if (data instanceof BitArray) return new Ok(data); - if (data instanceof Uint8Array) return new Ok(new BitArray(data)); - return new Error(new BitArray(new Uint8Array())); -} - -export function float(data) { - if (typeof data === "number") return new Ok(data); - return new Error(0.0); -} - -export function int(data) { - if (Number.isInteger(data)) return new Ok(data); - return new Error(0); -} - -export function string(data) { - if (typeof data === "string") return new Ok(data); - return new Error(""); -} - -export function is_null(data) { - return data === null || data === undefined; -} diff --git a/lsp/bet-lsp/build/packages/gleeunit/LICENCE b/lsp/bet-lsp/build/packages/gleeunit/LICENCE deleted file mode 100644 index c7967c3..0000000 --- a/lsp/bet-lsp/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/lsp/bet-lsp/build/packages/gleeunit/README.md b/lsp/bet-lsp/build/packages/gleeunit/README.md deleted file mode 100644 index 4d81364..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# gleeunit - -A simple test runner for Gleam, using EUnit on Erlang and a custom runner on JS. - -[![Package Version](https://img.shields.io/hexpm/v/gleeunit)](https://hex.pm/packages/gleeunit) -[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/gleeunit/) - - -```sh -gleam add gleeunit@1 --dev -``` -```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 some_function_test() { - assert some_function() == "Hello!" -} -``` - -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/lsp/bet-lsp/build/packages/gleeunit/gleam.toml b/lsp/bet-lsp/build/packages/gleeunit/gleam.toml deleted file mode 100644 index c7df0c5..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/gleam.toml +++ /dev/null @@ -1,16 +0,0 @@ -name = "gleeunit" -version = "1.9.0" -licences = ["Apache-2.0"] -description = "A simple test runner for Gleam, using EUnit on Erlang" -repository = { type = "github", user = "lpil", repo = "gleeunit" } -links = [{ title = "Sponsor", href = "https://github.com/sponsors/lpil" }] -gleam = ">= 1.13.0" - -[javascript.deno] -allow_read = ["gleam.toml", "test", "build"] - -[dependencies] -gleam_stdlib = ">= 0.60.0 and < 1.0.0" - -[dev-dependencies] -testhelper = { "path" = "./testhelper" } diff --git a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_Assert.hrl b/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_Assert.hrl deleted file mode 100644 index 9360941..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_Assert.hrl +++ /dev/null @@ -1,6 +0,0 @@ --record(assert, { - start :: integer(), - 'end' :: integer(), - expression_start :: integer(), - kind :: gleeunit@internal@gleam_panic:assert_kind() -}). diff --git a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_AssertedExpression.hrl b/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_AssertedExpression.hrl deleted file mode 100644 index 812663c..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_AssertedExpression.hrl +++ /dev/null @@ -1,5 +0,0 @@ --record(asserted_expression, { - start :: integer(), - 'end' :: integer(), - kind :: gleeunit@internal@gleam_panic:expression_kind() -}). diff --git a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_BinaryOperator.hrl b/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_BinaryOperator.hrl deleted file mode 100644 index eee44c9..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_BinaryOperator.hrl +++ /dev/null @@ -1,5 +0,0 @@ --record(binary_operator, { - operator :: binary(), - left :: gleeunit@internal@gleam_panic:asserted_expression(), - right :: gleeunit@internal@gleam_panic:asserted_expression() -}). diff --git a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_Expression.hrl b/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_Expression.hrl deleted file mode 100644 index e7ffaa0..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_Expression.hrl +++ /dev/null @@ -1 +0,0 @@ --record(expression, {value :: gleam@dynamic:dynamic_()}). diff --git a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_FunctionCall.hrl b/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_FunctionCall.hrl deleted file mode 100644 index 9d55488..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_FunctionCall.hrl +++ /dev/null @@ -1,3 +0,0 @@ --record(function_call, { - arguments :: list(gleeunit@internal@gleam_panic:asserted_expression()) -}). diff --git a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_GleamPanic.hrl b/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_GleamPanic.hrl deleted file mode 100644 index cf36764..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_GleamPanic.hrl +++ /dev/null @@ -1,8 +0,0 @@ --record(gleam_panic, { - message :: binary(), - file :: binary(), - module :: binary(), - function :: binary(), - line :: integer(), - kind :: gleeunit@internal@gleam_panic:panic_kind() -}). diff --git a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_LetAssert.hrl b/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_LetAssert.hrl deleted file mode 100644 index 11f865e..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_LetAssert.hrl +++ /dev/null @@ -1,7 +0,0 @@ --record(let_assert, { - start :: integer(), - 'end' :: integer(), - pattern_start :: integer(), - pattern_end :: integer(), - value :: gleam@dynamic:dynamic_() -}). diff --git a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_Literal.hrl b/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_Literal.hrl deleted file mode 100644 index 2396489..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_Literal.hrl +++ /dev/null @@ -1 +0,0 @@ --record(literal, {value :: gleam@dynamic:dynamic_()}). diff --git a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_OtherExpression.hrl b/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_OtherExpression.hrl deleted file mode 100644 index 0424990..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@gleam_panic_OtherExpression.hrl +++ /dev/null @@ -1,3 +0,0 @@ --record(other_expression, { - expression :: gleeunit@internal@gleam_panic:asserted_expression() -}). diff --git a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@reporting_State.hrl b/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@reporting_State.hrl deleted file mode 100644 index 575ccce..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/include/gleeunit@internal@reporting_State.hrl +++ /dev/null @@ -1 +0,0 @@ --record(state, {passed :: integer(), failed :: integer(), skipped :: integer()}). diff --git a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit.app.src b/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit.app.src deleted file mode 100644 index e72987c..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit.app.src +++ /dev/null @@ -1,16 +0,0 @@ -{application, gleeunit, [ - {vsn, "1.9.0"}, - {applications, [gleam_stdlib]}, - {description, "A simple test runner for Gleam, using EUnit on Erlang"}, - {modules, [erlang_test_module, - gleeunit, - gleeunit@@main, - gleeunit@internal@gleam_panic, - gleeunit@internal@reporting, - gleeunit@should, - gleeunit_ffi, - gleeunit_gleam_panic_ffi, - gleeunit_progress, - gleeunit_test_ffi]}, - {registered, []} -]}. diff --git a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit.erl b/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit.erl deleted file mode 100644 index bcb58b6..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit.erl +++ /dev/null @@ -1,89 +0,0 @@ --module(gleeunit). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleeunit.gleam"). --export([main/0]). --export_type([atom_/0, encoding/0, report_module_name/0, gleeunit_progress_option/0, eunit_option/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - --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())}} | - {scale_timeouts, integer()}. - --file("src/gleeunit.gleam", 42). --spec gleam_to_erlang_module_name(binary()) -> binary(). -gleam_to_erlang_module_name(Path) -> - case gleam_stdlib:string_ends_with(Path, <<".gleam"/utf8>>) of - true -> - _pipe = Path, - _pipe@1 = gleam@string:replace( - _pipe, - <<".gleam"/utf8>>, - <<""/utf8>> - ), - gleam@string:replace(_pipe@1, <<"/"/utf8>>, <<"@"/utf8>>); - - false -> - _pipe@2 = Path, - _pipe@3 = gleam@string:split(_pipe@2, <<"/"/utf8>>), - _pipe@4 = gleam@list:last(_pipe@3), - _pipe@5 = gleam@result:unwrap(_pipe@4, Path), - gleam@string:replace(_pipe@5, <<".erl"/utf8>>, <<""/utf8>>) - end. - --file("src/gleeunit.gleam", 18). --spec do_main() -> nil. -do_main() -> - Options = [verbose, - no_tty, - {report, {gleeunit_progress, [{colored, true}]}}, - {scale_timeouts, 10}], - 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 - ), - gleeunit_ffi:run_eunit(_pipe@2, Options) - end, - Code = case Result of - {ok, _} -> - 0; - - {error, _} -> - 1 - end, - erlang:halt(Code). - --file("src/gleeunit.gleam", 13). -?DOC( - " Find and run all test functions for the current project using Erlang's EUnit\n" - " test framework, or a custom JavaScript test runner.\n" - "\n" - " Any Erlang or Gleam function in the `test` directory with a name ending in\n" - " `_test` is considered a test function and will be run.\n" - "\n" - " A test that panics is considered a failure.\n" -). --spec main() -> nil. -main() -> - do_main(). diff --git a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit.gleam b/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit.gleam deleted file mode 100644 index 7d3155e..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit.gleam +++ /dev/null @@ -1,86 +0,0 @@ -import gleam/list -import gleam/result -import gleam/string - -/// Find and run all test functions for the current project using Erlang's EUnit -/// test framework, or a custom JavaScript test runner. -/// -/// Any Erlang or Gleam function in the `test` directory with a name ending in -/// `_test` is considered a test function and will be run. -/// -/// A test that panics is considered a failure. -/// -pub fn main() -> Nil { - do_main() -} - -@external(javascript, "./gleeunit_ffi.mjs", "main") -fn do_main() -> Nil { - let options = [ - Verbose, - NoTty, - Report(#(GleeunitProgress, [Colored(True)])), - ScaleTimeouts(10), - ] - - 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) - - let code = case result { - Ok(_) -> 0 - Error(_) -> 1 - } - halt(code) -} - -@external(erlang, "erlang", "halt") -fn halt(a: Int) -> Nil - -fn gleam_to_erlang_module_name(path: String) -> String { - case string.ends_with(path, ".gleam") { - True -> - path - |> string.replace(".gleam", "") - |> string.replace("/", "@") - - False -> - path - |> string.split("/") - |> list.last - |> result.unwrap(path) - |> string.replace(".erl", "") - } -} - -@external(erlang, "gleeunit_ffi", "find_files") -fn find_files(matching matching: String, in in: String) -> List(String) - -type Atom - -type Encoding { - Utf8 -} - -@external(erlang, "erlang", "binary_to_atom") -fn dangerously_convert_string_to_atom(a: String, b: Encoding) -> Atom - -type ReportModuleName { - GleeunitProgress -} - -type GleeunitProgressOption { - Colored(Bool) -} - -type EunitOption { - Verbose - NoTty - Report(#(ReportModuleName, List(GleeunitProgressOption))) - ScaleTimeouts(Int) -} - -@external(erlang, "gleeunit_ffi", "run_eunit") -fn run_eunit(a: List(Atom), b: List(EunitOption)) -> Result(Nil, a) diff --git a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/internal/gleam_panic.gleam b/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/internal/gleam_panic.gleam deleted file mode 100644 index 6a5d309..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/internal/gleam_panic.gleam +++ /dev/null @@ -1,49 +0,0 @@ -import gleam/dynamic - -pub type GleamPanic { - GleamPanic( - message: String, - file: String, - module: String, - function: String, - line: Int, - kind: PanicKind, - ) -} - -pub type PanicKind { - Todo - Panic - LetAssert( - start: Int, - end: Int, - pattern_start: Int, - pattern_end: Int, - value: dynamic.Dynamic, - ) - Assert(start: Int, end: Int, expression_start: Int, kind: AssertKind) -} - -pub type AssertKind { - BinaryOperator( - operator: String, - left: AssertedExpression, - right: AssertedExpression, - ) - FunctionCall(arguments: List(AssertedExpression)) - OtherExpression(expression: AssertedExpression) -} - -pub type AssertedExpression { - AssertedExpression(start: Int, end: Int, kind: ExpressionKind) -} - -pub type ExpressionKind { - Literal(value: dynamic.Dynamic) - Expression(value: dynamic.Dynamic) - Unevaluated -} - -@external(erlang, "gleeunit_gleam_panic_ffi", "from_dynamic") -@external(javascript, "./gleeunit_gleam_panic_ffi.mjs", "from_dynamic") -pub fn from_dynamic(data: dynamic.Dynamic) -> Result(GleamPanic, Nil) diff --git a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/internal/gleeunit_gleam_panic_ffi.erl b/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/internal/gleeunit_gleam_panic_ffi.erl deleted file mode 100644 index d78f5e5..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/internal/gleeunit_gleam_panic_ffi.erl +++ /dev/null @@ -1,49 +0,0 @@ --module(gleeunit_gleam_panic_ffi). --export([from_dynamic/1]). - -from_dynamic(#{ - gleam_error := assert, - start := Start, - 'end' := End, - expression_start := EStart -} = E) -> - wrap(E, {assert, Start, End, EStart, assert_kind(E)}); -from_dynamic(#{ - gleam_error := let_assert, - start := Start, - 'end' := End, - pattern_start := PStart, - pattern_end := PEnd, - value := Value -} = E) -> - wrap(E, {let_assert, Start, End, PStart, PEnd, Value}); -from_dynamic(#{gleam_error := panic} = E) -> - wrap(E, panic); -from_dynamic(#{gleam_error := todo} = E) -> - wrap(E, todo); -from_dynamic(_) -> - {error, nil}. - -assert_kind(#{kind := binary_operator, left := L, right := R, operator := O}) -> - {binary_operator, atom_to_binary(O), expression(L), expression(R)}; -assert_kind(#{kind := function_call, arguments := Arguments}) -> - {function_call, lists:map(fun expression/1, Arguments)}; -assert_kind(#{kind := expression, expression := Expression}) -> - {other_expression, expression(Expression)}. - -expression(#{start := S, 'end' := E, kind := literal, value := Value}) -> - {asserted_expression, S, E, {literal, Value}}; -expression(#{start := S, 'end' := E, kind := expression, value := Value}) -> - {asserted_expression, S, E, {expression, Value}}; -expression(#{start := S, 'end' := E, kind := unevaluated}) -> - {asserted_expression, S, E, unevaluated}. - -wrap(#{ - gleam_error := _, - file := File, - message := Message, - module := Module, - function := Function, - line := Line -}, Kind) -> - {ok, {gleam_panic, Message, File, Module, Function, Line, Kind}}. diff --git a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/internal/gleeunit_gleam_panic_ffi.mjs b/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/internal/gleeunit_gleam_panic_ffi.mjs deleted file mode 100644 index 03f6025..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/internal/gleeunit_gleam_panic_ffi.mjs +++ /dev/null @@ -1,91 +0,0 @@ -import { Result$Ok, Result$Error, List$Empty, List$NonEmpty } from "../../gleam.mjs"; -import { - GleamPanic$GleamPanic, - PanicKind$Todo, - PanicKind$Panic, - PanicKind$LetAssert, - PanicKind$Assert, - AssertKind$BinaryOperator, - AssertKind$FunctionCall, - AssertKind$OtherExpression, - AssertedExpression$AssertedExpression, - ExpressionKind$Literal, - ExpressionKind$Expression, - ExpressionKind$Unevaluated, -} from "./gleam_panic.mjs"; - -export function from_dynamic(error) { - if (!(error instanceof globalThis.Error) || !error.gleam_error) { - return Result$Error(undefined); - } - - if (error.gleam_error === "todo") { - return wrap(error, PanicKind$Todo()); - } - - if (error.gleam_error === "panic") { - return wrap(error, PanicKind$Panic()); - } - - if (error.gleam_error === "let_assert") { - let kind = PanicKind$LetAssert( - error.start, - error.end, - error.pattern_start, - error.pattern_end, - error.value, - ); - return wrap(error, kind); - } - - if (error.gleam_error === "assert") { - let kind = PanicKind$Assert( - error.start, - error.end, - error.expression_start, - assert_kind(error), - ); - return wrap(error, kind); - } - - return Result$Error(undefined); -} - -function assert_kind(error) { - if (error.kind == "binary_operator") { - return AssertKind$BinaryOperator( - error.operator, - expression(error.left), - expression(error.right), - ); - } - - if (error.kind == "function_call") { - let list = List$Empty(); - let i = error.arguments.length; - while (i--) { - list = List$NonEmpty(expression(error.arguments[i]), list); - } - return AssertKind$FunctionCall(list); - } - - return AssertKind$OtherExpression(expression(error.expression)); -} - -function expression(data) { - const expression = AssertedExpression$AssertedExpression(data.start, data.end, undefined); - if (data.kind == "literal") { - expression.kind = ExpressionKind$Literal(data.value); - } else if (data.kind == "expression") { - expression.kind = ExpressionKind$Expression(data.value); - } else { - expression.kind = ExpressionKind$Unevaluated(); - } - return expression; -} - -function wrap(e, kind) { - return Result$Ok( - GleamPanic$GleamPanic(e.message, e.file, e.module, e.function, e.line, kind), - ); -} diff --git a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/internal/reporting.gleam b/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/internal/reporting.gleam deleted file mode 100644 index 72f766f..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/internal/reporting.gleam +++ /dev/null @@ -1,240 +0,0 @@ -import gleam/bit_array -import gleam/dynamic -import gleam/int -import gleam/io -import gleam/list -import gleam/option.{type Option} -import gleam/result -import gleam/string -import gleeunit/internal/gleam_panic.{type GleamPanic} - -pub type State { - State(passed: Int, failed: Int, skipped: Int) -} - -pub fn new_state() -> State { - State(passed: 0, failed: 0, skipped: 0) -} - -pub fn finished(state: State) -> Int { - case state { - State(passed: 0, failed: 0, skipped: 0) -> { - io.println("\nNo tests found!") - 1 - } - State(failed: 0, skipped: 0, ..) -> { - let message = - "\n" <> int.to_string(state.passed) <> " passed, no failures" - io.println(green(message)) - 0 - } - State(skipped: 0, ..) -> { - let message = - "\n" - <> int.to_string(state.passed) - <> " passed, " - <> int.to_string(state.failed) - <> " failures" - io.println(red(message)) - 1 - } - State(failed: 0, ..) -> { - let message = - "\n" - <> int.to_string(state.passed) - <> " passed, 0 failures, " - <> int.to_string(state.skipped) - <> " skipped" - io.println(yellow(message)) - 1 - } - State(..) -> { - let message = - "\n" - <> int.to_string(state.passed) - <> " passed, " - <> int.to_string(state.failed) - <> " failures, " - <> int.to_string(state.skipped) - <> " skipped" - io.println(red(message)) - 1 - } - } -} - -pub fn test_passed(state: State) -> State { - io.print(green(".")) - State(..state, passed: state.passed + 1) -} - -pub fn test_failed( - state: State, - module: String, - function: String, - error: dynamic.Dynamic, -) -> State { - let message = case gleam_panic.from_dynamic(error) { - Ok(error) -> { - let src = option.from_result(read_file(error.file)) - format_gleam_error(error, module, function, src) - } - Error(_) -> format_unknown(module, function, error) - } - - io.print("\n" <> message) - State(..state, failed: state.failed + 1) -} - -pub fn eunit_missing() -> Result(never, Nil) { - let message = bold(red("Error")) <> ": EUnit libraries not found. - -Your Erlang installation seems to be incomplete. If you installed Erlang using -a package manager ensure that you have installed the full Erlang -distribution instead of a stripped-down version. -" - io.print_error(message) - Error(Nil) -} - -fn format_unknown( - module: String, - function: String, - error: dynamic.Dynamic, -) -> String { - string.concat([ - grey(module <> "." <> function) <> "\n", - "An unexpected error occurred:\n", - "\n", - " " <> string.inspect(error) <> "\n", - ]) -} - -fn format_gleam_error( - error: GleamPanic, - module: String, - function: String, - src: Option(BitArray), -) -> String { - let location = grey(error.file <> ":" <> int.to_string(error.line)) - - case error.kind { - gleam_panic.Panic -> { - string.concat([ - bold(red("panic")) <> " " <> location <> "\n", - cyan(" test") <> ": " <> module <> "." <> function <> "\n", - cyan(" info") <> ": " <> error.message <> "\n", - ]) - } - - gleam_panic.Todo -> { - string.concat([ - bold(yellow("todo")) <> " " <> location <> "\n", - cyan(" test") <> ": " <> module <> "." <> function <> "\n", - cyan(" info") <> ": " <> error.message <> "\n", - ]) - } - - gleam_panic.Assert(start:, end:, kind:, ..) -> { - string.concat([ - bold(red("assert")) <> " " <> location <> "\n", - cyan(" test") <> ": " <> module <> "." <> function <> "\n", - code_snippet(src, start, end), - assert_info(kind), - cyan(" info") <> ": " <> error.message <> "\n", - ]) - } - - gleam_panic.LetAssert(start:, end:, value:, ..) -> { - string.concat([ - bold(red("let assert")) <> " " <> location <> "\n", - cyan(" test") <> ": " <> module <> "." <> function <> "\n", - code_snippet(src, start, end), - cyan("value") <> ": " <> string.inspect(value) <> "\n", - cyan(" info") <> ": " <> error.message <> "\n", - ]) - } - } -} - -fn assert_info(kind: gleam_panic.AssertKind) -> String { - case kind { - gleam_panic.BinaryOperator(left:, right:, ..) -> { - string.concat([assert_value(" left", left), assert_value("right", right)]) - } - - gleam_panic.FunctionCall(arguments:) -> { - arguments - |> list.index_map(fn(e, i) { - let number = string.pad_start(int.to_string(i), 5, " ") - assert_value(number, e) - }) - |> string.concat - } - - gleam_panic.OtherExpression(..) -> "" - } -} - -fn assert_value(name: String, value: gleam_panic.AssertedExpression) -> String { - cyan(name) <> ": " <> inspect_value(value) <> "\n" -} - -fn inspect_value(value: gleam_panic.AssertedExpression) -> String { - case value.kind { - gleam_panic.Unevaluated -> grey("unevaluated") - gleam_panic.Literal(..) -> grey("literal") - gleam_panic.Expression(value:) -> string.inspect(value) - } -} - -fn code_snippet(src: Option(BitArray), start: Int, end: Int) -> String { - { - use src <- result.try(option.to_result(src, Nil)) - use snippet <- result.try(bit_array.slice(src, start, end - start)) - use snippet <- result.try(bit_array.to_string(snippet)) - let snippet = cyan(" code") <> ": " <> snippet <> "\n" - Ok(snippet) - } - |> result.unwrap("") -} - -pub fn test_skipped(state: State, module: String, function: String) -> State { - io.print("\n" <> module <> "." <> function <> yellow(" skipped")) - State(..state, skipped: state.skipped + 1) -} - -fn bold(text: String) -> String { - "\u{001b}[1m" <> text <> "\u{001b}[22m" -} - -fn cyan(text: String) -> String { - "\u{001b}[36m" <> text <> "\u{001b}[39m" -} - -fn yellow(text: String) -> String { - "\u{001b}[33m" <> text <> "\u{001b}[39m" -} - -fn green(text: String) -> String { - "\u{001b}[32m" <> text <> "\u{001b}[39m" -} - -fn red(text: String) -> String { - "\u{001b}[31m" <> text <> "\u{001b}[39m" -} - -fn grey(text: String) -> String { - "\u{001b}[90m" <> text <> "\u{001b}[39m" -} - -@external(erlang, "file", "read_file") -fn read_file(path: String) -> Result(BitArray, dynamic.Dynamic) { - case read_file_text(path) { - Ok(text) -> Ok(bit_array.from_string(text)) - Error(e) -> Error(e) - } -} - -@external(javascript, "../../gleeunit_ffi.mjs", "read_file") -fn read_file_text(path: String) -> Result(String, dynamic.Dynamic) diff --git a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/should.gleam b/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/should.gleam deleted file mode 100644 index 99cd16c..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit/should.gleam +++ /dev/null @@ -1,72 +0,0 @@ -//// Use the `assert` keyword instead of this module. - -import gleam/option.{type Option, None, Some} -import gleam/string - -pub fn equal(a: t, b: t) -> Nil { - case a == b { - True -> Nil - _ -> - panic as string.concat([ - "\n", - string.inspect(a), - "\nshould equal\n", - string.inspect(b), - ]) - } -} - -pub fn not_equal(a: t, b: t) -> Nil { - case a != b { - True -> Nil - _ -> - panic as string.concat([ - "\n", - string.inspect(a), - "\nshould not equal\n", - string.inspect(b), - ]) - } -} - -pub fn be_ok(a: Result(a, e)) -> a { - case a { - Ok(value) -> value - _ -> panic as string.concat(["\n", string.inspect(a), "\nshould be ok"]) - } -} - -pub fn be_error(a: Result(a, e)) -> e { - case a { - Error(error) -> error - _ -> panic as string.concat(["\n", string.inspect(a), "\nshould be error"]) - } -} - -pub fn be_some(a: Option(a)) -> a { - case a { - Some(value) -> value - _ -> panic as string.concat(["\n", string.inspect(a), "\nshould be some"]) - } -} - -pub fn be_none(a: Option(a)) -> Nil { - case a { - None -> Nil - _ -> panic as string.concat(["\n", string.inspect(a), "\nshould be none"]) - } -} - -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/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit@internal@gleam_panic.erl b/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit@internal@gleam_panic.erl deleted file mode 100644 index 398ea7d..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit@internal@gleam_panic.erl +++ /dev/null @@ -1,56 +0,0 @@ --module(gleeunit@internal@gleam_panic). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleeunit/internal/gleam_panic.gleam"). --export([from_dynamic/1]). --export_type([gleam_panic/0, panic_kind/0, assert_kind/0, asserted_expression/0, expression_kind/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC(false). - --type gleam_panic() :: {gleam_panic, - binary(), - binary(), - binary(), - binary(), - integer(), - panic_kind()}. - --type panic_kind() :: todo | - panic | - {let_assert, - integer(), - integer(), - integer(), - integer(), - gleam@dynamic:dynamic_()} | - {assert, integer(), integer(), integer(), assert_kind()}. - --type assert_kind() :: {binary_operator, - binary(), - asserted_expression(), - asserted_expression()} | - {function_call, list(asserted_expression())} | - {other_expression, asserted_expression()}. - --type asserted_expression() :: {asserted_expression, - integer(), - integer(), - expression_kind()}. - --type expression_kind() :: {literal, gleam@dynamic:dynamic_()} | - {expression, gleam@dynamic:dynamic_()} | - unevaluated. - --file("src/gleeunit/internal/gleam_panic.gleam", 49). -?DOC(false). --spec from_dynamic(gleam@dynamic:dynamic_()) -> {ok, gleam_panic()} | - {error, nil}. -from_dynamic(Data) -> - gleeunit_gleam_panic_ffi:from_dynamic(Data). diff --git a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit@internal@reporting.erl b/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit@internal@reporting.erl deleted file mode 100644 index 8c37c79..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit@internal@reporting.erl +++ /dev/null @@ -1,343 +0,0 @@ --module(gleeunit@internal@reporting). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleeunit/internal/reporting.gleam"). --export([new_state/0, test_skipped/3, test_passed/1, finished/1, eunit_missing/0, test_failed/4]). --export_type([state/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC(false). - --type state() :: {state, integer(), integer(), integer()}. - --file("src/gleeunit/internal/reporting.gleam", 15). -?DOC(false). --spec new_state() -> state(). -new_state() -> - {state, 0, 0, 0}. - --file("src/gleeunit/internal/reporting.gleam", 207). -?DOC(false). --spec bold(binary()) -> binary(). -bold(Text) -> - <<<<"\x{001b}[1m"/utf8, Text/binary>>/binary, "\x{001b}[22m"/utf8>>. - --file("src/gleeunit/internal/reporting.gleam", 211). -?DOC(false). --spec cyan(binary()) -> binary(). -cyan(Text) -> - <<<<"\x{001b}[36m"/utf8, Text/binary>>/binary, "\x{001b}[39m"/utf8>>. - --file("src/gleeunit/internal/reporting.gleam", 191). -?DOC(false). --spec code_snippet(gleam@option:option(bitstring()), integer(), integer()) -> binary(). -code_snippet(Src, Start, End) -> - _pipe = begin - gleam@result:'try'( - gleam@option:to_result(Src, nil), - fun(Src@1) -> - gleam@result:'try'( - gleam_stdlib:bit_array_slice(Src@1, Start, End - Start), - fun(Snippet) -> - gleam@result:'try'( - gleam@bit_array:to_string(Snippet), - fun(Snippet@1) -> - Snippet@2 = <<<<<<(cyan(<<" code"/utf8>>))/binary, - ": "/utf8>>/binary, - Snippet@1/binary>>/binary, - "\n"/utf8>>, - {ok, Snippet@2} - end - ) - end - ) - end - ) - end, - gleam@result:unwrap(_pipe, <<""/utf8>>). - --file("src/gleeunit/internal/reporting.gleam", 215). -?DOC(false). --spec yellow(binary()) -> binary(). -yellow(Text) -> - <<<<"\x{001b}[33m"/utf8, Text/binary>>/binary, "\x{001b}[39m"/utf8>>. - --file("src/gleeunit/internal/reporting.gleam", 202). -?DOC(false). --spec test_skipped(state(), binary(), binary()) -> state(). -test_skipped(State, Module, Function) -> - gleam_stdlib:print( - <<<<<<<<"\n"/utf8, Module/binary>>/binary, "."/utf8>>/binary, - Function/binary>>/binary, - (yellow(<<" skipped"/utf8>>))/binary>> - ), - {state, - erlang:element(2, State), - erlang:element(3, State), - erlang:element(4, State) + 1}. - --file("src/gleeunit/internal/reporting.gleam", 219). -?DOC(false). --spec green(binary()) -> binary(). -green(Text) -> - <<<<"\x{001b}[32m"/utf8, Text/binary>>/binary, "\x{001b}[39m"/utf8>>. - --file("src/gleeunit/internal/reporting.gleam", 66). -?DOC(false). --spec test_passed(state()) -> state(). -test_passed(State) -> - gleam_stdlib:print(green(<<"."/utf8>>)), - {state, - erlang:element(2, State) + 1, - erlang:element(3, State), - erlang:element(4, State)}. - --file("src/gleeunit/internal/reporting.gleam", 223). -?DOC(false). --spec red(binary()) -> binary(). -red(Text) -> - <<<<"\x{001b}[31m"/utf8, Text/binary>>/binary, "\x{001b}[39m"/utf8>>. - --file("src/gleeunit/internal/reporting.gleam", 19). -?DOC(false). --spec finished(state()) -> integer(). -finished(State) -> - case State of - {state, 0, 0, 0} -> - gleam_stdlib:println(<<"\nNo tests found!"/utf8>>), - 1; - - {state, _, 0, 0} -> - Message = <<<<"\n"/utf8, - (erlang:integer_to_binary(erlang:element(2, State)))/binary>>/binary, - " passed, no failures"/utf8>>, - gleam_stdlib:println(green(Message)), - 0; - - {state, _, _, 0} -> - Message@1 = <<<<<<<<"\n"/utf8, - (erlang:integer_to_binary(erlang:element(2, State)))/binary>>/binary, - " passed, "/utf8>>/binary, - (erlang:integer_to_binary(erlang:element(3, State)))/binary>>/binary, - " failures"/utf8>>, - gleam_stdlib:println(red(Message@1)), - 1; - - {state, _, 0, _} -> - Message@2 = <<<<<<<<"\n"/utf8, - (erlang:integer_to_binary(erlang:element(2, State)))/binary>>/binary, - " passed, 0 failures, "/utf8>>/binary, - (erlang:integer_to_binary(erlang:element(4, State)))/binary>>/binary, - " skipped"/utf8>>, - gleam_stdlib:println(yellow(Message@2)), - 1; - - {state, _, _, _} -> - Message@3 = <<<<<<<<<<<<"\n"/utf8, - (erlang:integer_to_binary( - erlang:element(2, State) - ))/binary>>/binary, - " passed, "/utf8>>/binary, - (erlang:integer_to_binary(erlang:element(3, State)))/binary>>/binary, - " failures, "/utf8>>/binary, - (erlang:integer_to_binary(erlang:element(4, State)))/binary>>/binary, - " skipped"/utf8>>, - gleam_stdlib:println(red(Message@3)), - 1 - end. - --file("src/gleeunit/internal/reporting.gleam", 89). -?DOC(false). --spec eunit_missing() -> {ok, any()} | {error, nil}. -eunit_missing() -> - Message = <<(bold(red(<<"Error"/utf8>>)))/binary, - ": EUnit libraries not found. - -Your Erlang installation seems to be incomplete. If you installed Erlang using -a package manager ensure that you have installed the full Erlang -distribution instead of a stripped-down version. -"/utf8>>, - gleam_stdlib:print_error(Message), - {error, nil}. - --file("src/gleeunit/internal/reporting.gleam", 227). -?DOC(false). --spec grey(binary()) -> binary(). -grey(Text) -> - <<<<"\x{001b}[90m"/utf8, Text/binary>>/binary, "\x{001b}[39m"/utf8>>. - --file("src/gleeunit/internal/reporting.gleam", 100). -?DOC(false). --spec format_unknown(binary(), binary(), gleam@dynamic:dynamic_()) -> binary(). -format_unknown(Module, Function, Error) -> - erlang:list_to_binary( - [<<(grey(<<<>/binary, Function/binary>>))/binary, - "\n"/utf8>>, - <<"An unexpected error occurred:\n"/utf8>>, - <<"\n"/utf8>>, - <<<<" "/utf8, (gleam@string:inspect(Error))/binary>>/binary, - "\n"/utf8>>] - ). - --file("src/gleeunit/internal/reporting.gleam", 183). -?DOC(false). --spec inspect_value(gleeunit@internal@gleam_panic:asserted_expression()) -> binary(). -inspect_value(Value) -> - case erlang:element(4, Value) of - unevaluated -> - grey(<<"unevaluated"/utf8>>); - - {literal, _} -> - grey(<<"literal"/utf8>>); - - {expression, Value@1} -> - gleam@string:inspect(Value@1) - end. - --file("src/gleeunit/internal/reporting.gleam", 179). -?DOC(false). --spec assert_value( - binary(), - gleeunit@internal@gleam_panic:asserted_expression() -) -> binary(). -assert_value(Name, Value) -> - <<<<<<(cyan(Name))/binary, ": "/utf8>>/binary, - (inspect_value(Value))/binary>>/binary, - "\n"/utf8>>. - --file("src/gleeunit/internal/reporting.gleam", 160). -?DOC(false). --spec assert_info(gleeunit@internal@gleam_panic:assert_kind()) -> binary(). -assert_info(Kind) -> - case Kind of - {binary_operator, _, Left, Right} -> - erlang:list_to_binary( - [assert_value(<<" left"/utf8>>, Left), - assert_value(<<"right"/utf8>>, Right)] - ); - - {function_call, Arguments} -> - _pipe = Arguments, - _pipe@1 = gleam@list:index_map( - _pipe, - fun(E, I) -> - Number = gleam@string:pad_start( - erlang:integer_to_binary(I), - 5, - <<" "/utf8>> - ), - assert_value(Number, E) - end - ), - erlang:list_to_binary(_pipe@1); - - {other_expression, _} -> - <<""/utf8>> - end. - --file("src/gleeunit/internal/reporting.gleam", 113). -?DOC(false). --spec format_gleam_error( - gleeunit@internal@gleam_panic:gleam_panic(), - binary(), - binary(), - gleam@option:option(bitstring()) -) -> binary(). -format_gleam_error(Error, Module, Function, Src) -> - Location = grey( - <<<<(erlang:element(3, Error))/binary, ":"/utf8>>/binary, - (erlang:integer_to_binary(erlang:element(6, Error)))/binary>> - ), - case erlang:element(7, Error) of - panic -> - erlang:list_to_binary( - [<<<<<<(bold(red(<<"panic"/utf8>>)))/binary, " "/utf8>>/binary, - Location/binary>>/binary, - "\n"/utf8>>, - <<<<<<<<<<(cyan(<<" test"/utf8>>))/binary, ": "/utf8>>/binary, - Module/binary>>/binary, - "."/utf8>>/binary, - Function/binary>>/binary, - "\n"/utf8>>, - <<<<<<(cyan(<<" info"/utf8>>))/binary, ": "/utf8>>/binary, - (erlang:element(2, Error))/binary>>/binary, - "\n"/utf8>>] - ); - - todo -> - erlang:list_to_binary( - [<<<<<<(bold(yellow(<<"todo"/utf8>>)))/binary, " "/utf8>>/binary, - Location/binary>>/binary, - "\n"/utf8>>, - <<<<<<<<<<(cyan(<<" test"/utf8>>))/binary, ": "/utf8>>/binary, - Module/binary>>/binary, - "."/utf8>>/binary, - Function/binary>>/binary, - "\n"/utf8>>, - <<<<<<(cyan(<<" info"/utf8>>))/binary, ": "/utf8>>/binary, - (erlang:element(2, Error))/binary>>/binary, - "\n"/utf8>>] - ); - - {assert, Start, End, _, Kind} -> - erlang:list_to_binary( - [<<<<<<(bold(red(<<"assert"/utf8>>)))/binary, " "/utf8>>/binary, - Location/binary>>/binary, - "\n"/utf8>>, - <<<<<<<<<<(cyan(<<" test"/utf8>>))/binary, ": "/utf8>>/binary, - Module/binary>>/binary, - "."/utf8>>/binary, - Function/binary>>/binary, - "\n"/utf8>>, - code_snippet(Src, Start, End), - assert_info(Kind), - <<<<<<(cyan(<<" info"/utf8>>))/binary, ": "/utf8>>/binary, - (erlang:element(2, Error))/binary>>/binary, - "\n"/utf8>>] - ); - - {let_assert, Start@1, End@1, _, _, Value} -> - erlang:list_to_binary( - [<<<<<<(bold(red(<<"let assert"/utf8>>)))/binary, " "/utf8>>/binary, - Location/binary>>/binary, - "\n"/utf8>>, - <<<<<<<<<<(cyan(<<" test"/utf8>>))/binary, ": "/utf8>>/binary, - Module/binary>>/binary, - "."/utf8>>/binary, - Function/binary>>/binary, - "\n"/utf8>>, - code_snippet(Src, Start@1, End@1), - <<<<<<(cyan(<<"value"/utf8>>))/binary, ": "/utf8>>/binary, - (gleam@string:inspect(Value))/binary>>/binary, - "\n"/utf8>>, - <<<<<<(cyan(<<" info"/utf8>>))/binary, ": "/utf8>>/binary, - (erlang:element(2, Error))/binary>>/binary, - "\n"/utf8>>] - ) - end. - --file("src/gleeunit/internal/reporting.gleam", 71). -?DOC(false). --spec test_failed(state(), binary(), binary(), gleam@dynamic:dynamic_()) -> state(). -test_failed(State, Module, Function, Error) -> - Message = case gleeunit_gleam_panic_ffi:from_dynamic(Error) of - {ok, Error@1} -> - Src = gleam@option:from_result( - file:read_file(erlang:element(3, Error@1)) - ), - format_gleam_error(Error@1, Module, Function, Src); - - {error, _} -> - format_unknown(Module, Function, Error) - end, - gleam_stdlib:print(<<"\n"/utf8, Message/binary>>), - {state, - erlang:element(2, State), - erlang:element(3, State) + 1, - erlang:element(4, State)}. diff --git a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit@should.erl b/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit@should.erl deleted file mode 100644 index 81048de..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit@should.erl +++ /dev/null @@ -1,153 +0,0 @@ --module(gleeunit@should). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). --define(FILEPATH, "src/gleeunit/should.gleam"). --export([equal/2, not_equal/2, be_ok/1, be_error/1, be_some/1, be_none/1, be_true/1, be_false/1, fail/0]). - --if(?OTP_RELEASE >= 27). --define(MODULEDOC(Str), -moduledoc(Str)). --define(DOC(Str), -doc(Str)). --else. --define(MODULEDOC(Str), -compile([])). --define(DOC(Str), -compile([])). --endif. - -?MODULEDOC(" Use the `assert` keyword instead of this module.\n"). - --file("src/gleeunit/should.gleam", 6). --spec equal(DOF, DOF) -> nil. -equal(A, B) -> - case A =:= B of - true -> - nil; - - _ -> - erlang:error(#{gleam_error => panic, - message => erlang:list_to_binary( - [<<"\n"/utf8>>, - gleam@string:inspect(A), - <<"\nshould equal\n"/utf8>>, - gleam@string:inspect(B)] - ), - file => <>, - module => <<"gleeunit/should"/utf8>>, - function => <<"equal"/utf8>>, - line => 10}) - end. - --file("src/gleeunit/should.gleam", 19). --spec not_equal(DOG, DOG) -> nil. -not_equal(A, B) -> - case A /= B of - true -> - nil; - - _ -> - erlang:error(#{gleam_error => panic, - message => erlang:list_to_binary( - [<<"\n"/utf8>>, - gleam@string:inspect(A), - <<"\nshould not equal\n"/utf8>>, - gleam@string:inspect(B)] - ), - file => <>, - module => <<"gleeunit/should"/utf8>>, - function => <<"not_equal"/utf8>>, - line => 23}) - end. - --file("src/gleeunit/should.gleam", 32). --spec be_ok({ok, DOH} | {error, any()}) -> DOH. -be_ok(A) -> - case A of - {ok, Value} -> - Value; - - _ -> - erlang:error(#{gleam_error => panic, - message => erlang:list_to_binary( - [<<"\n"/utf8>>, - gleam@string:inspect(A), - <<"\nshould be ok"/utf8>>] - ), - file => <>, - module => <<"gleeunit/should"/utf8>>, - function => <<"be_ok"/utf8>>, - line => 35}) - end. - --file("src/gleeunit/should.gleam", 39). --spec be_error({ok, any()} | {error, DOM}) -> DOM. -be_error(A) -> - case A of - {error, Error} -> - Error; - - _ -> - erlang:error(#{gleam_error => panic, - message => erlang:list_to_binary( - [<<"\n"/utf8>>, - gleam@string:inspect(A), - <<"\nshould be error"/utf8>>] - ), - file => <>, - module => <<"gleeunit/should"/utf8>>, - function => <<"be_error"/utf8>>, - line => 42}) - end. - --file("src/gleeunit/should.gleam", 46). --spec be_some(gleam@option:option(DOP)) -> DOP. -be_some(A) -> - case A of - {some, Value} -> - Value; - - _ -> - erlang:error(#{gleam_error => panic, - message => erlang:list_to_binary( - [<<"\n"/utf8>>, - gleam@string:inspect(A), - <<"\nshould be some"/utf8>>] - ), - file => <>, - module => <<"gleeunit/should"/utf8>>, - function => <<"be_some"/utf8>>, - line => 49}) - end. - --file("src/gleeunit/should.gleam", 53). --spec be_none(gleam@option:option(any())) -> nil. -be_none(A) -> - case A of - none -> - nil; - - _ -> - erlang:error(#{gleam_error => panic, - message => erlang:list_to_binary( - [<<"\n"/utf8>>, - gleam@string:inspect(A), - <<"\nshould be none"/utf8>>] - ), - file => <>, - module => <<"gleeunit/should"/utf8>>, - function => <<"be_none"/utf8>>, - line => 56}) - end. - --file("src/gleeunit/should.gleam", 60). --spec be_true(boolean()) -> nil. -be_true(Actual) -> - _pipe = Actual, - equal(_pipe, true). - --file("src/gleeunit/should.gleam", 65). --spec be_false(boolean()) -> nil. -be_false(Actual) -> - _pipe = Actual, - equal(_pipe, false). - --file("src/gleeunit/should.gleam", 70). --spec fail() -> nil. -fail() -> - be_true(false). diff --git a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit_ffi.erl b/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit_ffi.erl deleted file mode 100644 index 05c7490..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit_ffi.erl +++ /dev/null @@ -1,21 +0,0 @@ --module(gleeunit_ffi). - --export([find_files/2, run_eunit/2]). - -find_files(Pattern, In) -> - Results = filelib:wildcard(binary_to_list(Pattern), binary_to_list(In)), - lists:map(fun list_to_binary/1, Results). - -run_eunit(Tests, Options) -> - case code:which(eunit) of - non_existing -> - gleeunit@internal@reporting:eunit_missing(); - - _ -> - case eunit:test(Tests, Options) of - ok -> {ok, nil}; - error -> {error, nil}; - {error, Term} -> {error, Term} - end - end. - diff --git a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit_ffi.mjs b/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit_ffi.mjs deleted file mode 100644 index 7bdc071..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit_ffi.mjs +++ /dev/null @@ -1,100 +0,0 @@ -import { readFileSync } from "node:fs"; -import { Result$Ok, Result$Error } from "./gleam.mjs"; -import * as reporting from "./gleeunit/internal/reporting.mjs"; - -export function read_file(path) { - try { - return Result$Ok(readFileSync(path)); - } catch { - return Result$Error(undefined); - } -} - -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 async_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 state = reporting.new_state(); - - 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](); - state = reporting.test_passed(state); - } catch (error) { - let moduleName = js_path.slice(0, -4); - state = reporting.test_failed(state, moduleName, fnName, error); - } - } - } - - const status = reporting.finished(state); - exit(status); -} - -export function crash(message) { - throw new Error(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("node:fs/promises"); - return readdir(path); - } -} - -function join_path(a, b) { - if (a.endsWith("/")) return a + b; - return a + "/" + b; -} - -async function async_read_file(path) { - if (globalThis.Deno) { - return Deno.readTextFile(path); - } else { - let { readFile } = await import("node:fs/promises"); - let contents = await readFile(path); - return contents.toString(); - } -} diff --git a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit_progress.erl b/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit_progress.erl deleted file mode 100644 index e6576a5..0000000 --- a/lsp/bet-lsp/build/packages/gleeunit/src/gleeunit_progress.erl +++ /dev/null @@ -1,72 +0,0 @@ -%% A formatter adapted from Sean Cribb's https://github.com/seancribbs/eunit_formatters - --module(gleeunit_progress). --define(NOTEST, true). - -%% eunit_listener callbacks --export([ - init/1, handle_begin/3, handle_end/3, handle_cancel/3, terminate/2, - start/0, start/1 -]). - --define(reporting, gleeunit@internal@reporting). - -start() -> - start([]). - -start(Options) -> - eunit_listener:start(?MODULE, Options). - -init(_Options) -> - ?reporting:new_state(). - -handle_begin(_test_or_group, _data, State) -> - State. - -handle_end(group, _data, State) -> - State; -handle_end(test, Data, State) -> - {AtomModule, AtomFunction, _Arity} = proplists:get_value(source, Data), - Module = erlang:atom_to_binary(AtomModule), - Function = erlang:atom_to_binary(AtomFunction), - - % EUnit swallows stdout, so print it to make debugging easier. - case proplists:get_value(output, Data) of - undefined -> ok; - <<>> -> ok; - Out -> gleam@io:print(Out) - end, - - case proplists:get_value(status, Data) of - ok -> - ?reporting:test_passed(State); - {skipped, _Reason} -> - ?reporting:test_skipped(State, Module, Function); - {error, {_, Exception, _Stack}} -> - ?reporting:test_failed(State, Module, Function, Exception) - end. - - -handle_cancel(_test_or_group, Data, State) -> - ?reporting:test_failed(State, <<"gleeunit">>, <<"main">>, Data). - -terminate({ok, _Data}, State) -> - ?reporting:finished(State), - ok; -terminate({error, Reason}, State) -> - ?reporting:finished(State), - io:fwrite(" -Eunit failed: - -~80p - -This is probably a bug in gleeunit. Please report it. -", [Reason]), - sync_end(error). - -sync_end(Result) -> - receive - {stop, Reference, ReplyTo} -> - ReplyTo ! {result, Reference, Result}, - ok - end. diff --git a/lsp/bet-lsp/build/packages/glisten/README.md b/lsp/bet-lsp/build/packages/glisten/README.md deleted file mode 100644 index 79c02d4..0000000 --- a/lsp/bet-lsp/build/packages/glisten/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# glisten - -[![Package Version](https://img.shields.io/hexpm/v/glisten)](https://hex.pm/packages/glisten) -[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/glisten/) - -A Gleam TCP server library. Built on top of `gleam_otp`, it provides a -supervisor over a pool of socket acceptors. Each acceptor will block on `accept` -until a connection is opened. The acceptor will then spawn a handler process -and then block again on `accept`. - -Here is a simple example that will echo received messages: - -```gleam -import gleam/bytes_builder -import gleam/erlang/process -import gleam/option.{None} -import gleam/otp/actor -import glisten.{Packet} - -pub fn main() { - let assert Ok(_) = - glisten.handler(fn(_conn) { #(Nil, None) }, fn(msg, state, conn) { - let assert Packet(msg) = msg - let assert Ok(_) = glisten.send(conn, bytes_builder.from_bit_array(msg)) - actor.continue(state) - }) - |> glisten.serve(3000) - - process.sleep_forever() -} -``` - -SSL is also handled using the `glisten.{serve_ssl}` method. This requires a -certificate and key file path. The rest of the handler flow remains unchanged. - -`glisten` doesn't provide a public API for connected clients. In order to hook -into the socket lifecycle, you can establish some functions which are called -for the opening and closing of the socket. An example is provided below. - -To serve over SSL: - -```gleam -// ... -import glisten/ssl - -pub fn main() { - let assert Ok(_) = - glisten.handler( - // omitted - ) - |> glisten.serve_ssl( - // Passing labeled arguments for clarity - port: 8080, - certfile: "/path/to/server.crt", - keyfile: "/path/to/server.key", - ) - process.sleep_forever() -} -``` - -But you can also drop down to the lower level listen/accept flow if you'd prefer -to manage connections yourself, or only handle a small number at a time. - -```gleam -import gleam/io -import gleam/result -import glisten/socket/options.{ActiveMode, Passive} -import glisten/tcp - -pub fn main() { - use listener <- result.then(tcp.listen(8000, [ActiveMode(Passive)])) - use socket <- result.then(tcp.accept(listener)) - use msg <- result.then(tcp.receive(socket, 0)) - io.debug(#("got a msg", msg)) - - Ok(Nil) -} -``` - -See [mist](https://github.com/rawhat/mist) for HTTP support built on top of this library. diff --git a/lsp/bet-lsp/build/packages/glisten/gleam.toml b/lsp/bet-lsp/build/packages/glisten/gleam.toml deleted file mode 100644 index 6a60029..0000000 --- a/lsp/bet-lsp/build/packages/glisten/gleam.toml +++ /dev/null @@ -1,14 +0,0 @@ -name = "glisten" -version = "2.0.0" -description = "a shiny Gleam TCP/SSL server" -licences = ["Apache-2.0"] -repository = { type = "github", user = "rawhat", repo = "glisten" } -gleam = ">= 1.0.0" - -[dependencies] -gleam_stdlib = "~> 0.35 or ~> 1.0" -gleam_otp = "~> 0.9" -gleam_erlang = "~> 0.24" - -[dev-dependencies] -gleeunit = "~> 1.0" diff --git a/lsp/bet-lsp/build/packages/glisten/include/glisten@internal@acceptor_AcceptorState.hrl b/lsp/bet-lsp/build/packages/glisten/include/glisten@internal@acceptor_AcceptorState.hrl deleted file mode 100644 index 88646cf..0000000 --- a/lsp/bet-lsp/build/packages/glisten/include/glisten@internal@acceptor_AcceptorState.hrl +++ /dev/null @@ -1,5 +0,0 @@ --record(acceptor_state, { - sender :: gleam@erlang@process:subject(glisten@internal@acceptor:acceptor_message()), - socket :: gleam@option:option(glisten@socket:socket()), - transport :: glisten@transport:transport() -}). diff --git a/lsp/bet-lsp/build/packages/glisten/include/glisten@internal@acceptor_Pool.hrl b/lsp/bet-lsp/build/packages/glisten/include/glisten@internal@acceptor_Pool.hrl deleted file mode 100644 index ed9ba6b..0000000 --- a/lsp/bet-lsp/build/packages/glisten/include/glisten@internal@acceptor_Pool.hrl +++ /dev/null @@ -1,9 +0,0 @@ --record(pool, { - listener_socket :: glisten@socket:listen_socket(), - handler :: fun((glisten@internal@handler:loop_message(any()), any(), glisten@internal@handler:connection(any())) -> gleam@otp@actor:next(glisten@internal@handler:loop_message(any()), any())), - pool_count :: integer(), - on_init :: fun((glisten@internal@handler:connection(any())) -> {any(), - gleam@option:option(gleam@erlang@process:selector(any()))}), - on_close :: gleam@option:option(fun((any()) -> nil)), - transport :: glisten@transport:transport() -}). diff --git a/lsp/bet-lsp/build/packages/glisten/include/glisten@internal@handler_Connection.hrl b/lsp/bet-lsp/build/packages/glisten/include/glisten@internal@handler_Connection.hrl deleted file mode 100644 index ba21f2f..0000000 --- a/lsp/bet-lsp/build/packages/glisten/include/glisten@internal@handler_Connection.hrl +++ /dev/null @@ -1,7 +0,0 @@ --record(connection, { - client_ip :: {ok, {{integer(), integer(), integer(), integer()}, integer()}} | - {error, nil}, - socket :: glisten@socket:socket(), - transport :: glisten@transport:transport(), - sender :: gleam@erlang@process:subject(glisten@internal@handler:message(any())) -}). diff --git a/lsp/bet-lsp/build/packages/glisten/include/glisten@internal@handler_Handler.hrl b/lsp/bet-lsp/build/packages/glisten/include/glisten@internal@handler_Handler.hrl deleted file mode 100644 index cd6627a..0000000 --- a/lsp/bet-lsp/build/packages/glisten/include/glisten@internal@handler_Handler.hrl +++ /dev/null @@ -1,8 +0,0 @@ --record(handler, { - socket :: glisten@socket:socket(), - loop :: fun((glisten@internal@handler:loop_message(any()), any(), glisten@internal@handler:connection(any())) -> gleam@otp@actor:next(glisten@internal@handler:loop_message(any()), any())), - on_init :: fun((glisten@internal@handler:connection(any())) -> {any(), - gleam@option:option(gleam@erlang@process:selector(any()))}), - on_close :: gleam@option:option(fun((any()) -> nil)), - transport :: glisten@transport:transport() -}). diff --git a/lsp/bet-lsp/build/packages/glisten/include/glisten@internal@handler_LoopState.hrl b/lsp/bet-lsp/build/packages/glisten/include/glisten@internal@handler_LoopState.hrl deleted file mode 100644 index dc1cbc3..0000000 --- a/lsp/bet-lsp/build/packages/glisten/include/glisten@internal@handler_LoopState.hrl +++ /dev/null @@ -1,8 +0,0 @@ --record(loop_state, { - client_ip :: {ok, {{integer(), integer(), integer(), integer()}, integer()}} | - {error, nil}, - socket :: glisten@socket:socket(), - sender :: gleam@erlang@process:subject(glisten@internal@handler:message(any())), - transport :: glisten@transport:transport(), - data :: any() -}). diff --git a/lsp/bet-lsp/build/packages/glisten/include/glisten_Connection.hrl b/lsp/bet-lsp/build/packages/glisten/include/glisten_Connection.hrl deleted file mode 100644 index 41d0860..0000000 --- a/lsp/bet-lsp/build/packages/glisten/include/glisten_Connection.hrl +++ /dev/null @@ -1,7 +0,0 @@ --record(connection, { - client_ip :: {ok, {{integer(), integer(), integer(), integer()}, integer()}} | - {error, nil}, - socket :: glisten@socket:socket(), - transport :: glisten@transport:transport(), - subject :: gleam@erlang@process:subject(glisten@internal@handler:message(any())) -}). diff --git a/lsp/bet-lsp/build/packages/glisten/include/glisten_Handler.hrl b/lsp/bet-lsp/build/packages/glisten/include/glisten_Handler.hrl deleted file mode 100644 index bdd9f80..0000000 --- a/lsp/bet-lsp/build/packages/glisten/include/glisten_Handler.hrl +++ /dev/null @@ -1,7 +0,0 @@ --record(handler, { - on_init :: fun((glisten:connection(any())) -> {any(), - gleam@option:option(gleam@erlang@process:selector(any()))}), - loop :: fun((glisten:message(any()), any(), glisten:connection(any())) -> gleam@otp@actor:next(glisten:message(any()), any())), - on_close :: gleam@option:option(fun((any()) -> nil)), - pool_size :: integer() -}). diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten.app.src b/lsp/bet-lsp/build/packages/glisten/src/glisten.app.src deleted file mode 100644 index c5b5514..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten.app.src +++ /dev/null @@ -1,18 +0,0 @@ -{application, glisten, [ - {vsn, "2.0.0"}, - {applications, [gleam_erlang, - gleam_otp, - gleam_stdlib, - gleeunit]}, - {description, "a shiny Gleam TCP/SSL server"}, - {modules, [glisten, - glisten@internal@acceptor, - glisten@internal@handler, - glisten@internal@logger, - glisten@socket, - glisten@socket@options, - glisten@ssl, - glisten@tcp, - glisten@transport]}, - {registered, []} -]}. diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten.erl b/lsp/bet-lsp/build/packages/glisten/src/glisten.erl deleted file mode 100644 index 48ee596..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten.erl +++ /dev/null @@ -1,210 +0,0 @@ --module(glisten). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([send/2, handler/2, with_close/2, with_pool_size/2, serve/2, serve_ssl/4]). --export_type([start_error/0, message/1, connection/1, handler/2]). - --type start_error() :: listener_closed | - listener_timeout | - acceptor_timeout | - {acceptor_failed, gleam@erlang@process:exit_reason()} | - {acceptor_crashed, gleam@dynamic:dynamic_()} | - {system_error, glisten@socket:socket_reason()}. - --type message(HUP) :: {packet, bitstring()} | {user, HUP}. - --type connection(HUQ) :: {connection, - {ok, {{integer(), integer(), integer(), integer()}, integer()}} | - {error, nil}, - glisten@socket:socket(), - glisten@transport:transport(), - gleam@erlang@process:subject(glisten@internal@handler:message(HUQ))}. - --opaque handler(HUR, HUS) :: {handler, - fun((connection(HUR)) -> {HUS, - gleam@option:option(gleam@erlang@process:selector(HUR))}), - fun((message(HUR), HUS, connection(HUR)) -> gleam@otp@actor:next(message(HUR), HUS)), - gleam@option:option(fun((HUS) -> nil)), - integer()}. - --spec send(connection(any()), gleam@bytes_builder:bytes_builder()) -> {ok, nil} | - {error, glisten@socket:socket_reason()}. -send(Conn, Msg) -> - glisten@transport:send( - erlang:element(4, Conn), - erlang:element(3, Conn), - Msg - ). - --spec convert_on_init( - fun((connection(HVP)) -> {HVR, - gleam@option:option(gleam@erlang@process:selector(HVP))}) -) -> fun((glisten@internal@handler:connection(HVP)) -> {HVR, - gleam@option:option(gleam@erlang@process:selector(HVP))}). -convert_on_init(On_init) -> - fun(Conn) -> - Connection = {connection, - erlang:element(2, Conn), - erlang:element(3, Conn), - erlang:element(4, Conn), - erlang:element(5, Conn)}, - On_init(Connection) - end. - --spec handler( - fun((connection(HVX)) -> {HVZ, - gleam@option:option(gleam@erlang@process:selector(HVX))}), - fun((message(HVX), HVZ, connection(HVX)) -> gleam@otp@actor:next(message(HVX), HVZ)) -) -> handler(HVX, HVZ). -handler(On_init, Loop) -> - {handler, On_init, Loop, none, 10}. - --spec map_user_selector(gleam@erlang@process:selector(message(HVE))) -> gleam@erlang@process:selector(glisten@internal@handler:loop_message(HVE)). -map_user_selector(Selector) -> - gleam_erlang_ffi:map_selector(Selector, fun(Value) -> case Value of - {packet, Msg} -> - {packet, Msg}; - - {user, Msg@1} -> - {custom, Msg@1} - end end). - --spec convert_loop( - fun((message(HVJ), HVK, connection(HVJ)) -> gleam@otp@actor:next(message(HVJ), HVK)) -) -> fun((glisten@internal@handler:loop_message(HVJ), HVK, glisten@internal@handler:connection(HVJ)) -> gleam@otp@actor:next(glisten@internal@handler:loop_message(HVJ), HVK)). -convert_loop(Loop) -> - fun(Msg, Data, Conn) -> - Conn@1 = {connection, - erlang:element(2, Conn), - erlang:element(3, Conn), - erlang:element(4, Conn), - erlang:element(5, Conn)}, - case Msg of - {packet, Msg@1} -> - case Loop({packet, Msg@1}, Data, Conn@1) of - {continue, Data@1, Selector} -> - {continue, - Data@1, - gleam@option:map(Selector, fun map_user_selector/1)}; - - {stop, Reason} -> - {stop, Reason} - end; - - {custom, Msg@2} -> - case Loop({user, Msg@2}, Data, Conn@1) of - {continue, Data@2, Selector@1} -> - {continue, - Data@2, - gleam@option:map( - Selector@1, - fun map_user_selector/1 - )}; - - {stop, Reason@1} -> - {stop, Reason@1} - end - end - end. - --spec with_close(handler(HWG, HWH), fun((HWH) -> nil)) -> handler(HWG, HWH). -with_close(Handler, On_close) -> - erlang:setelement(4, Handler, {some, On_close}). - --spec with_pool_size(handler(HWM, HWN), integer()) -> handler(HWM, HWN). -with_pool_size(Handler, Size) -> - erlang:setelement(5, Handler, Size). - --spec serve(handler(any(), any()), integer()) -> {ok, - gleam@erlang@process:subject(gleam@otp@supervisor:message())} | - {error, start_error()}. -serve(Handler, Port) -> - _pipe = Port, - _pipe@1 = glisten@tcp:listen(_pipe, []), - _pipe@2 = gleam@result:map_error(_pipe@1, fun(Err) -> case Err of - closed -> - listener_closed; - - timeout -> - listener_timeout; - - Err@1 -> - {system_error, Err@1} - end end), - gleam@result:then( - _pipe@2, - fun(Socket) -> - _pipe@3 = {pool, - Socket, - convert_loop(erlang:element(3, Handler)), - erlang:element(5, Handler), - convert_on_init(erlang:element(2, Handler)), - erlang:element(4, Handler), - tcp}, - _pipe@4 = glisten@internal@acceptor:start_pool(_pipe@3), - gleam@result:map_error(_pipe@4, fun(Err@2) -> case Err@2 of - init_timeout -> - acceptor_timeout; - - {init_failed, Reason} -> - {acceptor_failed, Reason}; - - {init_crashed, Reason@1} -> - {acceptor_crashed, Reason@1} - end end) - end - ). - --spec serve_ssl(handler(any(), any()), integer(), binary(), binary()) -> {ok, - gleam@erlang@process:subject(gleam@otp@supervisor:message())} | - {error, start_error()}. -serve_ssl(Handler, Port, Certfile, Keyfile) -> - _assert_subject = glisten_ssl_ffi:start_ssl(), - {ok, _} = 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 => <<"glisten"/utf8>>, - function => <<"serve_ssl"/utf8>>, - line => 206}) - end, - _pipe = Port, - _pipe@1 = glisten@ssl:listen( - _pipe, - [{certfile, Certfile}, {keyfile, Keyfile}] - ), - _pipe@2 = gleam@result:map_error(_pipe@1, fun(Err) -> case Err of - closed -> - listener_closed; - - timeout -> - listener_timeout; - - Err@1 -> - {system_error, Err@1} - end end), - gleam@result:then( - _pipe@2, - fun(Socket) -> - _pipe@3 = {pool, - Socket, - convert_loop(erlang:element(3, Handler)), - erlang:element(5, Handler), - convert_on_init(erlang:element(2, Handler)), - erlang:element(4, Handler), - ssl}, - _pipe@4 = glisten@internal@acceptor:start_pool(_pipe@3), - gleam@result:map_error(_pipe@4, fun(Err@2) -> case Err@2 of - init_timeout -> - acceptor_timeout; - - {init_failed, Reason} -> - {acceptor_failed, Reason}; - - {init_crashed, Reason@1} -> - {acceptor_crashed, Reason@1} - end end) - end - ). diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten.gleam b/lsp/bet-lsp/build/packages/glisten/src/glisten.gleam deleted file mode 100644 index 7b4c47e..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten.gleam +++ /dev/null @@ -1,234 +0,0 @@ -import gleam/bytes_builder.{type BytesBuilder} -import gleam/dynamic.{type Dynamic} -import gleam/erlang/process.{type Selector, type Subject} -import gleam/option.{type Option, None, Some} -import gleam/result -import glisten/internal/acceptor.{Pool} -import glisten/internal/handler.{type ClientIp as InternalClientIp} -import glisten/socket.{ - type Socket as InternalSocket, type SocketReason as InternalSocketReason, - Closed, Timeout, -} -import glisten/socket/options.{Certfile, Keyfile} -import glisten/transport.{type Transport} -import glisten/tcp -import glisten/ssl -import gleam/otp/actor -import gleam/otp/supervisor - -/// Reasons that `serve` might fail -pub type StartError { - ListenerClosed - ListenerTimeout - AcceptorTimeout - AcceptorFailed(process.ExitReason) - AcceptorCrashed(Dynamic) - SystemError(SocketReason) -} - -/// Your provided loop function with receive these message types as the -/// first argument. -pub type Message(user_message) { - /// These are messages received from the socket - Packet(BitArray) - /// These are any messages received from the selector returned from `on_init` - User(user_message) -} - -pub type ClientIp = - InternalClientIp - -pub type Socket = - InternalSocket - -pub type SocketReason = - InternalSocketReason - -/// This type holds useful bits of data for the active connection. -pub type Connection(user_message) { - Connection( - /// This will be optionally a tuple for the IPv4 of the other end of the - /// socket - client_ip: ClientIp, - socket: Socket, - /// This provides a uniform interface for both TCP and SSL methods. - transport: Transport, - subject: Subject(handler.Message(user_message)), - ) -} - -/// Sends a BytesBuilder message over the socket using the active transport -pub fn send( - conn: Connection(user_message), - msg: BytesBuilder, -) -> Result(Nil, SocketReason) { - transport.send(conn.transport, conn.socket, msg) -} - -/// This is the shape of the function you need to provide for the `handler` -/// argument to `serve(_ssl)`. -pub type Loop(user_message, data) = - fn(Message(user_message), data, Connection(user_message)) -> - actor.Next(Message(user_message), data) - -pub opaque type Handler(user_message, data) { - Handler( - on_init: fn(Connection(user_message)) -> - #(data, Option(Selector(user_message))), - loop: Loop(user_message, data), - on_close: Option(fn(data) -> Nil), - pool_size: Int, - ) -} - -fn map_user_selector( - selector: Selector(Message(user_message)), -) -> Selector(handler.LoopMessage(user_message)) { - process.map_selector(selector, fn(value) { - case value { - Packet(msg) -> handler.Packet(msg) - User(msg) -> handler.Custom(msg) - } - }) -} - -fn convert_loop( - loop: Loop(user_message, data), -) -> handler.Loop(user_message, data) { - fn(msg, data, conn: handler.Connection(user_message)) { - let conn = - Connection(conn.client_ip, conn.socket, conn.transport, conn.sender) - case msg { - handler.Packet(msg) -> { - case loop(Packet(msg), data, conn) { - actor.Continue(data, selector) -> - actor.Continue(data, option.map(selector, map_user_selector)) - actor.Stop(reason) -> actor.Stop(reason) - } - } - handler.Custom(msg) -> { - case loop(User(msg), data, conn) { - actor.Continue(data, selector) -> - actor.Continue(data, option.map(selector, map_user_selector)) - actor.Stop(reason) -> actor.Stop(reason) - } - } - } - } -} - -fn convert_on_init( - on_init: fn(Connection(user_message)) -> - #(state, Option(Selector(user_message))), -) -> fn(handler.Connection(user_message)) -> - #(state, Option(Selector(user_message))) { - fn(conn: handler.Connection(user_message)) { - let connection = - Connection( - client_ip: conn.client_ip, - subject: conn.sender, - socket: conn.socket, - transport: conn.transport, - ) - on_init(connection) - } -} - -/// Create a new handler for each connection. The required arguments mirror the -/// `actor.start` API from `gleam_otp`. The default pool is 10 accceptor -/// processes. -pub fn handler( - on_init: fn(Connection(user_message)) -> - #(data, Option(Selector(user_message))), - loop: Loop(user_message, data), -) -> Handler(user_message, data) { - Handler(on_init: on_init, loop: loop, on_close: None, pool_size: 10) -} - -/// Adds a function to the handler to be called when the connection is closed. -pub fn with_close( - handler: Handler(user_message, data), - on_close: fn(data) -> Nil, -) -> Handler(user_message, data) { - Handler(..handler, on_close: Some(on_close)) -} - -/// Modify the size of the acceptor pool -pub fn with_pool_size( - handler: Handler(user_message, data), - size: Int, -) -> Handler(user_message, data) { - Handler(..handler, pool_size: size) -} - -/// Start the TCP server with the given handler on the provided port -pub fn serve( - handler: Handler(user_message, data), - port: Int, -) -> Result(Subject(supervisor.Message), StartError) { - port - |> tcp.listen([]) - |> result.map_error(fn(err) { - case err { - Closed -> ListenerClosed - Timeout -> ListenerTimeout - err -> SystemError(err) - } - }) - |> result.then(fn(socket) { - Pool( - listener_socket: socket, - handler: convert_loop(handler.loop), - pool_count: handler.pool_size, - on_init: convert_on_init(handler.on_init), - on_close: handler.on_close, - transport: transport.Tcp, - ) - |> acceptor.start_pool - |> result.map_error(fn(err) { - case err { - actor.InitTimeout -> AcceptorTimeout - actor.InitFailed(reason) -> AcceptorFailed(reason) - actor.InitCrashed(reason) -> AcceptorCrashed(reason) - } - }) - }) -} - -/// Start the SSL server with the given handler on the provided port. The key -/// and cert files must be provided, valid, and readable by the current user. -pub fn serve_ssl( - handler: Handler(user_message, data), - port port: Int, - certfile certfile: String, - keyfile keyfile: String, -) -> Result(Subject(supervisor.Message), StartError) { - let assert Ok(_nil) = ssl.start() - port - |> ssl.listen([Certfile(certfile), Keyfile(keyfile)]) - |> result.map_error(fn(err) { - case err { - Closed -> ListenerClosed - Timeout -> ListenerTimeout - err -> SystemError(err) - } - }) - |> result.then(fn(socket) { - Pool( - listener_socket: socket, - handler: convert_loop(handler.loop), - pool_count: handler.pool_size, - on_init: convert_on_init(handler.on_init), - on_close: handler.on_close, - transport: transport.Ssl, - ) - |> acceptor.start_pool - |> result.map_error(fn(err) { - case err { - actor.InitTimeout -> AcceptorTimeout - actor.InitFailed(reason) -> AcceptorFailed(reason) - actor.InitCrashed(reason) -> AcceptorCrashed(reason) - } - }) - }) -} diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten/internal/acceptor.gleam b/lsp/bet-lsp/build/packages/glisten/src/glisten/internal/acceptor.gleam deleted file mode 100644 index df4a17c..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten/internal/acceptor.gleam +++ /dev/null @@ -1,126 +0,0 @@ -import gleam/erlang/process.{type Selector, type Subject, Abnormal} -import gleam/function -import gleam/iterator -import gleam/option.{type Option, None} -import gleam/otp/actor -import gleam/otp/supervisor -import gleam/result -import glisten/internal/handler.{ - type Connection, type Loop, Handler, Internal, Ready, -} -import glisten/internal/logger -import glisten/socket.{type ListenSocket, type Socket} -import glisten/transport.{type Transport} - -pub type AcceptorMessage { - AcceptConnection(ListenSocket) -} - -pub type AcceptorError { - AcceptError - HandlerError - ControlError -} - -pub type AcceptorState { - AcceptorState( - sender: Subject(AcceptorMessage), - socket: Option(Socket), - transport: Transport, - ) -} - -/// Worker process that handles `accept`ing connections and starts a new process -/// which receives the messages from the socket -pub fn start( - pool: Pool(user_message, data), -) -> Result(Subject(AcceptorMessage), actor.StartError) { - actor.start_spec(actor.Spec( - init: fn() { - let subject = process.new_subject() - let selector = - process.new_selector() - |> process.selecting(subject, function.identity) - - process.send(subject, AcceptConnection(pool.listener_socket)) - - actor.Ready(AcceptorState(subject, None, pool.transport), selector) - }, - // TODO: rethink this value, probably... - init_timeout: 1000, - loop: fn(msg, state) { - let AcceptorState(sender, ..) = state - case msg { - AcceptConnection(listener) -> { - let res = { - use sock <- result.then( - transport.accept(state.transport, listener) - |> result.replace_error(AcceptError), - ) - use start <- result.then( - Handler( - socket: sock, - loop: pool.handler, - on_init: pool.on_init, - on_close: pool.on_close, - transport: pool.transport, - ) - |> handler.start - |> result.replace_error(HandlerError), - ) - sock - |> transport.controlling_process( - state.transport, - _, - process.subject_owner(start), - ) - |> result.replace_error(ControlError) - |> result.map(fn(_) { process.send(start, Internal(Ready)) }) - } - case res { - Error(reason) -> { - logger.error(#("Failed to accept/start handler", reason)) - actor.Stop(Abnormal("Failed to accept/start handler")) - } - _val -> { - actor.send(sender, AcceptConnection(listener)) - actor.continue(state) - } - } - } - } - }, - )) -} - -pub type Pool(user_message, data) { - Pool( - listener_socket: ListenSocket, - handler: Loop(user_message, data), - pool_count: Int, - on_init: fn(Connection(user_message)) -> - #(data, Option(Selector(user_message))), - on_close: Option(fn(data) -> Nil), - transport: Transport, - ) -} - -/// Starts a pool of acceptors of size `pool_count`. -/// -/// Runs `loop_fn` on ever message received -pub fn start_pool( - pool: Pool(user_message, data), -) -> Result(Subject(supervisor.Message), actor.StartError) { - supervisor.start_spec(supervisor.Spec( - argument: Nil, - // TODO: i think these might need some tweaking - max_frequency: 100, - frequency_period: 1, - init: fn(children) { - iterator.range(from: 0, to: pool.pool_count) - |> iterator.fold(children, fn(children, _index) { - supervisor.add(children, supervisor.worker(fn(_arg) { start(pool) })) - }) - }, - )) -} diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten/internal/handler.gleam b/lsp/bet-lsp/build/packages/glisten/src/glisten/internal/handler.gleam deleted file mode 100644 index 5ae10a4..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten/internal/handler.gleam +++ /dev/null @@ -1,201 +0,0 @@ -import gleam/dynamic -import gleam/erlang/atom -import gleam/erlang/process.{type Selector, type Subject} -import gleam/function -import gleam/option.{type Option, Some} -import gleam/otp/actor -import gleam/result -import gleam/string -import glisten/socket.{type Socket} -import glisten/socket/options -import glisten/transport.{type Transport} - -/// All message types that the handler will receive, or that you can -/// send to the handler process -pub type InternalMessage { - Close - Ready - ReceiveMessage(BitArray) - SslClosed - TcpClosed -} - -pub type Message(user_message) { - Internal(InternalMessage) - User(user_message) -} - -pub type LoopMessage(user_message) { - Packet(BitArray) - Custom(user_message) -} - -pub type ClientIp = - Result(#(#(Int, Int, Int, Int), Int), Nil) - -pub type LoopState(user_message, data) { - LoopState( - client_ip: ClientIp, - socket: Socket, - sender: Subject(Message(user_message)), - transport: Transport, - data: data, - ) -} - -pub type Connection(user_message) { - Connection( - client_ip: ClientIp, - socket: Socket, - transport: Transport, - sender: Subject(Message(user_message)), - ) -} - -pub type Loop(user_message, data) = - fn(LoopMessage(user_message), data, Connection(user_message)) -> - actor.Next(LoopMessage(user_message), data) - -pub type Handler(user_message, data) { - Handler( - socket: Socket, - loop: Loop(user_message, data), - on_init: fn(Connection(user_message)) -> - #(data, Option(Selector(user_message))), - on_close: Option(fn(data) -> Nil), - transport: Transport, - ) -} - -/// Starts an actor for the TCP connection -pub fn start( - handler: Handler(user_message, data), -) -> Result(Subject(Message(user_message)), actor.StartError) { - actor.start_spec( - actor.Spec( - init: fn() { - let subject = process.new_subject() - let client_ip = transport.peername(handler.transport, handler.socket) - let connection = - Connection( - socket: handler.socket, - client_ip: client_ip, - transport: handler.transport, - sender: subject, - ) - let #(initial_state, user_selector) = handler.on_init(connection) - let selector = - process.new_selector() - |> process.selecting_record3( - atom.create_from_string("tcp"), - fn(_sock, data) { - data - |> dynamic.bit_array - |> result.unwrap(<<>>) - |> ReceiveMessage - }, - ) - |> process.selecting_record3( - atom.create_from_string("ssl"), - fn(_sock, data) { - data - |> dynamic.bit_array - |> result.unwrap(<<>>) - |> ReceiveMessage - }, - ) - |> process.selecting_record2( - atom.create_from_string("ssl_closed"), - fn(_nil) { SslClosed }, - ) - |> process.selecting_record2( - atom.create_from_string("tcp_closed"), - fn(_nil) { TcpClosed }, - ) - |> process.map_selector(Internal) - |> process.selecting(subject, function.identity) - let selector = case user_selector { - Some(sel) -> - sel - |> process.map_selector(User) - |> process.merge_selector(selector, _) - _ -> selector - } - actor.Ready( - LoopState( - client_ip: client_ip, - socket: handler.socket, - sender: subject, - transport: handler.transport, - data: initial_state, - ), - selector, - ) - }, - init_timeout: 1000, - loop: fn(msg, state) { - let connection = - Connection( - socket: state.socket, - client_ip: state.client_ip, - transport: state.transport, - sender: state.sender, - ) - case msg { - Internal(TcpClosed) | Internal(SslClosed) | Internal(Close) -> - case transport.close(state.transport, state.socket) { - Ok(Nil) -> { - let _ = case handler.on_close { - Some(on_close) -> on_close(state.data) - _ -> Nil - } - actor.Stop(process.Normal) - } - Error(err) -> actor.Stop(process.Abnormal(string.inspect(err))) - } - Internal(Ready) -> - state.socket - |> transport.handshake(state.transport, _) - |> result.replace_error("Failed to handshake socket") - |> result.then(fn(_ok) { - transport.set_opts(state.transport, state.socket, [ - options.ActiveMode(options.Once), - ]) - |> result.replace_error("Failed to set socket active") - }) - |> result.replace(actor.continue(state)) - |> result.map_error(fn(reason) { - actor.Stop(process.Abnormal(reason)) - }) - |> result.unwrap_both - User(msg) -> { - let msg = Custom(msg) - case handler.loop(msg, state.data, connection) { - actor.Continue(next_state, _selector) -> { - let assert Ok(Nil) = - transport.set_opts(state.transport, state.socket, [ - options.ActiveMode(options.Once), - ]) - actor.continue(LoopState(..state, data: next_state)) - } - actor.Stop(reason) -> actor.Stop(reason) - } - } - Internal(ReceiveMessage(msg)) -> { - let msg = Packet(msg) - case handler.loop(msg, state.data, connection) { - actor.Continue(next_state, _selector) -> { - let assert Ok(Nil) = - transport.set_opts(state.transport, state.socket, [ - options.ActiveMode(options.Once), - ]) - actor.continue(LoopState(..state, data: next_state)) - } - actor.Stop(reason) -> actor.Stop(reason) - } - } - } - }, - ), - ) -} diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten/internal/logger.gleam b/lsp/bet-lsp/build/packages/glisten/src/glisten/internal/logger.gleam deleted file mode 100644 index 7a28f3d..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten/internal/logger.gleam +++ /dev/null @@ -1,8 +0,0 @@ -import gleam/erlang/charlist.{type Charlist} - -@external(erlang, "logger", "error") -fn log_error(format: Charlist, data data: any) -> Nil - -pub fn error(data: any) -> Nil { - log_error(charlist.from_string("~tp"), [data]) -} diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten/socket.gleam b/lsp/bet-lsp/build/packages/glisten/src/glisten/socket.gleam deleted file mode 100644 index 95aca83..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten/socket.gleam +++ /dev/null @@ -1,93 +0,0 @@ -pub type SocketReason { - Closed - Timeout - Badarg - Terminated - - // inet:posix() errors. - Eaddrinuse - Eaddrnotavail - Eafnosupport - Ealready - Econnaborted - Econnrefused - Econnreset - Edestaddrreq - Ehostdown - Ehostunreach - Einprogress - Eisconn - Emsgsize - Enetdown - Enetunreach - Enopkg - Enoprotoopt - Enotconn - Enotty - Enotsock - Eproto - Eprotonosupport - Eprototype - Esocktnosupport - Etimedout - Ewouldblock - Exbadport - Exbadseq - - // file:posix() errors. - Eacces - Eagain - Ebadf - Ebadmsg - Ebusy - Edeadlk - Edeadlock - Edquot - Eexist - Efault - Efbig - Eftype - Eintr - Einval - Eio - Eisdir - Eloop - Emfile - Emlink - Emultihop - Enametoolong - Enfile - Enobufs - Enodev - Enolck - Enolink - Enoent - Enomem - Enospc - Enosr - Enostr - Enosys - Enotblk - Enotdir - Enotsup - Enxio - Eopnotsupp - Eoverflow - Eperm - Epipe - Erange - Erofs - Espipe - Esrch - Estale - Etxtbsy - Exdev -} - -pub opaque type ListenSocket { - ListenSocket -} - -pub opaque type Socket { - Socket -} diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten/socket/options.gleam b/lsp/bet-lsp/build/packages/glisten/src/glisten/socket/options.gleam deleted file mode 100644 index 45fcecd..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten/socket/options.gleam +++ /dev/null @@ -1,82 +0,0 @@ -import gleam/dynamic.{type Dynamic} -import gleam/erlang/atom -import gleam/list -import gleam/dict.{type Dict} -import gleam/pair - -/// Mode for the socket. Currently `list` is not supported -pub type SocketMode { - Binary -} - -/// Mapping to the {active, _} option -pub type ActiveState { - Once - Passive - Count(Int) - Active -} - -/// Options for the TCP socket -pub type TcpOption { - Backlog(Int) - Nodelay(Bool) - Linger(#(Bool, Int)) - SendTimeout(Int) - SendTimeoutClose(Bool) - Reuseaddr(Bool) - ActiveMode(ActiveState) - Mode(SocketMode) - // TODO: Probably should adjust the type here to only allow this for SSL - Certfile(String) - Keyfile(String) - AlpnPreferredProtocols(List(String)) - Inet6 -} - -pub fn to_dict(options: List(TcpOption)) -> Dict(atom.Atom, Dynamic) { - let opt_decoder = dynamic.tuple2(dynamic.dynamic, dynamic.dynamic) - - options - |> list.map(fn(opt) { - case opt { - ActiveMode(Passive) -> - dynamic.from(#(atom.create_from_string("active"), False)) - ActiveMode(Active) -> - dynamic.from(#(atom.create_from_string("active"), True)) - ActiveMode(Count(n)) -> - dynamic.from(#(atom.create_from_string("active"), n)) - ActiveMode(Once) -> - dynamic.from(#( - atom.create_from_string("active"), - atom.create_from_string("once"), - )) - other -> dynamic.from(other) - } - }) - |> list.filter_map(opt_decoder) - |> list.map(pair.map_first(_, dynamic.unsafe_coerce)) - |> dict.from_list -} - -pub const default_options = [ - Backlog(1024), - Nodelay(True), - SendTimeout(30_000), - SendTimeoutClose(True), - Reuseaddr(True), - Mode(Binary), - ActiveMode(Passive), -] - -pub fn merge_with_defaults(options: List(TcpOption)) -> List(TcpOption) { - let overrides = to_dict(options) - - default_options - |> to_dict - |> dict.merge(overrides) - |> dict.to_list - |> list.map(dynamic.from) - |> list.map(dynamic.unsafe_coerce) - |> list.append([Inet6]) -} diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten/ssl.gleam b/lsp/bet-lsp/build/packages/glisten/src/glisten/ssl.gleam deleted file mode 100644 index 6f01a69..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten/ssl.gleam +++ /dev/null @@ -1,87 +0,0 @@ -import gleam/bytes_builder.{type BytesBuilder} -import gleam/dynamic.{type Dynamic} -import gleam/erlang/atom.{type Atom} -import gleam/erlang/process.{type Pid} -import gleam/list -import gleam/dict -import glisten/socket.{type ListenSocket, type Socket, type SocketReason} -import glisten/socket/options - -@external(erlang, "glisten_ssl_ffi", "controlling_process") -pub fn controlling_process(socket: Socket, pid: Pid) -> Result(Nil, Atom) - -@external(erlang, "ssl", "listen") -fn do_listen( - port: Int, - options: List(options.TcpOption), -) -> Result(ListenSocket, SocketReason) - -@external(erlang, "ssl", "transport_accept") -pub fn accept_timeout( - socket: ListenSocket, - timeout: Int, -) -> Result(Socket, SocketReason) - -@external(erlang, "ssl", "transport_accept") -pub fn accept(socket: ListenSocket) -> Result(Socket, SocketReason) - -@external(erlang, "ssl", "recv") -pub fn receive_timeout( - socket: Socket, - length: Int, - timeout: Int, -) -> Result(BitArray, SocketReason) - -@external(erlang, "ssl", "recv") -pub fn receive(socket: Socket, length: Int) -> Result(BitArray, SocketReason) - -@external(erlang, "glisten_ssl_ffi", "send") -pub fn send(socket: Socket, packet: BytesBuilder) -> Result(Nil, SocketReason) - -@external(erlang, "glisten_ssl_ffi", "close") -pub fn close(socket: Socket) -> Result(Nil, SocketReason) - -@external(erlang, "glisten_ssl_ffi", "shutdown") -pub fn do_shutdown(socket: Socket, write: Atom) -> Result(Nil, SocketReason) - -pub fn shutdown(socket: Socket) -> Result(Nil, SocketReason) { - let assert Ok(write) = atom.from_string("write") - do_shutdown(socket, write) -} - -@external(erlang, "glisten_ssl_ffi", "set_opts") -fn do_set_opts(socket: Socket, opts: List(Dynamic)) -> Result(Nil, Nil) - -/// Update the optons for a socket (mutates the socket) -pub fn set_opts( - socket: Socket, - opts: List(options.TcpOption), -) -> Result(Nil, Nil) { - opts - |> options.to_dict - |> dict.to_list - |> list.map(dynamic.from) - |> do_set_opts(socket, _) -} - -@external(erlang, "ssl", "handshake") -pub fn handshake(socket: Socket) -> Result(Socket, Nil) - -/// Start listening over SSL on a port with the given options -pub fn listen( - port: Int, - options: List(options.TcpOption), -) -> Result(ListenSocket, SocketReason) { - options - |> options.merge_with_defaults - |> do_listen(port, _) -} - -@external(erlang, "glisten_ssl_ffi", "negotiated_protocol") -pub fn negotiated_protocol(socket: Socket) -> Result(String, String) - -@external(erlang, "ssl", "peername") -pub fn peername(socket: Socket) -> Result(#(#(Int, Int, Int, Int), Int), Nil) - -@external(erlang, "glisten_ssl_ffi", "start_ssl") -pub fn start() -> Result(Nil, Dynamic) diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten/tcp.gleam b/lsp/bet-lsp/build/packages/glisten/src/glisten/tcp.gleam deleted file mode 100644 index c6789d5..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten/tcp.gleam +++ /dev/null @@ -1,85 +0,0 @@ -import gleam/bytes_builder.{type BytesBuilder} -import gleam/dynamic.{type Dynamic} -import gleam/erlang/atom.{type Atom} -import gleam/erlang/process.{type Pid} -import gleam/list -import gleam/dict.{type Dict} -import glisten/socket.{type ListenSocket, type Socket, type SocketReason} -import glisten/socket/options.{type TcpOption} - -@external(erlang, "glisten_tcp_ffi", "controlling_process") -pub fn controlling_process(socket: Socket, pid: Pid) -> Result(Nil, Atom) - -@external(erlang, "gen_tcp", "listen") -fn do_listen_tcp( - port: Int, - options: List(TcpOption), -) -> Result(ListenSocket, SocketReason) - -@external(erlang, "gen_tcp", "accept") -pub fn accept_timeout( - socket: ListenSocket, - timeout: Int, -) -> Result(Socket, SocketReason) - -@external(erlang, "gen_tcp", "accept") -pub fn accept(socket: ListenSocket) -> Result(Socket, SocketReason) - -@external(erlang, "gen_tcp", "recv") -pub fn receive_timeout( - socket: Socket, - length: Int, - timeout: Int, -) -> Result(BitArray, SocketReason) - -@external(erlang, "gen_tcp", "recv") -pub fn receive(socket: Socket, length: Int) -> Result(BitArray, SocketReason) - -@external(erlang, "glisten_tcp_ffi", "send") -pub fn send(socket: Socket, packet: BytesBuilder) -> Result(Nil, SocketReason) - -@external(erlang, "socket", "info") -pub fn socket_info(socket: Socket) -> Dict(a, b) - -@external(erlang, "glisten_tcp_ffi", "close") -pub fn close(socket: a) -> Result(Nil, SocketReason) - -@external(erlang, "glisten_tcp_ffi", "shutdown") -pub fn do_shutdown(socket: Socket, write: Atom) -> Result(Nil, SocketReason) - -pub fn shutdown(socket: Socket) -> Result(Nil, SocketReason) { - let assert Ok(write) = atom.from_string("write") - do_shutdown(socket, write) -} - -@external(erlang, "glisten_tcp_ffi", "set_opts") -fn do_set_opts(socket: Socket, opts: List(Dynamic)) -> Result(Nil, Nil) - -/// Update the optons for a socket (mutates the socket) -pub fn set_opts(socket: Socket, opts: List(TcpOption)) -> Result(Nil, Nil) { - opts - |> options.to_dict - |> dict.to_list - |> list.map(dynamic.from) - |> do_set_opts(socket, _) -} - -/// Start listening over TCP on a port with the given options -pub fn listen( - port: Int, - opts: List(TcpOption), -) -> Result(ListenSocket, SocketReason) { - opts - |> options.merge_with_defaults - |> do_listen_tcp(port, _) -} - -pub fn handshake(socket: Socket) -> Result(Socket, Nil) { - Ok(socket) -} - -@external(erlang, "tcp", "negotiated_protocol") -pub fn negotiated_protocol(socket: Socket) -> a - -@external(erlang, "inet", "peername") -pub fn peername(socket: Socket) -> Result(#(#(Int, Int, Int, Int), Int), Nil) diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten/transport.gleam b/lsp/bet-lsp/build/packages/glisten/src/glisten/transport.gleam deleted file mode 100644 index 5bc5f6f..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten/transport.gleam +++ /dev/null @@ -1,149 +0,0 @@ -import gleam/bytes_builder.{type BytesBuilder} -import gleam/dynamic.{type Dynamic} -import gleam/erlang/atom.{type Atom} -import gleam/erlang/process.{type Pid} -import gleam/dict.{type Dict} -import glisten/socket/options -import glisten/socket.{type ListenSocket, type Socket, type SocketReason} -import glisten/ssl -import glisten/tcp - -pub type Transport { - Tcp - Ssl -} - -pub fn controlling_process( - transport: Transport, - socket: Socket, - pid: Pid, -) -> Result(Nil, Atom) { - case transport { - Tcp -> tcp.controlling_process(socket, pid) - Ssl -> ssl.controlling_process(socket, pid) - } -} - -pub fn listen( - transport: Transport, - port: Int, - opts: List(options.TcpOption), -) -> Result(ListenSocket, SocketReason) { - case transport { - Tcp -> tcp.listen(port, opts) - Ssl -> ssl.listen(port, opts) - } -} - -pub fn accept_timeout( - transport: Transport, - socket: ListenSocket, - timeout: Int, -) -> Result(Socket, SocketReason) { - case transport { - Tcp -> tcp.accept_timeout(socket, timeout) - Ssl -> ssl.accept_timeout(socket, timeout) - } -} - -pub fn accept( - transport: Transport, - socket: ListenSocket, -) -> Result(Socket, SocketReason) { - case transport { - Tcp -> tcp.accept(socket) - Ssl -> ssl.accept(socket) - } -} - -pub fn handshake(transport: Transport, socket: Socket) -> Result(Socket, Nil) { - case transport { - Tcp -> tcp.handshake(socket) - Ssl -> ssl.handshake(socket) - } -} - -pub fn receive_timeout( - transport: Transport, - socket: Socket, - amount: Int, - timeout: Int, -) -> Result(BitArray, SocketReason) { - case transport { - Tcp -> tcp.receive_timeout(socket, amount, timeout) - Ssl -> ssl.receive_timeout(socket, amount, timeout) - } -} - -pub fn receive( - transport: Transport, - socket: Socket, - amount: Int, -) -> Result(BitArray, SocketReason) { - case transport { - Tcp -> tcp.receive(socket, amount) - Ssl -> ssl.receive(socket, amount) - } -} - -pub fn send( - transport: Transport, - socket: Socket, - data: BytesBuilder, -) -> Result(Nil, SocketReason) { - case transport { - Tcp -> tcp.send(socket, data) - Ssl -> ssl.send(socket, data) - } -} - -pub fn close(transport: Transport, socket: Socket) -> Result(Nil, SocketReason) { - case transport { - Tcp -> tcp.close(socket) - Ssl -> ssl.close(socket) - } -} - -pub fn shutdown( - transport: Transport, - socket: Socket, -) -> Result(Nil, SocketReason) { - case transport { - Tcp -> tcp.shutdown(socket) - Ssl -> ssl.shutdown(socket) - } -} - -pub fn set_opts( - transport: Transport, - socket: Socket, - opts: List(options.TcpOption), -) -> Result(Nil, Nil) { - case transport { - Tcp -> tcp.set_opts(socket, opts) - Ssl -> ssl.set_opts(socket, opts) - } -} - -pub fn negotiated_protocol( - transport: Transport, - socket: Socket, -) -> Result(String, String) { - case transport { - Tcp -> Error("Can't negotiate protocol on tcp") - Ssl -> ssl.negotiated_protocol(socket) - } -} - -pub fn peername( - transport: Transport, - socket: Socket, -) -> Result(#(#(Int, Int, Int, Int), Int), Nil) { - case transport { - Tcp -> tcp.peername(socket) - Ssl -> ssl.peername(socket) - } -} - -@external(erlang, "socket", "info") -pub fn socket_info(socket: Socket) -> Dict(Atom, Dynamic) diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten@internal@acceptor.erl b/lsp/bet-lsp/build/packages/glisten/src/glisten@internal@acceptor.erl deleted file mode 100644 index 4de508c..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten@internal@acceptor.erl +++ /dev/null @@ -1,151 +0,0 @@ --module(glisten@internal@acceptor). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([start/1, start_pool/1]). --export_type([acceptor_message/0, acceptor_error/0, acceptor_state/0, pool/2]). - --type acceptor_message() :: {accept_connection, glisten@socket:listen_socket()}. - --type acceptor_error() :: accept_error | handler_error | control_error. - --type acceptor_state() :: {acceptor_state, - gleam@erlang@process:subject(acceptor_message()), - gleam@option:option(glisten@socket:socket()), - glisten@transport:transport()}. - --type pool(HPZ, HQA) :: {pool, - glisten@socket:listen_socket(), - fun((glisten@internal@handler:loop_message(HPZ), HQA, glisten@internal@handler:connection(HPZ)) -> gleam@otp@actor:next(glisten@internal@handler:loop_message(HPZ), HQA)), - integer(), - fun((glisten@internal@handler:connection(HPZ)) -> {HQA, - gleam@option:option(gleam@erlang@process:selector(HPZ))}), - gleam@option:option(fun((HQA) -> nil)), - glisten@transport:transport()}. - --spec start(pool(any(), any())) -> {ok, - gleam@erlang@process:subject(acceptor_message())} | - {error, gleam@otp@actor:start_error()}. -start(Pool) -> - gleam@otp@actor:start_spec( - {spec, - fun() -> - Subject = gleam@erlang@process:new_subject(), - Selector = begin - _pipe = gleam_erlang_ffi:new_selector(), - gleam@erlang@process:selecting( - _pipe, - Subject, - fun gleam@function:identity/1 - ) - end, - gleam@erlang@process:send( - Subject, - {accept_connection, erlang:element(2, Pool)} - ), - {ready, - {acceptor_state, Subject, none, erlang:element(7, Pool)}, - Selector} - end, - 1000, - fun(Msg, State) -> - {acceptor_state, Sender, _, _} = State, - case Msg of - {accept_connection, Listener} -> - Res = (gleam@result:then( - begin - _pipe@1 = glisten@transport:accept( - erlang:element(4, State), - Listener - ), - gleam@result:replace_error( - _pipe@1, - accept_error - ) - end, - fun(Sock) -> - gleam@result:then( - begin - _pipe@2 = {handler, - Sock, - erlang:element(3, Pool), - erlang:element(5, Pool), - erlang:element(6, Pool), - erlang:element(7, Pool)}, - _pipe@3 = glisten@internal@handler:start( - _pipe@2 - ), - gleam@result:replace_error( - _pipe@3, - handler_error - ) - end, - fun(Start) -> _pipe@4 = Sock, - _pipe@5 = glisten@transport:controlling_process( - erlang:element(4, State), - _pipe@4, - gleam@erlang@process:subject_owner( - Start - ) - ), - _pipe@6 = gleam@result:replace_error( - _pipe@5, - control_error - ), - gleam@result:map( - _pipe@6, - fun(_) -> - gleam@erlang@process:send( - Start, - {internal, ready} - ) - end - ) end - ) - end - )), - case Res of - {error, Reason} -> - glisten@internal@logger:error( - {<<"Failed to accept/start handler"/utf8>>, - Reason} - ), - {stop, - {abnormal, - <<"Failed to accept/start handler"/utf8>>}}; - - _ -> - gleam@otp@actor:send( - Sender, - {accept_connection, Listener} - ), - gleam@otp@actor:continue(State) - end - end - end} - ). - --spec start_pool(pool(any(), any())) -> {ok, - gleam@erlang@process:subject(gleam@otp@supervisor:message())} | - {error, gleam@otp@actor:start_error()}. -start_pool(Pool) -> - gleam@otp@supervisor:start_spec( - {spec, - nil, - 100, - 1, - fun(Children) -> - _pipe = gleam@iterator:range(0, erlang:element(4, Pool)), - gleam@iterator:fold( - _pipe, - Children, - fun(Children@1, _) -> - gleam@otp@supervisor:add( - Children@1, - gleam@otp@supervisor:worker( - fun(_) -> start(Pool) end - ) - ) - end - ) - end} - ). diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten@internal@handler.erl b/lsp/bet-lsp/build/packages/glisten/src/glisten@internal@handler.erl deleted file mode 100644 index 2fc20a4..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten@internal@handler.erl +++ /dev/null @@ -1,285 +0,0 @@ --module(glisten@internal@handler). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([start/1]). --export_type([internal_message/0, message/1, loop_message/1, loop_state/2, connection/1, handler/2]). - --type internal_message() :: close | - ready | - {receive_message, bitstring()} | - ssl_closed | - tcp_closed. - --type message(HGV) :: {internal, internal_message()} | {user, HGV}. - --type loop_message(HGW) :: {packet, bitstring()} | {custom, HGW}. - --type loop_state(HGX, HGY) :: {loop_state, - {ok, {{integer(), integer(), integer(), integer()}, integer()}} | - {error, nil}, - glisten@socket:socket(), - gleam@erlang@process:subject(message(HGX)), - glisten@transport:transport(), - HGY}. - --type connection(HGZ) :: {connection, - {ok, {{integer(), integer(), integer(), integer()}, integer()}} | - {error, nil}, - glisten@socket:socket(), - glisten@transport:transport(), - gleam@erlang@process:subject(message(HGZ))}. - --type handler(HHA, HHB) :: {handler, - glisten@socket:socket(), - fun((loop_message(HHA), HHB, connection(HHA)) -> gleam@otp@actor:next(loop_message(HHA), HHB)), - fun((connection(HHA)) -> {HHB, - gleam@option:option(gleam@erlang@process:selector(HHA))}), - gleam@option:option(fun((HHB) -> nil)), - glisten@transport:transport()}. - --spec start(handler(HHL, any())) -> {ok, - gleam@erlang@process:subject(message(HHL))} | - {error, gleam@otp@actor:start_error()}. -start(Handler) -> - gleam@otp@actor:start_spec( - {spec, - fun() -> - Subject = gleam@erlang@process:new_subject(), - Client_ip = glisten@transport:peername( - erlang:element(6, Handler), - erlang:element(2, Handler) - ), - Connection = {connection, - Client_ip, - erlang:element(2, Handler), - erlang:element(6, Handler), - Subject}, - {Initial_state, User_selector} = (erlang:element(4, Handler))( - Connection - ), - Selector = begin - _pipe = gleam_erlang_ffi:new_selector(), - _pipe@4 = gleam@erlang@process:selecting_record3( - _pipe, - erlang:binary_to_atom(<<"tcp"/utf8>>), - fun(_, Data) -> _pipe@1 = Data, - _pipe@2 = gleam@dynamic:bit_array(_pipe@1), - _pipe@3 = gleam@result:unwrap(_pipe@2, <<>>), - {receive_message, _pipe@3} end - ), - _pipe@8 = gleam@erlang@process:selecting_record3( - _pipe@4, - erlang:binary_to_atom(<<"ssl"/utf8>>), - fun(_, Data@1) -> _pipe@5 = Data@1, - _pipe@6 = gleam@dynamic:bit_array(_pipe@5), - _pipe@7 = gleam@result:unwrap(_pipe@6, <<>>), - {receive_message, _pipe@7} end - ), - _pipe@9 = gleam@erlang@process:selecting_record2( - _pipe@8, - erlang:binary_to_atom(<<"ssl_closed"/utf8>>), - fun(_) -> ssl_closed end - ), - _pipe@10 = gleam@erlang@process:selecting_record2( - _pipe@9, - erlang:binary_to_atom(<<"tcp_closed"/utf8>>), - fun(_) -> tcp_closed end - ), - _pipe@11 = gleam_erlang_ffi:map_selector( - _pipe@10, - fun(Field@0) -> {internal, Field@0} end - ), - gleam@erlang@process:selecting( - _pipe@11, - Subject, - fun gleam@function:identity/1 - ) - end, - Selector@1 = case User_selector of - {some, Sel} -> - _pipe@12 = Sel, - _pipe@13 = gleam_erlang_ffi:map_selector( - _pipe@12, - fun(Field@0) -> {user, Field@0} end - ), - gleam_erlang_ffi:merge_selector(Selector, _pipe@13); - - _ -> - Selector - end, - {ready, - {loop_state, - Client_ip, - erlang:element(2, Handler), - Subject, - erlang:element(6, Handler), - Initial_state}, - Selector@1} - end, - 1000, - fun(Msg, State) -> - Connection@1 = {connection, - erlang:element(2, State), - erlang:element(3, State), - erlang:element(5, State), - erlang:element(4, State)}, - case Msg of - {internal, tcp_closed} -> - case glisten@transport:close( - erlang:element(5, State), - erlang:element(3, State) - ) of - {ok, nil} -> - _ = case erlang:element(5, Handler) of - {some, On_close} -> - On_close(erlang:element(6, State)); - - _ -> - nil - end, - {stop, normal}; - - {error, Err} -> - {stop, {abnormal, gleam@string:inspect(Err)}} - end; - - {internal, ssl_closed} -> - case glisten@transport:close( - erlang:element(5, State), - erlang:element(3, State) - ) of - {ok, nil} -> - _ = case erlang:element(5, Handler) of - {some, On_close} -> - On_close(erlang:element(6, State)); - - _ -> - nil - end, - {stop, normal}; - - {error, Err} -> - {stop, {abnormal, gleam@string:inspect(Err)}} - end; - - {internal, close} -> - case glisten@transport:close( - erlang:element(5, State), - erlang:element(3, State) - ) of - {ok, nil} -> - _ = case erlang:element(5, Handler) of - {some, On_close} -> - On_close(erlang:element(6, State)); - - _ -> - nil - end, - {stop, normal}; - - {error, Err} -> - {stop, {abnormal, gleam@string:inspect(Err)}} - end; - - {internal, ready} -> - _pipe@14 = erlang:element(3, State), - _pipe@15 = glisten@transport:handshake( - erlang:element(5, State), - _pipe@14 - ), - _pipe@16 = gleam@result:replace_error( - _pipe@15, - <<"Failed to handshake socket"/utf8>> - ), - _pipe@18 = gleam@result:then( - _pipe@16, - fun(_) -> - _pipe@17 = glisten@transport:set_opts( - erlang:element(5, State), - erlang:element(3, State), - [{active_mode, once}] - ), - gleam@result:replace_error( - _pipe@17, - <<"Failed to set socket active"/utf8>> - ) - end - ), - _pipe@19 = gleam@result:replace( - _pipe@18, - gleam@otp@actor:continue(State) - ), - _pipe@20 = gleam@result:map_error( - _pipe@19, - fun(Reason) -> {stop, {abnormal, Reason}} end - ), - gleam@result:unwrap_both(_pipe@20); - - {user, Msg@1} -> - Msg@2 = {custom, Msg@1}, - case (erlang:element(3, Handler))( - Msg@2, - erlang:element(6, State), - Connection@1 - ) of - {continue, Next_state, _} -> - _assert_subject = glisten@transport:set_opts( - erlang:element(5, State), - erlang:element(3, State), - [{active_mode, once}] - ), - {ok, nil} = case _assert_subject of - {ok, nil} -> _assert_subject; - _assert_fail -> - erlang:error( - #{gleam_error => let_assert, - message => <<"Assertion pattern match failed"/utf8>>, - value => _assert_fail, - module => <<"glisten/internal/handler"/utf8>>, - function => <<"start"/utf8>>, - line => 175} - ) - end, - gleam@otp@actor:continue( - erlang:setelement(6, State, Next_state) - ); - - {stop, Reason@1} -> - {stop, Reason@1} - end; - - {internal, {receive_message, Msg@3}} -> - Msg@4 = {packet, Msg@3}, - case (erlang:element(3, Handler))( - Msg@4, - erlang:element(6, State), - Connection@1 - ) of - {continue, Next_state@1, _} -> - _assert_subject@1 = glisten@transport:set_opts( - erlang:element(5, State), - erlang:element(3, State), - [{active_mode, once}] - ), - {ok, nil} = case _assert_subject@1 of - {ok, nil} -> _assert_subject@1; - _assert_fail@1 -> - erlang:error( - #{gleam_error => let_assert, - message => <<"Assertion pattern match failed"/utf8>>, - value => _assert_fail@1, - module => <<"glisten/internal/handler"/utf8>>, - function => <<"start"/utf8>>, - line => 188} - ) - end, - gleam@otp@actor:continue( - erlang:setelement(6, State, Next_state@1) - ); - - {stop, Reason@2} -> - {stop, Reason@2} - end - end - end} - ). diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten@internal@logger.erl b/lsp/bet-lsp/build/packages/glisten/src/glisten@internal@logger.erl deleted file mode 100644 index ed3d3de..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten@internal@logger.erl +++ /dev/null @@ -1,8 +0,0 @@ --module(glisten@internal@logger). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([error/1]). - --spec error(any()) -> nil. -error(Data) -> - logger:error(unicode:characters_to_list(<<"~tp"/utf8>>), [Data]). diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten@socket.erl b/lsp/bet-lsp/build/packages/glisten/src/glisten@socket.erl deleted file mode 100644 index 969a495..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten@socket.erl +++ /dev/null @@ -1,90 +0,0 @@ --module(glisten@socket). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export_type([socket_reason/0, listen_socket/0, socket/0]). - --type socket_reason() :: closed | - timeout | - badarg | - terminated | - eaddrinuse | - eaddrnotavail | - eafnosupport | - ealready | - econnaborted | - econnrefused | - econnreset | - edestaddrreq | - ehostdown | - ehostunreach | - einprogress | - eisconn | - emsgsize | - enetdown | - enetunreach | - enopkg | - enoprotoopt | - enotconn | - enotty | - enotsock | - eproto | - eprotonosupport | - eprototype | - esocktnosupport | - etimedout | - ewouldblock | - exbadport | - exbadseq | - eacces | - eagain | - ebadf | - ebadmsg | - ebusy | - edeadlk | - edeadlock | - edquot | - eexist | - efault | - efbig | - eftype | - eintr | - einval | - eio | - eisdir | - eloop | - emfile | - emlink | - emultihop | - enametoolong | - enfile | - enobufs | - enodev | - enolck | - enolink | - enoent | - enomem | - enospc | - enosr | - enostr | - enosys | - enotblk | - enotdir | - enotsup | - enxio | - eopnotsupp | - eoverflow | - eperm | - epipe | - erange | - erofs | - espipe | - esrch | - estale | - etxtbsy | - exdev. - --opaque listen_socket() :: listen_socket. - --opaque socket() :: socket. - - diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten@socket@options.erl b/lsp/bet-lsp/build/packages/glisten/src/glisten@socket@options.erl deleted file mode 100644 index 1b4ed3c..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten@socket@options.erl +++ /dev/null @@ -1,80 +0,0 @@ --module(glisten@socket@options). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([to_dict/1, merge_with_defaults/1]). --export_type([socket_mode/0, active_state/0, tcp_option/0]). - --type socket_mode() :: binary. - --type active_state() :: once | passive | {count, integer()} | active. - --type tcp_option() :: {backlog, integer()} | - {nodelay, boolean()} | - {linger, {boolean(), integer()}} | - {send_timeout, integer()} | - {send_timeout_close, boolean()} | - {reuseaddr, boolean()} | - {active_mode, active_state()} | - {mode, socket_mode()} | - {certfile, binary()} | - {keyfile, binary()} | - {alpn_preferred_protocols, list(binary())} | - inet6. - --spec to_dict(list(tcp_option())) -> gleam@dict:dict(gleam@erlang@atom:atom_(), gleam@dynamic:dynamic_()). -to_dict(Options) -> - Opt_decoder = gleam@dynamic:tuple2( - fun gleam@dynamic:dynamic/1, - fun gleam@dynamic:dynamic/1 - ), - _pipe = Options, - _pipe@1 = gleam@list:map(_pipe, fun(Opt) -> case Opt of - {active_mode, passive} -> - gleam@dynamic:from( - {erlang:binary_to_atom(<<"active"/utf8>>), false} - ); - - {active_mode, active} -> - gleam@dynamic:from( - {erlang:binary_to_atom(<<"active"/utf8>>), true} - ); - - {active_mode, {count, N}} -> - gleam@dynamic:from( - {erlang:binary_to_atom(<<"active"/utf8>>), N} - ); - - {active_mode, once} -> - gleam@dynamic:from( - {erlang:binary_to_atom(<<"active"/utf8>>), - erlang:binary_to_atom(<<"once"/utf8>>)} - ); - - Other -> - gleam@dynamic:from(Other) - end end), - _pipe@2 = gleam@list:filter_map(_pipe@1, Opt_decoder), - _pipe@3 = gleam@list:map( - _pipe@2, - fun(_capture) -> - gleam@pair:map_first(_capture, fun gleam@dynamic:unsafe_coerce/1) - end - ), - maps:from_list(_pipe@3). - --spec merge_with_defaults(list(tcp_option())) -> list(tcp_option()). -merge_with_defaults(Options) -> - Overrides = to_dict(Options), - _pipe = [{backlog, 1024}, - {nodelay, true}, - {send_timeout, 30000}, - {send_timeout_close, true}, - {reuseaddr, true}, - {mode, binary}, - {active_mode, passive}], - _pipe@1 = to_dict(_pipe), - _pipe@2 = gleam@dict:merge(_pipe@1, Overrides), - _pipe@3 = maps:to_list(_pipe@2), - _pipe@4 = gleam@list:map(_pipe@3, fun gleam@dynamic:from/1), - _pipe@5 = gleam@list:map(_pipe@4, fun gleam@dynamic:unsafe_coerce/1), - gleam@list:append(_pipe@5, [inet6]). diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten@ssl.erl b/lsp/bet-lsp/build/packages/glisten/src/glisten@ssl.erl deleted file mode 100644 index 63e7ad7..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten@ssl.erl +++ /dev/null @@ -1,104 +0,0 @@ --module(glisten@ssl). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([controlling_process/2, accept_timeout/2, accept/1, receive_timeout/3, 'receive'/2, send/2, close/1, do_shutdown/2, shutdown/1, set_opts/2, handshake/1, listen/2, negotiated_protocol/1, peername/1, start/0]). - --spec controlling_process(glisten@socket:socket(), gleam@erlang@process:pid_()) -> {ok, - nil} | - {error, gleam@erlang@atom:atom_()}. -controlling_process(Socket, Pid) -> - glisten_ssl_ffi:controlling_process(Socket, Pid). - --spec accept_timeout(glisten@socket:listen_socket(), integer()) -> {ok, - glisten@socket:socket()} | - {error, glisten@socket:socket_reason()}. -accept_timeout(Socket, Timeout) -> - ssl:transport_accept(Socket, Timeout). - --spec accept(glisten@socket:listen_socket()) -> {ok, glisten@socket:socket()} | - {error, glisten@socket:socket_reason()}. -accept(Socket) -> - ssl:transport_accept(Socket). - --spec receive_timeout(glisten@socket:socket(), integer(), integer()) -> {ok, - bitstring()} | - {error, glisten@socket:socket_reason()}. -receive_timeout(Socket, Length, Timeout) -> - ssl:recv(Socket, Length, Timeout). - --spec 'receive'(glisten@socket:socket(), integer()) -> {ok, bitstring()} | - {error, glisten@socket:socket_reason()}. -'receive'(Socket, Length) -> - ssl:recv(Socket, Length). - --spec send(glisten@socket:socket(), gleam@bytes_builder:bytes_builder()) -> {ok, - nil} | - {error, glisten@socket:socket_reason()}. -send(Socket, Packet) -> - glisten_ssl_ffi:send(Socket, Packet). - --spec close(glisten@socket:socket()) -> {ok, nil} | - {error, glisten@socket:socket_reason()}. -close(Socket) -> - glisten_ssl_ffi:close(Socket). - --spec do_shutdown(glisten@socket:socket(), gleam@erlang@atom:atom_()) -> {ok, - nil} | - {error, glisten@socket:socket_reason()}. -do_shutdown(Socket, Write) -> - glisten_ssl_ffi:shutdown(Socket, Write). - --spec shutdown(glisten@socket:socket()) -> {ok, nil} | - {error, glisten@socket:socket_reason()}. -shutdown(Socket) -> - _assert_subject = gleam_erlang_ffi:atom_from_string(<<"write"/utf8>>), - {ok, Write} = 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 => <<"glisten/ssl"/utf8>>, - function => <<"shutdown"/utf8>>, - line => 48}) - end, - glisten_ssl_ffi:shutdown(Socket, Write). - --spec set_opts( - glisten@socket:socket(), - list(glisten@socket@options:tcp_option()) -) -> {ok, nil} | {error, nil}. -set_opts(Socket, Opts) -> - _pipe = Opts, - _pipe@1 = glisten@socket@options:to_dict(_pipe), - _pipe@2 = maps:to_list(_pipe@1), - _pipe@3 = gleam@list:map(_pipe@2, fun gleam@dynamic:from/1), - glisten_ssl_ffi:set_opts(Socket, _pipe@3). - --spec handshake(glisten@socket:socket()) -> {ok, glisten@socket:socket()} | - {error, nil}. -handshake(Socket) -> - ssl:handshake(Socket). - --spec listen(integer(), list(glisten@socket@options:tcp_option())) -> {ok, - glisten@socket:listen_socket()} | - {error, glisten@socket:socket_reason()}. -listen(Port, Options) -> - _pipe = Options, - _pipe@1 = glisten@socket@options:merge_with_defaults(_pipe), - ssl:listen(Port, _pipe@1). - --spec negotiated_protocol(glisten@socket:socket()) -> {ok, binary()} | - {error, binary()}. -negotiated_protocol(Socket) -> - glisten_ssl_ffi:negotiated_protocol(Socket). - --spec peername(glisten@socket:socket()) -> {ok, - {{integer(), integer(), integer(), integer()}, integer()}} | - {error, nil}. -peername(Socket) -> - ssl:peername(Socket). - --spec start() -> {ok, nil} | {error, gleam@dynamic:dynamic_()}. -start() -> - glisten_ssl_ffi:start_ssl(). diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten@tcp.erl b/lsp/bet-lsp/build/packages/glisten/src/glisten@tcp.erl deleted file mode 100644 index 8cbacd6..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten@tcp.erl +++ /dev/null @@ -1,102 +0,0 @@ --module(glisten@tcp). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([controlling_process/2, accept_timeout/2, accept/1, receive_timeout/3, 'receive'/2, send/2, socket_info/1, close/1, do_shutdown/2, shutdown/1, set_opts/2, listen/2, handshake/1, negotiated_protocol/1, peername/1]). - --spec controlling_process(glisten@socket:socket(), gleam@erlang@process:pid_()) -> {ok, - nil} | - {error, gleam@erlang@atom:atom_()}. -controlling_process(Socket, Pid) -> - glisten_tcp_ffi:controlling_process(Socket, Pid). - --spec accept_timeout(glisten@socket:listen_socket(), integer()) -> {ok, - glisten@socket:socket()} | - {error, glisten@socket:socket_reason()}. -accept_timeout(Socket, Timeout) -> - gen_tcp:accept(Socket, Timeout). - --spec accept(glisten@socket:listen_socket()) -> {ok, glisten@socket:socket()} | - {error, glisten@socket:socket_reason()}. -accept(Socket) -> - gen_tcp:accept(Socket). - --spec receive_timeout(glisten@socket:socket(), integer(), integer()) -> {ok, - bitstring()} | - {error, glisten@socket:socket_reason()}. -receive_timeout(Socket, Length, Timeout) -> - gen_tcp:recv(Socket, Length, Timeout). - --spec 'receive'(glisten@socket:socket(), integer()) -> {ok, bitstring()} | - {error, glisten@socket:socket_reason()}. -'receive'(Socket, Length) -> - gen_tcp:recv(Socket, Length). - --spec send(glisten@socket:socket(), gleam@bytes_builder:bytes_builder()) -> {ok, - nil} | - {error, glisten@socket:socket_reason()}. -send(Socket, Packet) -> - glisten_tcp_ffi:send(Socket, Packet). - --spec socket_info(glisten@socket:socket()) -> gleam@dict:dict(any(), any()). -socket_info(Socket) -> - socket:info(Socket). - --spec close(any()) -> {ok, nil} | {error, glisten@socket:socket_reason()}. -close(Socket) -> - glisten_tcp_ffi:close(Socket). - --spec do_shutdown(glisten@socket:socket(), gleam@erlang@atom:atom_()) -> {ok, - nil} | - {error, glisten@socket:socket_reason()}. -do_shutdown(Socket, Write) -> - glisten_tcp_ffi:shutdown(Socket, Write). - --spec shutdown(glisten@socket:socket()) -> {ok, nil} | - {error, glisten@socket:socket_reason()}. -shutdown(Socket) -> - _assert_subject = gleam_erlang_ffi:atom_from_string(<<"write"/utf8>>), - {ok, Write} = 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 => <<"glisten/tcp"/utf8>>, - function => <<"shutdown"/utf8>>, - line => 51}) - end, - glisten_tcp_ffi:shutdown(Socket, Write). - --spec set_opts( - glisten@socket:socket(), - list(glisten@socket@options:tcp_option()) -) -> {ok, nil} | {error, nil}. -set_opts(Socket, Opts) -> - _pipe = Opts, - _pipe@1 = glisten@socket@options:to_dict(_pipe), - _pipe@2 = maps:to_list(_pipe@1), - _pipe@3 = gleam@list:map(_pipe@2, fun gleam@dynamic:from/1), - glisten_tcp_ffi:set_opts(Socket, _pipe@3). - --spec listen(integer(), list(glisten@socket@options:tcp_option())) -> {ok, - glisten@socket:listen_socket()} | - {error, glisten@socket:socket_reason()}. -listen(Port, Opts) -> - _pipe = Opts, - _pipe@1 = glisten@socket@options:merge_with_defaults(_pipe), - gen_tcp:listen(Port, _pipe@1). - --spec handshake(glisten@socket:socket()) -> {ok, glisten@socket:socket()} | - {error, nil}. -handshake(Socket) -> - {ok, Socket}. - --spec negotiated_protocol(glisten@socket:socket()) -> any(). -negotiated_protocol(Socket) -> - tcp:negotiated_protocol(Socket). - --spec peername(glisten@socket:socket()) -> {ok, - {{integer(), integer(), integer(), integer()}, integer()}} | - {error, nil}. -peername(Socket) -> - inet:peername(Socket). diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten@transport.erl b/lsp/bet-lsp/build/packages/glisten/src/glisten@transport.erl deleted file mode 100644 index 1171751..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten@transport.erl +++ /dev/null @@ -1,174 +0,0 @@ --module(glisten@transport). --compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). - --export([controlling_process/3, listen/3, accept_timeout/3, accept/2, handshake/2, receive_timeout/4, 'receive'/3, send/3, close/2, shutdown/2, set_opts/3, negotiated_protocol/2, peername/2, socket_info/1]). --export_type([transport/0]). - --type transport() :: tcp | ssl. - --spec controlling_process( - transport(), - glisten@socket:socket(), - gleam@erlang@process:pid_() -) -> {ok, nil} | {error, gleam@erlang@atom:atom_()}. -controlling_process(Transport, Socket, Pid) -> - case Transport of - tcp -> - glisten_tcp_ffi:controlling_process(Socket, Pid); - - ssl -> - glisten_ssl_ffi:controlling_process(Socket, Pid) - end. - --spec listen(transport(), integer(), list(glisten@socket@options:tcp_option())) -> {ok, - glisten@socket:listen_socket()} | - {error, glisten@socket:socket_reason()}. -listen(Transport, Port, Opts) -> - case Transport of - tcp -> - glisten@tcp:listen(Port, Opts); - - ssl -> - glisten@ssl:listen(Port, Opts) - end. - --spec accept_timeout(transport(), glisten@socket:listen_socket(), integer()) -> {ok, - glisten@socket:socket()} | - {error, glisten@socket:socket_reason()}. -accept_timeout(Transport, Socket, Timeout) -> - case Transport of - tcp -> - gen_tcp:accept(Socket, Timeout); - - ssl -> - ssl:transport_accept(Socket, Timeout) - end. - --spec accept(transport(), glisten@socket:listen_socket()) -> {ok, - glisten@socket:socket()} | - {error, glisten@socket:socket_reason()}. -accept(Transport, Socket) -> - case Transport of - tcp -> - gen_tcp:accept(Socket); - - ssl -> - ssl:transport_accept(Socket) - end. - --spec handshake(transport(), glisten@socket:socket()) -> {ok, - glisten@socket:socket()} | - {error, nil}. -handshake(Transport, Socket) -> - case Transport of - tcp -> - glisten@tcp:handshake(Socket); - - ssl -> - ssl:handshake(Socket) - end. - --spec receive_timeout( - transport(), - glisten@socket:socket(), - integer(), - integer() -) -> {ok, bitstring()} | {error, glisten@socket:socket_reason()}. -receive_timeout(Transport, Socket, Amount, Timeout) -> - case Transport of - tcp -> - gen_tcp:recv(Socket, Amount, Timeout); - - ssl -> - ssl:recv(Socket, Amount, Timeout) - end. - --spec 'receive'(transport(), glisten@socket:socket(), integer()) -> {ok, - bitstring()} | - {error, glisten@socket:socket_reason()}. -'receive'(Transport, Socket, Amount) -> - case Transport of - tcp -> - gen_tcp:recv(Socket, Amount); - - ssl -> - ssl:recv(Socket, Amount) - end. - --spec send( - transport(), - glisten@socket:socket(), - gleam@bytes_builder:bytes_builder() -) -> {ok, nil} | {error, glisten@socket:socket_reason()}. -send(Transport, Socket, Data) -> - case Transport of - tcp -> - glisten_tcp_ffi:send(Socket, Data); - - ssl -> - glisten_ssl_ffi:send(Socket, Data) - end. - --spec close(transport(), glisten@socket:socket()) -> {ok, nil} | - {error, glisten@socket:socket_reason()}. -close(Transport, Socket) -> - case Transport of - tcp -> - glisten_tcp_ffi:close(Socket); - - ssl -> - glisten_ssl_ffi:close(Socket) - end. - --spec shutdown(transport(), glisten@socket:socket()) -> {ok, nil} | - {error, glisten@socket:socket_reason()}. -shutdown(Transport, Socket) -> - case Transport of - tcp -> - glisten@tcp:shutdown(Socket); - - ssl -> - glisten@ssl:shutdown(Socket) - end. - --spec set_opts( - transport(), - glisten@socket:socket(), - list(glisten@socket@options:tcp_option()) -) -> {ok, nil} | {error, nil}. -set_opts(Transport, Socket, Opts) -> - case Transport of - tcp -> - glisten@tcp:set_opts(Socket, Opts); - - ssl -> - glisten@ssl:set_opts(Socket, Opts) - end. - --spec negotiated_protocol(transport(), glisten@socket:socket()) -> {ok, - binary()} | - {error, binary()}. -negotiated_protocol(Transport, Socket) -> - case Transport of - tcp -> - {error, <<"Can't negotiate protocol on tcp"/utf8>>}; - - ssl -> - glisten_ssl_ffi:negotiated_protocol(Socket) - end. - --spec peername(transport(), glisten@socket:socket()) -> {ok, - {{integer(), integer(), integer(), integer()}, integer()}} | - {error, nil}. -peername(Transport, Socket) -> - case Transport of - tcp -> - inet:peername(Socket); - - ssl -> - ssl:peername(Socket) - end. - --spec socket_info(glisten@socket:socket()) -> gleam@dict:dict(gleam@erlang@atom:atom_(), gleam@dynamic:dynamic_()). -socket_info(Socket) -> - socket:info(Socket). diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten_ssl_ffi.erl b/lsp/bet-lsp/build/packages/glisten/src/glisten_ssl_ffi.erl deleted file mode 100644 index 8c8c6fe..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten_ssl_ffi.erl +++ /dev/null @@ -1,60 +0,0 @@ --module(glisten_ssl_ffi). - --export([controlling_process/2, send/2, set_opts/2, start_ssl/0, shutdown/2, close/1, - negotiated_protocol/1]). - -send(Socket, Packet) -> - case ssl:send(Socket, Packet) of - ok -> - {ok, nil}; - Res -> - Res - end. - -set_opts(Socket, Options) -> - case ssl:setopts(Socket, Options) of - ok -> - {ok, nil}; - {error, Reason} -> - {error, Reason} - end. - -controlling_process(Socket, Pid) -> - case ssl:controlling_process(Socket, Pid) of - ok -> - {ok, nil}; - {error, Reason} -> - {error, Reason} - end. - -start_ssl() -> - case application:ensure_all_started(ssl) of - {ok, _} -> - {ok, nil}; - {error, Reason} -> - {error, Reason} - end. - -shutdown(Socket, How) -> - case ssl:shutdown(Socket, How) of - ok -> - {ok, nil}; - {error, Reason} -> - {error, Reason} - end. - -close(Socket) -> - case ssl:close(Socket) of - ok -> - {ok, nil}; - {error, Reason} -> - {error, Reason} - end. - -negotiated_protocol(Socket) -> - case ssl:negotiated_protocol(Socket) of - {error, _} -> - {error, "Socket not negotiated"}; - Protocol -> - Protocol - end. diff --git a/lsp/bet-lsp/build/packages/glisten/src/glisten_tcp_ffi.erl b/lsp/bet-lsp/build/packages/glisten/src/glisten_tcp_ffi.erl deleted file mode 100644 index f4a2005..0000000 --- a/lsp/bet-lsp/build/packages/glisten/src/glisten_tcp_ffi.erl +++ /dev/null @@ -1,43 +0,0 @@ --module(glisten_tcp_ffi). - --export([controlling_process/2, send/2, set_opts/2, shutdown/2, close/1]). - -send(Socket, Packet) -> - case gen_tcp:send(Socket, Packet) of - ok -> - {ok, nil}; - Res -> - Res - end. - -set_opts(Socket, Options) -> - case inet:setopts(Socket, Options) of - ok -> - {ok, nil}; - {error, Reason} -> - {error, Reason} - end. - -controlling_process(Socket, Pid) -> - case gen_tcp:controlling_process(Socket, Pid) of - ok -> - {ok, nil}; - {error, Reason} -> - {error, Reason} - end. - -shutdown(Socket, How) -> - case gen_tcp:shutdown(Socket, How) of - ok -> - {ok, nil}; - {error, Reason} -> - {error, Reason} - end. - -close(Socket) -> - case gen_tcp:close(Socket) of - ok -> - {ok, nil}; - {error, Reason} -> - {error, Reason} - end. diff --git a/lsp/bet-lsp/build/packages/packages.toml b/lsp/bet-lsp/build/packages/packages.toml deleted file mode 100644 index b40876c..0000000 --- a/lsp/bet-lsp/build/packages/packages.toml +++ /dev/null @@ -1,9 +0,0 @@ -[packages] -gleeunit = "1.9.0" -glisten = "2.0.0" -gleam_erlang = "0.34.0" -gleam_json = "1.0.1" -gleam_stdlib = "0.68.1" -gleam_http = "3.7.2" -gleam_otp = "0.16.1" -thoas = "1.2.1" diff --git a/lsp/bet-lsp/build/packages/thoas/CHANGELOG.md b/lsp/bet-lsp/build/packages/thoas/CHANGELOG.md deleted file mode 100644 index 5e1ccef..0000000 --- a/lsp/bet-lsp/build/packages/thoas/CHANGELOG.md +++ /dev/null @@ -1,45 +0,0 @@ -# Changelog - -## v1.2.1 - 2024-05-13 - -- Corrected typespec. - -## v1.2.0 - 2023-10-17 - -- The `thoas:decode/2` function now accepts the `keys` option which can be one - of `reference`, `copy`, `to_existing_atom`, or `to_atom`. - -## v1.1.1 - 2023-10-11 - -- Corrected an incorrect typespec. - -## v1.1.0 - 2023-10-11 - -- Dates and datetimes may now be encoded with `thoas:encode/2`. - -## v1.0.0 - 2023-01-23 - -- `float_to_binary(Float, [short])` is now used for encoding floats. This - improves performance and memory usage, but means this library now requires OTP - 25.0 or later. - -## v0.4.1 - 2023-01-23 - -- Corrected the `json_term` type to include `null`, `true`, and `false`. - -## v0.4.0 - 2022-08-26 - -- Adds support for integer keys. - -## v0.3.0 - 2022-07-27 - -- Proplists may now be encoded with `thoas:encode/2`. - -## v0.2.0 - 2021-12-29 - -- The atom `null` is now used to represent `null`, not `nil` as was previously - used. - -## v0.1.0 - 2021-12-28 - -- Initial version diff --git a/lsp/bet-lsp/build/packages/thoas/LICENSE b/lsp/bet-lsp/build/packages/thoas/LICENSE deleted file mode 100644 index 420c27d..0000000 --- a/lsp/bet-lsp/build/packages/thoas/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2017 Michał Muskała - -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. \ No newline at end of file diff --git a/lsp/bet-lsp/build/packages/thoas/README.md b/lsp/bet-lsp/build/packages/thoas/README.md deleted file mode 100644 index 1404527..0000000 --- a/lsp/bet-lsp/build/packages/thoas/README.md +++ /dev/null @@ -1,124 +0,0 @@ -# Thoas - -A blazing fast JSON parser and generator in pure Erlang. - -Thoas is an Erlang conversion of the Elixir based [Jason library][jason]. - -The parser and generator are at least twice as fast as other Elixir/Erlang -libraries. The performance is comparable to `jiffy`, which is implemented in C -as a NIF. Thoas and Jason are usually only twice as slow. - -Both parser and generator fully conform to -[RFC 8259](https://tools.ietf.org/html/rfc8259) and -[ECMA 404](http://www.ecma-international.org/publications/standards/Ecma-404.htm) -standards. The parser is tested using [JSONTestSuite](https://github.com/nst/JSONTestSuite). - -If you like this library thank Michał and the Jason contributors. They did all -the hard work! - -## Installation - -### Erlang - -```erlang -% rebar.config -{deps, [thoas]} -``` - -### Gleam - -```shell -gleam add thoas -``` - -### Elixir - -```elixir -# mix.exs -def deps do - [{:thoas, "~> 1.0"}] -end -``` - -## Basic Usage - -```erlang -> JSON = thoas:encode(#{age => 44, name => <<"Steve Irwin">>, nationality => <<"Australian">>}). -<<"{\"age\":44,\"name\":\"Steve Irwin\",\"nationality\":\"Australian\"}">> - -> thoas:decode(JSON). -{ok,#{<<"age">> => 44,<<"name">> => <<"Steve Irwin">>, <<"nationality">> => <<"Australian">>}} - -> thoas:decode(JSON, #{keys => to_existing_atom}). -{ok,#{age => 44,name => <<"Steve Irwin">>, nationality => <<"Australian">>}} -``` - -## Erlang <-> JSON mapping - -Erlang | JSON ------- | ------ -`null` | `null` -`true` | `true` -`false` | `false` -`nil` | `"nil"` -`undefined` | `"undefined"` -`other_atom` | `"other_atom"` -`1` | `1` -`1.1` | `1.1` -`-2.0` | `-2.0` -`[]` | `[]` -`[1, 2]` | `[1,2]` -`"chars"` | `[99,104,97,114,115]` -`<<"text">>` | `"text"` -`<<"\n">>` | `"\\n"` -`#{}` | `{}` -`#{<<"name">> => <<"Lucy">>}` | `{"name":"Lucy"}` -`#{score => 42, win => true}` | `{"score":42,"win":true}` -`[{proplists, true}]` | `{"proplists":true}` - - -## Benchmarks - -Benchmarks against most popular Elixir & Erlang json libraries can be executed after -going into the `bench/` folder and then executing `mix bench.encode` and `mix bench.decode`. -A HTML report of the benchmarks (after their execution) can be found in -`bench/output/encode.html` and `bench/output/decode.html` respectively. - -## Differences to Jason - -Thoas has some feature differences compared to Jason. - -- Thoas is written in Erlang. -- Thoas has no support for Elixir protocols. -- Thoas has no support for pretty-printing JSON. -- Thoas has no support for detecting duplicate object keys. -- Thoas has no support for decoding objects to ordered dictionaries. -- Thoas has no support for decoding floats to Elixir decimals. -- Thoas has an additional non-recursive encoder API that may be useful when - working within statically typed languages such as Gleam. - -## Why not use Jason? - -Jason rocks, but if you're writing Erlang, Gleam, or some other BEAM language -you probably don't want to pull in the Elixir compiler and their standard -libraries just to get a really fast JSON parser. Thoas is just Erlang and uses -rebar3, so it can be easily added as a dependency to projects written in any -BEAM language. - -Thoas also has a non-recursive API that may be useful from statically typed -languages or in highly performance constrained scenarios. - -## Why is it called Thoas? - -Thoas is [a son of Jason](https://en.wikipedia.org/wiki/Thoas_(son_of_Jason)). - -## License - -Thoas is released under the Apache License 2.0 - see the [LICENSE](LICENSE) file. - -Thoas is based off of [Jason][jason], which is also Apache 2.0 licenced. - -Some elements of tests and benchmarks have their origins in the -[Poison library](https://github.com/devinus/poison) and were initially licensed under [CC0-1.0](https://creativecommons.org/publicdomain/zero/1.0/). - -[jason]: https://github.com/michalmuskala/jason diff --git a/lsp/bet-lsp/build/packages/thoas/rebar.config b/lsp/bet-lsp/build/packages/thoas/rebar.config deleted file mode 100644 index f8e731c..0000000 --- a/lsp/bet-lsp/build/packages/thoas/rebar.config +++ /dev/null @@ -1,18 +0,0 @@ -{erl_opts, [debug_info]}. -{deps, []}. - -{project_plugins, [rebar3_ex_doc, rebar3_hex]}. - -{hex, [{doc, #{provider => ex_doc}}]}. - -{ex_doc, [ - {extras, [ - {'CHANGELOG.md', #{title => <<"Changelog">>}}, - {'README.md', #{title => <<"Overview">>}}, - {'LICENSE', #{title => <<"License">>}} - ]}, - {main, <<"readme">>}, - {homepage_url, <<"https://github.com/lpil/thoas">>}, - {source_url, <<"https://github.com/lpil/thoas">>}, - {api_reference, false} -]}. diff --git a/lsp/bet-lsp/build/packages/thoas/rebar.lock b/lsp/bet-lsp/build/packages/thoas/rebar.lock deleted file mode 100644 index 57afcca..0000000 --- a/lsp/bet-lsp/build/packages/thoas/rebar.lock +++ /dev/null @@ -1 +0,0 @@ -[]. diff --git a/lsp/bet-lsp/build/packages/thoas/src/thoas.app.src b/lsp/bet-lsp/build/packages/thoas/src/thoas.app.src deleted file mode 100644 index 4d1b154..0000000 --- a/lsp/bet-lsp/build/packages/thoas/src/thoas.app.src +++ /dev/null @@ -1,10 +0,0 @@ -{application,thoas, - [{description,"A blazing fast JSON parser and generator in pure Erlang."}, - {vsn,"1.2.1"}, - {registered,[]}, - {applications,[kernel,stdlib]}, - {env,[]}, - {modules,[]}, - {licenses,["Apache 2.0"]}, - {links,[{"GitHub","https://github.com/lpil/thoas"}, - {"Sponsor","https://github.com/sponsors/lpil"}]}]}. diff --git a/lsp/bet-lsp/build/packages/thoas/src/thoas.erl b/lsp/bet-lsp/build/packages/thoas/src/thoas.erl deleted file mode 100644 index 0414c6d..0000000 --- a/lsp/bet-lsp/build/packages/thoas/src/thoas.erl +++ /dev/null @@ -1,151 +0,0 @@ --module(thoas). - --export([ - decode/1, decode/2, encode/1, encode/2, encode_to_iodata/1, - encode_to_iodata/2 -]). - --export_type([ - decode_error/0, decode_options/0, encode_options/0, json_term/0, - input_term/0 -]). - --type decode_options() :: #{ - strings => reference | copy, - keys => reference | copy | to_existing_atom | to_atom -}. - --type encode_options() :: #{ - escape => json | unicode | html | javascript -}. - --type json_term() :: - integer() | - float() | - binary() | - boolean() | - 'null' | - list(json_term()) | - #{ - binary() => json_term(), - atom() => json_term() - }. - --type input_term() :: - integer() | - float() | - binary() | - atom() | - calendar:datetime() | - calendar:date() | - list(input_term()) | - list({binary() | atom(), input_term()}) | - #{ binary() | atom() => input_term() }. - --type decode_error() :: - unexpected_end_of_input | - {unexpected_byte, binary(), integer()} | - {unexpected_sequence, binary(), integer()}. - -%% Decode JSON into Erlang terms. -%% --spec decode(iodata()) -> {ok, json_term()} | {error, decode_error()}. -decode(Json) -> - decode(Json, #{}). - -%% Decode JSON into Erlang terms. -%% -%% # Options -%% -%% Decoding of keys and string values can be controlled with the options -%% `strings` and `keys` respectively. They control how the values are decoded -%% into the final Erlang term structure. -%% -%% - Option values common to both `strings` and `keys` -%% - `reference` (default) - when possible thoas tries to create a -%% sub-binary into the original -%% - `copy` - always copies the sub-binary. This option is especially useful -%% when parts of the decoded data will be stored for a long time (in ETS -%% or some process state) to avoid keeping the reference to the original -%% data -%% -%% - Option values unique to `keys` -%% - `to_existing_atom` - convert keys to atoms if the atom already exists -%% - `to_atom` - convert all keys to new or existing atoms. **Caution:** only -%% use this if you know you need it, since atoms are not garbage -%% collected and there is a hard limit on the amount that can be created. -%% Should preferably only be used if the input data is trusted, or in -%% short running VM sessions -%% --spec decode(iodata(), decode_options()) -> - {ok, json_term()} | {error, decode_error()}. -decode(Json, Options) when is_map(Options) -> - Binary = iolist_to_binary(Json), - thoas_decode:decode(Binary, Options). - -%% Encode Erlang terms into JSON. -%% -%% Throws on invalid input. -%% --spec encode(input_term()) -> binary(). -encode(Term) -> - encode(Term, #{}). - -%% Encode Erlang terms into JSON. -%% -%% Throws on invalid input. -%% -%% # Options -%% -%% - `escape` -%% - `json` (default) - the regular JSON escaping as defined by RFC 7159. -%% - `javascript` - additionally escapes the LINE SEPARATOR (U+2028) and -%% PARAGRAPH SEPARATOR (U+2029) characters to make the produced JSON valid -%% JavaScript. -%% - `html` - similar to `javascript_safe`, but also escapes the / character -%% to prevent XSS. -%% - `unicode` - escapes all non-ascii characters. -%% --spec encode(input_term(), encode_options()) -> binary(). -encode(Input, Options) when is_map(Options) -> - iolist_to_binary(thoas_encode:encode(Input, Options)). - -%% Encode Erlang terms into JSON as iodata. -%% -%% This function should be preferred to encode/2, if the generated JSON will be -%% handed over to one of the IO functions or sent over the socket. The Erlang -%% runtime is able to leverage vectorised writes and avoid allocating a continuous -%% buffer for the whole resulting string, lowering memory use and increasing -%% performance. -%% -%% Throws on invalid input. -%% --spec encode_to_iodata(input_term()) -> iodata(). -encode_to_iodata(Term) -> - encode_to_iodata(Term, #{}). - -%% Encode Erlang terms into JSON as iodata. -%% -%% This function should be preferred to encode/2, if the generated JSON will be -%% handed over to one of the IO functions or sent over the socket. The Erlang -%% runtime is able to leverage vectorised writes and avoid allocating a continuous -%% buffer for the whole resulting string, lowering memory use and increasing -%% performance. -%% -%% Throws on invalid input. -%% -%% # Options -%% -%% - `escape` -%% - `json` (default) - the regular JSON escaping as defined by RFC 7159. -%% - `javascript` - additionally escapes the LINE SEPARATOR (U+2028) and -%% PARAGRAPH SEPARATOR (U+2029) characters to make the produced JSON valid -%% JavaScript. -%% - `html` - similar to `javascript_safe`, but also escapes the / character -%% to prevent XSS. -%% - `unicode` - escapes all non-ascii characters. -%% --spec encode_to_iodata(input_term(), encode_options()) -> iodata(). -encode_to_iodata(Input, Options) -> - thoas_encode:encode(Input, Options). - diff --git a/lsp/bet-lsp/build/packages/thoas/src/thoas_decode.erl b/lsp/bet-lsp/build/packages/thoas/src/thoas_decode.erl deleted file mode 100644 index bc82b11..0000000 --- a/lsp/bet-lsp/build/packages/thoas/src/thoas_decode.erl +++ /dev/null @@ -1,1185 +0,0 @@ --module(thoas_decode). - --compile([{inline, [ - {array, 6}, {object, 6}, {token_error, 3}, {token_error, 2}, - {throw_error, 2}, {continue, 7} -]}]). - --export([decode/2]). - -% We use integers instead of atoms to take advantage of the jump table optimization --define(terminate, 0). --define(array, 1). --define(key, 2). --define(object, 3). - -array(Rest, Input, Skip, Stack, StringDecode, KeyDecode) -> - value(Rest, Input, Skip, [?array, [] | Stack], StringDecode, KeyDecode). - -array(Data, Input, Skip, Stack, StringDecode, KeyDecode, Value) -> - case Data of - <<$\t/integer,Rest/bitstring>> -> - array(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode, Value); - <<$\n/integer,Rest/bitstring>> -> - array(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode, Value); - <<$\r/integer,Rest/bitstring>> -> - array(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode, Value); - <<$\s/integer,Rest/bitstring>> -> - array(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode, Value); - <<$,/integer,Rest/bitstring>> -> - [Acc | Stack2] = Stack, - value(Rest, Input, Skip + 1, [?array, [Value | Acc] | Stack2], StringDecode, KeyDecode); - <<$]/integer,Rest/bitstring>> -> - [Acc | Stack2] = Stack, - Value2 = lists:reverse(Acc, [Value]), - continue(Rest, Input, Skip + 1, Stack2, StringDecode, KeyDecode, Value2); - <<_/integer,_/bitstring>> -> - throw_error(Input, Skip); - <<_/bitstring>> -> - empty_error(Input, Skip) - end. - -continue(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Value) -> - case Stack of - [?terminate | Stack2] -> - terminate(Rest, Input, Skip, Stack2, StringDecode, KeyDecode, Value); - [?array | Stack2] -> - array(Rest, Input, Skip, Stack2, StringDecode, KeyDecode, Value); - [?key | Stack2] -> - key(Rest, Input, Skip, Stack2, StringDecode, KeyDecode, Value); - [?object | Stack2] -> - object(Rest, Input, Skip, Stack2, StringDecode, KeyDecode, Value) - end. - -empty_array(<>, Input, Skip, Stack, StringDecode, KeyDecode) -> - case Stack of - [?array, [] | _stack@2] -> - continue(Rest, Input, Skip, _stack@2, StringDecode, KeyDecode, []); - _ -> - throw_error(Input, Skip - 1) - end. - -empty_error(_Input, Skip) -> - throw({position, Skip}). - -escape(Data, Input, Skip, Stack, StringDecode, KeyDecode, Acc) -> - case Data of - <<$\"/integer,Rest/bitstring>> -> - string(Rest, Input, Skip + 2, Stack, StringDecode, KeyDecode, [Acc, $\"], 0); - <<$//integer,Rest/bitstring>> -> - string(Rest, Input, Skip + 2, Stack, StringDecode, KeyDecode, [Acc, $/], 0); - <<$\\/integer,Rest/bitstring>> -> - string(Rest, Input, Skip + 2, Stack, StringDecode, KeyDecode, [Acc, $\\], 0); - <<$b/integer,Rest/bitstring>> -> - string(Rest, Input, Skip + 2, Stack, StringDecode, KeyDecode, [Acc, $\b], 0); - <<$f/integer,Rest/bitstring>> -> - string(Rest, Input, Skip + 2, Stack, StringDecode, KeyDecode, [Acc, $\f], 0); - <<$n/integer,Rest/bitstring>> -> - string(Rest, Input, Skip + 2, Stack, StringDecode, KeyDecode, [Acc, $\n], 0); - <<$r/integer,Rest/bitstring>> -> - string(Rest, Input, Skip + 2, Stack, StringDecode, KeyDecode, [Acc, $\r], 0); - <<$t/integer,Rest/bitstring>> -> - string(Rest, Input, Skip + 2, Stack, StringDecode, KeyDecode, [Acc, $\t], 0); - <<$u/integer,Rest/bitstring>> -> - escapeu(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc); - <<_/integer,_/bitstring>> -> - throw_error(Input, Skip + 1); - <<_/bitstring>> -> - empty_error(Input, Skip) - end. - -escape_surrogate(<<92/integer, 117/integer, Int1:16/integer, Int2:16/integer, Rest/bitstring>>, - Input, Skip, Stack, StringDecode, KeyDecode, Acc, Hi) -> - Last = escapeu_last(Int2, Input, Skip + 6), - X = case Int1 of - 17475 -> 220; - 17476 -> 221; - 17477 -> 222; - 17478 -> 223; - 17507 -> 220; - 17508 -> 221; - 17509 -> 222; - 17510 -> 223; - 25667 -> 220; - 25668 -> 221; - 25669 -> 222; - 25670 -> 223; - 25699 -> 220; - 25700 -> 221; - 25701 -> 222; - 25702 -> 223; - _ -> token_error(Input, Skip, 12) - end, - string(Rest, Input, - Skip + 12, - Stack, StringDecode, KeyDecode, - begin - Y = X band 3 bsl 8 + Last, - [Acc | <<(Hi + Y)/utf8>>] - end, - 0); -escape_surrogate(<<_Rest/bitstring>>, Input, Skip, _Stack, _StringDecode, _KeyDecode, _Acc, _Hi) -> - throw_error(Input, Skip + 6). - - -escapeu_1(<<_/bitstring>> = Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, X) -> - A = 6 bsl 5 + (X bsl 2) + (Last bsr 6), - B = 2 bsl 6 + Last band 63, - C = [Acc, A, B], - string(Rest, Input, Skip + 6, Stack, StringDecode, KeyDecode, C, 0). - -escapeu_2(<<_/bitstring>> = Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, X) -> - A = 14 bsl 4 + (X bsr 4), - B = 2 bsl 6 + (X band 15 bsl 2) + (Last bsr 6), - C = 2 bsl 6 + Last band 63, - D = [Acc, A, B, C], - string(Rest, Input, Skip + 6, Stack, StringDecode, KeyDecode, D, 0). - -escapeu(<>, Input, Skip, Stack, StringDecode, KeyDecode, Acc) -> - Last = escapeu_last(Int2, Input, Skip), - case Int1 of - 12336 -> - string(Rest, Input, - Skip + 6, - Stack, StringDecode, KeyDecode, - begin - _@1 = Acc, - _@2 = 0, - _@3 = Last, - case _@3 =< 127 of - false -> - _@4 = 6 bsl 5 + (_@2 bsl 2) + (_@3 bsr 6), - _@5 = 2 bsl 6 + _@3 band 63, - [_@1, _@4, _@5]; - true -> - [_@1, _@3] - end - end, - 0); - 12337 -> escapeu_1(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 1); - 12338 -> escapeu_1(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 2); - 12339 -> escapeu_1(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 3); - 12340 -> escapeu_1(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 4); - 12341 -> escapeu_1(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 5); - 12342 -> escapeu_1(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 6); - 12343 -> escapeu_1(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 7); - 12344 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 8); - 12345 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 9); - 12353 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 10); - 12354 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 11); - 12355 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 12); - 12356 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 13); - 12357 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 14); - 12358 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 15); - 12385 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 10); - 12386 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 11); - 12387 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 12); - 12388 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 13); - 12389 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 14); - 12390 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 15); - 12592 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 16); - 12593 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 17); - 12594 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 18); - 12595 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 19); - 12596 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 20); - 12597 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 21); - 12598 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 22); - 12599 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 23); - 12600 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 24); - 12601 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 25); - 12609 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 26); - 12610 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 27); - 12611 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 28); - 12612 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 29); - 12613 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 30); - 12614 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 31); - 12641 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 26); - 12642 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 27); - 12643 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 28); - 12644 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 29); - 12645 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 30); - 12646 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 31); - 12848 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 32); - 12849 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 33); - 12850 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 34); - 12851 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 35); - 12852 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 36); - 12853 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 37); - 12854 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 38); - 12855 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 39); - 12856 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 40); - 12857 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 41); - 12865 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 42); - 12866 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 43); - 12867 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 44); - 12868 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 45); - 12869 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 46); - 12870 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 47); - 12897 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 42); - 12898 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 43); - 12899 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 44); - 12900 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 45); - 12901 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 46); - 12902 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 47); - 13104 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 48); - 13105 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 49); - 13106 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 50); - 13107 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 51); - 13108 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 52); - 13109 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 53); - 13110 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 54); - 13111 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 55); - 13112 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 56); - 13113 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 57); - 13121 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 58); - 13122 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 59); - 13123 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 60); - 13124 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 61); - 13125 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 62); - 13126 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 63); - 13153 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 58); - 13154 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 59); - 13155 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 60); - 13156 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 61); - 13157 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 62); - 13158 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 63); - 13360 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 64); - 13361 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 65); - 13362 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 66); - 13363 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 67); - 13364 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 68); - 13365 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 69); - 13366 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 70); - 13367 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 71); - 13368 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 72); - 13369 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 73); - 13377 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 74); - 13378 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 75); - 13379 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 76); - 13380 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 77); - 13381 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 78); - 13382 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 79); - 13409 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 74); - 13410 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 75); - 13411 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 76); - 13412 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 77); - 13413 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 78); - 13414 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 79); - 13616 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 80); - 13617 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 81); - 13618 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 82); - 13619 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 83); - 13620 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 84); - 13621 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 85); - 13622 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 86); - 13623 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 87); - 13624 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 88); - 13625 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 89); - 13633 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 90); - 13634 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 91); - 13635 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 92); - 13636 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 93); - 13637 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 94); - 13638 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 95); - 13665 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 90); - 13666 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 91); - 13667 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 92); - 13668 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 93); - 13669 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 94); - 13670 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 95); - 13872 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 96); - 13873 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 97); - 13874 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 98); - 13875 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 99); - 13876 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 100); - 13877 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 101); - 13878 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 102); - 13879 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 103); - 13880 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 104); - 13881 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 105); - 13889 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 106); - 13890 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 107); - 13891 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 108); - 13892 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 109); - 13893 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 110); - 13894 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 111); - 13921 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 106); - 13922 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 107); - 13923 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 108); - 13924 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 109); - 13925 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 110); - 13926 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 111); - 14128 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 112); - 14129 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 113); - 14130 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 114); - 14131 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 115); - 14132 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 116); - 14133 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 117); - 14134 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 118); - 14135 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 119); - 14136 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 120); - 14137 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 121); - 14145 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 122); - 14146 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 123); - 14147 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 124); - 14148 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 125); - 14149 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 126); - 14150 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 127); - 14177 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 122); - 14178 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 123); - 14179 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 124); - 14180 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 125); - 14181 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 126); - 14182 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 127); - 14384 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 128); - 14385 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 129); - 14386 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 130); - 14387 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 131); - 14388 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 132); - 14389 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 133); - 14390 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 134); - 14391 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 135); - 14392 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 136); - 14393 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 137); - 14401 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 138); - 14402 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 139); - 14403 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 140); - 14404 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 141); - 14405 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 142); - 14406 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 143); - 14433 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 138); - 14434 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 139); - 14435 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 140); - 14436 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 141); - 14437 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 142); - 14438 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 143); - 14640 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 144); - 14641 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 145); - 14642 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 146); - 14643 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 147); - 14644 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 148); - 14645 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 149); - 14646 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 150); - 14647 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 151); - 14648 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 152); - 14649 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 153); - 14657 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 154); - 14658 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 155); - 14659 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 156); - 14660 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 157); - 14661 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 158); - 14662 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 159); - 14689 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 154); - 14690 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 155); - 14691 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 156); - 14692 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 157); - 14693 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 158); - 14694 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 159); - 16688 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 160); - 16689 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 161); - 16690 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 162); - 16691 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 163); - 16692 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 164); - 16693 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 165); - 16694 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 166); - 16695 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 167); - 16696 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 168); - 16697 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 169); - 16705 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 170); - 16706 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 171); - 16707 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 172); - 16708 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 173); - 16709 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 174); - 16710 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 175); - 16737 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 170); - 16738 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 171); - 16739 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 172); - 16740 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 173); - 16741 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 174); - 16742 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 175); - 16944 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 176); - 16945 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 177); - 16946 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 178); - 16947 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 179); - 16948 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 180); - 16949 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 181); - 16950 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 182); - 16951 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 183); - 16952 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 184); - 16953 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 185); - 16961 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 186); - 16962 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 187); - 16963 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 188); - 16964 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 189); - 16965 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 190); - 16966 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 191); - 16993 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 186); - 16994 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 187); - 16995 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 188); - 16996 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 189); - 16997 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 190); - 16998 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 191); - 17200 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 192); - 17201 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 193); - 17202 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 194); - 17203 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 195); - 17204 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 196); - 17205 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 197); - 17206 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 198); - 17207 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 199); - 17208 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 200); - 17209 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 201); - 17217 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 202); - 17218 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 203); - 17219 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 204); - 17220 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 205); - 17221 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 206); - 17222 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 207); - 17249 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 202); - 17250 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 203); - 17251 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 204); - 17252 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 205); - 17253 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 206); - 17254 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 207); - 17456 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 208); - 17457 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 209); - 17458 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 210); - 17459 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 211); - 17460 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 212); - 17461 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 213); - 17462 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 214); - 17463 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 215); - 17464 -> - escape_surrogate(Rest, Input, Skip, Stack, - StringDecode, KeyDecode, Acc, - begin - _@1757 = 216, - _@1758 = Last, - 65536 - + - (_@1757 band 3 bsl 8 + _@1758 bsl 10) - end); - 17465 -> - escape_surrogate(Rest, Input, Skip, Stack, - StringDecode, KeyDecode, Acc, - begin - _@1759 = 217, - _@1760 = Last, - 65536 - + - (_@1759 band 3 bsl 8 + _@1760 bsl 10) - end); - 17473 -> - escape_surrogate(Rest, Input, Skip, Stack, - StringDecode, KeyDecode, Acc, - begin - _@1761 = 218, - _@1762 = Last, - 65536 - + - (_@1761 band 3 bsl 8 + _@1762 bsl 10) - end); - 17474 -> - escape_surrogate(Rest, Input, Skip, Stack, - StringDecode, KeyDecode, Acc, - begin - _@1763 = 219, - _@1764 = Last, - 65536 - + - (_@1763 band 3 bsl 8 + _@1764 bsl 10) - end); - 17505 -> - escape_surrogate(Rest, Input, Skip, Stack, - StringDecode, KeyDecode, Acc, - begin - _@1765 = 218, - _@1766 = Last, - 65536 - + - (_@1765 band 3 bsl 8 + _@1766 bsl 10) - end); - 17506 -> - escape_surrogate(Rest, Input, Skip, Stack, - StringDecode, KeyDecode, Acc, - begin - _@1767 = 219, - _@1768 = Last, - 65536 - + - (_@1767 band 3 bsl 8 + _@1768 bsl 10) - end); - 17712 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 224); - 17713 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 225); - 17714 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 226); - 17715 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 227); - 17716 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 228); - 17717 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 229); - 17718 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 230); - 17719 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 231); - 17720 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 232); - 17721 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 233); - 17729 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 234); - 17730 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 235); - 17731 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 236); - 17732 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 237); - 17733 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 238); - 17734 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 239); - 17761 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 234); - 17762 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 235); - 17763 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 236); - 17764 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 237); - 17765 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 238); - 17766 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 239); - 17968 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 240); - 17969 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 241); - 17970 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 242); - 17971 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 243); - 17972 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 244); - 17973 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 245); - 17974 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 246); - 17975 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 247); - 17976 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 248); - 17977 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 249); - 17985 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 250); - 17986 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 251); - 17987 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 252); - 17988 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 253); - 17989 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 254); - 17990 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 255); - 18017 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 250); - 18018 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 251); - 18019 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 252); - 18020 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 253); - 18021 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 254); - 18022 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 255); - 24880 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 160); - 24881 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 161); - 24882 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 162); - 24883 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 163); - 24884 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 164); - 24885 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 165); - 24886 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 166); - 24887 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 167); - 24888 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 168); - 24889 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 169); - 24897 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 170); - 24898 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 171); - 24899 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 172); - 24900 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 173); - 24901 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 174); - 24902 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 175); - 24929 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 170); - 24930 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 171); - 24931 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 172); - 24932 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 173); - 24933 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 174); - 24934 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 175); - 25136 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 176); - 25137 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 177); - 25138 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 178); - 25139 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 179); - 25140 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 180); - 25141 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 181); - 25142 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 182); - 25143 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 183); - 25144 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 184); - 25145 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 185); - 25153 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 186); - 25154 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 187); - 25155 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 188); - 25156 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 189); - 25157 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 190); - 25158 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 191); - 25185 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 186); - 25186 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 187); - 25187 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 188); - 25188 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 189); - 25189 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 190); - 25190 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 191); - 25392 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 192); - 25393 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 193); - 25394 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 194); - 25395 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 195); - 25396 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 196); - 25397 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 197); - 25398 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 198); - 25399 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 199); - 25400 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 200); - 25401 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 201); - 25409 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 202); - 25410 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 203); - 25411 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 204); - 25412 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 205); - 25413 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 206); - 25414 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 207); - 25441 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 202); - 25442 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 203); - 25443 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 204); - 25444 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 205); - 25445 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 206); - 25446 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 207); - 25648 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 208); - 25649 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 209); - 25650 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 210); - 25651 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 211); - 25652 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 212); - 25653 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 213); - 25654 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 214); - 25655 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 215); - 25656 -> - escape_surrogate(Rest, Input, Skip, Stack, - StringDecode, KeyDecode, Acc, - begin - _@2477 = 216, - _@2478 = Last, - 65536 - + - (_@2477 band 3 bsl 8 + _@2478 bsl 10) - end); - 25657 -> - escape_surrogate(Rest, Input, Skip, Stack, - StringDecode, KeyDecode, Acc, - begin - _@2479 = 217, - _@2480 = Last, - 65536 - + - (_@2479 band 3 bsl 8 + _@2480 bsl 10) - end); - 25665 -> - escape_surrogate(Rest, Input, Skip, Stack, - StringDecode, KeyDecode, Acc, - begin - _@2481 = 218, - _@2482 = Last, - 65536 - + - (_@2481 band 3 bsl 8 + _@2482 bsl 10) - end); - 25666 -> - escape_surrogate(Rest, Input, Skip, Stack, - StringDecode, KeyDecode, Acc, - begin - _@2483 = 219, - _@2484 = Last, - 65536 - + - (_@2483 band 3 bsl 8 + _@2484 bsl 10) - end); - 25697 -> - escape_surrogate(Rest, Input, Skip, Stack, - StringDecode, KeyDecode, Acc, - begin - _@2485 = 218, - _@2486 = Last, - 65536 - + - (_@2485 band 3 bsl 8 + _@2486 bsl 10) - end); - 25698 -> - escape_surrogate(Rest, Input, Skip, Stack, - StringDecode, KeyDecode, Acc, - begin - _@2487 = 219, - _@2488 = Last, - 65536 - + - (_@2487 band 3 bsl 8 + _@2488 bsl 10) - end); - 25904 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 224); - 25905 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 225); - 25906 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 226); - 25907 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 227); - 25908 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 228); - 25909 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 229); - 25910 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 230); - 25911 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 231); - 25912 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 232); - 25913 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 233); - 25921 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 234); - 25922 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 235); - 25923 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 236); - 25924 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 237); - 25925 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 238); - 25926 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 239); - 25953 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 234); - 25954 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 235); - 25955 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 236); - 25956 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 237); - 25957 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 238); - 25958 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 239); - 26160 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 240); - 26161 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 241); - 26162 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 242); - 26163 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 243); - 26164 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 244); - 26165 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 245); - 26166 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 246); - 26167 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 247); - 26168 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 248); - 26169 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 249); - 26177 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 250); - 26178 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 251); - 26179 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 252); - 26180 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 253); - 26181 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 254); - 26182 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 255); - 26209 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 250); - 26210 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 251); - 26211 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 252); - 26212 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 253); - 26213 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 254); - 26214 -> escapeu_2(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Last, 255); - _ -> - token_error(Input, Skip, 6) - end; -escapeu(<<_Rest/bitstring>>, Input, Skip, _Stack, _StringDecode, _KeyDecode, _Acc) -> - empty_error(Input, Skip). - -escapeu_last(Int, Input, Skip) -> - case Int of - 12336 -> 0; 12337 -> 1; 12338 -> 2; 12339 -> 3; 12340 -> 4; 12341 -> 5; 12342 -> 6; - 12343 -> 7; 12344 -> 8; 12345 -> 9; 12353 -> 10; 12354 -> 11; 12355 -> 12; - 12356 -> 13; 12357 -> 14; 12358 -> 15; 12385 -> 10; 12386 -> 11; 12387 -> 12; - 12388 -> 13; 12389 -> 14; 12390 -> 15; 12592 -> 16; 12593 -> 17; 12594 -> 18; - 12595 -> 19; 12596 -> 20; 12597 -> 21; 12598 -> 22; 12599 -> 23; 12600 -> 24; - 12601 -> 25; 12609 -> 26; 12610 -> 27; 12611 -> 28; 12612 -> 29; 12613 -> 30; - 12614 -> 31; 12641 -> 26; 12642 -> 27; 12643 -> 28; 12644 -> 29; 12645 -> 30; - 12646 -> 31; 12848 -> 32; 12849 -> 33; 12850 -> 34; 12851 -> 35; 12852 -> 36; - 12853 -> 37; 12854 -> 38; 12855 -> 39; 12856 -> 40; 12857 -> 41; 12865 -> 42; - 12866 -> 43; 12867 -> 44; 12868 -> 45; 12869 -> 46; 12870 -> 47; 12897 -> 42; - 12898 -> 43; 12899 -> 44; 12900 -> 45; 12901 -> 46; 12902 -> 47; 13104 -> 48; - 13105 -> 49; 13106 -> 50; 13107 -> 51; 13108 -> 52; 13109 -> 53; 13110 -> 54; - 13111 -> 55; 13112 -> 56; 13113 -> 57; 13121 -> 58; 13122 -> 59; 13123 -> 60; - 13124 -> 61; 13125 -> 62; 13126 -> 63; 13153 -> 58; 13154 -> 59; 13155 -> 60; - 13156 -> 61; 13157 -> 62; 13158 -> 63; 13360 -> 64; 13361 -> 65; 13362 -> 66; - 13363 -> 67; 13364 -> 68; 13365 -> 69; 13366 -> 70; 13367 -> 71; 13368 -> 72; - 13369 -> 73; 13377 -> 74; 13378 -> 75; 13379 -> 76; 13380 -> 77; 13381 -> 78; - 13382 -> 79; 13409 -> 74; 13410 -> 75; 13411 -> 76; 13412 -> 77; 13413 -> 78; - 13414 -> 79; 13616 -> 80; 13617 -> 81; 13618 -> 82; 13619 -> 83; 13620 -> 84; - 13621 -> 85; 13622 -> 86; 13623 -> 87; 13624 -> 88; 13625 -> 89; 13633 -> 90; - 13634 -> 91; 13635 -> 92; 13636 -> 93; 13637 -> 94; 13638 -> 95; 13665 -> 90; - 13666 -> 91; 13667 -> 92; 13668 -> 93; 13669 -> 94; 13670 -> 95; 13872 -> 96; - 13873 -> 97; 13874 -> 98; 13875 -> 99; 13876 -> 100; 13877 -> 101; 13878 -> 102; - 13879 -> 103; 13880 -> 104; 13881 -> 105; 13889 -> 106; 13890 -> 107; 13891 -> 108; - 13892 -> 109; 13893 -> 110; 13894 -> 111; 13921 -> 106; 13922 -> 107; 13923 -> 108; - 13924 -> 109; 13925 -> 110; 13926 -> 111; 14128 -> 112; 14129 -> 113; 14130 -> 114; - 14131 -> 115; 14132 -> 116; 14133 -> 117; 14134 -> 118; 14135 -> 119; 14136 -> 120; - 14137 -> 121; 14145 -> 122; 14146 -> 123; 14147 -> 124; 14148 -> 125; 14149 -> 126; - 14150 -> 127; 14177 -> 122; 14178 -> 123; 14179 -> 124; 14180 -> 125; 14181 -> 126; - 14182 -> 127; 14384 -> 128; 14385 -> 129; 14386 -> 130; 14387 -> 131; 14388 -> 132; - 14389 -> 133; 14390 -> 134; 14391 -> 135; 14392 -> 136; 14393 -> 137; 14401 -> 138; - 14402 -> 139; 14403 -> 140; 14404 -> 141; 14405 -> 142; 14406 -> 143; 14433 -> 138; - 14434 -> 139; 14435 -> 140; 14436 -> 141; 14437 -> 142; 14438 -> 143; 14640 -> 144; - 14641 -> 145; 14642 -> 146; 14643 -> 147; 14644 -> 148; 14645 -> 149; 14646 -> 150; - 14647 -> 151; 14648 -> 152; 14649 -> 153; 14657 -> 154; 14658 -> 155; 14659 -> 156; - 14660 -> 157; 14661 -> 158; 14662 -> 159; 14689 -> 154; 14690 -> 155; 14691 -> 156; - 14692 -> 157; 14693 -> 158; 14694 -> 159; 16688 -> 160; 16689 -> 161; 16690 -> 162; - 16691 -> 163; 16692 -> 164; 16693 -> 165; 16694 -> 166; 16695 -> 167; 16696 -> 168; - 16697 -> 169; 16705 -> 170; 16706 -> 171; 16707 -> 172; 16708 -> 173; 16709 -> 174; - 16710 -> 175; 16737 -> 170; 16738 -> 171; 16739 -> 172; 16740 -> 173; 16741 -> 174; - 16742 -> 175; 16944 -> 176; 16945 -> 177; 16946 -> 178; 16947 -> 179; 16948 -> 180; - 16949 -> 181; 16950 -> 182; 16951 -> 183; 16952 -> 184; 16953 -> 185; 16961 -> 186; - 16962 -> 187; 16963 -> 188; 16964 -> 189; 16965 -> 190; 16966 -> 191; 16993 -> 186; - 16994 -> 187; 16995 -> 188; 16996 -> 189; 16997 -> 190; 16998 -> 191; 17200 -> 192; - 17201 -> 193; 17202 -> 194; 17203 -> 195; 17204 -> 196; 17205 -> 197; 17206 -> 198; - 17207 -> 199; 17208 -> 200; 17209 -> 201; 17217 -> 202; 17218 -> 203; 17219 -> 204; - 17220 -> 205; 17221 -> 206; 17222 -> 207; 17249 -> 202; 17250 -> 203; 17251 -> 204; - 17252 -> 205; 17253 -> 206; 17254 -> 207; 17456 -> 208; 17457 -> 209; 17458 -> 210; - 17459 -> 211; 17460 -> 212; 17461 -> 213; 17462 -> 214; 17463 -> 215; 17464 -> 216; - 17465 -> 217; 17473 -> 218; 17474 -> 219; 17475 -> 220; 17476 -> 221; 17477 -> 222; - 17478 -> 223; 17505 -> 218; 17506 -> 219; 17507 -> 220; 17508 -> 221; 17509 -> 222; - 17510 -> 223; 17712 -> 224; 17713 -> 225; 17714 -> 226; 17715 -> 227; 17716 -> 228; - 17717 -> 229; 17718 -> 230; 17719 -> 231; 17720 -> 232; 17721 -> 233; 17729 -> 234; - 17730 -> 235; 17731 -> 236; 17732 -> 237; 17733 -> 238; 17734 -> 239; 17761 -> 234; - 17762 -> 235; 17763 -> 236; 17764 -> 237; 17765 -> 238; 17766 -> 239; 17968 -> 240; - 17969 -> 241; 17970 -> 242; 17971 -> 243; 17972 -> 244; 17973 -> 245; 17974 -> 246; - 17975 -> 247; 17976 -> 248; 17977 -> 249; 17985 -> 250; 17986 -> 251; 17987 -> 252; - 17988 -> 253; 17989 -> 254; 17990 -> 255; 18017 -> 250; 18018 -> 251; 18019 -> 252; - 18020 -> 253; 18021 -> 254; 18022 -> 255; 24880 -> 160; 24881 -> 161; 24882 -> 162; - 24883 -> 163; 24884 -> 164; 24885 -> 165; 24886 -> 166; 24887 -> 167; 24888 -> 168; - 24889 -> 169; 24897 -> 170; 24898 -> 171; 24899 -> 172; 24900 -> 173; 24901 -> 174; - 24902 -> 175; 24929 -> 170; 24930 -> 171; 24931 -> 172; 24932 -> 173; 24933 -> 174; - 24934 -> 175; 25136 -> 176; 25137 -> 177; 25138 -> 178; 25139 -> 179; 25140 -> 180; - 25141 -> 181; 25142 -> 182; 25143 -> 183; 25144 -> 184; 25145 -> 185; 25153 -> 186; - 25154 -> 187; 25155 -> 188; 25156 -> 189; 25157 -> 190; 25158 -> 191; 25185 -> 186; - 25186 -> 187; 25187 -> 188; 25188 -> 189; 25189 -> 190; 25190 -> 191; 25392 -> 192; - 25393 -> 193; 25394 -> 194; 25395 -> 195; 25396 -> 196; 25397 -> 197; 25398 -> 198; - 25399 -> 199; 25400 -> 200; 25401 -> 201; 25409 -> 202; 25410 -> 203; 25411 -> 204; - 25412 -> 205; 25413 -> 206; 25414 -> 207; 25441 -> 202; 25442 -> 203; 25443 -> 204; - 25444 -> 205; 25445 -> 206; 25446 -> 207; 25648 -> 208; 25649 -> 209; 25650 -> 210; - 25651 -> 211; 25652 -> 212; 25653 -> 213; 25654 -> 214; 25655 -> 215; 25656 -> 216; - 25657 -> 217; 25665 -> 218; 25666 -> 219; 25667 -> 220; 25668 -> 221; 25669 -> 222; - 25670 -> 223; 25697 -> 218; 25698 -> 219; 25699 -> 220; 25700 -> 221; 25701 -> 222; - 25702 -> 223; 25904 -> 224; 25905 -> 225; 25906 -> 226; 25907 -> 227; 25908 -> 228; - 25909 -> 229; 25910 -> 230; 25911 -> 231; 25912 -> 232; 25913 -> 233; 25921 -> 234; - 25922 -> 235; 25923 -> 236; 25924 -> 237; 25925 -> 238; 25926 -> 239; 25953 -> 234; - 25954 -> 235; 25955 -> 236; 25956 -> 237; 25957 -> 238; 25958 -> 239; 26160 -> 240; - 26161 -> 241; 26162 -> 242; 26163 -> 243; 26164 -> 244; 26165 -> 245; 26166 -> 246; - 26167 -> 247; 26168 -> 248; 26169 -> 249; 26177 -> 250; 26178 -> 251; 26179 -> 252; - 26180 -> 253; 26181 -> 254; 26182 -> 255; 26209 -> 250; 26210 -> 251; 26211 -> 252; - 26212 -> 253; 26213 -> 254; 26214 -> 255; - _ -> token_error(Input, Skip, 6) - end. - -key(Data, Input, Skip, Stack, StringDecode, KeyDecode) -> - case Data of - <<$\t/integer,Rest/bitstring>> -> - key(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode); - <<$\n/integer,Rest/bitstring>> -> - key(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode); - <<$\r/integer,Rest/bitstring>> -> - key(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode); - <<$\s/integer,Rest/bitstring>> -> - key(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode); - <<$"/integer,Rest/bitstring>> -> - string(Rest, Input, Skip + 1, [?key | Stack], StringDecode, KeyDecode, 0); - <<$}/integer,Rest/bitstring>> -> - case Stack of - [[] | Stack2] -> - continue(Rest, Input, Skip + 1, Stack2, StringDecode, KeyDecode, #{}); - _ -> - throw_error(Input, Skip) - end; - <<_/integer,_/bitstring>> -> - throw_error(Input, Skip); - <<_/bitstring>> -> - empty_error(Input, Skip) - end. - -key(Data, Input, Skip, Stack, StringDecode, KeyDecode, Value) -> - case Data of - <<$\t/integer,Rest/bitstring>> -> - key(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode, Value); - <<$\n/integer,Rest/bitstring>> -> - key(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode, Value); - <<$\r/integer,Rest/bitstring>> -> - key(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode, Value); - <<$\s/integer,Rest/bitstring>> -> - key(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode, Value); - <<$:/integer,Rest/bitstring>> -> - value(Rest, Input, Skip + 1, [?object, Value | Stack], StringDecode, KeyDecode); - <<_/integer,_/bitstring>> -> - throw_error(Input, Skip); - <<_/bitstring>> -> - empty_error(Input, Skip) - end. - -number(<>, Input, Skip, Stack, StringDecode, KeyDecode, Len) -when Byte >= $0 andalso Byte =< $9 -> - number(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Len + 1); -number(<<$./integer,Rest/bitstring>>, Input, Skip, Stack, StringDecode, KeyDecode, Len) -> - number_frac(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Len + 1); -number(<>, Input, Skip, Stack, StringDecode, KeyDecode, Len) -when E =:= $e orelse E =:= $E -> - Prefix = binary_part(Input, Skip, Len), - number_exp_copy(Rest, Input, Skip + Len + 1, Stack, StringDecode, KeyDecode, Prefix); -number(<>, Input, Skip, Stack, StringDecode, KeyDecode, Len) -> - Int = binary_to_integer(binary_part(Input, Skip, Len)), - continue(Rest, Input, Skip + Len, Stack, StringDecode, KeyDecode, Int). - -number_exp(<>, Input, Skip, Stack, StringDecode, KeyDecode, Len) -when Byte >= $0 andalso Byte =< $9 -> - number_exp_cont(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Len + 1); -number_exp(<>, Input, Skip, Stack, StringDecode, KeyDecode, Len) -when Byte =:= $+ orelse Byte =:= $- -> - number_exp_sign(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Len + 1); -number_exp(<<_Rest/bitstring>>, Input, Skip, _Stack, _StringDecode, _KeyDecode, Len) -> - throw_error(Input, Skip + Len). - -number_exp_cont(<>, Input, Skip, Stack, StringDecode, KeyDecode, Len) -when Byte >= $0 andalso Byte =< $9 -> - number_exp_cont(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Len + 1); -number_exp_cont(<>, Input, Skip, Stack, StringDecode, KeyDecode, Len) -> - Token = binary_part(Input, Skip, Len), - Float = try_parse_float(Token, Token, Skip), - continue(Rest, Input, Skip + Len, Stack, StringDecode, KeyDecode, Float). - -number_exp_cont(<>, Input, Skip, Stack, StringDecode, KeyDecode, Prefix, Len) -when Byte >= $0 andalso Byte =< $9 -> - number_exp_cont(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Prefix, Len + 1); -number_exp_cont(<>, Input, Skip, Stack, StringDecode, KeyDecode, Prefix, Len) -> - Suffix = binary_part(Input, Skip, Len), - String = <>, - PrefixSize = byte_size(Prefix), - InitialSkip = Skip - PrefixSize - 1, - FinalSkip = Skip + Len, - Token = binary_part(Input, InitialSkip, PrefixSize + Len + 1), - Float = try_parse_float(String, Token, InitialSkip), - continue(Rest, Input, FinalSkip, Stack, StringDecode, KeyDecode, Float). - -number_exp_copy(<>, Input, Skip, Stack, StringDecode, KeyDecode, Prefix) -when Byte >= $0 andalso Byte =< $9 -> - number_exp_cont(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Prefix, 1); -number_exp_copy(<>, Input, Skip, Stack, StringDecode, KeyDecode, Prefix) -when Byte =:= $+ orelse Byte =:= $- -> - number_exp_sign(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Prefix, 1); -number_exp_copy(<<_Rest/bitstring>>, Input, Skip, _Stack, _StringDecode, _KeyDecode, _Prefix) -> - throw_error(Input, Skip). - -number_exp_sign(<>, Input, Skip, Stack, StringDecode, KeyDecode, Len) -when Byte >= $0 andalso Byte =< $9 -> - number_exp_cont(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Len + 1); -number_exp_sign(<<_Rest/bitstring>>, Input, Skip, _Stack, _StringDecode, _KeyDecode, Len) -> - throw_error(Input, Skip + Len). - -number_exp_sign(<>, Input, Skip, Stack, StringDecode, KeyDecode, Prefix, Len) -when Byte >= $0 andalso Byte =< $9 -> - number_exp_cont(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Prefix, Len + 1); -number_exp_sign(<<_Rest/bitstring>>, Input, Skip, _Stack, _StringDecode, _KeyDecode, _Prefix, Len) -> - throw_error(Input, Skip + Len). - -number_frac(<>, Input, Skip, Stack, StringDecode, KeyDecode, Len) -when Byte >= $0 andalso Byte =< $9 -> - number_frac_cont(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Len + 1); -number_frac(<<_Rest/bitstring>>, Input, Skip, _Stack, _StringDecode, _KeyDecode, Len) -> - throw_error(Input, Skip + Len). - -number_frac_cont(<>, Input, Skip, Stack, StringDecode, KeyDecode, Len) -when Byte >= $0 andalso Byte =< $9 -> - number_frac_cont(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Len + 1); -number_frac_cont(<>, Input, Skip, Stack, StringDecode, KeyDecode, Len) -when E =:= $e orelse E =:= $E -> - number_exp(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Len + 1); -number_frac_cont(<>, Input, Skip, Stack, StringDecode, KeyDecode, Len) -> - Token = binary_part(Input, Skip, Len), - Float = try_parse_float(Token, Token, Skip), - continue(Rest, Input, Skip + Len, Stack, StringDecode, KeyDecode, Float). - -number_minus(<<48/integer,Rest/bitstring>>, Input, Skip, Stack, StringDecode, KeyDecode) -> - number_zero(Rest, Input, Skip, Stack, StringDecode, KeyDecode, 2); -number_minus(<>, Input, Skip, Stack, StringDecode, KeyDecode) -when Byte >= $0 andalso Byte =< $9 -> - number(Rest, Input, Skip, Stack, StringDecode, KeyDecode, 2); -number_minus(<<_Rest/bitstring>>, Input, Skip, _Stack, _StringDecode, _KeyDecode) -> - throw_error(Input, Skip + 1). - -number_zero(<<46/integer,Rest/bitstring>>, Input, Skip, Stack, StringDecode, KeyDecode, Len) -> - number_frac(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Len + 1); -number_zero(<>, Input, Skip, Stack, StringDecode, KeyDecode, Len) -when E =:= $e orelse E =:= $E -> - number_exp_copy(Rest, Input, Skip + Len + 1, Stack, StringDecode, KeyDecode, <<"0">>); -number_zero(<>, Input, Skip, Stack, StringDecode, KeyDecode, Len) -> - continue(Rest, Input, Skip + Len, Stack, StringDecode, KeyDecode, 0). - -object(Rest, Input, Skip, Stack, StringDecode, KeyDecode) -> - key(Rest, Input, Skip, [[] | Stack], StringDecode, KeyDecode). - -object(Data, Input, Skip, Stack, StringDecode, KeyDecode, Value) -> - case Data of - <<9/integer,Rest/bitstring>> -> - object(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode, Value); - <<10/integer,Rest/bitstring>> -> - object(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode, Value); - <<13/integer,Rest/bitstring>> -> - object(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode, Value); - <<32/integer,Rest/bitstring>> -> - object(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode, Value); - <<44/integer,Rest/bitstring>> -> - Skip2 = Skip + 1, - [Key, Acc | Stack2] = Stack, - Acc2 = [{Key, Value} | Acc], - key(Rest, Input, Skip2, [Acc2 | Stack2], StringDecode, KeyDecode); - <<125/integer,Rest/bitstring>> -> - Skip2 = Skip + 1, - [Key, Acc2 | Stack2] = Stack, - Final = [{Key, Value} | Acc2], - continue(Rest, Input, Skip2, Stack2, StringDecode, KeyDecode, maps:from_list(Final)); - <<_/integer,_/bitstring>> -> - throw_error(Input, Skip); - <<_/bitstring>> -> - empty_error(Input, Skip) - end. - -decode(Data, Options) when is_binary(Data) andalso is_map(Options) -> - KeyDecode = key_decode_function(Options), - StringDecode = string_decode_function(Options), - try - {ok, value(Data, Data, 0, [?terminate], StringDecode, KeyDecode)} - catch - throw:{position, Position}:_ -> - case Position == byte_size(Data) of - true -> - {error, unexpected_end_of_input}; - false -> - Byte = binary:at(Data, Position), - _hex@1 = integer_to_binary(Byte, 16), - {error, {unexpected_byte, <<"0x"/utf8,_hex@1/binary>>, Position}} - end; - throw:{token, Token, Position}:_ -> - {error, {unexpected_sequence, Token, Position}} - end. - -string(Data, Input, Skip, Stack, StringDecode, KeyDecode, Len) -> - case Data of - <> when X < 32 -> - throw_error(Input, Skip); - <> when X < 34 -> - string(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Len + 1); - <<34/integer,Rest/bitstring>> -> - Value = case Stack of - [?key | _] -> KeyDecode(binary_part(Input, Skip, Len)); - _ -> StringDecode(binary_part(Input, Skip, Len)) - end, - continue(Rest, Input, Skip + Len + 1, Stack, StringDecode, KeyDecode, Value); - <> when X < 92 -> - string(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Len + 1); - <<92/integer,Rest/bitstring>> -> - Part = binary_part(Input, Skip, Len), - escape(Rest, Input, Skip + Len, Stack, StringDecode, KeyDecode, Part); - <> when X < 128 -> - string(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Len + 1); - <> when Char =< 2047 -> - string(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Len + 2); - <> when Char =< 65535 -> - string(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Len + 3); - <<_Char/utf8,Rest/bitstring>> -> - string(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Len + 4); - <<_/integer,_/bitstring>> -> - throw_error(Input, Skip); - <<_/bitstring>> -> - empty_error(Input, Skip + Len) - end. - -string(Data, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Len) -> - case Data of - <> when X < 32 -> - throw_error(Input, Skip); - <> when X < 34 -> - string(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Len + 1); - <<34/integer,Rest/bitstring>> -> - Last = binary_part(Input, Skip, Len), - String = iolist_to_binary([Acc | Last]), - continue(Rest, Input, Skip + Len + 1, Stack, StringDecode, KeyDecode, String); - <> when X < 92 -> - string(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Len + 1); - <<92/integer,Rest/bitstring>> -> - Part = binary_part(Input, Skip, Len), - escape(Rest, Input, Skip + Len, Stack, StringDecode, KeyDecode, [Acc | Part]); - <> when X < 128 -> - string(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Len + 1); - <> when Char =< 2047 -> - string(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Len + 2); - <> when Char =< 65535 -> - string(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Len + 3); - <<_Char/utf8,Rest/bitstring>> -> - string(Rest, Input, Skip, Stack, StringDecode, KeyDecode, Acc, Len + 4); - <<_/integer,_/bitstring>> -> - throw_error(Input, Skip); - <<_/bitstring>> -> - empty_error(Input, Skip + Len) - end. - -string_decode_function(Options) -> - case maps:get(strings, Options, reference) of - reference -> fun identity/1; - copy -> fun binary:copy/1; - Invalid -> error({invalid_option, #{strings => Invalid}}) - end. - -key_decode_function(Options) -> - case maps:get(keys, Options, reference) of - reference -> fun identity/1; - copy -> fun binary:copy/1; - to_atom -> fun to_atom/1; - to_existing_atom -> fun to_existing_atom/1; - Invalid -> error({invalid_option, #{keys => Invalid}}) - end. - -identity(Key) -> Key. - -to_atom(Key) when is_binary(Key) -> binary_to_atom(Key); -to_atom(Key) -> Key. - -to_existing_atom(Key) when is_binary(Key) -> - try - binary_to_existing_atom(Key) - catch - error:badarg -> Key - end; -to_existing_atom(Key) -> - Key. - -terminate(<<32/integer,Rest/bitstring>>, Input, Skip, Stack, StringDecode, KeyDecode, Value) -> - terminate(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode, Value); -terminate(<<13/integer,Rest/bitstring>>, Input, Skip, Stack, StringDecode, KeyDecode, Value) -> - terminate(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode, Value); -terminate(<<10/integer,Rest/bitstring>>, Input, Skip, Stack, StringDecode, KeyDecode, Value) -> - terminate(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode, Value); -terminate(<<9/integer,Rest/bitstring>>, Input, Skip, Stack, StringDecode, KeyDecode, Value) -> - terminate(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode, Value); -terminate(<<>>, _Input, _Skip, _Stack, _StringDecode, _KeyDecode, Value) -> - Value; -terminate(<<_Rest/bitstring>>, Input, Skip, _Stack, _StringDecode, _KeyDecode, _Value) -> - throw_error(Input, Skip). - -throw_error(_Input, Skip) -> - throw({position, Skip}). - -throw_error(<<_Rest/bitstring>>, _Input, Skip, _Stack, _StringDecode, _KeyDecode) -> - throw({position, Skip - 1}). - -token_error(Token, Position) -> - throw({token, Token, Position}). - -token_error(Token, Position, Len) -> - throw({token, binary_part(Token, Position, Len), Position}). - -try_parse_float(_string@1, Token, Skip) -> - try - binary_to_float(_string@1) - catch - error:badarg:_ -> - token_error(Token, Skip) - end. - -value(Data, Input, Skip, Stack, StringDecode, KeyDecode) -> - case Data of - <> when X =:= 9 orelse X =:= 10 -> - value(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode); - <<13/integer,Rest/bitstring>> -> - value(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode); - <<32/integer,Rest/bitstring>> -> - value(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode); - <<34/integer,Rest/bitstring>> -> - string(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode, 0); - <<45/integer,Rest/bitstring>> -> - number_minus(Rest, Input, Skip, Stack, StringDecode, KeyDecode); - <<48/integer,Rest/bitstring>> -> - number_zero(Rest, Input, Skip, Stack, StringDecode, KeyDecode, 1); - <> when X >= 49 andalso X =< 57 -> - number(Rest, Input, Skip, Stack, StringDecode, KeyDecode, 1); - <<91/integer,Rest/bitstring>> -> - array(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode); - <<93/integer,Rest/bitstring>> -> - empty_array(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode); - <<102/integer,Rest/bitstring>> -> - case Rest of - <<"alse",Rest1/bitstring>> -> - continue(Rest1, Input, Skip + 5, Stack, StringDecode, KeyDecode, false); - <<_/bitstring>> -> - throw_error(Input, Skip) - end; - <<110/integer,Rest/bitstring>> -> - case Rest of - <<"ull",Rest1/bitstring>> -> - continue(Rest1, Input, Skip + 4, Stack, StringDecode, KeyDecode, null); - <<_/bitstring>> -> - throw_error(Input, Skip) - end; - <<116/integer,Rest/bitstring>> -> - case Rest of - <<"rue",Rest1/bitstring>> -> - continue(Rest1, Input, Skip + 4, Stack, StringDecode, KeyDecode, true); - <<_/bitstring>> -> - throw_error(Input, Skip) - end; - <<123/integer,Rest/bitstring>> -> - object(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode); - <<_/integer,Rest/bitstring>> -> - throw_error(Rest, Input, Skip + 1, Stack, StringDecode, KeyDecode); - <<_/bitstring>> -> - throw_error(Input, Skip) - end. - diff --git a/lsp/bet-lsp/build/packages/thoas/src/thoas_encode.erl b/lsp/bet-lsp/build/packages/thoas/src/thoas_encode.erl deleted file mode 100644 index f2fbbef..0000000 --- a/lsp/bet-lsp/build/packages/thoas/src/thoas_encode.erl +++ /dev/null @@ -1,1764 +0,0 @@ --module(thoas_encode). - --compile([ - {no_auto_import, [float/1]}, - {inline, [{float, 1}, {integer, 1}, {error_invalid_byte_error, 2}]} -]). - -%%% Normal reflection based API that turns Erlang terms into JSON. --export([encode/2]). - -%%% Non-recursive API that expects sub-objects to already be encoded. Likely -%%% useful for statically typed languages such as Gleam. --export([ - true/0, false/0, null/0, boolean/1, integer/1, float/1, string/1, - non_recursive_array/1, non_recursive_object/1 -]). - -%%% A boolean value as JSON. --spec boolean(boolean()) -> iodata(). -boolean('true') -> <<"true">>; -boolean('false') -> <<"false">>. - -%%% The JSON value `true`. --spec true() -> iodata(). -true() -> <<"true">>. - -%%% The JSON value `false`. --spec false() -> iodata(). -false() -> <<"false">>. - -%%% The JSON value `null`. --spec null() -> iodata(). -null() -> <<"null">>. - -%%% A float in JSON format. --spec float(float()) -> iodata(). -float(Float) -> - erlang:float_to_binary(Float, [short]). - -%%% An integer in JSON format. --spec integer(integer()) -> iodata(). -integer(Int) -> - integer_to_list(Int). - -%%% A string in JSON format, using normal JSON escaping of the contents. --spec string(binary()) -> iodata(). -string(String) -> - encode_string(String, fun escape_json/3). - -%%% An array of JSON values. -%%% -%%% Important: The values supplied in the list are not processed and **must** -%%% already encoded into JSON using one of the other functions, such as -%%% `integer/1` or `string/1`. -%%% --spec non_recursive_array(list(iodata())) -> iodata(). -non_recursive_array([]) -> - <<"[]">>; -non_recursive_array([First | Rest]) -> - [$[, First | non_recursive_array_loop(Rest)]. - -non_recursive_array_loop([]) -> - [$]]; -non_recursive_array_loop([First | Rest]) -> - [$,, First | non_recursive_array_loop(Rest)]. - - -%%% An object of JSON values. -%%% -%%% Important: The values supplied in the list are not processed and **must** -%%% already encoded into JSON using one of the other functions, such as -%%% `integer/1` or `string/1`. -%%% Keys are processed as strings and get escaped using normal JSON escaping. -%%% --spec non_recursive_object(list({binary(), iodata()})) -> iodata(). -non_recursive_object([]) -> - <<"{}">>; -non_recursive_object([{Key, Value} | Tail]) -> - Escape = fun escape_json/3, - [ - <<"{\"">>, key(Key, Escape), <<"\":">>, Value - | non_recursive_object_loop(Tail, Escape) - ]. - -non_recursive_object_loop([], _Escape) -> - [$}]; -non_recursive_object_loop([{Key, Value} | Tail], Escape) -> - [ - <<",\"">>, key(Key, Escape), <<"\":">>, Value - | non_recursive_object_loop(Tail, Escape) - ]. - -%%%% -%%%% Recursive encoding functions -%%%% - -encode(Value, Opts) -> - value(Value, escape_function(Opts)). - -encode_atom(null, _Escape) -> <<"null">>; -encode_atom(true, _Escape) -> <<"true">>; -encode_atom(false, _Escape) -> <<"false">>; -encode_atom(Atom, Escape) -> encode_string(atom_to_binary(Atom, utf8), Escape). - -encode_string(String, Escape) -> - [$", Escape(String, String, 0), $"]. - -escape(0) -> <<"\\u0000">>; -escape(1) -> <<"\\u0001">>; -escape(2) -> <<"\\u0002">>; -escape(3) -> <<"\\u0003">>; -escape(4) -> <<"\\u0004">>; -escape(5) -> <<"\\u0005">>; -escape(6) -> <<"\\u0006">>; -escape(7) -> <<"\\u0007">>; -escape(8) -> <<"\\b">>; -escape(9) -> <<"\\t">>; -escape(10) -> <<"\\n">>; -escape(11) -> <<"\\u000B">>; -escape(12) -> <<"\\f">>; -escape(13) -> <<"\\r">>; -escape(14) -> <<"\\u000E">>; -escape(15) -> <<"\\u000F">>; -escape(16) -> <<"\\u0010">>; -escape(17) -> <<"\\u0011">>; -escape(18) -> <<"\\u0012">>; -escape(19) -> <<"\\u0013">>; -escape(20) -> <<"\\u0014">>; -escape(21) -> <<"\\u0015">>; -escape(22) -> <<"\\u0016">>; -escape(23) -> <<"\\u0017">>; -escape(24) -> <<"\\u0018">>; -escape(25) -> <<"\\u0019">>; -escape(26) -> <<"\\u001A">>; -escape(27) -> <<"\\u001B">>; -escape(28) -> <<"\\u001C">>; -escape(29) -> <<"\\u001D">>; -escape(30) -> <<"\\u001E">>; -escape(31) -> <<"\\u001F">>; -escape(32) -> throw(error); -escape(33) -> throw(error); -escape(34) -> <<"\\\"">>; -escape(X) when X < 47 andalso X > 34 -> throw(error); -escape(47) -> <<"\\/">>; -escape(X) when X < 92 andalso X > 47 -> throw(error); -escape(92) -> <<"\\\\">>. - -escape_function(Options) -> - case maps:get(escape, Options, json) of - json -> fun escape_json/3; - html -> fun escape_html/3; - unicode -> fun escape_unicode/3; - javascript -> fun escape_js/3 - end. - -escape_html(Data, Input, Skip) -> - escape_html(Data, [], Input, Skip). - -escape_html(<>, Acc, Input, Skip) when Byte < 33 -> - Acc2 = [Acc | escape(Byte)], - escape_html(Rest, Acc2, Input, Skip + 1); -escape_html(<>, Acc, Input, Skip) when Byte =:= 33 -> - escape_html_chunk(Rest, Acc, Input, Skip, 1); -escape_html(<>, Acc, Input, Skip) when Byte =:= 34 -> - Acc2 = [Acc | escape(Byte)], - escape_html(Rest, Acc2, Input, Skip + 1); -escape_html(<>, Acc, Input, Skip) when Byte < 47 -> - escape_html_chunk(Rest, Acc, Input, Skip, 1); -escape_html(<>, Acc, Input, Skip) when Byte =:= 47 -> - Acc2 = [Acc | escape(Byte)], - escape_html(Rest, Acc2, Input, Skip + 1); -escape_html(<>, Acc, Input, Skip) when Byte < 92 -> - escape_html_chunk(Rest, Acc, Input, Skip, 1); -escape_html(<>, Acc, Input, Skip) when Byte =:= 92 -> - Acc2 = [Acc | escape(Byte)], - escape_html(Rest, Acc2, Input, Skip + 1); -escape_html(<>, Acc, Input, Skip) when Byte < 128 -> - escape_html_chunk(Rest, Acc, Input, Skip, 1); -escape_html(<>, Acc, Input, Skip) when Char =< 2047 -> - escape_html_chunk(Rest, Acc, Input, Skip, 2); -escape_html(<<8232/utf8,Rest/bitstring>>, Acc, Input, Skip) -> - Acc2 = [Acc | <<"\\u2028">>], - escape_html(Rest, Acc2, Input, Skip + 3); -escape_html(<<8233/utf8,Rest/bitstring>>, Acc, Input, Skip) -> - Acc2 = [Acc | <<"\\u2029">>], - escape_html(Rest, Acc2, Input, Skip + 3); -escape_html(<>, Acc, Input, Skip) - when Char =< 65535 -> - escape_html_chunk(Rest, Acc, Input, Skip, 3); -escape_html(<<_Char/utf8,Rest/bitstring>>, Acc, Input, Skip) -> - escape_html_chunk(Rest, Acc, Input, Skip, 4); -escape_html(<<>>, Acc, _Input, _Skip) -> - Acc; -escape_html(<>, _Acc, Input, _Skip) -> - error_invalid_byte_error(Byte, Input). - -escape_html_chunk(<>, Acc, Input, Skip, Len) when Byte < 32 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_html(Rest, Acc2, Input, Skip + Len + 1); -escape_html_chunk(<>, Acc, Input, Skip, Len) when Byte < 34 -> - escape_html_chunk(Rest, Acc, Input, Skip, Len + 1); -escape_html_chunk(<>, Acc, Input, Skip, Len) when Byte =:= 34 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_html(Rest, Acc2, Input, Skip + Len + 1); -escape_html_chunk(<>, Acc, Input, Skip, Len) when Byte < 47 -> - escape_html_chunk(Rest, Acc, Input, Skip, Len + 1); -escape_html_chunk(<>, Acc, Input, Skip, Len) when Byte =:= 47 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_html(Rest, Acc2, Input, Skip + Len + 1); -escape_html_chunk(<>, Acc, Input, Skip, Len) when Byte < 92 -> - escape_html_chunk(Rest, Acc, Input, Skip, Len + 1); -escape_html_chunk(<>, Acc, Input, Skip, Len) when Byte =:= 92 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_html(Rest, Acc2, Input, Skip + Len + 1); -escape_html_chunk(<>, Acc, Input, Skip, Len) when Byte < 128 -> - escape_html_chunk(Rest, Acc, Input, Skip, Len + 1); -escape_html_chunk(<>, Acc, Input, Skip, Len) when Char =< 2047 -> - escape_html_chunk(Rest, Acc, Input, Skip, Len + 2); -escape_html_chunk(<<8232/utf8,Rest/bitstring>>, Acc, Input, Skip, Len) -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | <<"\\u2028">>], - escape_html(Rest, Acc2, Input, Skip + Len + 3); -escape_html_chunk(<<8233/utf8,Rest/bitstring>>, Acc, Input, Skip, Len) -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | <<"\\u2029">>], - escape_html(Rest, Acc2, Input, Skip + Len + 3); -escape_html_chunk(<>, Acc, Input, Skip, Len) when Char =< 65535 -> - escape_html_chunk(Rest, Acc, Input, Skip, Len + 3); -escape_html_chunk(<<_Char/utf8,Rest/bitstring>>, Acc, Input, Skip, Len) -> - escape_html_chunk(Rest, Acc, Input, Skip, Len + 4); -escape_html_chunk(<<>>, Acc, Input, Skip, Len) -> - Part = binary_part(Input, Skip, Len), - [Acc | Part]; -escape_html_chunk(<>, _Acc, Input, _Skip, _Len) -> - error_invalid_byte_error(Byte, Input). - -escape_js(Data, Input, Skip) -> - escape_js(Data, [], Input, Skip). - -escape_js(<>, Acc, Input, Skip) when Byte < 32 -> - Acc2 = [Acc | escape(Byte)], - escape_js(Rest, Acc2, Input, Skip + 1); -escape_js(<>, Acc, Input, Skip) when Byte < 34 -> - escape_js_chunk(Rest, Acc, Input, Skip, 1); -escape_js(<>, Acc, Input, Skip) when Byte =:= 34 -> - Acc2 = [Acc | escape(Byte)], - escape_js(Rest, Acc2, Input, Skip + 1); -escape_js(<>, Acc, Input, Skip) when Byte < 92 -> - escape_js_chunk(Rest, Acc, Input, Skip, 1); -escape_js(<>, Acc, Input, Skip) when Byte =:= 92 -> - Acc2 = [Acc | escape(Byte)], - escape_js(Rest, Acc2, Input, Skip + 1); -escape_js(<>, Acc, Input, Skip) when Byte < 128 -> - escape_js_chunk(Rest, Acc, Input, Skip, 1); -escape_js(<>, Acc, Input, Skip) when Char =< 2047 -> - escape_js_chunk(Rest, Acc, Input, Skip, 2); -escape_js(<<8232/utf8,Rest/bitstring>>, Acc, Input, Skip) -> - Acc2 = [Acc | <<"\\u2028">>], - escape_js(Rest, Acc2, Input, Skip + 3); -escape_js(<<8233/utf8,Rest/bitstring>>, Acc, Input, Skip) -> - Acc2 = [Acc | <<"\\u2029">>], - escape_js(Rest, Acc2, Input, Skip + 3); -escape_js(<>, Acc, Input, Skip) when Char =< 65535 -> - escape_js_chunk(Rest, Acc, Input, Skip, 3); -escape_js(<<_Char/utf8,Rest/bitstring>>, Acc, Input, Skip) -> - escape_js_chunk(Rest, Acc, Input, Skip, 4); -escape_js(<<>>, Acc, _Input, _Skip) -> - Acc; -escape_js(<>, _Acc, Input, _Skip) -> - error_invalid_byte_error(Byte, Input). - -escape_js_chunk(<>, Acc, Input, Skip, Len) when Byte < 32 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_js(Rest, Acc2, Input, Skip + Len + 1); -escape_js_chunk(<>, Acc, Input, Skip, Len) when Byte < 34 -> - escape_js_chunk(Rest, Acc, Input, Skip, Len + 1); -escape_js_chunk(<>, Acc, Input, Skip, Len) when Byte =:= 34 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_js(Rest, Acc2, Input, Skip + Len + 1); -escape_js_chunk(<>, Acc, Input, Skip, Len) when Byte < 92 -> - escape_js_chunk(Rest, Acc, Input, Skip, Len + 1); -escape_js_chunk(<>, Acc, Input, Skip, Len) when Byte =:= 92 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_js(Rest, Acc2, Input, Skip + Len + 1); - -escape_js_chunk(<>, Acc, Input, Skip, Len) when Byte < 128 -> - escape_js_chunk(Rest, Acc, Input, Skip, Len + 1); -escape_js_chunk(<>, Acc, Input, Skip, Len) when Char =< 2047 -> - escape_js_chunk(Rest, Acc, Input, Skip, Len + 2); -escape_js_chunk(<<8232/utf8,Rest/bitstring>>, Acc, Input, Skip, Len) -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | <<"\\u2028">>], - escape_js(Rest, Acc2, Input, Skip + Len + 3); -escape_js_chunk(<<8233/utf8,Rest/bitstring>>, Acc, Input, Skip, Len) -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | <<"\\u2029">>], - escape_js(Rest, Acc2, Input, Skip + Len + 3); -escape_js_chunk(<>, Acc, Input, Skip, Len) when Char =< 65535 -> - escape_js_chunk(Rest, Acc, Input, Skip, Len + 3); -escape_js_chunk(<<_Char/utf8,Rest/bitstring>>, Acc, Input, Skip, Len) -> - escape_js_chunk(Rest, Acc, Input, Skip, Len + 4); -escape_js_chunk(<<>>, Acc, Input, Skip, Len) -> - Part = binary_part(Input, Skip, Len), - [Acc | Part]; -escape_js_chunk(<>, _Acc, Input, _Skip, _Len) -> - error_invalid_byte_error(Byte, Input). - -escape_json(Data, Input, Skip) -> - escape_json(Data, [], Input, Skip). - -escape_json(<>, Acc1, Input, Skip) when Byte < 32 -> - Acc2 = [Acc1 | escape(Byte)], - escape_json(Rest, Acc2, Input, Skip + 1); -escape_json(<>, Acc1, Input, Skip) when Byte < 34 -> - escape_json_chunk(Rest, Acc1, Input, Skip, 1); -escape_json(<>, Acc1, Input, Skip) when Byte =:= 34 -> - Acc2 = [Acc1 | escape(Byte)], - escape_json(Rest, Acc2, Input, Skip + 1); -escape_json(<>, Acc1, Input, Skip) when Byte < 92 -> - escape_json_chunk(Rest, Acc1, Input, Skip, 1); -escape_json(<>, Acc, Input, Skip) when Byte =:= 92 -> - Acc2 = [Acc | escape(Byte)], - escape_json(Rest, Acc2, Input, Skip + 1); -escape_json(<>, Acc, Input, Skip) when Byte < 128 -> - escape_json_chunk(Rest, Acc, Input, Skip, 1); -escape_json(<>, Acc, Input, Skip) when Char =< 2047 -> - escape_json_chunk(Rest, Acc, Input, Skip, 2); -escape_json(<>, Acc, Input, Skip) when Char =< 65535 -> - escape_json_chunk(Rest, Acc, Input, Skip, 3); -escape_json(<<_Char/utf8,Rest/bitstring>>, Acc, Input, Skip) -> - escape_json_chunk(Rest, Acc, Input, Skip, 4); -escape_json(<<>>, Acc, _Input, _Skip) -> - Acc; -escape_json(<>, _Acc, Input, _Skip) -> - error_invalid_byte_error(Byte, Input). - -escape_json_chunk(<>, Acc, Input, Skip, Len) when Byte < 32 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_json(Rest, Acc2, Input, Skip + Len + 1); -escape_json_chunk(<>, Acc, Input, Skip, Len) when Byte < 34 -> - escape_json_chunk(Rest, Acc, Input, Skip, Len + 1); -escape_json_chunk(<>, Acc, Input, Skip, Len) when Byte =:= 34 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_json(Rest, Acc2, Input, Skip + Len + 1); -escape_json_chunk(<>, Acc, Input, Skip, Len) when Byte < 92 -> - escape_json_chunk(Rest, Acc, Input, Skip, Len + 1); -escape_json_chunk(<>, Acc, Input, Skip, Len) when Byte =:= 92 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_json(Rest, Acc2, Input, Skip + Len + 1); -escape_json_chunk(<>, Acc, Input, Skip, Len) when Byte < 128 -> - escape_json_chunk(Rest, Acc, Input, Skip, Len + 1); -escape_json_chunk(<>, Acc, Input, Skip, Len) when Char =< 2047 -> - escape_json_chunk(Rest, Acc, Input, Skip, Len + 2); -escape_json_chunk(<>, Acc, Input, Skip, Len) when Char =< 65535 -> - escape_json_chunk(Rest, Acc, Input, Skip, Len + 3); -escape_json_chunk(<<_Char/utf8,Rest/bitstring>>, Acc, Input, Skip, Len) -> - escape_json_chunk(Rest, Acc, Input, Skip, Len + 4); -escape_json_chunk(<<>>, Acc, Input, Skip, Len) -> - Part = binary_part(Input, Skip, Len), - [Acc | Part]; -escape_json_chunk(<>, _Acc, Input, _Skip, _Len) -> - error_invalid_byte_error(Byte, Input). - -escape_unicode(Data, Input, Skip) -> - escape_unicode(Data, [], Input, Skip). - -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 0 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 1 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 2 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 3 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 4 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 5 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 6 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 7 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 8 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 9 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 10 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 11 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 12 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 13 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 14 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 15 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 16 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 17 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 18 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 19 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 20 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 21 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 22 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 23 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 24 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 25 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 26 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 27 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 28 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 29 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 30 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 31 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 32 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 33 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 34 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 35 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 36 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 37 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 38 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 39 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 40 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 41 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 42 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 43 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 44 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 45 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 46 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 47 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 48 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 49 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 50 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 51 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 52 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 53 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 54 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 55 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 56 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 57 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 58 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 59 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 60 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 61 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 62 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 63 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 64 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 65 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 66 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 67 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 68 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 69 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 70 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 71 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 72 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 73 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 74 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 75 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 76 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 77 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 78 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 79 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 80 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 81 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 82 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 83 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 84 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 85 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 86 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 87 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 88 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 89 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 90 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 91 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 92 -> - Acc2 = [Acc | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 93 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 94 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 95 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 96 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 97 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 98 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 99 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 100 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 101 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 102 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 103 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 104 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 105 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 106 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 107 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 108 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 109 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 110 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 111 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 112 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 113 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 114 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 115 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 116 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 117 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 118 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 119 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 120 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 121 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 122 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 123 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 124 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 125 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 126 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Byte =:= 127 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, 1); -escape_unicode(<>, - Acc, Input, Skip) - when Char =< 255 -> - Acc2 = [Acc, <<"\\u00">> | integer_to_list(Char, 16)], - escape_unicode(Rest, Acc2, Input, Skip + 2); -escape_unicode(<>, - Acc, Input, Skip) - when Char =< 2047 -> - Acc2 = [Acc, <<"\\u0">> | integer_to_list(Char, 16)], - escape_unicode(Rest, Acc2, Input, Skip + 2); -escape_unicode(<>, - Acc, Input, Skip) - when Char =< 4095 -> - Acc2 = [Acc, <<"\\u0">> | integer_to_list(Char, 16)], - escape_unicode(Rest, Acc2, Input, Skip + 3); -escape_unicode(<>, - Acc, Input, Skip) - when Char =< 65535 -> - Acc2 = [Acc, <<"\\u">> | integer_to_list(Char, 16)], - escape_unicode(Rest, Acc2, Input, Skip + 3); -escape_unicode(<>, - Acc, Input, Skip) -> - _char@2 = Char - 65536, - Acc2 = - [Acc, - <<"\\uD">>, - integer_to_list(2048 bor (_char@2 bsr 10), 16), - <<"\\uD">> | - integer_to_list(3072 bor _char@2 band 1023, 16)], - escape_unicode(Rest, Acc2, Input, Skip + 4); -escape_unicode(<<>>, Acc, _Input, _Skip) -> - Acc; -escape_unicode(<>, - _Acc, Input, _Skip) -> - error_invalid_byte_error(Byte, Input). - -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 0 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 1 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 2 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 3 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 4 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 5 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 6 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 7 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 8 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 9 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 10 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 11 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 12 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 13 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 14 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 15 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 16 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 17 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 18 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 19 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 20 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 21 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 22 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 23 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 24 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 25 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 26 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 27 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 28 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 29 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 30 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 31 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 32 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 33 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 34 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 35 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 36 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 37 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 38 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 39 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 40 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 41 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 42 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 43 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 44 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 45 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 46 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 47 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 48 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 49 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 50 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 51 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 52 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 53 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 54 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 55 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 56 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 57 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 58 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 59 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 60 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 61 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 62 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 63 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 64 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 65 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 66 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 67 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 68 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 69 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 70 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 71 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 72 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 73 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 74 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 75 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 76 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 77 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 78 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 79 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 80 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 81 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 82 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 83 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 84 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 85 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 86 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 87 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 88 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 89 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 90 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 91 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 92 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part | escape(Byte)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 93 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 94 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 95 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 96 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 97 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 98 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 99 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 100 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 101 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 102 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 103 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 104 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 105 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 106 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 107 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 108 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 109 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 110 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 111 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 112 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 113 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 114 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 115 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 116 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 117 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 118 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 119 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 120 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 121 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 122 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 123 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 124 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 125 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 126 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Byte =:= 127 -> - escape_unicode_chunk(Rest, Acc, Input, Skip, - Len + 1); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Char =< 255 -> - Part = binary_part(Input, Skip, Len), - Acc2 = - [Acc, Part, <<"\\u00">> | integer_to_list(Char, 16)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 2); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Char =< 2047 -> - Part = binary_part(Input, Skip, Len), - Acc2 = - [Acc, Part, <<"\\u0">> | integer_to_list(Char, 16)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 2); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Char =< 4095 -> - Part = binary_part(Input, Skip, Len), - Acc2 = - [Acc, Part, <<"\\u0">> | integer_to_list(Char, 16)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 3); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) - when Char =< 65535 -> - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part, <<"\\u">> | integer_to_list(Char, 16)], - escape_unicode(Rest, Acc2, Input, Skip + Len + 3); -escape_unicode_chunk(<>, - Acc, Input, Skip, Len) -> - _char@2 = Char - 65536, - Part = binary_part(Input, Skip, Len), - Acc2 = [Acc, Part, <<"\\uD">>, - integer_to_list(2048 bor (_char@2 bsr 10), 16), - <<"\\uD">> - | integer_to_list(3072 bor _char@2 band 1023, 16) - ], - escape_unicode(Rest, Acc2, Input, Skip + Len + 4); -escape_unicode_chunk(<<>>, Acc, Input, Skip, Len) -> - Part = binary_part(Input, Skip, Len), - [Acc | Part]; -escape_unicode_chunk(<>, - _Acc, Input, _Skip, _Len) -> - error_invalid_byte_error(Byte, Input). - -key(String, Escape) when is_binary(String) -> - Escape(String, String, 0); -key(Atom, Escape) when is_atom(Atom) -> - String = atom_to_binary(Atom, utf8), - Escape(String, String, 0); -key(_charlist@1, Escape) when is_list(_charlist@1) -> - String = list_to_binary(_charlist@1), - Escape(String, String, 0); -key(Int, Escape) when is_integer(Int) -> - String = integer_to_binary(Int), - Escape(String, String, 0). - -list([], _Escape) -> - <<"[]">>; -list([First | Tail], Escape) -> - [91, value(First, Escape) | list_loop(Tail, Escape)]. - -list_loop([], _Escape) -> - [93]; -list_loop([First | Tail], Escape) -> - [44, value(First, Escape) | list_loop(Tail, Escape)]. - -map_naive([{Key, Value} | Tail], Escape) -> - [<<"{\"">>, - key(Key, Escape), - <<"\":">>, - value(Value, Escape) | - map_naive_loop(Tail, Escape)]. - -map_naive_loop([], _Escape) -> - [$}]; -map_naive_loop([{Key, Value} | Tail], Escape) -> - [<<",\"">>, - key(Key, Escape), - <<"\":">>, - value(Value, Escape) | - map_naive_loop(Tail, Escape)]. - -error_invalid_byte_error(Byte, Input) -> - error({invalid_byte, - <<"0x"/utf8,(integer_to_binary(Byte, 16))/binary>>, - Input}). - -value(Value, Escape) when is_atom(Value) -> - encode_atom(Value, Escape); -value(Value, Escape) when is_binary(Value) -> - encode_string(Value, Escape); -value(Value, _Escape) when is_integer(Value) -> - integer(Value); -value(Value, _Escape) when is_float(Value) -> - float(Value); -value([{_, _} | _] = Keyword, Escape) -> - map_naive(Keyword, Escape); -value({Y, M, D}, Escape) - when is_integer(Y) andalso Y >= 0 andalso Y =< 9999 andalso - is_integer(M) andalso M >= 1 andalso M =< 12 andalso - is_integer(D) andalso D >= 1 andalso D =< 31 -> - DateTime = io_lib:format("~4..0b-~2..0b-~2..0b", [Y, M, D]), - encode_string(iolist_to_binary(DateTime), Escape); -value({{Y, M, D}, {H, I, S}}, Escape) - when is_integer(Y) andalso Y >= 0 andalso Y =< 9999 andalso - is_integer(M) andalso M >= 1 andalso M =< 12 andalso - is_integer(D) andalso D >= 1 andalso D =< 31 andalso - is_integer(H) andalso H >= 0 andalso H =< 23 andalso - is_integer(I) andalso I >= 0 andalso I =< 59 andalso - is_integer(S) andalso S >= 0 andalso S =< 59 -> - Dt = io_lib:format("~4..0b-~2..0b-~2..0bT~2..0b:~2..0b:~sZ", - [Y, M, D, H, I, integer_to_list(S)]), - encode_string(iolist_to_binary(Dt), Escape); -value({{Y, M, D}, {H, I, S}}, Escape) - when is_integer(Y) andalso Y >= 0 andalso Y =< 9999 andalso - is_integer(M) andalso M >= 1 andalso M =< 12 andalso - is_integer(D) andalso D >= 1 andalso D =< 31 andalso - is_integer(H) andalso H >= 0 andalso H =< 23 andalso - is_integer(I) andalso I >= 0 andalso I =< 59 andalso - is_float(S) andalso S >= 0 andalso S < 60 -> - Dt = io_lib:format("~4..0b-~2..0b-~2..0bT~2..0b:~2..0b:~sZ", - [Y, M, D, H, I, float_to_binary(S, [short])]), - encode_string(iolist_to_binary(Dt), Escape); -value(Value, Escape) when is_list(Value) -> - list(Value, Escape); -value(Value, Escape) when is_map(Value) -> - case maps:to_list(Value) of - [] -> - <<"{}">>; - Keyword -> - map_naive(Keyword, Escape) - end. diff --git a/repl/shell.rkt b/repl/shell.rkt index 3c11c12..a6da6ee 100644 --- a/repl/shell.rkt +++ b/repl/shell.rkt @@ -1,4 +1,6 @@ #lang racket +; SPDX-License-Identifier: MPL-2.0 +; SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) ;; Note: racket/readline (interactive line-editing) lives in the separate ;; readline-lib package, which is absent from minimal Racket installs (e.g. ;; CI). It was imported but never used here — input is read via plain diff --git a/repl/shell.rkt.bak.20250719-182140 b/repl/shell.rkt.bak.20250719-182140 deleted file mode 100644 index f2dc1a5..0000000 --- a/repl/shell.rkt.bak.20250719-182140 +++ /dev/null @@ -1,20 +0,0 @@ -#lang racket -(require racket/readline) -(require "../core/betlang.rkt") -(define logfile \"../logs/session.log\") - -(define (log-line line) - (with-output-to-file logfile #:exists 'append - (lambda () (printf \"~a\n\" line)))) - -(displayln \"🎰 Welcome to betlang REPL\") -(displayln \"Type: (bet \\\"Win\\\" \\\"Retry\\\" \\\"Lose\\\")\") - -(let loop () - (display \"betlang> \") (flush-output) - (define expr (read)) - (unless (eof-object? expr) - (define result (eval expr)) - (displayln result) - (log-line (format \"INPUT: ~a\\nOUTPUT: ~a\" expr result)) - (loop))) diff --git a/tests/basics.rkt b/tests/basics.rkt index f68eb6e..1d75dd4 100644 --- a/tests/basics.rkt +++ b/tests/basics.rkt @@ -1,4 +1,6 @@ #lang racket +; SPDX-License-Identifier: MPL-2.0 +; SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) (require rackunit) (require "../core/betlang.rkt") (require "../lib/statistics.rkt") diff --git a/tests/basics.rkt.bak.20250719-182140 b/tests/basics.rkt.bak.20250719-182140 deleted file mode 100644 index 73d6bb1..0000000 --- a/tests/basics.rkt.bak.20250719-182140 +++ /dev/null @@ -1,8 +0,0 @@ -#lang racket -(require rackunit) -(require \"../core/betlang.rkt\") - -(module+ test - (define samples (for/list ([i (in-range 100)]) (bet \"A\" \"B\" \"C\"))) - (for ([x '(\"A\" \"B\" \"C\")]) - (check-true (member x samples)))) From e7cdc8fcc4c23092c382e36e0395a525d18b393f Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 14 Jun 2026 16:50:23 +0000 Subject: [PATCH 2/2] ci: fix OpenSSF Scorecard enforcer (publish/run-step split + JSON score gate) The scorecard job invoked ossf/scorecard-action with publish_results: true AND contained a run: step in the same job. The OSSF attestation flow rejects that with HTTP 400 ("scorecard job must only have steps with `uses`"), which fails the whole workflow. Fix: split into an uses-only publish job plus an unprivileged score-gate job. The gate reads the aggregate score from JSON output (top-level `.score`); the previous SARIF path .runs[0].tool.driver.properties.score is absent in SARIF, so the old gate always read 0 via the `// 0` fallback and failed the < 5 check (verified live on nextgen-languages scorecard-enforcer run 27468148000). Repo-specific hygiene folded in while converging onto the canonical enforcer: tightened top-level read-all to contents:read, bumped upload-sarif v3 -> v4, and corrected the actions/checkout pin comment (the pinned SHA is v6.0.2, was mislabelled # v4). https://claude.ai/code/session_01VwbFNQJw23tW8tqM7utWku --- .github/workflows/scorecard-enforcer.yml | 48 ++++++++++++++++++++---- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/.github/workflows/scorecard-enforcer.yml b/.github/workflows/scorecard-enforcer.yml index cbae4a8..5c33aa3 100644 --- a/.github/workflows/scorecard-enforcer.yml +++ b/.github/workflows/scorecard-enforcer.yml @@ -17,17 +17,24 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -permissions: read-all +permissions: + contents: read jobs: + # Publish job. The OSSF attestation flow requires that a job invoking + # ossf/scorecard-action with publish_results: true contain ONLY `uses:` + # steps (no `run:`). A `run:` step in this job makes the OSSF publish + # endpoint reject the upload with HTTP 400 ("scorecard job must only have + # steps with `uses`"), failing the whole workflow. Score enforcement is + # therefore split into the separate unprivileged `score-gate` job below. scorecard: runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 15 permissions: security-events: write id-token: write # For OIDC steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false @@ -39,14 +46,39 @@ jobs: publish_results: true - name: Upload SARIF - uses: github/codeql-action/upload-sarif@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v3 + uses: github/codeql-action/upload-sarif@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v4 with: sarif_file: results.sarif + # Unprivileged enforcement gate. Re-derives the score read-only (no + # publish, no id-token), so it may legally contain a `run:` step. + # NOTE: uses JSON output deliberately. The SARIF format does NOT carry the + # aggregate score at .runs[0].tool.driver.properties.score (it is absent + # there, so a SARIF-based gate reads the `// 0` fallback and ALWAYS fails + # the < MIN_SCORE check); the JSON format exposes the aggregate at the + # top-level `.score`. publish_results is false here and does not affect the + # computed score, so enforcement behaviour is unchanged. + score-gate: + runs-on: ubuntu-latest + timeout-minutes: 15 + permissions: + contents: read + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Run Scorecard (analysis only) + uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3 + with: + results_file: results.json + results_format: json + publish_results: false + - name: Check minimum score run: | - # Parse score from results - SCORE=$(jq -r '.runs[0].tool.driver.properties.score // 0' results.sarif 2>/dev/null || echo "0") + # JSON output carries the aggregate score at the top-level `.score`. + SCORE=$(jq -r '.score // 0' results.json 2>/dev/null || echo "0") echo "OpenSSF Scorecard Score: $SCORE" @@ -61,9 +93,9 @@ jobs: # Check specific high-priority items check-critical: runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 15 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Check SECURITY.md exists run: |