skill-universe 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/bin/skillc.mjs +3 -0
- package/build/dev/javascript/argv/_gleam_artefacts/argv.cache +0 -0
- package/build/dev/javascript/argv/_gleam_artefacts/argv.cache_inline +0 -0
- package/build/dev/javascript/argv/_gleam_artefacts/argv.cache_meta +0 -0
- package/build/dev/javascript/argv/argv.erl +12 -0
- package/build/dev/javascript/argv/argv.mjs +31 -0
- package/build/dev/javascript/argv/argv_ffi.erl +27 -0
- package/build/dev/javascript/argv/argv_ffi.mjs +20 -0
- package/build/dev/javascript/argv/gleam.mjs +1 -0
- package/build/dev/javascript/filepath/_gleam_artefacts/filepath.cache +0 -0
- package/build/dev/javascript/filepath/_gleam_artefacts/filepath.cache_inline +0 -0
- package/build/dev/javascript/filepath/_gleam_artefacts/filepath.cache_meta +0 -0
- package/build/dev/javascript/filepath/filepath.erl +425 -0
- package/build/dev/javascript/filepath/filepath.mjs +529 -0
- package/build/dev/javascript/filepath/filepath_ffi.erl +9 -0
- package/build/dev/javascript/filepath/filepath_ffi.mjs +6 -0
- package/build/dev/javascript/filepath/gleam.mjs +1 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/dict.mjs +710 -0
- package/build/dev/javascript/gleam_stdlib/gleam/bit_array.mjs +285 -0
- package/build/dev/javascript/gleam_stdlib/gleam/bool.mjs +313 -0
- package/build/dev/javascript/gleam_stdlib/gleam/bytes_tree.mjs +225 -0
- package/build/dev/javascript/gleam_stdlib/gleam/dict.mjs +456 -0
- package/build/dev/javascript/gleam_stdlib/gleam/dynamic/decode.mjs +985 -0
- package/build/dev/javascript/gleam_stdlib/gleam/dynamic.mjs +35 -0
- package/build/dev/javascript/gleam_stdlib/gleam/float.mjs +572 -0
- package/build/dev/javascript/gleam_stdlib/gleam/function.mjs +6 -0
- package/build/dev/javascript/gleam_stdlib/gleam/int.mjs +832 -0
- package/build/dev/javascript/gleam_stdlib/gleam/io.mjs +8 -0
- package/build/dev/javascript/gleam_stdlib/gleam/list.mjs +3160 -0
- package/build/dev/javascript/gleam_stdlib/gleam/option.mjs +418 -0
- package/build/dev/javascript/gleam_stdlib/gleam/order.mjs +178 -0
- package/build/dev/javascript/gleam_stdlib/gleam/pair.mjs +102 -0
- package/build/dev/javascript/gleam_stdlib/gleam/result.mjs +480 -0
- package/build/dev/javascript/gleam_stdlib/gleam/set.mjs +416 -0
- package/build/dev/javascript/gleam_stdlib/gleam/string.mjs +723 -0
- package/build/dev/javascript/gleam_stdlib/gleam/string_tree.mjs +133 -0
- package/build/dev/javascript/gleam_stdlib/gleam/uri.mjs +1155 -0
- package/build/dev/javascript/gleam_stdlib/gleam.mjs +1 -0
- package/build/dev/javascript/gleam_stdlib/gleam@bit_array.erl +347 -0
- package/build/dev/javascript/gleam_stdlib/gleam@bool.erl +352 -0
- package/build/dev/javascript/gleam_stdlib/gleam@bytes_tree.erl +211 -0
- package/build/dev/javascript/gleam_stdlib/gleam@dict.erl +521 -0
- package/build/dev/javascript/gleam_stdlib/gleam@dynamic.erl +106 -0
- package/build/dev/javascript/gleam_stdlib/gleam@dynamic@decode.erl +1112 -0
- package/build/dev/javascript/gleam_stdlib/gleam@float.erl +764 -0
- package/build/dev/javascript/gleam_stdlib/gleam@function.erl +18 -0
- package/build/dev/javascript/gleam_stdlib/gleam@int.erl +1004 -0
- package/build/dev/javascript/gleam_stdlib/gleam@io.erl +80 -0
- package/build/dev/javascript/gleam_stdlib/gleam@list.erl +2832 -0
- package/build/dev/javascript/gleam_stdlib/gleam@option.erl +413 -0
- package/build/dev/javascript/gleam_stdlib/gleam@order.erl +200 -0
- package/build/dev/javascript/gleam_stdlib/gleam@pair.erl +110 -0
- package/build/dev/javascript/gleam_stdlib/gleam@result.erl +532 -0
- package/build/dev/javascript/gleam_stdlib/gleam@set.erl +433 -0
- package/build/dev/javascript/gleam_stdlib/gleam@string.erl +1012 -0
- package/build/dev/javascript/gleam_stdlib/gleam@string_tree.erl +207 -0
- package/build/dev/javascript/gleam_stdlib/gleam@uri.erl +1049 -0
- package/build/dev/javascript/gleam_stdlib/gleam_stdlib.erl +529 -0
- package/build/dev/javascript/gleam_stdlib/gleam_stdlib.mjs +1050 -0
- package/build/dev/javascript/gleam_version +1 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache_inline +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache_meta +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@gleam_panic.cache +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@gleam_panic.cache_inline +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@gleam_panic.cache_meta +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@reporting.cache +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@reporting.cache_inline +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@reporting.cache_meta +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache_inline +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache_meta +0 -0
- package/build/dev/javascript/gleeunit/gleam.mjs +1 -0
- package/build/dev/javascript/gleeunit/gleeunit/internal/gleam_panic.mjs +180 -0
- package/build/dev/javascript/gleeunit/gleeunit/internal/gleeunit_gleam_panic_ffi.erl +49 -0
- package/build/dev/javascript/gleeunit/gleeunit/internal/gleeunit_gleam_panic_ffi.mjs +91 -0
- package/build/dev/javascript/gleeunit/gleeunit/internal/reporting.mjs +256 -0
- package/build/dev/javascript/gleeunit/gleeunit/should.mjs +135 -0
- package/build/dev/javascript/gleeunit/gleeunit.erl +89 -0
- package/build/dev/javascript/gleeunit/gleeunit.mjs +62 -0
- package/build/dev/javascript/gleeunit/gleeunit@internal@gleam_panic.erl +56 -0
- package/build/dev/javascript/gleeunit/gleeunit@internal@reporting.erl +343 -0
- package/build/dev/javascript/gleeunit/gleeunit@should.erl +153 -0
- package/build/dev/javascript/gleeunit/gleeunit_ffi.erl +21 -0
- package/build/dev/javascript/gleeunit/gleeunit_ffi.mjs +100 -0
- package/build/dev/javascript/gleeunit/gleeunit_progress.erl +72 -0
- package/build/dev/javascript/prelude.mjs +1575 -0
- package/build/dev/javascript/simplifile/_gleam_artefacts/simplifile.cache +0 -0
- package/build/dev/javascript/simplifile/_gleam_artefacts/simplifile.cache_inline +0 -0
- package/build/dev/javascript/simplifile/_gleam_artefacts/simplifile.cache_meta +0 -0
- package/build/dev/javascript/simplifile/gleam.mjs +1 -0
- package/build/dev/javascript/simplifile/simplifile.erl +893 -0
- package/build/dev/javascript/simplifile/simplifile.mjs +893 -0
- package/build/dev/javascript/simplifile/simplifile_erl.erl +244 -0
- package/build/dev/javascript/simplifile/simplifile_js.mjs +400 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/cli_test.mjs +461 -0
- package/build/dev/javascript/skillc/compiler_test.mjs +3089 -0
- package/build/dev/javascript/skillc/config_test.mjs +308 -0
- package/build/dev/javascript/skillc/gleam.main.mjs +2 -0
- package/build/dev/javascript/skillc/gleam.mjs +1 -0
- package/build/dev/javascript/skillc/importer_test.mjs +1643 -0
- package/build/dev/javascript/skillc/parser_test.mjs +1601 -0
- package/build/dev/javascript/skillc/path_test.mjs +26 -0
- package/build/dev/javascript/skillc/provider_test.mjs +221 -0
- package/build/dev/javascript/skillc/registry_test.mjs +359 -0
- package/build/dev/javascript/skillc/scaffold_test.mjs +405 -0
- package/build/dev/javascript/skillc/skillc/compiler.mjs +724 -0
- package/build/dev/javascript/skillc/skillc/config.mjs +172 -0
- package/build/dev/javascript/skillc/skillc/error.mjs +145 -0
- package/build/dev/javascript/skillc/skillc/fs.mjs +40 -0
- package/build/dev/javascript/skillc/skillc/importer.mjs +975 -0
- package/build/dev/javascript/skillc/skillc/parser.mjs +427 -0
- package/build/dev/javascript/skillc/skillc/path.mjs +52 -0
- package/build/dev/javascript/skillc/skillc/platform.mjs +44 -0
- package/build/dev/javascript/skillc/skillc/provider.mjs +86 -0
- package/build/dev/javascript/skillc/skillc/registry.mjs +701 -0
- package/build/dev/javascript/skillc/skillc/scaffold.mjs +117 -0
- package/build/dev/javascript/skillc/skillc/semver.mjs +293 -0
- package/build/dev/javascript/skillc/skillc/shell.mjs +14 -0
- package/build/dev/javascript/skillc/skillc/template.mjs +1177 -0
- package/build/dev/javascript/skillc/skillc/types.mjs +249 -0
- package/build/dev/javascript/skillc/skillc/version_constraint.mjs +290 -0
- package/build/dev/javascript/skillc/skillc/yaml.mjs +51 -0
- package/build/dev/javascript/skillc/skillc.mjs +873 -0
- package/build/dev/javascript/skillc/skillc_ffi.mjs +30 -0
- package/build/dev/javascript/skillc/skillc_test.mjs +5 -0
- package/build/dev/javascript/skillc/template_test.mjs +1638 -0
- package/build/dev/javascript/skillc/version_constraint_test.mjs +1325 -0
- package/build/dev/javascript/yay/_gleam_artefacts/yay.cache +0 -0
- package/build/dev/javascript/yay/_gleam_artefacts/yay.cache_inline +0 -0
- package/build/dev/javascript/yay/_gleam_artefacts/yay.cache_meta +0 -0
- package/build/dev/javascript/yay/gleam.mjs +1 -0
- package/build/dev/javascript/yay/yaml_ffi.erl +106 -0
- package/build/dev/javascript/yay/yaml_ffi.mjs +373 -0
- package/build/dev/javascript/yay/yay.erl +1218 -0
- package/build/dev/javascript/yay/yay.mjs +1403 -0
- package/package.json +28 -0
- package/src/skillc/compiler.gleam +561 -0
- package/src/skillc/config.gleam +91 -0
- package/src/skillc/error.gleam +37 -0
- package/src/skillc/fs.gleam +31 -0
- package/src/skillc/importer.gleam +709 -0
- package/src/skillc/parser.gleam +279 -0
- package/src/skillc/path.gleam +30 -0
- package/src/skillc/platform.gleam +25 -0
- package/src/skillc/provider.gleam +58 -0
- package/src/skillc/registry.gleam +472 -0
- package/src/skillc/scaffold.gleam +112 -0
- package/src/skillc/semver.gleam +165 -0
- package/src/skillc/shell.gleam +12 -0
- package/src/skillc/template.gleam +885 -0
- package/src/skillc/types.gleam +93 -0
- package/src/skillc/version_constraint.gleam +163 -0
- package/src/skillc/yaml.gleam +27 -0
- package/src/skillc.gleam +466 -0
- package/src/skillc_ffi.mjs +30 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../prelude.mjs";
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
-module(gleam@bit_array).
|
|
2
|
+
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
|
|
3
|
+
-define(FILEPATH, "src/gleam/bit_array.gleam").
|
|
4
|
+
-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]).
|
|
5
|
+
|
|
6
|
+
-if(?OTP_RELEASE >= 27).
|
|
7
|
+
-define(MODULEDOC(Str), -moduledoc(Str)).
|
|
8
|
+
-define(DOC(Str), -doc(Str)).
|
|
9
|
+
-else.
|
|
10
|
+
-define(MODULEDOC(Str), -compile([])).
|
|
11
|
+
-define(DOC(Str), -compile([])).
|
|
12
|
+
-endif.
|
|
13
|
+
|
|
14
|
+
?MODULEDOC(" BitArrays are a sequence of binary data of any length.\n").
|
|
15
|
+
|
|
16
|
+
-file("src/gleam/bit_array.gleam", 11).
|
|
17
|
+
?DOC(" Converts a UTF-8 `String` type into a `BitArray`.\n").
|
|
18
|
+
-spec from_string(binary()) -> bitstring().
|
|
19
|
+
from_string(X) ->
|
|
20
|
+
gleam_stdlib:identity(X).
|
|
21
|
+
|
|
22
|
+
-file("src/gleam/bit_array.gleam", 17).
|
|
23
|
+
?DOC(" Returns an integer which is the number of bits in the bit array.\n").
|
|
24
|
+
-spec bit_size(bitstring()) -> integer().
|
|
25
|
+
bit_size(X) ->
|
|
26
|
+
erlang:bit_size(X).
|
|
27
|
+
|
|
28
|
+
-file("src/gleam/bit_array.gleam", 23).
|
|
29
|
+
?DOC(" Returns an integer which is the number of bytes in the bit array.\n").
|
|
30
|
+
-spec byte_size(bitstring()) -> integer().
|
|
31
|
+
byte_size(X) ->
|
|
32
|
+
erlang:byte_size(X).
|
|
33
|
+
|
|
34
|
+
-file("src/gleam/bit_array.gleam", 29).
|
|
35
|
+
?DOC(" Pads a bit array with zeros so that it is a whole number of bytes.\n").
|
|
36
|
+
-spec pad_to_bytes(bitstring()) -> bitstring().
|
|
37
|
+
pad_to_bytes(X) ->
|
|
38
|
+
gleam_stdlib:bit_array_pad_to_bytes(X).
|
|
39
|
+
|
|
40
|
+
-file("src/gleam/bit_array.gleam", 54).
|
|
41
|
+
?DOC(
|
|
42
|
+
" Extracts a sub-section of a bit array.\n"
|
|
43
|
+
"\n"
|
|
44
|
+
" The slice will start at given position and continue up to specified\n"
|
|
45
|
+
" length.\n"
|
|
46
|
+
" A negative length can be used to extract bytes at the end of a bit array.\n"
|
|
47
|
+
"\n"
|
|
48
|
+
" This function runs in constant time.\n"
|
|
49
|
+
).
|
|
50
|
+
-spec slice(bitstring(), integer(), integer()) -> {ok, bitstring()} |
|
|
51
|
+
{error, nil}.
|
|
52
|
+
slice(String, Position, Length) ->
|
|
53
|
+
gleam_stdlib:bit_array_slice(String, Position, Length).
|
|
54
|
+
|
|
55
|
+
-file("src/gleam/bit_array.gleam", 67).
|
|
56
|
+
-spec is_utf8_loop(bitstring()) -> boolean().
|
|
57
|
+
is_utf8_loop(Bits) ->
|
|
58
|
+
case Bits of
|
|
59
|
+
<<>> ->
|
|
60
|
+
true;
|
|
61
|
+
|
|
62
|
+
<<_/utf8, Rest/binary>> ->
|
|
63
|
+
is_utf8_loop(Rest);
|
|
64
|
+
|
|
65
|
+
_ ->
|
|
66
|
+
false
|
|
67
|
+
end.
|
|
68
|
+
|
|
69
|
+
-file("src/gleam/bit_array.gleam", 62).
|
|
70
|
+
?DOC(" Tests to see whether a bit array is valid UTF-8.\n").
|
|
71
|
+
-spec is_utf8(bitstring()) -> boolean().
|
|
72
|
+
is_utf8(Bits) ->
|
|
73
|
+
is_utf8_loop(Bits).
|
|
74
|
+
|
|
75
|
+
-file("src/gleam/bit_array.gleam", 88).
|
|
76
|
+
?DOC(
|
|
77
|
+
" Converts a bit array to a string.\n"
|
|
78
|
+
"\n"
|
|
79
|
+
" Returns an error if the bit array is invalid UTF-8 data.\n"
|
|
80
|
+
).
|
|
81
|
+
-spec to_string(bitstring()) -> {ok, binary()} | {error, nil}.
|
|
82
|
+
to_string(Bits) ->
|
|
83
|
+
case is_utf8(Bits) of
|
|
84
|
+
true ->
|
|
85
|
+
{ok, gleam_stdlib:identity(Bits)};
|
|
86
|
+
|
|
87
|
+
false ->
|
|
88
|
+
{error, nil}
|
|
89
|
+
end.
|
|
90
|
+
|
|
91
|
+
-file("src/gleam/bit_array.gleam", 109).
|
|
92
|
+
?DOC(
|
|
93
|
+
" Creates a new bit array by joining multiple binaries.\n"
|
|
94
|
+
"\n"
|
|
95
|
+
" ## Examples\n"
|
|
96
|
+
"\n"
|
|
97
|
+
" ```gleam\n"
|
|
98
|
+
" concat([from_string(\"butter\"), from_string(\"fly\")])\n"
|
|
99
|
+
" // -> from_string(\"butterfly\")\n"
|
|
100
|
+
" ```\n"
|
|
101
|
+
).
|
|
102
|
+
-spec concat(list(bitstring())) -> bitstring().
|
|
103
|
+
concat(Bit_arrays) ->
|
|
104
|
+
gleam_stdlib:bit_array_concat(Bit_arrays).
|
|
105
|
+
|
|
106
|
+
-file("src/gleam/bit_array.gleam", 40).
|
|
107
|
+
?DOC(
|
|
108
|
+
" Creates a new bit array by joining two bit arrays.\n"
|
|
109
|
+
"\n"
|
|
110
|
+
" ## Examples\n"
|
|
111
|
+
"\n"
|
|
112
|
+
" ```gleam\n"
|
|
113
|
+
" append(to: from_string(\"butter\"), suffix: from_string(\"fly\"))\n"
|
|
114
|
+
" // -> from_string(\"butterfly\")\n"
|
|
115
|
+
" ```\n"
|
|
116
|
+
).
|
|
117
|
+
-spec append(bitstring(), bitstring()) -> bitstring().
|
|
118
|
+
append(First, Second) ->
|
|
119
|
+
gleam_stdlib:bit_array_concat([First, Second]).
|
|
120
|
+
|
|
121
|
+
-file("src/gleam/bit_array.gleam", 118).
|
|
122
|
+
?DOC(
|
|
123
|
+
" Encodes a BitArray into a base 64 encoded string.\n"
|
|
124
|
+
"\n"
|
|
125
|
+
" If the bit array does not contain a whole number of bytes then it is padded\n"
|
|
126
|
+
" with zero bits prior to being encoded.\n"
|
|
127
|
+
).
|
|
128
|
+
-spec base64_encode(bitstring(), boolean()) -> binary().
|
|
129
|
+
base64_encode(Input, Padding) ->
|
|
130
|
+
gleam_stdlib:base64_encode(Input, Padding).
|
|
131
|
+
|
|
132
|
+
-file("src/gleam/bit_array.gleam", 122).
|
|
133
|
+
?DOC(" Decodes a base 64 encoded string into a `BitArray`.\n").
|
|
134
|
+
-spec base64_decode(binary()) -> {ok, bitstring()} | {error, nil}.
|
|
135
|
+
base64_decode(Encoded) ->
|
|
136
|
+
Padded = case erlang:byte_size(gleam_stdlib:identity(Encoded)) rem 4 of
|
|
137
|
+
0 ->
|
|
138
|
+
Encoded;
|
|
139
|
+
|
|
140
|
+
N ->
|
|
141
|
+
gleam@string:append(
|
|
142
|
+
Encoded,
|
|
143
|
+
gleam@string:repeat(<<"="/utf8>>, 4 - N)
|
|
144
|
+
)
|
|
145
|
+
end,
|
|
146
|
+
gleam_stdlib:base64_decode(Padded).
|
|
147
|
+
|
|
148
|
+
-file("src/gleam/bit_array.gleam", 140).
|
|
149
|
+
?DOC(
|
|
150
|
+
" Encodes a `BitArray` into a base 64 encoded string with URL and filename\n"
|
|
151
|
+
" safe alphabet.\n"
|
|
152
|
+
"\n"
|
|
153
|
+
" If the bit array does not contain a whole number of bytes then it is padded\n"
|
|
154
|
+
" with zero bits prior to being encoded.\n"
|
|
155
|
+
).
|
|
156
|
+
-spec base64_url_encode(bitstring(), boolean()) -> binary().
|
|
157
|
+
base64_url_encode(Input, Padding) ->
|
|
158
|
+
_pipe = Input,
|
|
159
|
+
_pipe@1 = gleam_stdlib:base64_encode(_pipe, Padding),
|
|
160
|
+
_pipe@2 = gleam@string:replace(_pipe@1, <<"+"/utf8>>, <<"-"/utf8>>),
|
|
161
|
+
gleam@string:replace(_pipe@2, <<"/"/utf8>>, <<"_"/utf8>>).
|
|
162
|
+
|
|
163
|
+
-file("src/gleam/bit_array.gleam", 150).
|
|
164
|
+
?DOC(
|
|
165
|
+
" Decodes a base 64 encoded string with URL and filename safe alphabet into a\n"
|
|
166
|
+
" `BitArray`.\n"
|
|
167
|
+
).
|
|
168
|
+
-spec base64_url_decode(binary()) -> {ok, bitstring()} | {error, nil}.
|
|
169
|
+
base64_url_decode(Encoded) ->
|
|
170
|
+
_pipe = Encoded,
|
|
171
|
+
_pipe@1 = gleam@string:replace(_pipe, <<"-"/utf8>>, <<"+"/utf8>>),
|
|
172
|
+
_pipe@2 = gleam@string:replace(_pipe@1, <<"_"/utf8>>, <<"/"/utf8>>),
|
|
173
|
+
base64_decode(_pipe@2).
|
|
174
|
+
|
|
175
|
+
-file("src/gleam/bit_array.gleam", 164).
|
|
176
|
+
?DOC(
|
|
177
|
+
" Encodes a `BitArray` into a base 16 encoded string.\n"
|
|
178
|
+
"\n"
|
|
179
|
+
" If the bit array does not contain a whole number of bytes then it is padded\n"
|
|
180
|
+
" with zero bits prior to being encoded.\n"
|
|
181
|
+
).
|
|
182
|
+
-spec base16_encode(bitstring()) -> binary().
|
|
183
|
+
base16_encode(Input) ->
|
|
184
|
+
gleam_stdlib:base16_encode(Input).
|
|
185
|
+
|
|
186
|
+
-file("src/gleam/bit_array.gleam", 170).
|
|
187
|
+
?DOC(" Decodes a base 16 encoded string into a `BitArray`.\n").
|
|
188
|
+
-spec base16_decode(binary()) -> {ok, bitstring()} | {error, nil}.
|
|
189
|
+
base16_decode(Input) ->
|
|
190
|
+
gleam_stdlib:base16_decode(Input).
|
|
191
|
+
|
|
192
|
+
-file("src/gleam/bit_array.gleam", 191).
|
|
193
|
+
-spec inspect_loop(bitstring(), binary()) -> binary().
|
|
194
|
+
inspect_loop(Input, Accumulator) ->
|
|
195
|
+
case Input of
|
|
196
|
+
<<>> ->
|
|
197
|
+
Accumulator;
|
|
198
|
+
|
|
199
|
+
<<X:1>> ->
|
|
200
|
+
<<<<Accumulator/binary, (erlang:integer_to_binary(X))/binary>>/binary,
|
|
201
|
+
":size(1)"/utf8>>;
|
|
202
|
+
|
|
203
|
+
<<X@1:2>> ->
|
|
204
|
+
<<<<Accumulator/binary, (erlang:integer_to_binary(X@1))/binary>>/binary,
|
|
205
|
+
":size(2)"/utf8>>;
|
|
206
|
+
|
|
207
|
+
<<X@2:3>> ->
|
|
208
|
+
<<<<Accumulator/binary, (erlang:integer_to_binary(X@2))/binary>>/binary,
|
|
209
|
+
":size(3)"/utf8>>;
|
|
210
|
+
|
|
211
|
+
<<X@3:4>> ->
|
|
212
|
+
<<<<Accumulator/binary, (erlang:integer_to_binary(X@3))/binary>>/binary,
|
|
213
|
+
":size(4)"/utf8>>;
|
|
214
|
+
|
|
215
|
+
<<X@4:5>> ->
|
|
216
|
+
<<<<Accumulator/binary, (erlang:integer_to_binary(X@4))/binary>>/binary,
|
|
217
|
+
":size(5)"/utf8>>;
|
|
218
|
+
|
|
219
|
+
<<X@5:6>> ->
|
|
220
|
+
<<<<Accumulator/binary, (erlang:integer_to_binary(X@5))/binary>>/binary,
|
|
221
|
+
":size(6)"/utf8>>;
|
|
222
|
+
|
|
223
|
+
<<X@6:7>> ->
|
|
224
|
+
<<<<Accumulator/binary, (erlang:integer_to_binary(X@6))/binary>>/binary,
|
|
225
|
+
":size(7)"/utf8>>;
|
|
226
|
+
|
|
227
|
+
<<X@7, Rest/bitstring>> ->
|
|
228
|
+
Suffix = case Rest of
|
|
229
|
+
<<>> ->
|
|
230
|
+
<<""/utf8>>;
|
|
231
|
+
|
|
232
|
+
_ ->
|
|
233
|
+
<<", "/utf8>>
|
|
234
|
+
end,
|
|
235
|
+
Accumulator@1 = <<<<Accumulator/binary,
|
|
236
|
+
(erlang:integer_to_binary(X@7))/binary>>/binary,
|
|
237
|
+
Suffix/binary>>,
|
|
238
|
+
inspect_loop(Rest, Accumulator@1);
|
|
239
|
+
|
|
240
|
+
_ ->
|
|
241
|
+
Accumulator
|
|
242
|
+
end.
|
|
243
|
+
|
|
244
|
+
-file("src/gleam/bit_array.gleam", 187).
|
|
245
|
+
?DOC(
|
|
246
|
+
" Converts a bit array to a string containing the decimal value of each byte.\n"
|
|
247
|
+
"\n"
|
|
248
|
+
" Use this over `string.inspect` when you have a bit array you want printed\n"
|
|
249
|
+
" in the array syntax even if it is valid UTF-8.\n"
|
|
250
|
+
"\n"
|
|
251
|
+
" ## Examples\n"
|
|
252
|
+
"\n"
|
|
253
|
+
" ```gleam\n"
|
|
254
|
+
" inspect(<<0, 20, 0x20, 255>>)\n"
|
|
255
|
+
" // -> \"<<0, 20, 32, 255>>\"\n"
|
|
256
|
+
"\n"
|
|
257
|
+
" inspect(<<100, 5:3>>)\n"
|
|
258
|
+
" // -> \"<<100, 5:size(3)>>\"\n"
|
|
259
|
+
" ```\n"
|
|
260
|
+
).
|
|
261
|
+
-spec inspect(bitstring()) -> binary().
|
|
262
|
+
inspect(Input) ->
|
|
263
|
+
<<(inspect_loop(Input, <<"<<"/utf8>>))/binary, ">>"/utf8>>.
|
|
264
|
+
|
|
265
|
+
-file("src/gleam/bit_array.gleam", 232).
|
|
266
|
+
?DOC(
|
|
267
|
+
" Compare two bit arrays as sequences of bytes.\n"
|
|
268
|
+
"\n"
|
|
269
|
+
" ## Examples\n"
|
|
270
|
+
"\n"
|
|
271
|
+
" ```gleam\n"
|
|
272
|
+
" compare(<<1>>, <<2>>)\n"
|
|
273
|
+
" // -> Lt\n"
|
|
274
|
+
"\n"
|
|
275
|
+
" compare(<<\"AB\":utf8>>, <<\"AA\":utf8>>)\n"
|
|
276
|
+
" // -> Gt\n"
|
|
277
|
+
"\n"
|
|
278
|
+
" compare(<<1, 2:size(2)>>, with: <<1, 2:size(2)>>)\n"
|
|
279
|
+
" // -> Eq\n"
|
|
280
|
+
" ```\n"
|
|
281
|
+
).
|
|
282
|
+
-spec compare(bitstring(), bitstring()) -> gleam@order:order().
|
|
283
|
+
compare(A, B) ->
|
|
284
|
+
case {A, B} of
|
|
285
|
+
{<<First_byte, First_rest/bitstring>>,
|
|
286
|
+
<<Second_byte, Second_rest/bitstring>>} ->
|
|
287
|
+
case {First_byte, Second_byte} of
|
|
288
|
+
{F, S} when F > S ->
|
|
289
|
+
gt;
|
|
290
|
+
|
|
291
|
+
{F@1, S@1} when F@1 < S@1 ->
|
|
292
|
+
lt;
|
|
293
|
+
|
|
294
|
+
{_, _} ->
|
|
295
|
+
compare(First_rest, Second_rest)
|
|
296
|
+
end;
|
|
297
|
+
|
|
298
|
+
{<<>>, <<>>} ->
|
|
299
|
+
eq;
|
|
300
|
+
|
|
301
|
+
{_, <<>>} ->
|
|
302
|
+
gt;
|
|
303
|
+
|
|
304
|
+
{<<>>, _} ->
|
|
305
|
+
lt;
|
|
306
|
+
|
|
307
|
+
{First, Second} ->
|
|
308
|
+
case {gleam_stdlib:bit_array_to_int_and_size(First),
|
|
309
|
+
gleam_stdlib:bit_array_to_int_and_size(Second)} of
|
|
310
|
+
{{A@1, _}, {B@1, _}} when A@1 > B@1 ->
|
|
311
|
+
gt;
|
|
312
|
+
|
|
313
|
+
{{A@2, _}, {B@2, _}} when A@2 < B@2 ->
|
|
314
|
+
lt;
|
|
315
|
+
|
|
316
|
+
{{_, Size_a}, {_, Size_b}} when Size_a > Size_b ->
|
|
317
|
+
gt;
|
|
318
|
+
|
|
319
|
+
{{_, Size_a@1}, {_, Size_b@1}} when Size_a@1 < Size_b@1 ->
|
|
320
|
+
lt;
|
|
321
|
+
|
|
322
|
+
{_, _} ->
|
|
323
|
+
eq
|
|
324
|
+
end
|
|
325
|
+
end.
|
|
326
|
+
|
|
327
|
+
-file("src/gleam/bit_array.gleam", 273).
|
|
328
|
+
?DOC(
|
|
329
|
+
" Checks whether the first `BitArray` starts with the second one.\n"
|
|
330
|
+
"\n"
|
|
331
|
+
" ## Examples\n"
|
|
332
|
+
"\n"
|
|
333
|
+
" ```gleam\n"
|
|
334
|
+
" starts_with(<<1, 2, 3, 4>>, <<1, 2>>)\n"
|
|
335
|
+
" // -> True\n"
|
|
336
|
+
" ```\n"
|
|
337
|
+
).
|
|
338
|
+
-spec starts_with(bitstring(), bitstring()) -> boolean().
|
|
339
|
+
starts_with(Bits, Prefix) ->
|
|
340
|
+
Prefix_size = erlang:bit_size(Prefix),
|
|
341
|
+
case Bits of
|
|
342
|
+
<<Pref:Prefix_size/bitstring, _/bitstring>> when Pref =:= Prefix ->
|
|
343
|
+
true;
|
|
344
|
+
|
|
345
|
+
_ ->
|
|
346
|
+
false
|
|
347
|
+
end.
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
-module(gleam@bool).
|
|
2
|
+
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
|
|
3
|
+
-define(FILEPATH, "src/gleam/bool.gleam").
|
|
4
|
+
-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]).
|
|
5
|
+
|
|
6
|
+
-if(?OTP_RELEASE >= 27).
|
|
7
|
+
-define(MODULEDOC(Str), -moduledoc(Str)).
|
|
8
|
+
-define(DOC(Str), -doc(Str)).
|
|
9
|
+
-else.
|
|
10
|
+
-define(MODULEDOC(Str), -compile([])).
|
|
11
|
+
-define(DOC(Str), -compile([])).
|
|
12
|
+
-endif.
|
|
13
|
+
|
|
14
|
+
?MODULEDOC(
|
|
15
|
+
" A type with two possible values, `True` and `False`. Used to indicate whether\n"
|
|
16
|
+
" things are... true or false!\n"
|
|
17
|
+
"\n"
|
|
18
|
+
" It is often clearer and offers more type safety to define a custom type\n"
|
|
19
|
+
" than to use `Bool`. For example, rather than having a `is_teacher: Bool`\n"
|
|
20
|
+
" field consider having a `role: SchoolRole` field where `SchoolRole` is a custom\n"
|
|
21
|
+
" type that can be either `Student` or `Teacher`.\n"
|
|
22
|
+
).
|
|
23
|
+
|
|
24
|
+
-file("src/gleam/bool.gleam", 31).
|
|
25
|
+
?DOC(
|
|
26
|
+
" Returns the and of two bools, but it evaluates both arguments.\n"
|
|
27
|
+
"\n"
|
|
28
|
+
" It's the function equivalent of the `&&` operator.\n"
|
|
29
|
+
" This function is useful in higher order functions or pipes.\n"
|
|
30
|
+
"\n"
|
|
31
|
+
" ## Examples\n"
|
|
32
|
+
"\n"
|
|
33
|
+
" ```gleam\n"
|
|
34
|
+
" and(True, True)\n"
|
|
35
|
+
" // -> True\n"
|
|
36
|
+
" ```\n"
|
|
37
|
+
"\n"
|
|
38
|
+
" ```gleam\n"
|
|
39
|
+
" and(False, True)\n"
|
|
40
|
+
" // -> False\n"
|
|
41
|
+
" ```\n"
|
|
42
|
+
"\n"
|
|
43
|
+
" ```gleam\n"
|
|
44
|
+
" False |> and(True)\n"
|
|
45
|
+
" // -> False\n"
|
|
46
|
+
" ```\n"
|
|
47
|
+
).
|
|
48
|
+
-spec 'and'(boolean(), boolean()) -> boolean().
|
|
49
|
+
'and'(A, B) ->
|
|
50
|
+
A andalso B.
|
|
51
|
+
|
|
52
|
+
-file("src/gleam/bool.gleam", 57).
|
|
53
|
+
?DOC(
|
|
54
|
+
" Returns the or of two bools, but it evaluates both arguments.\n"
|
|
55
|
+
"\n"
|
|
56
|
+
" It's the function equivalent of the `||` operator.\n"
|
|
57
|
+
" This function is useful in higher order functions or pipes.\n"
|
|
58
|
+
"\n"
|
|
59
|
+
" ## Examples\n"
|
|
60
|
+
"\n"
|
|
61
|
+
" ```gleam\n"
|
|
62
|
+
" or(True, True)\n"
|
|
63
|
+
" // -> True\n"
|
|
64
|
+
" ```\n"
|
|
65
|
+
"\n"
|
|
66
|
+
" ```gleam\n"
|
|
67
|
+
" or(False, True)\n"
|
|
68
|
+
" // -> True\n"
|
|
69
|
+
" ```\n"
|
|
70
|
+
"\n"
|
|
71
|
+
" ```gleam\n"
|
|
72
|
+
" False |> or(True)\n"
|
|
73
|
+
" // -> True\n"
|
|
74
|
+
" ```\n"
|
|
75
|
+
).
|
|
76
|
+
-spec 'or'(boolean(), boolean()) -> boolean().
|
|
77
|
+
'or'(A, B) ->
|
|
78
|
+
A orelse B.
|
|
79
|
+
|
|
80
|
+
-file("src/gleam/bool.gleam", 77).
|
|
81
|
+
?DOC(
|
|
82
|
+
" Returns the opposite bool value.\n"
|
|
83
|
+
"\n"
|
|
84
|
+
" This is the same as the `!` or `not` operators in some other languages.\n"
|
|
85
|
+
"\n"
|
|
86
|
+
" ## Examples\n"
|
|
87
|
+
"\n"
|
|
88
|
+
" ```gleam\n"
|
|
89
|
+
" negate(True)\n"
|
|
90
|
+
" // -> False\n"
|
|
91
|
+
" ```\n"
|
|
92
|
+
"\n"
|
|
93
|
+
" ```gleam\n"
|
|
94
|
+
" negate(False)\n"
|
|
95
|
+
" // -> True\n"
|
|
96
|
+
" ```\n"
|
|
97
|
+
).
|
|
98
|
+
-spec negate(boolean()) -> boolean().
|
|
99
|
+
negate(Bool) ->
|
|
100
|
+
not Bool.
|
|
101
|
+
|
|
102
|
+
-file("src/gleam/bool.gleam", 105).
|
|
103
|
+
?DOC(
|
|
104
|
+
" Returns the nor of two bools.\n"
|
|
105
|
+
"\n"
|
|
106
|
+
" ## Examples\n"
|
|
107
|
+
"\n"
|
|
108
|
+
" ```gleam\n"
|
|
109
|
+
" nor(False, False)\n"
|
|
110
|
+
" // -> True\n"
|
|
111
|
+
" ```\n"
|
|
112
|
+
"\n"
|
|
113
|
+
" ```gleam\n"
|
|
114
|
+
" nor(False, True)\n"
|
|
115
|
+
" // -> False\n"
|
|
116
|
+
" ```\n"
|
|
117
|
+
"\n"
|
|
118
|
+
" ```gleam\n"
|
|
119
|
+
" nor(True, False)\n"
|
|
120
|
+
" // -> False\n"
|
|
121
|
+
" ```\n"
|
|
122
|
+
"\n"
|
|
123
|
+
" ```gleam\n"
|
|
124
|
+
" nor(True, True)\n"
|
|
125
|
+
" // -> False\n"
|
|
126
|
+
" ```\n"
|
|
127
|
+
).
|
|
128
|
+
-spec nor(boolean(), boolean()) -> boolean().
|
|
129
|
+
nor(A, B) ->
|
|
130
|
+
not (A orelse B).
|
|
131
|
+
|
|
132
|
+
-file("src/gleam/bool.gleam", 133).
|
|
133
|
+
?DOC(
|
|
134
|
+
" Returns the nand of two bools.\n"
|
|
135
|
+
"\n"
|
|
136
|
+
" ## Examples\n"
|
|
137
|
+
"\n"
|
|
138
|
+
" ```gleam\n"
|
|
139
|
+
" nand(False, False)\n"
|
|
140
|
+
" // -> True\n"
|
|
141
|
+
" ```\n"
|
|
142
|
+
"\n"
|
|
143
|
+
" ```gleam\n"
|
|
144
|
+
" nand(False, True)\n"
|
|
145
|
+
" // -> True\n"
|
|
146
|
+
" ```\n"
|
|
147
|
+
"\n"
|
|
148
|
+
" ```gleam\n"
|
|
149
|
+
" nand(True, False)\n"
|
|
150
|
+
" // -> True\n"
|
|
151
|
+
" ```\n"
|
|
152
|
+
"\n"
|
|
153
|
+
" ```gleam\n"
|
|
154
|
+
" nand(True, True)\n"
|
|
155
|
+
" // -> False\n"
|
|
156
|
+
" ```\n"
|
|
157
|
+
).
|
|
158
|
+
-spec nand(boolean(), boolean()) -> boolean().
|
|
159
|
+
nand(A, B) ->
|
|
160
|
+
not (A andalso B).
|
|
161
|
+
|
|
162
|
+
-file("src/gleam/bool.gleam", 161).
|
|
163
|
+
?DOC(
|
|
164
|
+
" Returns the exclusive or of two bools.\n"
|
|
165
|
+
"\n"
|
|
166
|
+
" ## Examples\n"
|
|
167
|
+
"\n"
|
|
168
|
+
" ```gleam\n"
|
|
169
|
+
" exclusive_or(False, False)\n"
|
|
170
|
+
" // -> False\n"
|
|
171
|
+
" ```\n"
|
|
172
|
+
"\n"
|
|
173
|
+
" ```gleam\n"
|
|
174
|
+
" exclusive_or(False, True)\n"
|
|
175
|
+
" // -> True\n"
|
|
176
|
+
" ```\n"
|
|
177
|
+
"\n"
|
|
178
|
+
" ```gleam\n"
|
|
179
|
+
" exclusive_or(True, False)\n"
|
|
180
|
+
" // -> True\n"
|
|
181
|
+
" ```\n"
|
|
182
|
+
"\n"
|
|
183
|
+
" ```gleam\n"
|
|
184
|
+
" exclusive_or(True, True)\n"
|
|
185
|
+
" // -> False\n"
|
|
186
|
+
" ```\n"
|
|
187
|
+
).
|
|
188
|
+
-spec exclusive_or(boolean(), boolean()) -> boolean().
|
|
189
|
+
exclusive_or(A, B) ->
|
|
190
|
+
A /= B.
|
|
191
|
+
|
|
192
|
+
-file("src/gleam/bool.gleam", 189).
|
|
193
|
+
?DOC(
|
|
194
|
+
" Returns the exclusive nor of two bools.\n"
|
|
195
|
+
"\n"
|
|
196
|
+
" ## Examples\n"
|
|
197
|
+
"\n"
|
|
198
|
+
" ```gleam\n"
|
|
199
|
+
" exclusive_nor(False, False)\n"
|
|
200
|
+
" // -> True\n"
|
|
201
|
+
" ```\n"
|
|
202
|
+
"\n"
|
|
203
|
+
" ```gleam\n"
|
|
204
|
+
" exclusive_nor(False, True)\n"
|
|
205
|
+
" // -> False\n"
|
|
206
|
+
" ```\n"
|
|
207
|
+
"\n"
|
|
208
|
+
" ```gleam\n"
|
|
209
|
+
" exclusive_nor(True, False)\n"
|
|
210
|
+
" // -> False\n"
|
|
211
|
+
" ```\n"
|
|
212
|
+
"\n"
|
|
213
|
+
" ```gleam\n"
|
|
214
|
+
" exclusive_nor(True, True)\n"
|
|
215
|
+
" // -> True\n"
|
|
216
|
+
" ```\n"
|
|
217
|
+
).
|
|
218
|
+
-spec exclusive_nor(boolean(), boolean()) -> boolean().
|
|
219
|
+
exclusive_nor(A, B) ->
|
|
220
|
+
A =:= B.
|
|
221
|
+
|
|
222
|
+
-file("src/gleam/bool.gleam", 207).
|
|
223
|
+
?DOC(
|
|
224
|
+
" Returns a string representation of the given bool.\n"
|
|
225
|
+
"\n"
|
|
226
|
+
" ## Examples\n"
|
|
227
|
+
"\n"
|
|
228
|
+
" ```gleam\n"
|
|
229
|
+
" to_string(True)\n"
|
|
230
|
+
" // -> \"True\"\n"
|
|
231
|
+
" ```\n"
|
|
232
|
+
"\n"
|
|
233
|
+
" ```gleam\n"
|
|
234
|
+
" to_string(False)\n"
|
|
235
|
+
" // -> \"False\"\n"
|
|
236
|
+
" ```\n"
|
|
237
|
+
).
|
|
238
|
+
-spec to_string(boolean()) -> binary().
|
|
239
|
+
to_string(Bool) ->
|
|
240
|
+
case Bool of
|
|
241
|
+
false ->
|
|
242
|
+
<<"False"/utf8>>;
|
|
243
|
+
|
|
244
|
+
true ->
|
|
245
|
+
<<"True"/utf8>>
|
|
246
|
+
end.
|
|
247
|
+
|
|
248
|
+
-file("src/gleam/bool.gleam", 266).
|
|
249
|
+
?DOC(
|
|
250
|
+
" Run a callback function if the given bool is `False`, otherwise return a\n"
|
|
251
|
+
" default value.\n"
|
|
252
|
+
"\n"
|
|
253
|
+
" With a `use` expression this function can simulate the early-return pattern\n"
|
|
254
|
+
" found in some other programming languages.\n"
|
|
255
|
+
"\n"
|
|
256
|
+
" In a procedural language:\n"
|
|
257
|
+
"\n"
|
|
258
|
+
" ```js\n"
|
|
259
|
+
" if (predicate) return value;\n"
|
|
260
|
+
" // ...\n"
|
|
261
|
+
" ```\n"
|
|
262
|
+
"\n"
|
|
263
|
+
" In Gleam with a `use` expression:\n"
|
|
264
|
+
"\n"
|
|
265
|
+
" ```gleam\n"
|
|
266
|
+
" use <- guard(when: predicate, return: value)\n"
|
|
267
|
+
" // ...\n"
|
|
268
|
+
" ```\n"
|
|
269
|
+
"\n"
|
|
270
|
+
" Like everything in Gleam `use` is an expression, so it short circuits the\n"
|
|
271
|
+
" current block, not the entire function. As a result you can assign the value\n"
|
|
272
|
+
" to a variable:\n"
|
|
273
|
+
"\n"
|
|
274
|
+
" ```gleam\n"
|
|
275
|
+
" let x = {\n"
|
|
276
|
+
" use <- guard(when: predicate, return: value)\n"
|
|
277
|
+
" // ...\n"
|
|
278
|
+
" }\n"
|
|
279
|
+
" ```\n"
|
|
280
|
+
"\n"
|
|
281
|
+
" Note that unlike in procedural languages the `return` value is evaluated\n"
|
|
282
|
+
" even when the predicate is `False`, so it is advisable not to perform\n"
|
|
283
|
+
" expensive computation nor side-effects there.\n"
|
|
284
|
+
"\n"
|
|
285
|
+
"\n"
|
|
286
|
+
" ## Examples\n"
|
|
287
|
+
"\n"
|
|
288
|
+
" ```gleam\n"
|
|
289
|
+
" let name = \"\"\n"
|
|
290
|
+
" use <- guard(when: name == \"\", return: \"Welcome!\")\n"
|
|
291
|
+
" \"Hello, \" <> name\n"
|
|
292
|
+
" // -> \"Welcome!\"\n"
|
|
293
|
+
" ```\n"
|
|
294
|
+
"\n"
|
|
295
|
+
" ```gleam\n"
|
|
296
|
+
" let name = \"Kamaka\"\n"
|
|
297
|
+
" use <- guard(when: name == \"\", return: \"Welcome!\")\n"
|
|
298
|
+
" \"Hello, \" <> name\n"
|
|
299
|
+
" // -> \"Hello, Kamaka\"\n"
|
|
300
|
+
" ```\n"
|
|
301
|
+
).
|
|
302
|
+
-spec guard(boolean(), BTX, fun(() -> BTX)) -> BTX.
|
|
303
|
+
guard(Requirement, Consequence, Alternative) ->
|
|
304
|
+
case Requirement of
|
|
305
|
+
true ->
|
|
306
|
+
Consequence;
|
|
307
|
+
|
|
308
|
+
false ->
|
|
309
|
+
Alternative()
|
|
310
|
+
end.
|
|
311
|
+
|
|
312
|
+
-file("src/gleam/bool.gleam", 307).
|
|
313
|
+
?DOC(
|
|
314
|
+
" Runs a callback function if the given bool is `True`, otherwise runs an\n"
|
|
315
|
+
" alternative callback function.\n"
|
|
316
|
+
"\n"
|
|
317
|
+
" Useful when further computation should be delayed regardless of the given\n"
|
|
318
|
+
" bool's value.\n"
|
|
319
|
+
"\n"
|
|
320
|
+
" See [`guard`](#guard) for more info.\n"
|
|
321
|
+
"\n"
|
|
322
|
+
" ## Examples\n"
|
|
323
|
+
"\n"
|
|
324
|
+
" ```gleam\n"
|
|
325
|
+
" let name = \"Kamaka\"\n"
|
|
326
|
+
" let inquiry = fn() { \"How may we address you?\" }\n"
|
|
327
|
+
" use <- lazy_guard(when: name == \"\", return: inquiry)\n"
|
|
328
|
+
" \"Hello, \" <> name\n"
|
|
329
|
+
" // -> \"Hello, Kamaka\"\n"
|
|
330
|
+
" ```\n"
|
|
331
|
+
"\n"
|
|
332
|
+
" ```gleam\n"
|
|
333
|
+
" import gleam/int\n"
|
|
334
|
+
"\n"
|
|
335
|
+
" let name = \"\"\n"
|
|
336
|
+
" let greeting = fn() { \"Hello, \" <> name }\n"
|
|
337
|
+
" use <- lazy_guard(when: name == \"\", otherwise: greeting)\n"
|
|
338
|
+
" let number = int.random(99)\n"
|
|
339
|
+
" let name = \"User \" <> int.to_string(number)\n"
|
|
340
|
+
" \"Welcome, \" <> name\n"
|
|
341
|
+
" // -> \"Welcome, User 54\"\n"
|
|
342
|
+
" ```\n"
|
|
343
|
+
).
|
|
344
|
+
-spec lazy_guard(boolean(), fun(() -> BTY), fun(() -> BTY)) -> BTY.
|
|
345
|
+
lazy_guard(Requirement, Consequence, Alternative) ->
|
|
346
|
+
case Requirement of
|
|
347
|
+
true ->
|
|
348
|
+
Consequence();
|
|
349
|
+
|
|
350
|
+
false ->
|
|
351
|
+
Alternative()
|
|
352
|
+
end.
|