From 69fefab57c40f323d759dc444dbcebad15071585 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 13 Jul 2018 22:01:32 -0400 Subject: Re-named "Bool" type to "Bit". --- lux-lein/src/leiningen/lux/packager.clj | 2 +- lux-mode/lux-mode.el | 2 +- luxc/src/lux/analyser.clj | 6 +- luxc/src/lux/analyser/base.clj | 2 +- luxc/src/lux/analyser/case.clj | 30 ++-- luxc/src/lux/analyser/module.clj | 12 +- luxc/src/lux/analyser/parser.clj | 22 +-- luxc/src/lux/analyser/proc/common.clj | 16 +- luxc/src/lux/analyser/proc/jvm.clj | 34 ++-- luxc/src/lux/base.clj | 14 +- luxc/src/lux/compiler/cache.clj | 14 +- luxc/src/lux/compiler/cache/ann.clj | 6 +- luxc/src/lux/compiler/jvm.clj | 4 +- luxc/src/lux/compiler/jvm/base.clj | 5 +- luxc/src/lux/compiler/jvm/case.clj | 2 +- luxc/src/lux/compiler/jvm/lux.clj | 4 +- luxc/src/lux/lexer.clj | 6 +- luxc/src/lux/optimizer.clj | 28 +-- luxc/src/lux/parser.clj | 4 +- luxc/src/lux/type.clj | 8 +- luxc/src/lux/type/host.clj | 2 +- new-luxc/source/luxc/lang/host/common-lisp.lux | 2 +- new-luxc/source/luxc/lang/host/jvm.lux | 2 +- new-luxc/source/luxc/lang/host/jvm/def.lux | 2 +- new-luxc/source/luxc/lang/host/jvm/inst.lux | 4 +- new-luxc/source/luxc/lang/host/lua.lux | 2 +- new-luxc/source/luxc/lang/host/php.lux | 8 +- new-luxc/source/luxc/lang/host/python.lux | 2 +- new-luxc/source/luxc/lang/host/r.lux | 2 +- new-luxc/source/luxc/lang/host/ruby.lux | 14 +- new-luxc/source/luxc/lang/synthesis/variable.lux | 2 +- .../luxc/lang/translation/common-lisp/case.jvm.lux | 4 +- .../luxc/lang/translation/common-lisp/eval.jvm.lux | 2 +- .../translation/common-lisp/expression.jvm.lux | 4 +- .../lang/translation/common-lisp/primitive.jvm.lux | 4 +- .../lang/translation/common-lisp/runtime.jvm.lux | 4 +- .../lang/translation/common-lisp/structure.jvm.lux | 2 +- .../source/luxc/lang/translation/js/case.jvm.lux | 4 +- .../luxc/lang/translation/js/expression.jvm.lux | 4 +- .../luxc/lang/translation/js/primitive.jvm.lux | 4 +- .../luxc/lang/translation/js/runtime.jvm.lux | 4 +- .../luxc/lang/translation/js/structure.jvm.lux | 2 +- .../source/luxc/lang/translation/jvm/case.jvm.lux | 2 +- .../luxc/lang/translation/jvm/expression.jvm.lux | 6 +- .../luxc/lang/translation/jvm/function.jvm.lux | 2 +- .../luxc/lang/translation/jvm/imports.jvm.lux | 4 +- .../source/luxc/lang/translation/jvm/loop.jvm.lux | 2 +- .../luxc/lang/translation/jvm/primitive.jvm.lux | 4 +- .../lang/translation/jvm/procedure/host.jvm.lux | 16 +- .../luxc/lang/translation/jvm/structure.jvm.lux | 4 +- .../source/luxc/lang/translation/lua/case.jvm.lux | 4 +- .../luxc/lang/translation/lua/expression.jvm.lux | 4 +- .../luxc/lang/translation/lua/primitive.jvm.lux | 8 +- .../luxc/lang/translation/lua/runtime.jvm.lux | 4 +- .../luxc/lang/translation/lua/structure.jvm.lux | 2 +- .../source/luxc/lang/translation/php/case.jvm.lux | 6 +- .../luxc/lang/translation/php/expression.jvm.lux | 4 +- .../luxc/lang/translation/php/primitive.jvm.lux | 4 +- .../luxc/lang/translation/php/runtime.jvm.lux | 4 +- .../luxc/lang/translation/php/structure.jvm.lux | 2 +- .../luxc/lang/translation/python/case.jvm.lux | 6 +- .../lang/translation/python/expression.jvm.lux | 4 +- .../luxc/lang/translation/python/primitive.jvm.lux | 4 +- .../luxc/lang/translation/python/runtime.jvm.lux | 4 +- .../luxc/lang/translation/python/structure.jvm.lux | 2 +- .../source/luxc/lang/translation/r/case.jvm.lux | 4 +- .../luxc/lang/translation/r/expression.jvm.lux | 4 +- .../luxc/lang/translation/r/primitive.jvm.lux | 4 +- .../source/luxc/lang/translation/r/runtime.jvm.lux | 4 +- .../luxc/lang/translation/r/structure.jvm.lux | 2 +- .../source/luxc/lang/translation/ruby/case.jvm.lux | 4 +- .../luxc/lang/translation/ruby/expression.jvm.lux | 4 +- .../luxc/lang/translation/ruby/primitive.jvm.lux | 8 +- .../luxc/lang/translation/ruby/runtime.jvm.lux | 4 +- .../luxc/lang/translation/ruby/structure.jvm.lux | 2 +- .../luxc/lang/translation/scheme/eval.jvm.lux | 2 +- new-luxc/test/test/luxc/lang/analysis/host.jvm.lux | 12 +- new-luxc/test/test/luxc/lang/analysis/type.lux | 6 +- new-luxc/test/test/luxc/lang/synthesis/loop.lux | 34 ++-- new-luxc/test/test/luxc/lang/translation/case.lux | 8 +- .../test/test/luxc/lang/translation/common.lux | 20 +-- new-luxc/test/test/luxc/lang/translation/js.lux | 6 +- new-luxc/test/test/luxc/lang/translation/jvm.lux | 24 +-- .../test/test/luxc/lang/translation/primitive.lux | 6 +- .../test/test/luxc/lang/translation/structure.lux | 4 +- stdlib/source/lux.lux | 188 ++++++++++----------- stdlib/source/lux/concurrency/actor.lux | 6 +- stdlib/source/lux/concurrency/atom.lux | 2 +- stdlib/source/lux/concurrency/frp.lux | 2 +- stdlib/source/lux/concurrency/promise.lux | 4 +- stdlib/source/lux/concurrency/semaphore.lux | 2 +- stdlib/source/lux/concurrency/stm.lux | 4 +- stdlib/source/lux/control/concatenative.lux | 54 +++--- stdlib/source/lux/control/contract.lux | 2 +- stdlib/source/lux/control/enum.lux | 2 +- stdlib/source/lux/control/equivalence.lux | 2 +- stdlib/source/lux/control/exception.lux | 4 +- stdlib/source/lux/control/interval.lux | 24 +-- stdlib/source/lux/control/order.lux | 4 +- stdlib/source/lux/control/parser.lux | 4 +- stdlib/source/lux/control/predicate.lux | 2 +- stdlib/source/lux/control/state.lux | 4 +- stdlib/source/lux/data/bit.lux | 51 ++++++ stdlib/source/lux/data/bool.lux | 51 ------ stdlib/source/lux/data/collection/array.lux | 6 +- stdlib/source/lux/data/collection/bits.lux | 6 +- stdlib/source/lux/data/collection/dictionary.lux | 10 +- .../lux/data/collection/dictionary/ordered.lux | 2 +- .../lux/data/collection/dictionary/plist.lux | 2 +- stdlib/source/lux/data/collection/list.lux | 22 +-- stdlib/source/lux/data/collection/queue.lux | 4 +- .../source/lux/data/collection/queue/priority.lux | 2 +- stdlib/source/lux/data/collection/row.lux | 4 +- stdlib/source/lux/data/collection/sequence.lux | 10 +- stdlib/source/lux/data/collection/set.lux | 8 +- stdlib/source/lux/data/collection/set/multi.lux | 8 +- stdlib/source/lux/data/collection/set/ordered.lux | 6 +- stdlib/source/lux/data/collection/stack.lux | 2 +- stdlib/source/lux/data/collection/tree/finger.lux | 4 +- .../lux/data/collection/tree/rose/zipper.lux | 8 +- stdlib/source/lux/data/format/binary.lux | 12 +- stdlib/source/lux/data/format/json.lux | 28 +-- stdlib/source/lux/data/number.lux | 10 +- stdlib/source/lux/data/number/complex.lux | 2 +- stdlib/source/lux/data/number/i64.lux | 2 +- stdlib/source/lux/data/number/ratio.lux | 4 +- stdlib/source/lux/data/tainted.lux | 2 +- stdlib/source/lux/data/text.lux | 10 +- stdlib/source/lux/data/text/format.lux | 4 +- stdlib/source/lux/data/text/lexer.lux | 6 +- stdlib/source/lux/data/text/regex.lux | 4 +- stdlib/source/lux/data/text/unicode.lux | 2 +- stdlib/source/lux/host.js.lux | 2 +- stdlib/source/lux/host.jvm.lux | 66 ++++---- stdlib/source/lux/language/compiler/analysis.lux | 10 +- .../source/lux/language/compiler/analysis/case.lux | 2 +- .../language/compiler/analysis/case/coverage.lux | 26 +-- .../lux/language/compiler/analysis/expression.lux | 2 +- .../lux/language/compiler/analysis/module.lux | 10 +- .../lux/language/compiler/analysis/primitive.lux | 2 +- .../lux/language/compiler/analysis/scope.lux | 6 +- .../lux/language/compiler/default/repl/type.lux | 2 +- .../compiler/extension/analysis/common.lux | 16 +- .../compiler/extension/analysis/host.jvm.lux | 28 +-- stdlib/source/lux/language/compiler/meta/cache.lux | 6 +- stdlib/source/lux/language/compiler/synthesis.lux | 10 +- .../lux/language/compiler/synthesis/case.lux | 14 +- .../lux/language/compiler/synthesis/expression.lux | 2 +- .../lux/language/compiler/synthesis/function.lux | 4 +- .../lux/language/compiler/synthesis/loop.lux | 8 +- .../compiler/translation/scheme/case.jvm.lux | 4 +- .../compiler/translation/scheme/expression.jvm.lux | 2 +- .../compiler/translation/scheme/primitive.jvm.lux | 4 +- .../compiler/translation/scheme/runtime.jvm.lux | 2 +- stdlib/source/lux/language/host/scheme.lux | 2 +- stdlib/source/lux/language/reference.lux | 2 +- stdlib/source/lux/language/syntax.lux | 8 +- stdlib/source/lux/language/type.lux | 2 +- stdlib/source/lux/language/type/check.lux | 12 +- stdlib/source/lux/macro.lux | 22 +-- stdlib/source/lux/macro/code.lux | 39 ++--- stdlib/source/lux/macro/poly.lux | 4 +- stdlib/source/lux/macro/poly/equivalence.lux | 4 +- stdlib/source/lux/macro/poly/json.lux | 14 +- stdlib/source/lux/macro/syntax.lux | 10 +- stdlib/source/lux/macro/syntax/common/reader.lux | 2 +- stdlib/source/lux/macro/syntax/common/writer.lux | 2 +- stdlib/source/lux/math.lux | 2 +- stdlib/source/lux/math/modular.lux | 4 +- stdlib/source/lux/math/random.lux | 12 +- stdlib/source/lux/test.lux | 6 +- stdlib/source/lux/time/date.lux | 6 +- stdlib/source/lux/time/duration.lux | 2 +- stdlib/source/lux/time/instant.lux | 4 +- stdlib/source/lux/type/implicit.lux | 3 +- stdlib/source/lux/type/object/interface.lux | 10 +- stdlib/source/lux/type/object/protocol.lux | 6 +- stdlib/source/lux/world/file.lux | 6 +- stdlib/test/test/lux/concurrency/promise.lux | 2 +- stdlib/test/test/lux/control/exception.lux | 6 +- stdlib/test/test/lux/control/parser.lux | 16 +- stdlib/test/test/lux/control/region.lux | 2 +- stdlib/test/test/lux/control/state.lux | 2 +- stdlib/test/test/lux/data/bit.lux | 38 +++++ stdlib/test/test/lux/data/bool.lux | 38 ----- stdlib/test/test/lux/data/collection/list.lux | 14 +- stdlib/test/test/lux/data/format/json.lux | 22 +-- stdlib/test/test/lux/data/number/complex.lux | 4 +- stdlib/test/test/lux/data/number/i64.lux | 2 +- stdlib/test/test/lux/data/text/lexer.lux | 8 +- stdlib/test/test/lux/data/text/regex.lux | 6 +- .../test/lux/language/compiler/analysis/case.lux | 4 +- .../lux/language/compiler/analysis/function.lux | 2 +- .../lux/language/compiler/analysis/primitive.lux | 4 +- .../compiler/analysis/procedure/common.lux | 20 +-- .../lux/language/compiler/analysis/reference.lux | 4 +- .../lux/language/compiler/analysis/structure.lux | 16 +- .../test/lux/language/compiler/synthesis/case.lux | 6 +- .../lux/language/compiler/synthesis/function.lux | 6 +- .../lux/language/compiler/synthesis/primitive.lux | 12 +- .../lux/language/compiler/synthesis/structure.lux | 4 +- stdlib/test/test/lux/language/syntax.lux | 4 +- stdlib/test/test/lux/language/type.lux | 8 +- stdlib/test/test/lux/language/type/check.lux | 10 +- stdlib/test/test/lux/macro/code.lux | 24 +-- stdlib/test/test/lux/macro/poly/equivalence.lux | 10 +- stdlib/test/test/lux/macro/syntax.lux | 44 ++--- stdlib/test/test/lux/math.lux | 22 +-- stdlib/test/test/lux/math/logic/fuzzy.lux | 56 +++--- stdlib/test/test/lux/math/modular.lux | 34 ++-- stdlib/test/test/lux/type/implicit.lux | 6 +- stdlib/test/test/lux/type/object/protocol.lux | 6 +- stdlib/test/test/lux/world/blob.lux | 4 +- stdlib/test/test/lux/world/net/tcp.lux | 2 +- 214 files changed, 1034 insertions(+), 1013 deletions(-) create mode 100644 stdlib/source/lux/data/bit.lux delete mode 100644 stdlib/source/lux/data/bool.lux create mode 100644 stdlib/test/test/lux/data/bit.lux delete mode 100644 stdlib/test/test/lux/data/bool.lux diff --git a/lux-lein/src/leiningen/lux/packager.clj b/lux-lein/src/leiningen/lux/packager.clj index 9bea3ef5c..42d32fe95 100644 --- a/lux-lein/src/leiningen/lux/packager.clj +++ b/lux-lein/src/leiningen/lux/packager.clj @@ -22,7 +22,7 @@ (def ^:private buffer-size (* 10 kilobyte)) (defn ^:private manifest - "(-> Project Text Bool Manifest)" + "(-> Project Text Bit Manifest)" [project module includes-android?] (doto (new Manifest) (-> .getMainAttributes diff --git a/lux-mode/lux-mode.el b/lux-mode/lux-mode.el index 54eab4e63..50313365f 100644 --- a/lux-mode/lux-mode.el +++ b/lux-mode/lux-mode.el @@ -246,7 +246,7 @@ Called by `imenu--generic-function'." ) t) "\\>") 1 font-lock-builtin-face) - ; Bool literals + ; Bit literals (,(concat "\\<" (regexp-opt diff --git a/luxc/src/lux/analyser.clj b/luxc/src/lux/analyser.clj index 9052e6f8f..6e2d8f7aa 100644 --- a/luxc/src/lux/analyser.clj +++ b/luxc/src/lux/analyser.clj @@ -65,9 +65,9 @@ macro-caller (aget compilers 2)] (|case token ;; Standard special forms - (&/$Bool ?value) - (|do [_ (&type/check exo-type &type/Bool)] - (return (&/|list (&&/|meta exo-type cursor (&&/$bool ?value))))) + (&/$Bit ?value) + (|do [_ (&type/check exo-type &type/Bit)] + (return (&/|list (&&/|meta exo-type cursor (&&/$bit ?value))))) (&/$Nat ?value) (|do [_ (&type/check exo-type &type/Nat)] diff --git a/luxc/src/lux/analyser/base.clj b/luxc/src/lux/analyser/base.clj index 25b73ba1a..7874b0bd2 100644 --- a/luxc/src/lux/analyser/base.clj +++ b/luxc/src/lux/analyser/base.clj @@ -6,7 +6,7 @@ ;; [Tags] (defvariant - ("bool" 1) + ("bit" 1) ("nat" 1) ("int" 1) ("rev" 1) diff --git a/luxc/src/lux/analyser/case.clj b/luxc/src/lux/analyser/case.clj index 86752d336..73b4c8df2 100644 --- a/luxc/src/lux/analyser/case.clj +++ b/luxc/src/lux/analyser/case.clj @@ -12,7 +12,7 @@ ;; [Tags] (defvariant ("DefaultTotal" 1) - ("BoolTotal" 2) + ("BitTotal" 2) ("NatTotal" 2) ("IntTotal" 2) ("RevTotal" 2) @@ -24,7 +24,7 @@ (defvariant ("NoTestAC" 0) ("StoreTestAC" 1) - ("BoolTestAC" 1) + ("BitTestAC" 1) ("NatTestAC" 1) ("IntTestAC" 1) ("RevTestAC" 1) @@ -268,10 +268,10 @@ (&/$Symbol ident) (&/fail-with-loc (str "[Pattern-matching Error] Symbols must be unqualified: " (&/ident->text ident))) - (&/$Bool ?value) - (|do [_ (&type/check value-type &type/Bool) + (&/$Bit ?value) + (|do [_ (&type/check value-type &type/Bit) =kont kont] - (return (&/T [($BoolTestAC ?value) =kont]))) + (return (&/T [($BitTestAC ?value) =kont]))) (&/$Nat ?value) (|do [_ (&type/check value-type &type/Nat) @@ -405,8 +405,8 @@ [($DefaultTotal total?) ($NoTestAC)] (return ($DefaultTotal true)) - [($BoolTotal total? ?values) ($NoTestAC)] - (return ($BoolTotal true ?values)) + [($BitTotal total? ?values) ($NoTestAC)] + (return ($BitTotal true ?values)) [($NatTotal total? ?values) ($NoTestAC)] (return ($NatTotal true ?values)) @@ -432,8 +432,8 @@ [($DefaultTotal total?) ($StoreTestAC ?idx)] (return ($DefaultTotal true)) - [($BoolTotal total? ?values) ($StoreTestAC ?idx)] - (return ($BoolTotal true ?values)) + [($BitTotal total? ?values) ($StoreTestAC ?idx)] + (return ($BitTotal true ?values)) [($NatTotal total? ?values) ($StoreTestAC ?idx)] (return ($NatTotal true ?values)) @@ -456,11 +456,11 @@ [($VariantTotal total? ?values) ($StoreTestAC ?idx)] (return ($VariantTotal true ?values)) - [($DefaultTotal total?) ($BoolTestAC ?value)] - (return ($BoolTotal total? (&/|list ?value))) + [($DefaultTotal total?) ($BitTestAC ?value)] + (return ($BitTotal total? (&/|list ?value))) - [($BoolTotal total? ?values) ($BoolTestAC ?value)] - (return ($BoolTotal total? (&/$Cons ?value ?values))) + [($BitTotal total? ?values) ($BitTestAC ?value)] + (return ($BitTotal total? (&/$Cons ?value ?values))) [($DefaultTotal total?) ($NatTestAC ?value)] (return ($NatTotal total? (&/|list ?value))) @@ -550,8 +550,8 @@ ($DefaultTotal ?total) (return ?total) - ($BoolTotal ?total ?values) - (|do [_ (&type/check value-type &type/Bool)] + ($BitTotal ?total ?values) + (|do [_ (&type/check value-type &type/Bit)] (return (or ?total (= #{true false} (set (&/->seq ?values)))))) diff --git a/luxc/src/lux/analyser/module.clj b/luxc/src/lux/analyser/module.clj index 130004701..4174932ca 100644 --- a/luxc/src/lux/analyser/module.clj +++ b/luxc/src/lux/analyser/module.clj @@ -61,7 +61,7 @@ state)] (&/$Right (&/T [state* &/unit-tag]))))) (defn - "(-> Text (Lux Bool))" + "(-> Text (Lux Bit))" [module-name] (fn [state] (if-let [=module (->> state (&/get$ &/$modules) (&/|get module-name))] @@ -141,7 +141,7 @@ state)))) (defn type-def - "(-> Text Text (Lux [Bool Type]))" + "(-> Text Text (Lux [Bit Type]))" [module name] (fn [state] (if-let [$module (->> state (&/get$ &/$modules) (&/|get module))] @@ -167,7 +167,7 @@ state)))) (defn exists? - "(-> Text (Lux Bool))" + "(-> Text (Lux Bit))" [name] (fn [state] (return* state @@ -269,7 +269,7 @@ _ (return* state (&/T [(&/T [module name]) $def]))) (|case (&meta/meta-get &meta/export?-tag ?meta) - (&/$Some [_ (&/$Bool true)]) + (&/$Some [_ (&/$Bit true)]) (return* state (&/T [(&/T [module name]) $def])) _ @@ -354,7 +354,7 @@ (return nil))) (defn declare-tags - "(-> Text (List Text) Bool Type (Lux Null))" + "(-> Text (List Text) Bit Type (Lux Null))" [module tag-names was-exported? type] (|do [_ (ensure-undeclared-tags module tag-names) type-name (&type/type-name type) @@ -437,7 +437,7 @@ (do-template [ ] (defn [module name meta type] (|case (&meta/meta-get meta) - (&/$Some [_ (&/$Bool true)]) + (&/$Some [_ (&/$Bit true)]) (&/try-all% (&/|list (&type/check type) (&/fail-with-loc (str "[Analyser Error] Cannot tag as lux;" "? if it's not a " ": " (str module &/+name-separator+ name))))) diff --git a/luxc/src/lux/analyser/parser.clj b/luxc/src/lux/analyser/parser.clj index c5cd84eab..6a46bab3c 100644 --- a/luxc/src/lux/analyser/parser.clj +++ b/luxc/src/lux/analyser/parser.clj @@ -133,7 +133,7 @@ (def ^:private parse-ann-param (|do [param-name parse-name _ (&reader/read-text "=") - param-value (&/try-all% (&/|list (|do [[_ (&lexer/$Bool param-value*)] &lexer/lex-bool] + param-value (&/try-all% (&/|list (|do [[_ (&lexer/$Bit param-value*)] &lexer/lex-bit] (return (boolean param-value*))) (|do [[_ (&lexer/$Int param-value*)] &lexer/lex-int] @@ -243,8 +243,8 @@ (|do [_ (&reader/read-text "init") =privacy-modifier (with-pre-space parse-privacy-modifier) - [_ (&lexer/$Bool =strict*)] (with-pre-space - &lexer/lex-bool) + [_ (&lexer/$Bit =strict*)] (with-pre-space + &lexer/lex-bit) :let [=strict (Boolean/parseBoolean =strict*)] =anns (with-pre-space (with-brackets @@ -271,11 +271,11 @@ parse-name) =privacy-modifier (with-pre-space parse-privacy-modifier) - [_ (&lexer/$Bool =final?*)] (with-pre-space - &lexer/lex-bool) + [_ (&lexer/$Bit =final?*)] (with-pre-space + &lexer/lex-bit) :let [=final? (Boolean/parseBoolean =final?*)] - [_ (&lexer/$Bool =strict*)] (with-pre-space - &lexer/lex-bool) + [_ (&lexer/$Bit =strict*)] (with-pre-space + &lexer/lex-bit) :let [=strict (Boolean/parseBoolean =strict*)] =anns (with-pre-space (with-brackets @@ -301,8 +301,8 @@ parse-gclass-decl) =name (with-pre-space parse-name) - [_ (&lexer/$Bool =strict*)] (with-pre-space - &lexer/lex-bool) + [_ (&lexer/$Bit =strict*)] (with-pre-space + &lexer/lex-bit) :let [=strict (Boolean/parseBoolean =strict*)] =anns (with-pre-space (with-brackets @@ -328,8 +328,8 @@ parse-name) =privacy-modifier (with-pre-space parse-privacy-modifier) - [_ (&lexer/$Bool =strict*)] (with-pre-space - &lexer/lex-bool) + [_ (&lexer/$Bit =strict*)] (with-pre-space + &lexer/lex-bit) :let [=strict (Boolean/parseBoolean =strict*)] =anns (with-pre-space (with-brackets diff --git a/luxc/src/lux/analyser/proc/common.clj b/luxc/src/lux/analyser/proc/common.clj index 359fcb314..7b6bc6a3f 100644 --- a/luxc/src/lux/analyser/proc/common.clj +++ b/luxc/src/lux/analyser/proc/common.clj @@ -12,7 +12,7 @@ (|do [:let [(&/$Cons left (&/$Cons right (&/$Nil))) ?values] =left (&&/analyse-1 analyse $var left) =right (&&/analyse-1 analyse $var right) - _ (&type/check exo-type &type/Bool) + _ (&type/check exo-type &type/Bit) _cursor &/cursor] (return (&/|list (&&/|meta exo-type _cursor (&&/$proc (&/T ["lux" "is"]) (&/|list =left =right) (&/|list))))))))) @@ -39,8 +39,8 @@ (return (&/|list (&&/|meta exo-type _cursor (&&/$proc (&/T ) (&/|list =x =y) (&/|list))))))) - ^:private analyse-text-eq ["text" "="] &type/Text &type/Bool - ^:private analyse-text-lt ["text" "<"] &type/Text &type/Bool + ^:private analyse-text-eq ["text" "="] &type/Text &type/Bit + ^:private analyse-text-lt ["text" "<"] &type/Text &type/Bit ^:private analyse-text-concat ["text" "concat"] &type/Text &type/Text ) @@ -143,7 +143,7 @@ (return (&/|list (&&/|meta exo-type _cursor (&&/$proc (&/T ) (&/|list subjectA paramA) (&/|list)))))))) - ^:private analyse-i64-eq ["i64" "="] (&/$Apply &type/Any &type/I64) &type/Bool + ^:private analyse-i64-eq ["i64" "="] (&/$Apply &type/Any &type/I64) &type/Bit ^:private analyse-i64-add ["i64" "+"] (&/$Apply &type/Any &type/I64) &type/I64 ^:private analyse-i64-sub ["i64" "-"] (&/$Apply &type/Any &type/I64) &type/I64 ) @@ -163,15 +163,15 @@ ^:private analyse-int-mul ["int" "*"] &type/Int &type/Int ^:private analyse-int-div ["int" "/"] &type/Int &type/Int ^:private analyse-int-rem ["int" "%"] &type/Int &type/Int - ^:private analyse-int-lt ["int" "<"] &type/Int &type/Bool + ^:private analyse-int-lt ["int" "<"] &type/Int &type/Bit ^:private analyse-frac-add ["frac" "+"] &type/Frac &type/Frac ^:private analyse-frac-sub ["frac" "-"] &type/Frac &type/Frac ^:private analyse-frac-mul ["frac" "*"] &type/Frac &type/Frac ^:private analyse-frac-div ["frac" "/"] &type/Frac &type/Frac ^:private analyse-frac-rem ["frac" "%"] &type/Frac &type/Frac - ^:private analyse-frac-eq ["frac" "="] &type/Frac &type/Bool - ^:private analyse-frac-lt ["frac" "<"] &type/Frac &type/Bool + ^:private analyse-frac-eq ["frac" "="] &type/Frac &type/Bit + ^:private analyse-frac-lt ["frac" "<"] &type/Frac &type/Bit ) (do-template [ ] @@ -348,7 +348,7 @@ =atom (&&/analyse-1 analyse (&type/Atom $var) ?atom) =old (&&/analyse-1 analyse $var ?old) =new (&&/analyse-1 analyse $var ?new) - _ (&type/check exo-type &type/Bool) + _ (&type/check exo-type &type/Bit) _cursor &/cursor] (return (&/|list (&&/|meta exo-type _cursor (&&/$proc (&/T ["atom" "compare-and-swap"]) (&/|list =atom =old =new) (&/|list))))))))) diff --git a/luxc/src/lux/analyser/proc/jvm.clj b/luxc/src/lux/analyser/proc/jvm.clj index b6d291073..98c2435e9 100644 --- a/luxc/src/lux/analyser/proc/jvm.clj +++ b/luxc/src/lux/analyser/proc/jvm.clj @@ -464,40 +464,40 @@ ^:private analyse-jvm-imul "imul" "java.lang.Integer" "java.lang.Integer" ^:private analyse-jvm-idiv "idiv" "java.lang.Integer" "java.lang.Integer" ^:private analyse-jvm-irem "irem" "java.lang.Integer" "java.lang.Integer" - ^:private analyse-jvm-ieq "ieq" "java.lang.Integer" "java.lang.Boolean" - ^:private analyse-jvm-ilt "ilt" "java.lang.Integer" "java.lang.Boolean" - ^:private analyse-jvm-igt "igt" "java.lang.Integer" "java.lang.Boolean" + ^:private analyse-jvm-ieq "ieq" "java.lang.Integer" "#Bit" + ^:private analyse-jvm-ilt "ilt" "java.lang.Integer" "#Bit" + ^:private analyse-jvm-igt "igt" "java.lang.Integer" "#Bit" - ^:private analyse-jvm-ceq "ceq" "java.lang.Character" "java.lang.Boolean" - ^:private analyse-jvm-clt "clt" "java.lang.Character" "java.lang.Boolean" - ^:private analyse-jvm-cgt "cgt" "java.lang.Character" "java.lang.Boolean" + ^:private analyse-jvm-ceq "ceq" "java.lang.Character" "#Bit" + ^:private analyse-jvm-clt "clt" "java.lang.Character" "#Bit" + ^:private analyse-jvm-cgt "cgt" "java.lang.Character" "#Bit" ^:private analyse-jvm-ladd "ladd" "java.lang.Long" "java.lang.Long" ^:private analyse-jvm-lsub "lsub" "java.lang.Long" "java.lang.Long" ^:private analyse-jvm-lmul "lmul" "java.lang.Long" "java.lang.Long" ^:private analyse-jvm-ldiv "ldiv" "java.lang.Long" "java.lang.Long" ^:private analyse-jvm-lrem "lrem" "java.lang.Long" "java.lang.Long" - ^:private analyse-jvm-leq "leq" "java.lang.Long" "java.lang.Boolean" - ^:private analyse-jvm-llt "llt" "java.lang.Long" "java.lang.Boolean" - ^:private analyse-jvm-lgt "lgt" "java.lang.Long" "java.lang.Boolean" + ^:private analyse-jvm-leq "leq" "java.lang.Long" "#Bit" + ^:private analyse-jvm-llt "llt" "java.lang.Long" "#Bit" + ^:private analyse-jvm-lgt "lgt" "java.lang.Long" "#Bit" ^:private analyse-jvm-fadd "fadd" "java.lang.Float" "java.lang.Float" ^:private analyse-jvm-fsub "fsub" "java.lang.Float" "java.lang.Float" ^:private analyse-jvm-fmul "fmul" "java.lang.Float" "java.lang.Float" ^:private analyse-jvm-fdiv "fdiv" "java.lang.Float" "java.lang.Float" ^:private analyse-jvm-frem "frem" "java.lang.Float" "java.lang.Float" - ^:private analyse-jvm-feq "feq" "java.lang.Float" "java.lang.Boolean" - ^:private analyse-jvm-flt "flt" "java.lang.Float" "java.lang.Boolean" - ^:private analyse-jvm-fgt "fgt" "java.lang.Float" "java.lang.Boolean" + ^:private analyse-jvm-feq "feq" "java.lang.Float" "#Bit" + ^:private analyse-jvm-flt "flt" "java.lang.Float" "#Bit" + ^:private analyse-jvm-fgt "fgt" "java.lang.Float" "#Bit" ^:private analyse-jvm-dadd "dadd" "java.lang.Double" "java.lang.Double" ^:private analyse-jvm-dsub "dsub" "java.lang.Double" "java.lang.Double" ^:private analyse-jvm-dmul "dmul" "java.lang.Double" "java.lang.Double" ^:private analyse-jvm-ddiv "ddiv" "java.lang.Double" "java.lang.Double" ^:private analyse-jvm-drem "drem" "java.lang.Double" "java.lang.Double" - ^:private analyse-jvm-deq "deq" "java.lang.Double" "java.lang.Boolean" - ^:private analyse-jvm-dlt "dlt" "java.lang.Double" "java.lang.Boolean" - ^:private analyse-jvm-dgt "dgt" "java.lang.Double" "java.lang.Boolean" + ^:private analyse-jvm-deq "deq" "java.lang.Double" "#Bit" + ^:private analyse-jvm-dlt "dlt" "java.lang.Double" "#Bit" + ^:private analyse-jvm-dgt "dgt" "java.lang.Double" "#Bit" ) (let [length-type &type/Nat @@ -606,7 +606,7 @@ (|do [:let [(&/$Cons object (&/$Nil)) ?values] =object (&&/analyse-1+ analyse object) _ (ensure-object (&&/expr-type* =object)) - :let [output-type &type/Bool] + :let [output-type &type/Bit] _ (&type/check exo-type output-type) _cursor &/cursor] (return (&/|list (&&/|meta exo-type _cursor @@ -805,7 +805,7 @@ (|do [:let [(&/$Cons object (&/$Nil)) ?values] =object (&&/analyse-1+ analyse object) _ (ensure-object (&&/expr-type* =object)) - :let [output-type &type/Bool] + :let [output-type &type/Bit] _ (&type/check exo-type output-type) _cursor &/cursor] (return (&/|list (&&/|meta output-type _cursor diff --git a/luxc/src/lux/base.clj b/luxc/src/lux/base.clj index 37db2a480..464b7b585 100644 --- a/luxc/src/lux/base.clj +++ b/luxc/src/lux/base.clj @@ -71,7 +71,7 @@ ;; Code (defvariant - ("Bool" 1) + ("Bit" 1) ("Nat" 1) ("Int" 1) ("Rev" 1) @@ -410,7 +410,7 @@ (assert false (prn-str '|map f (adt->text xs))))) (defn |empty? - "(All [a] (-> (List a) Bool))" + "(All [a] (-> (List a) Bit))" [xs] (|case xs ($Nil) @@ -420,7 +420,7 @@ false)) (defn |filter - "(All [a] (-> (-> a Bool) (List a) (List a)))" + "(All [a] (-> (-> a Bit) (List a) (List a)))" [p xs] (|case xs ($Nil) @@ -856,7 +856,7 @@ (do-template [ ] (defn - "(-> CompilerMode Bool)" + "(-> CompilerMode Bit)" [mode] (|case mode () true @@ -1204,7 +1204,7 @@ (defn show-ast [ast] (|case ast - [_ ($Bool ?value)] + [_ ($Bit ?value)] (pr-str ?value) [_ ($Nat ?value)] @@ -1325,7 +1325,7 @@ (return* state (|keys (get$ $modules state))))) (defn when% - "(-> Bool (Meta Any) (Meta Any))" + "(-> Bit (Meta Any) (Meta Any))" [test body] (if test body @@ -1377,7 +1377,7 @@ (do-template [ ] (defn - "(All [a] (-> (-> a Bool) (List a) Bool))" + "(All [a] (-> (-> a Bit) (List a) Bit))" [p xs] (|case xs ($Nil) diff --git a/luxc/src/lux/compiler/cache.clj b/luxc/src/lux/compiler/cache.clj index 04ef34e52..0b8739463 100644 --- a/luxc/src/lux/compiler/cache.clj +++ b/luxc/src/lux/compiler/cache.clj @@ -28,12 +28,14 @@ java.io.File/separator (.replace ^String (&host/->module-class module) "/" java.io.File/separator))) -(defn cached? [module] - "(-> Text Bool)" +(defn cached? + "(-> Text Bit)" + [module] (.exists (new File (str (module-path module) java.io.File/separator &&core/lux-module-descriptor-name)))) -(defn delete [module] +(defn delete "(-> Text (Lux Null))" + [module] (fn [state] (do (delete-all-module-files (new File (module-path module))) (return* state nil)))) @@ -48,8 +50,9 @@ (apply concat) (list* module))) -(defn clean [state] +(defn clean "(-> Lux Null)" + [state] (let [needed-modules (->> state (&/get$ &/$modules) &/|keys &/->seq set) output-dir-prefix (str (.getAbsolutePath (new File ^String @&&core/!output-dir)) java.io.File/separator) outdated? #(->> % (contains? needed-modules) not) @@ -237,8 +240,9 @@ compiler) nil))) -(defn load [module-name] +(defn load "(-> Text (Lux Null))" + [module-name] (if-let [module-struct (get @!pre-loaded-cache module-name)] (|do [_ (inject-module module-name module-struct)] (return nil)) diff --git a/luxc/src/lux/compiler/cache/ann.clj b/luxc/src/lux/compiler/cache/ann.clj index 458146992..bab3d20c7 100644 --- a/luxc/src/lux/compiler/cache/ann.clj +++ b/luxc/src/lux/compiler/cache/ann.clj @@ -24,7 +24,7 @@ "(-> Code Text)" [ann] (|case ann - [_ (&/$Bool value)] + [_ (&/$Bit value)] (str "B" value stop) [_ (&/$Nat value)] @@ -76,7 +76,7 @@ (let [[value* ^String input*] (.split (.substring input 1) stop 2)] [(&/T [dummy-cursor ( ( value*))]) input*]))) - ^:private deserialize-bool "B" &/$Bool Boolean/parseBoolean + ^:private deserialize-bit "B" &/$Bit Boolean/parseBoolean ^:private deserialize-nat "N" &/$Nat Long/parseLong ^:private deserialize-int "I" &/$Int Long/parseLong ^:private deserialize-rev "D" &/$Rev Long/parseLong @@ -124,7 +124,7 @@ (defn deserialize "(-> Text V[Code Text])" [input] - (or (deserialize-bool input) + (or (deserialize-bit input) (deserialize-nat input) (deserialize-int input) (deserialize-rev input) diff --git a/luxc/src/lux/compiler/jvm.clj b/luxc/src/lux/compiler/jvm.clj index a13427bc3..60a2c7d2e 100644 --- a/luxc/src/lux/compiler/jvm.clj +++ b/luxc/src/lux/compiler/jvm.clj @@ -47,8 +47,8 @@ (.visitLineNumber (int _line) debug-label)) (swap! !source->last-line assoc _file-name _line))]] (|case ?form - (&o/$bool ?value) - (&&lux/compile-bool ?value) + (&o/$bit ?value) + (&&lux/compile-bit ?value) (&o/$nat ?value) (&&lux/compile-nat ?value) diff --git a/luxc/src/lux/compiler/jvm/base.clj b/luxc/src/lux/compiler/jvm/base.clj index 99e0f08e9..b5e520de5 100644 --- a/luxc/src/lux/compiler/jvm/base.clj +++ b/luxc/src/lux/compiler/jvm/base.clj @@ -43,8 +43,9 @@ (.mkdirs (File. module-dir)) (&&/write-file (str module-dir java.io.File/separator name ".class") data))) -(defn class-exists? [^String module ^String class-name] - "(-> Text Text (IO Bool))" +(defn class-exists? + "(-> Text Text (IO Bit))" + [^String module ^String class-name] (|do [_ (return nil) :let [full-path (str @&&/!output-dir java.io.File/separator module java.io.File/separator class-name ".class") exists? (.exists (File. full-path))]] diff --git a/luxc/src/lux/compiler/jvm/case.clj b/luxc/src/lux/compiler/jvm/case.clj index 79e6c559c..4c195ba36 100644 --- a/luxc/src/lux/compiler/jvm/case.clj +++ b/luxc/src/lux/compiler/jvm/case.clj @@ -63,7 +63,7 @@ (.visitVarInsn Opcodes/ASTORE _var-id) (.visitMethodInsn Opcodes/INVOKESTATIC "lux/LuxRT" "pm_stack_pop" "([Ljava/lang/Object;)[Ljava/lang/Object;")) - (&o/$BoolPM _value) + (&o/$BitPM _value) (doto writer stack-peek &&/unwrap-boolean diff --git a/luxc/src/lux/compiler/jvm/lux.clj b/luxc/src/lux/compiler/jvm/lux.clj index 6a85e1075..d9b9f00d0 100644 --- a/luxc/src/lux/compiler/jvm/lux.clj +++ b/luxc/src/lux/compiler/jvm/lux.clj @@ -24,7 +24,7 @@ java.lang.reflect.Field)) ;; [Exports] -(defn compile-bool [?value] +(defn compile-bit [?value] (|do [^MethodVisitor *writer* &/get-writer :let [_ (.visitFieldInsn *writer* Opcodes/GETSTATIC "java/lang/Boolean" (if ?value "TRUE" "FALSE") "Ljava/lang/Boolean;")]] (return nil))) @@ -253,7 +253,7 @@ :let [def-class (&&/load-class! class-loader (&host-generics/->class-name current-class)) def-type (&a/expr-type* ?body) is-type? (|case (&a-meta/meta-get &a-meta/type?-tag ?meta) - (&/$Some [_ (&/$Bool true)]) + (&/$Some [_ (&/$Bit true)]) true _ diff --git a/luxc/src/lux/lexer.clj b/luxc/src/lux/lexer.clj index d56a901ff..be8f8b69a 100644 --- a/luxc/src/lux/lexer.clj +++ b/luxc/src/lux/lexer.clj @@ -9,7 +9,7 @@ (defvariant ("White_Space" 1) ("Comment" 1) - ("Bool" 1) + ("Bit" 1) ("Nat" 1) ("Int" 1) ("Rev" 1) @@ -130,7 +130,7 @@ (|do [[meta _ token] (&reader/read-regex )] (return (&/T [meta ( token)])))) - lex-bool $Bool #"^(true|false)" + lex-bit $Bit #"^(true|false)" ) (do-template [ ] @@ -205,7 +205,7 @@ (&/try-all-% "[Reader Error]" (&/|list lex-white-space lex-comment - lex-bool + lex-bit lex-nat lex-frac lex-rev diff --git a/luxc/src/lux/optimizer.clj b/luxc/src/lux/optimizer.clj index 8f331cc95..e1187594c 100644 --- a/luxc/src/lux/optimizer.clj +++ b/luxc/src/lux/optimizer.clj @@ -6,7 +6,7 @@ ;; [Tags] (defvariant ;; These tags just have a one-to-one correspondence with Analysis data-structures. - ("bool" 1) + ("bit" 1) ("nat" 1) ("int" 1) ("rev" 1) @@ -65,8 +65,8 @@ ("PopPM" 0) ;; Store the CDN in a register. ("BindPM" 1) - ;; Compare the CDN with a boolean value. - ("BoolPM" 1) + ;; Compare the CDN with a bit value. + ("BitPM" 1) ;; Compare the CDN with a natural value. ("NatPM" 1) ;; Compare the CDN with an integer value. @@ -174,8 +174,8 @@ (&a-case/$StoreTestAC _register) (&/|list ($BindPM _register)) - (&a-case/$BoolTestAC _value) - (&/|list ($BoolPM _value) + (&a-case/$BitTestAC _value) + (&/|list ($BitPM _value) $PopPM) (&a-case/$NatTestAC _value) @@ -275,9 +275,9 @@ ($BindPM _pre-var-id) ($AltPM pre post)) - [($BoolPM _pre-value) ($BoolPM _post-value)] + [($BitPM _pre-value) ($BitPM _post-value)] (if (= _pre-value _post-value) - ($BoolPM _pre-value) + ($BitPM _pre-value) ($AltPM pre post)) [($NatPM _pre-value) ($NatPM _post-value)] @@ -632,7 +632,7 @@ ;; Shifts the body of a function after a folding is performed. (defn shift-function-body - "(-> Scope Scope Bool Optimized Optimized)" + "(-> Scope Scope Bit Optimized Optimized)" [old-scope new-scope own-body? body] (|let [[meta body-] body] (|case body- @@ -818,7 +818,7 @@ ))) (defn ^:private contains-self-reference? - "(-> Optimized Bool)" + "(-> Optimized Bit)" [body] (|let [[meta body-] body stepwise-test (fn [base arg] (or base (contains-self-reference? arg)))] @@ -997,12 +997,12 @@ (&/T [_name (optimize _analysis)]))) closure))] (defn ^:private pass-0 - "(-> Bool Analysis Optimized)" + "(-> Bit Analysis Optimized)" [top-level-func? analysis] (|let [[meta analysis-] analysis] (|case analysis- - (&a/$bool value) - (&/T [meta ($bool value)]) + (&a/$bit value) + (&/T [meta ($bit value)]) (&a/$nat value) (&/T [meta ($nat value)]) @@ -1052,8 +1052,8 @@ (&/$Cons [(&a-case/$StoreTestAC _register) _body] (&/$Nil)) (&/T [meta ($let (pass-0 top-level-func? value) _register (pass-0 top-level-func? _body))]) - (&/$Cons [(&a-case/$BoolTestAC false) _else] - (&/$Cons [(&a-case/$BoolTestAC true) _then] + (&/$Cons [(&a-case/$BitTestAC false) _else] + (&/$Cons [(&a-case/$BitTestAC true) _then] (&/$Nil))) (&/T [meta ($if (pass-0 top-level-func? value) (pass-0 top-level-func? _then) (pass-0 top-level-func? _else))]) diff --git a/luxc/src/lux/parser.clj b/luxc/src/lux/parser.clj index 130a794ac..92a23da81 100644 --- a/luxc/src/lux/parser.clj +++ b/luxc/src/lux/parser.clj @@ -64,8 +64,8 @@ (&lexer/$Comment _) (return &/$Nil) - (&lexer/$Bool ?value) - (return (&/|list (&/T [meta (&/$Bool (Boolean/parseBoolean ?value))]))) + (&lexer/$Bit ?value) + (return (&/|list (&/T [meta (&/$Bit (Boolean/parseBoolean ?value))]))) (&lexer/$Nat ?value) (return (&/|list (&/T [meta (&/$Nat (Long/parseUnsignedLong ?value))]))) diff --git a/luxc/src/lux/type.clj b/luxc/src/lux/type.clj index 6cc33688e..8a498463e 100644 --- a/luxc/src/lux/type.clj +++ b/luxc/src/lux/type.clj @@ -32,7 +32,7 @@ (def Rev* (&/$Primitive &&host/rev-data-tag &/$Nil)) (def Int* (&/$Primitive &&host/int-data-tag &/$Nil)) -(def Bool (&/$Named (&/T ["lux" "Bool"]) (&/$Primitive "#Bool" &/$Nil))) +(def Bit (&/$Named (&/T ["lux" "Bit"]) (&/$Primitive "#Bit" &/$Nil))) (def Nat (&/$Named (&/T ["lux" "Nat"]) (&/$Apply Nat* I64))) (def Rev (&/$Named (&/T ["lux" "Rev"]) (&/$Apply Rev* I64))) (def Int (&/$Named (&/T ["lux" "Int"]) (&/$Apply Int* I64))) @@ -150,8 +150,8 @@ (&/$Parameter 1)) Code-List (&/$Apply Code List)] (&/$UnivQ empty-env - (&/$Sum ;; "lux;Bool" - Bool + (&/$Sum ;; "lux;Bit" + Bit (&/$Sum ;; "lux;Nat" Nat (&/$Sum ;; "lux;Int" @@ -886,7 +886,7 @@ )) (defn unknown? [type] - "(-> Type (Lux Bool))" + "(-> Type (Lux Bit))" (|case type (&/$Var id) (|do [? (bound? id)] diff --git a/luxc/src/lux/type/host.clj b/luxc/src/lux/type/host.clj index 474153316..e0eafdd73 100644 --- a/luxc/src/lux/type/host.clj +++ b/luxc/src/lux/type/host.clj @@ -310,7 +310,7 @@ (contains? primitive-types type-name))) (def ^:private lux-jvm-type-combos - #{#{"java.lang.Boolean" "#Bool"} + #{#{"java.lang.Boolean" "#Bit"} #{"java.lang.Long" i64-data-tag} #{"java.lang.Double" "#Frac"} #{"java.lang.String" "#Text"}}) diff --git a/new-luxc/source/luxc/lang/host/common-lisp.lux b/new-luxc/source/luxc/lang/host/common-lisp.lux index 77b8cfc22..fb6a933df 100644 --- a/new-luxc/source/luxc/lang/host/common-lisp.lux +++ b/new-luxc/source/luxc/lang/host/common-lisp.lux @@ -53,7 +53,7 @@ (:abstraction "()")) (def: #export bool - (-> Bool Expression) + (-> Bit Expression) (|>> (case> true (:abstraction "t") false ..nil))) diff --git a/new-luxc/source/luxc/lang/host/jvm.lux b/new-luxc/source/luxc/lang/host/jvm.lux index d30df3fd3..3c5fa3150 100644 --- a/new-luxc/source/luxc/lang/host/jvm.lux +++ b/new-luxc/source/luxc/lang/host/jvm.lux @@ -97,7 +97,7 @@ options)] (wrap (list& (` (type: (~' #export) (~ g!type) (~ (code.record (list/map (function (_ tag) - [tag (` .Bool)]) + [tag (` .Bit)]) g!tags+))))) (` (def: (~' #export) (~ g!none) diff --git a/new-luxc/source/luxc/lang/host/jvm/def.lux b/new-luxc/source/luxc/lang/host/jvm/def.lux index c973f79c3..4c19f38f6 100644 --- a/new-luxc/source/luxc/lang/host/jvm/def.lux +++ b/new-luxc/source/luxc/lang/host/jvm/def.lux @@ -265,7 +265,7 @@ (FieldVisitor::visitEnd []))] writer)))] - [boolean-field Bool $t.boolean id] + [boolean-field Bit $t.boolean id] [byte-field Int $t.byte host.long-to-byte] [short-field Int $t.short host.long-to-short] [int-field Int $t.int host.long-to-int] diff --git a/new-luxc/source/luxc/lang/host/jvm/inst.lux b/new-luxc/source/luxc/lang/host/jvm/inst.lux index c3088ec7d..3f0f68def 100644 --- a/new-luxc/source/luxc/lang/host/jvm/inst.lux +++ b/new-luxc/source/luxc/lang/host/jvm/inst.lux @@ -127,7 +127,7 @@ (do-to visitor (MethodVisitor::visitLdcInsn [( value)]))))] - [boolean Bool id] + [boolean Bit id] [int Int host.long-to-int] [long Int id] [double Frac id] @@ -259,7 +259,7 @@ (do-template [ ] [(def: #export ( class method-name method-signature interface?) - (-> Text Text //.Method Bool //.Inst) + (-> Text Text //.Method Bit //.Inst) (function (_ visitor) (do-to visitor (MethodVisitor::visitMethodInsn [ (//type.binary-name class) method-name (//type.method-descriptor method-signature) interface?]))))] diff --git a/new-luxc/source/luxc/lang/host/lua.lux b/new-luxc/source/luxc/lang/host/lua.lux index 8f057bc29..ec2fa8928 100644 --- a/new-luxc/source/luxc/lang/host/lua.lux +++ b/new-luxc/source/luxc/lang/host/lua.lux @@ -15,7 +15,7 @@ "nil") (def: #export bool - (-> Bool Expression) + (-> Bit Expression) %b) (def: #export int diff --git a/new-luxc/source/luxc/lang/host/php.lux b/new-luxc/source/luxc/lang/host/php.lux index 50d618f85..34c7c0535 100644 --- a/new-luxc/source/luxc/lang/host/php.lux +++ b/new-luxc/source/luxc/lang/host/php.lux @@ -23,7 +23,7 @@ (type: #export Global (Code' (Expression' Global'))) (type: #export Var (Code' (Expression' Var'))) (type: #export Argument - {#reference? Bool + {#reference? Bit #var Var}) (type: #export Computation (Code' (Expression' Computation'))) (type: #export Statement (Code' Statement')) @@ -82,8 +82,10 @@ (:abstraction "NULL")) (def: #export bool - (-> Bool Computation) - (|>> %b :abstraction)) + (-> Bit Computation) + (|>> (case> true "true" + false "false") + :abstraction)) (def: #export int (-> Int Computation) diff --git a/new-luxc/source/luxc/lang/host/python.lux b/new-luxc/source/luxc/lang/host/python.lux index c9835aa5d..e39ce5571 100644 --- a/new-luxc/source/luxc/lang/host/python.lux +++ b/new-luxc/source/luxc/lang/host/python.lux @@ -48,7 +48,7 @@ (:abstraction "None")) (def: #export bool - (-> Bool Expression) + (-> Bit Expression) (|>> (case> true "True" false "False") :abstraction)) diff --git a/new-luxc/source/luxc/lang/host/r.lux b/new-luxc/source/luxc/lang/host/r.lux index 6667d531f..4655c1343 100644 --- a/new-luxc/source/luxc/lang/host/r.lux +++ b/new-luxc/source/luxc/lang/host/r.lux @@ -66,7 +66,7 @@ (def: #export no-answer Expression n/a) (def: #export bool - (-> Bool Expression) + (-> Bit Expression) (|>> (case> true "TRUE" false "FALSE") self-contained)) diff --git a/new-luxc/source/luxc/lang/host/ruby.lux b/new-luxc/source/luxc/lang/host/ruby.lux index c2bc6e95f..51b0d7ea7 100644 --- a/new-luxc/source/luxc/lang/host/ruby.lux +++ b/new-luxc/source/luxc/lang/host/ruby.lux @@ -1,8 +1,11 @@ (.module: [lux #- not or and] - (lux (data [text] - text/format - (coll [list "list/" Functor Fold])))) + (lux + (control + pipe) + (data [text] + text/format + (coll [list "list/" Functor Fold])))) (type: #export Ruby Text) @@ -15,8 +18,9 @@ "nil") (def: #export bool - (-> Bool Expression) - %b) + (-> Bit Expression) + (|>> (case> true "true" + false "false"))) (def: #export int (-> Int Expression) diff --git a/new-luxc/source/luxc/lang/synthesis/variable.lux b/new-luxc/source/luxc/lang/synthesis/variable.lux index 4a3317d9f..f6a45b02e 100644 --- a/new-luxc/source/luxc/lang/synthesis/variable.lux +++ b/new-luxc/source/luxc/lang/synthesis/variable.lux @@ -35,7 +35,7 @@ (list))) (def: (non-arg? arity var) - (-> ls.Arity Variable Bool) + (-> ls.Arity Variable Bit) (and (variableL.local? var) (n/> arity (.nat var)))) diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/case.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/case.jvm.lux index 9d781429e..373d23ae4 100644 --- a/new-luxc/source/luxc/lang/translation/common-lisp/case.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/common-lisp/case.jvm.lux @@ -29,7 +29,7 @@ bodyO)))) (def: #export (translate-record-get translate valueS pathP) - (-> (-> Synthesis (Meta Expression)) Synthesis (List [Nat Bool]) + (-> (-> Synthesis (Meta Expression)) Synthesis (List [Nat Bit]) (Meta Expression)) (do macro.Monad [valueO (translate valueS)] @@ -115,7 +115,7 @@ [_ ( value)] (meta/wrap (_.when (|> value (<=> cursor-top) _.not) fail-pm!))) - ([#.Bool _.bool _.equal] + ([#.Bit _.bool _.equal] [#.Nat (<| _.int (:coerce Int)) _.=] [#.Int _.int _.=] [#.Rev (<| _.int (:coerce Int)) _.=] diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/eval.jvm.lux index a10fa0d5d..c88e83ed5 100644 --- a/new-luxc/source/luxc/lang/translation/common-lisp/eval.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/common-lisp/eval.jvm.lux @@ -85,7 +85,7 @@ (#e.Success output))))) (def: (variant tag flag value) - (-> Nat Bool Any Any) + (-> Nat Bit Any Any) [(Long::intValue [] (:coerce Long tag)) (: Any (if flag diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/expression.jvm.lux index 4e0c617b4..d3761ff6b 100644 --- a/new-luxc/source/luxc/lang/translation/common-lisp/expression.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/common-lisp/expression.jvm.lux @@ -38,14 +38,14 @@ (^template [ ] [_ ( value)] ( value)) - ([#.Bool primitiveT.translate-bool] + ([#.Bit primitiveT.translate-bit] [#.Nat primitiveT.translate-nat] [#.Int primitiveT.translate-int] [#.Rev primitiveT.translate-rev] [#.Frac primitiveT.translate-frac] [#.Text primitiveT.translate-text]) - (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bool last?)]) (~ valueS))) + (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bit last?)]) (~ valueS))) (structureT.translate-variant translate tag last? valueS) (^code [(~ singleton)]) diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/primitive.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/primitive.jvm.lux index 1c8c17bed..7556e6ebb 100644 --- a/new-luxc/source/luxc/lang/translation/common-lisp/primitive.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/common-lisp/primitive.jvm.lux @@ -5,8 +5,8 @@ [//] (// [".T" runtime])) -(def: #export translate-bool - (-> Bool (Meta Expression)) +(def: #export translate-bit + (-> Bit (Meta Expression)) (|>> _.bool meta/wrap)) (def: #export translate-int diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/runtime.jvm.lux index cd12328e2..43c1fd2a0 100644 --- a/new-luxc/source/luxc/lang/translation/common-lisp/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/common-lisp/runtime.jvm.lux @@ -19,7 +19,7 @@ (def: #export unit Expression (_.string //.unit)) (def: (flag value) - (-> Bool Expression) + (-> Bit Expression) (if value (_.string "") _.nil)) @@ -32,7 +32,7 @@ value)) (def: #export (variant tag last? value) - (-> Nat Bool Expression Expression) + (-> Nat Bit Expression Expression) (variant' (_.int (:coerce Int tag)) (flag last?) value)) (def: #export none diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/structure.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/structure.jvm.lux index fe7009627..dcf7e5693 100644 --- a/new-luxc/source/luxc/lang/translation/common-lisp/structure.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/common-lisp/structure.jvm.lux @@ -25,7 +25,7 @@ (wrap (_.vector elemsT+))))) (def: #export (translate-variant translate tag tail? valueS) - (-> (-> Synthesis (Meta Expression)) Nat Bool Synthesis (Meta Expression)) + (-> (-> Synthesis (Meta Expression)) Nat Bit Synthesis (Meta Expression)) (do macro.Monad [valueT (translate valueS)] (wrap (runtimeT.variant tag tail? valueT)))) diff --git a/new-luxc/source/luxc/lang/translation/js/case.jvm.lux b/new-luxc/source/luxc/lang/translation/js/case.jvm.lux index fc01a9d7c..e8fdcb00c 100644 --- a/new-luxc/source/luxc/lang/translation/js/case.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/js/case.jvm.lux @@ -25,7 +25,7 @@ "})()")))) (def: #export (translate-record-get translate valueS path) - (-> (-> ls.Synthesis (Meta Expression)) ls.Synthesis (List [Nat Bool]) + (-> (-> ls.Synthesis (Meta Expression)) ls.Synthesis (List [Nat Bit]) (Meta Expression)) (do macro.Monad [valueJS (translate valueS)] @@ -105,7 +105,7 @@ (^template [ ] [_ ( value)] (meta/wrap (format "if(" peek-cursor " !== " ( value) ") { " fail-pattern-matching " }"))) - ([#.Bool %b] + ([#.Bit %b] [#.Frac %f] [#.Text %t]) diff --git a/new-luxc/source/luxc/lang/translation/js/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/js/expression.jvm.lux index 8a5e73c75..544dd1eca 100644 --- a/new-luxc/source/luxc/lang/translation/js/expression.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/js/expression.jvm.lux @@ -42,14 +42,14 @@ (^template [ ] [_ ( value)] ( value)) - ([#.Bool primitiveT.translate-bool] + ([#.Bit primitiveT.translate-bit] [#.Nat primitiveT.translate-nat] [#.Int primitiveT.translate-int] [#.Rev primitiveT.translate-rev] [#.Frac primitiveT.translate-frac] [#.Text primitiveT.translate-text]) - (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bool last?)]) (~ valueS))) + (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bit last?)]) (~ valueS))) (structureT.translate-variant translate tag last? valueS) (^code [(~+ members)]) diff --git a/new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux b/new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux index 753f1ce45..e69291007 100644 --- a/new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux @@ -9,8 +9,8 @@ (// [".T" runtime]) (luxc (lang (host [js #+ JS Expression Statement])))) -(def: #export translate-bool - (-> Bool (Meta Expression)) +(def: #export translate-bit + (-> Bit (Meta Expression)) (|>> %b meta/wrap)) (def: low-mask Nat (dec (bit.left-shift +32 +1))) diff --git a/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux index 9840bba1f..8adfd22bf 100644 --- a/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux @@ -14,7 +14,7 @@ (def: #export unit Expression (%t //.unit)) (def: (flag value) - (-> Bool JS) + (-> Bit JS) (if value (%t "") "null")) @@ -26,7 +26,7 @@ [//.variant-value-field value]))) (def: #export (variant tag last? value) - (-> Nat Bool Expression Expression) + (-> Nat Bit Expression Expression) (variant' (%i (.int tag)) (flag last?) value)) (def: none diff --git a/new-luxc/source/luxc/lang/translation/js/structure.jvm.lux b/new-luxc/source/luxc/lang/translation/js/structure.jvm.lux index df7215dba..580f48807 100644 --- a/new-luxc/source/luxc/lang/translation/js/structure.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/js/structure.jvm.lux @@ -25,7 +25,7 @@ (wrap (format "[" (text.join-with "," elemsT+) "]"))))) (def: #export (translate-variant translate tag tail? valueS) - (-> (-> Synthesis (Meta Expression)) Nat Bool Synthesis (Meta Expression)) + (-> (-> Synthesis (Meta Expression)) Nat Bit Synthesis (Meta Expression)) (do macro.Monad [valueT (translate valueS)] (wrap (runtimeT.variant tag tail? valueT)))) diff --git a/new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux index 18309b0e5..d29b9ae7c 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux @@ -73,7 +73,7 @@ (macro/wrap (|>> peekI ($i.ASTORE register))) - [_ (#.Bool value)] + [_ (#.Bit value)] (macro/wrap (let [jumpI (if value $i.IFEQ $i.IFNE)] (|>> peekI ($i.unwrap #$.Boolean) diff --git a/new-luxc/source/luxc/lang/translation/jvm/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/expression.jvm.lux index a587d2e5b..b6fed434e 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/expression.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/expression.jvm.lux @@ -32,8 +32,8 @@ (def: #export (translate synthesis) (-> Synthesis (Meta $.Inst)) (case synthesis - (^ (//synthesis.bool value)) - (primitiveT.translate-bool value) + (^ (//synthesis.bit value)) + (primitiveT.translate-bit value) (^ (//synthesis.i64 value)) (primitiveT.translate-i64 value) @@ -44,7 +44,7 @@ (^ (//synthesis.text value)) (primitiveT.translate-text value) - (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bool last?)]) (~ valueS))) + (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bit last?)]) (~ valueS))) (structureT.translate-variant translate tag last? valueS) (^code [(~+ members)]) diff --git a/new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux index 70eedf738..062cf5d52 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux @@ -23,7 +23,7 @@ (def: $Object $.Type ($t.class "java.lang.Object" (list))) (def: (poly-arg? arity) - (-> ls.Arity Bool) + (-> ls.Arity Bit) (n/> +1 arity)) (def: (reset-method class) diff --git a/new-luxc/source/luxc/lang/translation/jvm/imports.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/imports.jvm.lux index 22fdfbece..820024153 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/imports.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/imports.jvm.lux @@ -66,7 +66,7 @@ (<| (Future::get []) promise-to-future (do promise.Monad - [[new? future] (stm.commit (: (STM [Bool (CompletableFuture (Error Lux))]) + [[new? future] (stm.commit (: (STM [Bit (CompletableFuture (Error Lux))]) (do stm.Monad [current-compilations (stm.read compilations)] (case (dict.get dependency current-compilations) @@ -87,7 +87,7 @@ (wrap future))))) (def: compiled? - (-> Module Bool) + (-> Module Bit) (|>> (get@ #.module-state) (case> (^or #.Cached #.Compiled) diff --git a/new-luxc/source/luxc/lang/translation/jvm/loop.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/loop.jvm.lux index f48ab149a..120a3e384 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/loop.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/loop.jvm.lux @@ -19,7 +19,7 @@ [".T" reference])) (def: (constant? register changeS) - (-> Register ls.Synthesis Bool) + (-> Register ls.Synthesis Bit) (case changeS (^multi (^code ((~ [_ (#.Int var)]))) (i/= (variableL.local register) diff --git a/new-luxc/source/luxc/lang/translation/jvm/primitive.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/primitive.jvm.lux index 80a243852..250b0db52 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/primitive.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/primitive.jvm.lux @@ -12,8 +12,8 @@ ["ls" synthesis])) (// [".T" common])) -(def: #export (translate-bool value) - (-> Bool (Meta $.Inst)) +(def: #export (translate-bit value) + (-> Bit (Meta $.Inst)) (macro/wrap ($i.GETSTATIC "java.lang.Boolean" (if value "TRUE" "FALSE") ($t.class "java.lang.Boolean" (list))))) diff --git a/new-luxc/source/luxc/lang/translation/jvm/procedure/host.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/procedure/host.jvm.lux index f6a0069f5..45cb67fb9 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/procedure/host.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/procedure/host.jvm.lux @@ -155,6 +155,10 @@ [double//% $i.DREM #$.Double #$.Double #$.Double] ) +(def: boolean-class ($t.class "java.lang.Boolean" (list))) +(def: falseI ($i.GETSTATIC "java.lang.Boolean" "FALSE" boolean-class)) +(def: trueI ($i.GETSTATIC "java.lang.Boolean" "TRUE" boolean-class)) + (do-template [ ] [(def: ( [xI yI]) @.Binary @@ -163,10 +167,10 @@ (|>> xI ($i.unwrap ) yI ($i.unwrap ) ( @then) - ($i.GETSTATIC "java.lang.Boolean" "FALSE" ($t.class "java.lang.Boolean" (list))) + falseI ($i.GOTO @end) ($i.label @then) - ($i.GETSTATIC "java.lang.Boolean" "TRUE" ($t.class "java.lang.Boolean" (list))) + trueI ($i.label @end))))] [int//= $i.IF_ICMPEQ #$.Int #$.Int #$.Boolean] @@ -186,10 +190,10 @@ ($i.int ) ($i.IF_ICMPEQ @then) - ($i.GETSTATIC "java.lang.Boolean" "FALSE" ($t.class "java.lang.Boolean" (list))) + falseI ($i.GOTO @end) ($i.label @then) - ($i.GETSTATIC "java.lang.Boolean" "TRUE" ($t.class "java.lang.Boolean" (list))) + trueI ($i.label @end))))] [long//= $i.LCMP 0 #$.Long #$.Long #$.Boolean] @@ -380,10 +384,10 @@ $i.with-label (function (_ @end)) (|>> objectI ($i.IFNULL @then) - ($i.GETSTATIC "java.lang.Boolean" "FALSE" ($t.class "java.lang.Boolean" (list))) + falseI ($i.GOTO @end) ($i.label @then) - ($i.GETSTATIC "java.lang.Boolean" "TRUE" ($t.class "java.lang.Boolean" (list))) + trueI ($i.label @end)))) (def: (object//synchronized [monitorI exprI]) diff --git a/new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux index fce1c6790..9d3e4d097 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux @@ -42,13 +42,13 @@ membersI)))) (def: (flagI tail?) - (-> Bool $.Inst) + (-> Bit $.Inst) (if tail? ($i.string "") $i.NULL)) (def: #export (translate-variant translate tag tail? member) - (-> (-> ls.Synthesis (Meta $.Inst)) Nat Bool ls.Synthesis (Meta $.Inst)) + (-> (-> ls.Synthesis (Meta $.Inst)) Nat Bit ls.Synthesis (Meta $.Inst)) (do macro.Monad [memberI (translate member)] (wrap (|>> ($i.int (.int tag)) diff --git a/new-luxc/source/luxc/lang/translation/lua/case.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/case.jvm.lux index 70d2330f4..af4e61b7c 100644 --- a/new-luxc/source/luxc/lang/translation/lua/case.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/lua/case.jvm.lux @@ -30,7 +30,7 @@ (lua.return! bodyO))))))) (def: #export (translate-record-get translate valueS path) - (-> (-> ls.Synthesis (Meta Expression)) ls.Synthesis (List [Nat Bool]) + (-> (-> ls.Synthesis (Meta Expression)) ls.Synthesis (List [Nat Bit]) (Meta Expression)) (do macro.Monad [valueO (translate valueS)] @@ -105,7 +105,7 @@ ([#.Nat (<| lua.int (:coerce Int))] [#.Int lua.int] [#.Rev (<| lua.int (:coerce Int))] - [#.Bool lua.bool] + [#.Bit lua.bool] [#.Frac lua.float] [#.Text lua.string]) diff --git a/new-luxc/source/luxc/lang/translation/lua/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/expression.jvm.lux index 9632d5708..0fefcc8ba 100644 --- a/new-luxc/source/luxc/lang/translation/lua/expression.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/lua/expression.jvm.lux @@ -42,14 +42,14 @@ (^template [ ] [_ ( value)] ( value)) - ([#.Bool primitiveT.translate-bool] + ([#.Bit primitiveT.translate-bit] [#.Nat primitiveT.translate-nat] [#.Int primitiveT.translate-int] [#.Rev primitiveT.translate-rev] [#.Frac primitiveT.translate-frac] [#.Text primitiveT.translate-text]) - (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bool last?)]) (~ valueS))) + (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bit last?)]) (~ valueS))) (structureT.translate-variant translate tag last? valueS) (^code [(~+ members)]) diff --git a/new-luxc/source/luxc/lang/translation/lua/primitive.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/primitive.jvm.lux index 4a6c78b04..230498fcb 100644 --- a/new-luxc/source/luxc/lang/translation/lua/primitive.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/lua/primitive.jvm.lux @@ -6,13 +6,13 @@ [macro "meta/" Monad]) (luxc (lang (host [lua #+ Lua Expression Statement])))) -(def: #export translate-bool - (-> Bool (Meta Expression)) - (|>> %b meta/wrap)) +(def: #export translate-bit + (-> Bit (Meta Expression)) + (|>> lua.bool meta/wrap)) (def: #export translate-int (-> Int (Meta Expression)) - (|>> %i meta/wrap)) + (|>> lua.int meta/wrap)) (def: #export translate-frac (-> Frac (Meta Expression)) diff --git a/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux index 2c0dfec17..6be20a0e6 100644 --- a/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux @@ -17,7 +17,7 @@ (def: #export unit Expression (%t //.unit)) (def: (flag value) - (-> Bool Lua) + (-> Bit Lua) (if value (lua.string "") lua.nil)) @@ -29,7 +29,7 @@ [//.variant-value-field value]))) (def: #export (variant tag last? value) - (-> Nat Bool Expression Expression) + (-> Nat Bit Expression Expression) (variant' (%i (.int tag)) (flag last?) value)) (def: none diff --git a/new-luxc/source/luxc/lang/translation/lua/structure.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/structure.jvm.lux index c629b0cae..b6eeaa013 100644 --- a/new-luxc/source/luxc/lang/translation/lua/structure.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/lua/structure.jvm.lux @@ -25,7 +25,7 @@ (wrap (format "{" (text.join-with "," elemsT+) "}"))))) (def: #export (translate-variant translate tag tail? valueS) - (-> (-> Synthesis (Meta Expression)) Nat Bool Synthesis (Meta Expression)) + (-> (-> Synthesis (Meta Expression)) Nat Bit Synthesis (Meta Expression)) (do macro.Monad [valueT (translate valueS)] (wrap (runtimeT.variant tag tail? valueT)))) diff --git a/new-luxc/source/luxc/lang/translation/php/case.jvm.lux b/new-luxc/source/luxc/lang/translation/php/case.jvm.lux index 0e0aecb7d..c438425ff 100644 --- a/new-luxc/source/luxc/lang/translation/php/case.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/php/case.jvm.lux @@ -31,7 +31,7 @@ (_.nth (_.int 1)))))) (def: #export (translate-record-get translate valueS pathP) - (-> (-> Synthesis (Meta Expression)) Synthesis (List [Nat Bool]) + (-> (-> Synthesis (Meta Expression)) Synthesis (List [Nat Bit]) (Meta Expression)) (do macro.Monad [valueO (translate valueS)] @@ -115,7 +115,7 @@ (meta/wrap (_.when! (_.not (_.= (|> value ) cursor-top)) fail-pm!))) ([#.Int _.int] - [#.Bool _.bool] + [#.Bit _.bool] [#.Frac _.float] [#.Text _.string]) @@ -196,7 +196,7 @@ ## TODO: Remove (let [inner recur]) once loops can have names. (let [inner recur] (case bodyS - (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bool last?)]) (~ valueS))) + (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bit last?)]) (~ valueS))) (inner valueS inner-variables) (^code [(~+ members)]) diff --git a/new-luxc/source/luxc/lang/translation/php/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/php/expression.jvm.lux index 420775734..b7f9661e7 100644 --- a/new-luxc/source/luxc/lang/translation/php/expression.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/php/expression.jvm.lux @@ -36,12 +36,12 @@ (^template [ ] [_ ( value)] (|> value )) - ([#.Bool primitiveT.translate-bool] + ([#.Bit primitiveT.translate-bit] [#.Int primitiveT.translate-int] [#.Frac primitiveT.translate-frac] [#.Text primitiveT.translate-text]) - (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bool last?)]) (~ valueS))) + (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bit last?)]) (~ valueS))) (structureT.translate-variant translate tag last? valueS) (^code [(~+ members)]) diff --git a/new-luxc/source/luxc/lang/translation/php/primitive.jvm.lux b/new-luxc/source/luxc/lang/translation/php/primitive.jvm.lux index 6fcd675ce..061833c70 100644 --- a/new-luxc/source/luxc/lang/translation/php/primitive.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/php/primitive.jvm.lux @@ -3,8 +3,8 @@ (lux [macro "meta/" Monad]) (luxc (lang (host ["_" php #+ Computation])))) -(def: #export translate-bool - (-> Bool (Meta Computation)) +(def: #export translate-bit + (-> Bit (Meta Computation)) (|>> _.bool meta/wrap)) (def: #export translate-int diff --git a/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux index aeffe45e5..045f8ceb7 100644 --- a/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux @@ -17,7 +17,7 @@ (def: #export unit Computation (_.string //.unit)) (def: (flag value) - (-> Bool Computation) + (-> Bit Computation) (if value (_.string "") _.null)) @@ -29,7 +29,7 @@ [(_.string //.variant-value-field) value]))) (def: #export (variant tag last? value) - (-> Nat Bool Expression Computation) + (-> Nat Bit Expression Computation) (variant' (_.int (.int tag)) (flag last?) value)) diff --git a/new-luxc/source/luxc/lang/translation/php/structure.jvm.lux b/new-luxc/source/luxc/lang/translation/php/structure.jvm.lux index a92340e92..229b0e31d 100644 --- a/new-luxc/source/luxc/lang/translation/php/structure.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/php/structure.jvm.lux @@ -25,7 +25,7 @@ (wrap (_.array/* elemsT+))))) (def: #export (translate-variant translate tag tail? valueS) - (-> //.Translator Nat Bool Synthesis (Meta Computation)) + (-> //.Translator Nat Bit Synthesis (Meta Computation)) (do macro.Monad [valueT (translate valueS)] (wrap (runtimeT.variant tag tail? valueT)))) diff --git a/new-luxc/source/luxc/lang/translation/python/case.jvm.lux b/new-luxc/source/luxc/lang/translation/python/case.jvm.lux index 8e5b16a88..809b32c23 100644 --- a/new-luxc/source/luxc/lang/translation/python/case.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/case.jvm.lux @@ -30,7 +30,7 @@ (python.apply (list valueO)))))) (def: #export (translate-record-get translate valueS pathP) - (-> (-> Synthesis (Meta Expression)) Synthesis (List [Nat Bool]) + (-> (-> Synthesis (Meta Expression)) Synthesis (List [Nat Bit]) (Meta Expression)) (do macro.Monad [valueO (translate valueS)] @@ -118,7 +118,7 @@ ([#.Nat (<| python.int (:coerce Int))] [#.Int python.int] [#.Rev (<| python.int (:coerce Int))] - [#.Bool python.bool] + [#.Bit python.bool] [#.Frac python.float] [#.Text python.string]) @@ -204,7 +204,7 @@ ## TODO: Remove (let [inner recur]) once loops can have names. (let [inner recur] (case bodyS - (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bool last?)]) (~ valueS))) + (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bit last?)]) (~ valueS))) (inner valueS inner-variables) (^code [(~+ members)]) diff --git a/new-luxc/source/luxc/lang/translation/python/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/python/expression.jvm.lux index a1abe59a6..62be95f27 100644 --- a/new-luxc/source/luxc/lang/translation/python/expression.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/expression.jvm.lux @@ -41,14 +41,14 @@ (^template [ ] [_ ( value)] ( value)) - ([#.Bool primitiveT.translate-bool] + ([#.Bit primitiveT.translate-bit] [#.Nat primitiveT.translate-nat] [#.Int primitiveT.translate-int] [#.Rev primitiveT.translate-rev] [#.Frac primitiveT.translate-frac] [#.Text primitiveT.translate-text]) - (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bool last?)]) (~ valueS))) + (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bit last?)]) (~ valueS))) (structureT.translate-variant translate tag last? valueS) (^code [(~+ members)]) diff --git a/new-luxc/source/luxc/lang/translation/python/primitive.jvm.lux b/new-luxc/source/luxc/lang/translation/python/primitive.jvm.lux index 439404893..f88c34fce 100644 --- a/new-luxc/source/luxc/lang/translation/python/primitive.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/primitive.jvm.lux @@ -3,8 +3,8 @@ (lux [macro "meta/" Monad]) (luxc (lang (host [python #+ Expression Statement])))) -(def: #export translate-bool - (-> Bool (Meta Expression)) +(def: #export translate-bit + (-> Bit (Meta Expression)) (|>> python.bool meta/wrap)) (def: #export translate-int diff --git a/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux index fbd599c77..70ce11a94 100644 --- a/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux @@ -17,7 +17,7 @@ (def: #export unit Expression (python.string //.unit)) (def: (flag value) - (-> Bool Expression) + (-> Bit Expression) (if value (python.string "") python.none)) @@ -29,7 +29,7 @@ [(python.string //.variant-value-field) value]))) (def: #export (variant tag last? value) - (-> Nat Bool Expression Expression) + (-> Nat Bit Expression Expression) (variant' (python.int (.int tag)) (flag last?) value)) diff --git a/new-luxc/source/luxc/lang/translation/python/structure.jvm.lux b/new-luxc/source/luxc/lang/translation/python/structure.jvm.lux index 0452ef504..158cf3a2c 100644 --- a/new-luxc/source/luxc/lang/translation/python/structure.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/structure.jvm.lux @@ -25,7 +25,7 @@ (wrap (python.tuple elemsT+))))) (def: #export (translate-variant translate tag tail? valueS) - (-> (-> Synthesis (Meta Expression)) Nat Bool Synthesis (Meta Expression)) + (-> (-> Synthesis (Meta Expression)) Nat Bit Synthesis (Meta Expression)) (do macro.Monad [valueT (translate valueS)] (wrap (runtimeT.variant tag tail? valueT)))) diff --git a/new-luxc/source/luxc/lang/translation/r/case.jvm.lux b/new-luxc/source/luxc/lang/translation/r/case.jvm.lux index fb16b8791..42460b620 100644 --- a/new-luxc/source/luxc/lang/translation/r/case.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/r/case.jvm.lux @@ -31,7 +31,7 @@ bodyO))))) (def: #export (translate-record-get translate valueS pathP) - (-> (-> Synthesis (Meta Expression)) Synthesis (List [Nat Bool]) + (-> (-> Synthesis (Meta Expression)) Synthesis (List [Nat Bit]) (Meta Expression)) (do macro.Monad [valueO (translate valueS)] @@ -116,7 +116,7 @@ [_ ( value)] (meta/wrap (r.when (r.not (r.= (|> value ) cursor-top)) fail-pm!))) - ([#.Bool r.bool] + ([#.Bit r.bool] [#.Frac r.float] [#.Text r.string]) diff --git a/new-luxc/source/luxc/lang/translation/r/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/r/expression.jvm.lux index cd2227df3..2e30b4999 100644 --- a/new-luxc/source/luxc/lang/translation/r/expression.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/r/expression.jvm.lux @@ -39,14 +39,14 @@ (^template [ ] [_ ( value)] ( value)) - ([#.Bool primitiveT.translate-bool] + ([#.Bit primitiveT.translate-bit] [#.Nat primitiveT.translate-nat] [#.Int primitiveT.translate-int] [#.Rev primitiveT.translate-rev] [#.Frac primitiveT.translate-frac] [#.Text primitiveT.translate-text]) - (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bool last?)]) (~ valueS))) + (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bit last?)]) (~ valueS))) (structureT.translate-variant translate tag last? valueS) (^code [(~ singleton)]) diff --git a/new-luxc/source/luxc/lang/translation/r/primitive.jvm.lux b/new-luxc/source/luxc/lang/translation/r/primitive.jvm.lux index 3652dfcfd..8bc7da848 100644 --- a/new-luxc/source/luxc/lang/translation/r/primitive.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/r/primitive.jvm.lux @@ -5,8 +5,8 @@ [//] (// [".T" runtime])) -(def: #export translate-bool - (-> Bool (Meta Expression)) +(def: #export translate-bit + (-> Bit (Meta Expression)) (|>> r.bool meta/wrap)) (def: #export translate-int diff --git a/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux index 9cab92115..cf0b87d78 100644 --- a/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux @@ -45,7 +45,7 @@ [//.int-low-field (r.int low)])))) (def: (flag value) - (-> Bool Expression) + (-> Bit Expression) (if value (r.string "") r.null)) @@ -57,7 +57,7 @@ [//.variant-value-field value]))) (def: #export (variant tag last? value) - (-> Nat Bool Expression Expression) + (-> Nat Bit Expression Expression) (variant' (r.int (.int tag)) (flag last?) value)) diff --git a/new-luxc/source/luxc/lang/translation/r/structure.jvm.lux b/new-luxc/source/luxc/lang/translation/r/structure.jvm.lux index bfe0a40a6..e9a528d2b 100644 --- a/new-luxc/source/luxc/lang/translation/r/structure.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/r/structure.jvm.lux @@ -25,7 +25,7 @@ (wrap (r.list elemsT+))))) (def: #export (translate-variant translate tag tail? valueS) - (-> (-> Synthesis (Meta Expression)) Nat Bool Synthesis (Meta Expression)) + (-> (-> Synthesis (Meta Expression)) Nat Bit Synthesis (Meta Expression)) (do macro.Monad [valueT (translate valueS)] (wrap (runtimeT.variant tag tail? valueT)))) diff --git a/new-luxc/source/luxc/lang/translation/ruby/case.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/case.jvm.lux index 2cce1abf5..d83a5cd0a 100644 --- a/new-luxc/source/luxc/lang/translation/ruby/case.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/ruby/case.jvm.lux @@ -30,7 +30,7 @@ (ruby.return! bodyO))))))) (def: #export (translate-record-get translate valueS path) - (-> (-> ls.Synthesis (Meta Expression)) ls.Synthesis (List [Nat Bool]) + (-> (-> ls.Synthesis (Meta Expression)) ls.Synthesis (List [Nat Bit]) (Meta Expression)) (do macro.Monad [valueO (translate valueS)] @@ -108,7 +108,7 @@ (meta/wrap (ruby.when! (ruby.not (ruby.= (|> value ) cursor-top)) (ruby.raise pm-error)))) ([#.Int ruby.int] - [#.Bool ruby.bool] + [#.Bit ruby.bool] [#.Frac ruby.float] [#.Text ruby.string]) diff --git a/new-luxc/source/luxc/lang/translation/ruby/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/expression.jvm.lux index 6d829f81c..e68cf8a8f 100644 --- a/new-luxc/source/luxc/lang/translation/ruby/expression.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/ruby/expression.jvm.lux @@ -41,12 +41,12 @@ (^template [ ] [_ ( value)] ( value)) - ([#.Bool primitiveT.translate-bool] + ([#.Bit primitiveT.translate-bit] [#.Int primitiveT.translate-int] [#.Frac primitiveT.translate-frac] [#.Text primitiveT.translate-text]) - (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bool last?)]) (~ valueS))) + (^code ((~ [_ (#.Nat tag)]) (~ [_ (#.Bit last?)]) (~ valueS))) (structureT.translate-variant translate tag last? valueS) (^code [(~+ members)]) diff --git a/new-luxc/source/luxc/lang/translation/ruby/primitive.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/primitive.jvm.lux index f84c700d4..cc5e5752e 100644 --- a/new-luxc/source/luxc/lang/translation/ruby/primitive.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/ruby/primitive.jvm.lux @@ -6,13 +6,13 @@ [macro "meta/" Monad]) (luxc (lang (host [ruby #+ Ruby Expression Statement])))) -(def: #export translate-bool - (-> Bool (Meta Expression)) - (|>> %b meta/wrap)) +(def: #export translate-bit + (-> Bit (Meta Expression)) + (|>> ruby.bool meta/wrap)) (def: #export translate-int (-> Int (Meta Expression)) - (|>> %i meta/wrap)) + (|>> ruby.int meta/wrap)) (def: #export translate-frac (-> Frac (Meta Expression)) diff --git a/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux index 7e94101ff..9d0d0f890 100644 --- a/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux @@ -17,7 +17,7 @@ (def: #export unit Expression (%t //.unit)) (def: (flag value) - (-> Bool Ruby) + (-> Bit Ruby) (if value (ruby.string "") ruby.nil)) @@ -29,7 +29,7 @@ [(ruby.string //.variant-value-field) value]))) (def: #export (variant tag last? value) - (-> Nat Bool Expression Expression) + (-> Nat Bit Expression Expression) (variant' (%i (.int tag)) (flag last?) value)) (def: #export none diff --git a/new-luxc/source/luxc/lang/translation/ruby/structure.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/structure.jvm.lux index 5bf7c9e8b..2a1f81d37 100644 --- a/new-luxc/source/luxc/lang/translation/ruby/structure.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/ruby/structure.jvm.lux @@ -25,7 +25,7 @@ (wrap (ruby.array elemsT+))))) (def: #export (translate-variant translate tag tail? valueS) - (-> (-> Synthesis (Meta Expression)) Nat Bool Synthesis (Meta Expression)) + (-> (-> Synthesis (Meta Expression)) Nat Bit Synthesis (Meta Expression)) (do macro.Monad [valueT (translate valueS)] (wrap (runtimeT.variant tag tail? valueT)))) diff --git a/new-luxc/source/luxc/lang/translation/scheme/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/scheme/eval.jvm.lux index cbdd43d94..ae4a4151a 100644 --- a/new-luxc/source/luxc/lang/translation/scheme/eval.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/scheme/eval.jvm.lux @@ -73,7 +73,7 @@ (#e.Success output))))) (def: (variant tag flag value) - (-> Nat Bool Any Any) + (-> Nat Bit Any Any) [(Long::intValue [] (:coerce Long tag)) (: Any (if flag diff --git a/new-luxc/test/test/luxc/lang/analysis/host.jvm.lux b/new-luxc/test/test/luxc/lang/analysis/host.jvm.lux index 02574a31a..1e6cafdfc 100644 --- a/new-luxc/test/test/luxc/lang/analysis/host.jvm.lux +++ b/new-luxc/test/test/luxc/lang/analysis/host.jvm.lux @@ -35,7 +35,7 @@ (do-template [ ] [(def: ( procedure params output-type) - (-> Text (List Code) Type Bool) + (-> Text (List Code) Type Bit) (|> (do Monad [## runtime-bytecode @runtime.translate ] @@ -56,7 +56,7 @@ (do-template [ ] [(def: ( syntax output-type) - (-> Code Type Bool) + (-> Code Type Bit) (|> (do Monad [## runtime-bytecode @runtime.translate ] @@ -365,7 +365,7 @@ (test "jvm object null?" (success "jvm object null?" (list boxedC) - Bool)) + Bit)) (test "jvm object synchronized" (success "jvm object synchronized" (list boxedC boxedC) @@ -388,18 +388,18 @@ (success "jvm object instance?" (list (code.text boxed) boxedC) - Bool)) + Bit)) (test "jvm object instance? (lineage)" (success "jvm object instance?" (list (' "java.lang.Object") boxedC) - Bool)) + Bit)) (test "jvm object instance? (no lineage)" (or (text/= "java.lang.Object" boxed) (failure "jvm object instance?" (list (code.text boxed) !boxedC) - Bool))) + Bit))) )))) (context: "Member [Static Field]." diff --git a/new-luxc/test/test/luxc/lang/analysis/type.lux b/new-luxc/test/test/luxc/lang/analysis/type.lux index a026f8df2..b2d819ec5 100644 --- a/new-luxc/test/test/luxc/lang/analysis/type.lux +++ b/new-luxc/test/test/luxc/lang/analysis/type.lux @@ -3,7 +3,7 @@ (lux [io] (control [monad #+ do] pipe) - (data [bool "bool/" Eq] + (data [bit "bit/" Eq] [text "text/" Eq] (text format ["l" lexer]) @@ -36,7 +36,7 @@ ( value)]))] - [r.bool (+0 "#Bool" (+0)) code.bool] + [r.bit (+0 "#Bit" (+0)) code.bit] [r.nat (+0 "#Nat" (+0)) code.nat] [r.int (+0 "#Int" (+0)) code.int] [r.rev (+0 "#Rev" (+0)) code.rev] @@ -65,7 +65,7 @@ (^template [ ] [[_ ( expected)] [_ ( actual)]] ( expected actual)) - ([#.Bool bool/=] + ([#.Bit bit/=] [#.Nat n/=] [#.Int i/=] [#.Rev r/=] diff --git a/new-luxc/test/test/luxc/lang/synthesis/loop.lux b/new-luxc/test/test/luxc/lang/synthesis/loop.lux index 23641780f..af818255b 100644 --- a/new-luxc/test/test/luxc/lang/synthesis/loop.lux +++ b/new-luxc/test/test/luxc/lang/synthesis/loop.lux @@ -2,7 +2,7 @@ lux (lux [io] (control [monad #+ do]) - (data [bool "bool/" Eq] + (data [bit "bit/" Eq] [number] (coll [list "list/" Functor Fold] (set ["set" unordered])) @@ -18,7 +18,7 @@ (// common)) (def: (does-recursion? arity exprS) - (-> ls.Arity ls.Synthesis Bool) + (-> ls.Arity ls.Synthesis Bit) (loop [exprS exprS] (case exprS (^ [_ (#.Form (list [_ (#.Text "lux case")] inputS pathS))]) @@ -68,19 +68,19 @@ (wrap (` ("lux case" (~ inputA) (~ (code.record (list.zip2 tests bodies)))))))) (r.either (do r.Monad - [valueS r.bool + [valueS r.bit output' (gen-body (n/inc arity) output)] - (wrap (` ("lux case" (~ (code.bool valueS)) + (wrap (` ("lux case" (~ (code.bit valueS)) {("lux case bind" (~ (code.nat arity))) (~ output')})))) (do r.Monad - [valueS r.bool - then|else r.bool + [valueS r.bit + then|else r.bit output' (gen-body arity output) #let [thenA (if then|else output' (' [])) elseA (if (not then|else) output' (' []))]] - (wrap (` ("lux case" (~ (code.bool valueS)) - {(~ (code.bool then|else)) (~ thenA) - (~ (code.bool (not then|else))) (~ elseA)}))))) + (wrap (` ("lux case" (~ (code.bit valueS)) + {(~ (code.bit then|else)) (~ thenA) + (~ (code.bit (not then|else))) (~ elseA)}))))) )) (def: (make-function arity body) @@ -90,14 +90,14 @@ _ (` ("lux function" [] (~ (make-function (n/dec arity) body)))))) (def: gen-recursion - (r.Random [Bool Nat la.Analysis]) + (r.Random [Bit Nat la.Analysis]) (do r.Monad [arity (|> r.nat (:: @ map (|>> (n/% +10) (n/max +1)))) - recur? r.bool + recur? r.bit outputS (if recur? (wrap (la.apply (list.repeat arity (' [])) (la.var 0))) (do @ - [plus-or-minus? r.bool + [plus-or-minus? r.bit how-much (|> r.nat (:: @ map (|>> (n/% arity) (n/max +1)))) #let [shift (if plus-or-minus? n/+ n/-)]] (wrap (la.apply (list.repeat (shift how-much arity) (' [])) (la.var 0))))) @@ -105,17 +105,17 @@ (wrap [recur? arity (make-function arity bodyS)]))) (def: gen-loop - (r.Random [Bool Nat la.Analysis]) + (r.Random [Bit Nat la.Analysis]) (do r.Monad [arity (|> r.nat (:: @ map (|>> (n/% +10) (n/max +1)))) - recur? r.bool - self-ref? r.bool + recur? r.bit + self-ref? r.bit #let [selfA (la.var 0) argA (if self-ref? selfA (' []))] outputS (if recur? (wrap (la.apply (list.repeat arity argA) selfA)) (do @ - [plus-or-minus? r.bool + [plus-or-minus? r.bit how-much (|> r.nat (:: @ map (|>> (n/% arity) (n/max +1)))) #let [shift (if plus-or-minus? n/+ n/-)]] (wrap (la.apply (list.repeat (shift how-much arity) (' [])) selfA)))) @@ -135,7 +135,7 @@ (^ [_ (#.Form (list [_ (#.Text "lux function")] [_ (#.Nat _arity)] [_ (#.Tuple _env)] _body))]) (|> _body (does-recursion? arity) - (bool/= prediction) + (bit/= prediction) (and (n/= arity _arity))) _ diff --git a/new-luxc/test/test/luxc/lang/translation/case.lux b/new-luxc/test/test/luxc/lang/translation/case.lux index a16715729..20d072651 100644 --- a/new-luxc/test/test/luxc/lang/translation/case.lux +++ b/new-luxc/test/test/luxc/lang/translation/case.lux @@ -14,7 +14,7 @@ (def: struct-limit Nat +10) (def: (tail? size idx) - (-> Nat Nat Bool) + (-> Nat Nat Bit) (n/= (n/dec size) idx)) (def: gen-case @@ -31,7 +31,7 @@ (wrap [( value) ( value)]))] - [r.bool //synthesis.bool //synthesis.path/bool] + [r.bit //synthesis.bit //synthesis.path/bit] [r.int //synthesis.i64 //synthesis.path/i64] [r.frac //synthesis.f64 //synthesis.path/f64] [(r.unicode +5) //synthesis.text //synthesis.path/text])) @@ -51,7 +51,7 @@ [size (|> r.nat (:: @ map (|>> (n/% struct-limit) (n/max +2)))) idx (|> r.nat (:: @ map (n/% size))) [subS subP] gen-case - #let [caseS (` ((~ (code.nat idx)) (~ (code.bool (tail? size idx))) (~ subS))) + #let [caseS (` ((~ (code.nat idx)) (~ (code.bit (tail? size idx))) (~ subS))) caseP (` ("lux case seq" (~ (if (tail? size idx) (` ("lux case variant right" (~ (code.nat idx)))) @@ -74,7 +74,7 @@ ("lux case seq" ("lux case bind" +0) ("lux case exec" false)))))) (case> (#e.Success valueT) - (:coerce Bool valueT) + (:coerce Bit valueT) (#e.Error error) (exec (log! error) diff --git a/new-luxc/test/test/luxc/lang/translation/common.lux b/new-luxc/test/test/luxc/lang/translation/common.lux index 0e2d66503..9aba56d6b 100644 --- a/new-luxc/test/test/luxc/lang/translation/common.lux +++ b/new-luxc/test/test/luxc/lang/translation/common.lux @@ -6,7 +6,7 @@ (data text/format [bit] ["e" error] - [bool "bool/" Eq] + [bit "bit/" Eq] [text "text/" Eq] [number "int/" Number "frac/" Number Interval] (coll ["a" array] @@ -100,8 +100,8 @@ ["lux int *" i/* Int i/=] ["lux int /" i// Int i/=] ["lux int %" i/% Int i/=] - ["lux int =" i/= Bool bool/=] - ["lux int <" i/< Bool bool/=] + ["lux int =" i/= Bit bit/=] + ["lux int <" i/< Bit bit/=] )) )))) @@ -124,8 +124,8 @@ ["lux frac *" f/* Frac f/=] ["lux frac /" f// Frac f/=] ["lux frac %" f/% Frac f/=] - ["lux frac =" f/= Bool bool/=] - ["lux frac <" f/< Bool bool/=] + ["lux frac =" f/= Bit bit/=] + ["lux frac <" f/< Bit bit/=] )] ($_ seq @@ -202,20 +202,20 @@ (test "Can compare texts for equality." (and (|> (run (` ("lux text =" (~ sample0S) (~ sample0S)))) (case> (#e.Success valueV) - (:coerce Bool valueV) + (:coerce Bit valueV) _ false)) (|> (run (` ("lux text =" (~ sample0S) (~ sample1S)))) (case> (#e.Success valueV) - (not (:coerce Bool valueV)) + (not (:coerce Bit valueV)) _ false)))) (test "Can compare texts for order." (|> (run (` ("lux text <" (~ sample1S) (~ sample0S)))) (case> (#e.Success valueV) - (:coerce Bool valueV) + (:coerce Bit valueV) _ false))) @@ -423,7 +423,7 @@ [("lux atom compare-and-swap" (1) (0) (~ postS)) ("lux atom read" (1))])))) (case> (#e.Success valueV) - (let [[swapped? current-value] (:coerce [Bool Nat] valueV)] + (let [[swapped? current-value] (:coerce [Bit Nat] valueV)] (and swapped? (n/= post current-value))) @@ -435,7 +435,7 @@ [("lux atom compare-and-swap" (1) (~ postS) (~ postS)) ("lux atom read" (1))])))) (case> (#e.Success valueV) - (let [[swapped? current-value] (:coerce [Bool Nat] valueV)] + (let [[swapped? current-value] (:coerce [Bit Nat] valueV)] (and (not swapped?) (n/= pre current-value))) diff --git a/new-luxc/test/test/luxc/lang/translation/js.lux b/new-luxc/test/test/luxc/lang/translation/js.lux index 6f4fb572d..42947b580 100644 --- a/new-luxc/test/test/luxc/lang/translation/js.lux +++ b/new-luxc/test/test/luxc/lang/translation/js.lux @@ -20,15 +20,15 @@ (|> r.nat (:: r.Functor map (|>> (n/% +91) (n/max +65))))) (def: (test-primitive-identity synthesis) - (-> Synthesis Bool) + (-> Synthesis Bit) (|> (run-js (` ("lux is" (~ synthesis) (~ synthesis)))) (case> (#e.Success valueV) - (:coerce Bool valueV) + (:coerce Bit valueV) _ false))) -(type: Check (-> (e.Error Any) Bool)) +(type: Check (-> (e.Error Any) Bit)) (do-template [
 <=>]
   [(def: ( angle)
diff --git a/new-luxc/test/test/luxc/lang/translation/jvm.lux b/new-luxc/test/test/luxc/lang/translation/jvm.lux
index 6652c8484..34f1af508 100644
--- a/new-luxc/test/test/luxc/lang/translation/jvm.lux
+++ b/new-luxc/test/test/luxc/lang/translation/jvm.lux
@@ -6,7 +6,7 @@
        (data [maybe]
              ["e" error]
              [bit]
-             [bool "bool/" Eq]
+             [bit "bit/" Eq]
              [number "int/" Number Codec]
              [text "text/" Eq]
              text/format
@@ -242,8 +242,8 @@
                                                   (lang.with-current-module "")
                                                   (macro.run (io.run init-jvm))
                                                   (case> (#e.Success valueT)
-                                                         (bool/= ( param subject)
-                                                                 (:coerce Bool valueT))
+                                                         (bit/= ( param subject)
+                                                                (:coerce Bit valueT))
 
                                                          (#e.Error error)
                                                          false)))]
@@ -279,7 +279,7 @@
       (do @
         [size (|> r.nat (:: @ map (|>> (n/% +10) (n/max +1))))
          idx (|> r.nat (:: @ map (n/% size)))
-         valueZ r.bool
+         valueZ r.bit
          valueB gen-int
          valueS gen-int
          valueI gen-int
@@ -303,7 +303,7 @@
                                                       (#e.Error error)
                                                       false)))]
 
-                                    ["boolean" Bool valueZ bool/= (code.bool valueZ)
+                                    ["boolean" Bit valueZ bit/= (code.bit valueZ)
                                      id]
                                     ["byte" Int valueB i/= (|> (code.int valueB) (~) "jvm convert long-to-byte" (`))
                                      "jvm convert byte-to-long"]
@@ -327,7 +327,7 @@
       (do @
         [size (|> r.nat (:: @ map (|>> (n/% +10) (n/max +1))))
          idx (|> r.nat (:: @ map (n/% size)))
-         valueZ r.bool
+         valueZ r.bit
          valueB gen-int
          valueS gen-int
          valueI gen-int
@@ -401,7 +401,7 @@
 
 (def: instances
   (List [Text (r.Random ls.Synthesis)])
-  (let [gen-boolean (|> r.bool (:: r.Functor map code.bool))
+  (let [gen-boolean (|> r.bit (:: r.Functor map code.bit))
         gen-integer (|> r.int (:: r.Functor map code.int))
         gen-double (|> r.frac (:: r.Functor map code.frac))
         gen-string (|> (r.text +5) (:: r.Functor map code.text))]
@@ -436,7 +436,7 @@
                       (lang.with-current-module "")
                       (macro.run (io.run init-jvm))
                       (case> (#e.Success outputT)
-                             (:coerce Bool outputT)
+                             (:coerce Bit outputT)
 
                              (#e.Error error)
                              false)))
@@ -447,7 +447,7 @@
                       (lang.with-current-module "")
                       (macro.run (io.run init-jvm))
                       (case> (#e.Success outputT)
-                             (not (:coerce Bool outputT))
+                             (not (:coerce Bit outputT))
 
                              (#e.Error error)
                              false)))
@@ -500,7 +500,7 @@
                       (lang.with-current-module "")
                       (macro.run (io.run init-jvm))
                       (case> (#e.Success outputT)
-                             (:coerce Bool outputT)
+                             (:coerce Bit outputT)
 
                              (#e.Error error)
                              false)))
@@ -610,7 +610,7 @@
                       (lang.with-current-module "")
                       (macro.run (io.run init-jvm))
                       (case> (#e.Success outputT)
-                             (:coerce Bool outputT)
+                             (:coerce Bit outputT)
 
                              (#e.Error error)
                              false)))
@@ -623,7 +623,7 @@
                       (lang.with-current-module "")
                       (macro.run (io.run init-jvm))
                       (case> (#e.Success outputT)
-                             (:coerce Bool outputT)
+                             (:coerce Bit outputT)
 
                              (#e.Error error)
                              false)))
diff --git a/new-luxc/test/test/luxc/lang/translation/primitive.lux b/new-luxc/test/test/luxc/lang/translation/primitive.lux
index 43886e197..a58b3b97e 100644
--- a/new-luxc/test/test/luxc/lang/translation/primitive.lux
+++ b/new-luxc/test/test/luxc/lang/translation/primitive.lux
@@ -5,7 +5,7 @@
                 pipe)
        (data text/format
              ["e" error]
-             [bool "bool/" Eq]
+             [bit "bit/" Eq]
              [text "text/" Eq])
        ["r" math/random]
        (lang ["//." synthesis])
@@ -16,7 +16,7 @@
 (def: (spec run)
   (-> Runner Test)
   (do r.Monad
-    [%bool% r.bool
+    [%bit% r.bit
      %nat% r.nat
      %int% r.int
      %rev% r.rev
@@ -33,7 +33,7 @@
                                     (exec (log! error)
                                       false))))]
 
-                  ["bool" Bool //synthesis.bool %bool% bool/=]
+                  ["bit" Bit //synthesis.bit %bit% bit/=]
                   ["int"  Int  //synthesis.i64  %int%  i/=]
                   ["frac" Frac //synthesis.f64  %frac% f/=]
                   ["text" Text //synthesis.text %text% text/=]))
diff --git a/new-luxc/test/test/luxc/lang/translation/structure.lux b/new-luxc/test/test/luxc/lang/translation/structure.lux
index df1350395..17068bb72 100644
--- a/new-luxc/test/test/luxc/lang/translation/structure.lux
+++ b/new-luxc/test/test/luxc/lang/translation/structure.lux
@@ -5,7 +5,7 @@
                 pipe)
        (data ["e" error]
              [maybe]
-             [bool "bool/" Eq]
+             [bit "bit/" Eq]
              [text "text/" Eq]
              text/format
              (coll [array]
@@ -48,7 +48,7 @@
      #let [last?-in (n/= (n/dec num-tags) tag-in)]
      value-in r.int]
     (test "Can translate variant."
-          (|> (run (` ((~ (code.nat tag-in)) (~ (code.bool last?-in)) (~ (code.int value-in)))))
+          (|> (run (` ((~ (code.nat tag-in)) (~ (code.bit last?-in)) (~ (code.int value-in)))))
               (case> (#e.Success valueT)
                      (let [valueT (:coerce (Array Any) valueT)]
                        (and (n/= +3 (array.size valueT))
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux
index ecf5584d6..2f2649758 100644
--- a/stdlib/source/lux.lux
+++ b/stdlib/source/lux.lux
@@ -65,16 +65,16 @@
                             [dummy-cursor (+5 "A potentially empty list of values.")]]
                            (+0)))))))])
 
-("lux def" Bool
- (+10 ["lux" "Bool"]
-      (+0 "#Bool" #Nil))
+("lux def" Bit
+ (+10 ["lux" "Bit"]
+      (+0 "#Bit" #Nil))
  [dummy-cursor
   (+10 (#Cons [[dummy-cursor (+7 ["lux" "type?"])]
                [dummy-cursor (+0 true)]]
               (#Cons [[dummy-cursor (+7 ["lux" "export?"])]
                       [dummy-cursor (+0 true)]]
                      (#Cons [[dummy-cursor (+7 ["lux" "doc"])]
-                             [dummy-cursor (+5 "Your standard, run-of-the-mill boolean values.")]]
+                             [dummy-cursor (+5 "Your standard, run-of-the-mill boolean values (as bits).")]]
                             #Nil))))])
 
 ("lux def" I64
@@ -306,7 +306,7 @@
                                           #Nil))))))])
 
 ## (type: (Code' w)
-##   (#Bool Bool)
+##   (#Bit Bit)
 ##   (#Nat Nat)
 ##   (#Int Int)
 ##   (#Rev Rev)
@@ -322,8 +322,8 @@
          ({Code
            ({Code-List
              (#UnivQ #Nil
-                     (#Sum ## "lux.Bool"
-                      Bool
+                     (#Sum ## "lux.Bit"
+                      Bit
                       (#Sum ## "lux.Nat"
                        Nat
                        (#Sum ## "lux.Int"
@@ -352,7 +352,7 @@
                                     (#Parameter +1)))))
  [dummy-cursor
   (+10 (#Cons [[dummy-cursor (+7 ["lux" "tags"])]
-               [dummy-cursor (+9 (#Cons [dummy-cursor (+5 "Bool")]
+               [dummy-cursor (+9 (#Cons [dummy-cursor (+5 "Bit")]
                                         (#Cons [dummy-cursor (+5 "Nat")]
                                                (#Cons [dummy-cursor (+5 "Int")]
                                                       (#Cons [dummy-cursor (+5 "Rev")]
@@ -383,9 +383,9 @@
   (#Record (#Cons [[dummy-cursor (#Tag ["lux" "doc"])]
                    [dummy-cursor (#Text "The type of Code nodes for Lux syntax.")]]
                   (#Cons [[dummy-cursor (#Tag ["lux" "type?"])]
-                          [dummy-cursor (#Bool true)]]
+                          [dummy-cursor (#Bit true)]]
                          (#Cons [[dummy-cursor (#Tag ["lux" "export?"])]
-                                 [dummy-cursor (#Bool true)]]
+                                 [dummy-cursor (#Bit true)]]
                                 #Nil))))])
 
 ("lux def" _ann
@@ -396,9 +396,9 @@
    [dummy-cursor data]))
  [dummy-cursor (#Record #Nil)])
 
-("lux def" bool$
- ("lux check" (#Function Bool Code)
-  ([_ value] (_ann (#Bool value))))
+("lux def" bit$
+ ("lux check" (#Function Bit Code)
+  ([_ value] (_ann (#Bit value))))
  [dummy-cursor (#Record #Nil)])
 
 ("lux def" nat$
@@ -459,16 +459,16 @@
 ("lux def" default-def-meta-exported
  ("lux check" (#Apply (#Product Code Code) List)
   (#Cons [(tag$ ["lux" "type?"])
-          (bool$ true)]
+          (bit$ true)]
          (#Cons [(tag$ ["lux" "export?"])
-                 (bool$ true)]
+                 (bit$ true)]
                 #Nil)))
  (record$ #Nil))
 
 ("lux def" default-def-meta-unexported
  ("lux check" (#Apply (#Product Code Code) List)
   (#Cons [(tag$ ["lux" "type?"])
-          (bool$ true)]
+          (bit$ true)]
          #Nil))
  (record$ #Nil))
 
@@ -585,8 +585,8 @@
 ##    #module-aliases     (List [Text Text])
 ##    #definitions        (List [Text Definition])
 ##    #imports            (List Text)
-##    #tags               (List [Text [Nat (List Ident) Bool Type]])
-##    #types              (List [Text [(List Ident) Bool Type]])
+##    #tags               (List [Text [Nat (List Ident) Bit Type]])
+##    #types              (List [Text [(List Ident) Bit Type]])
 ##    #module-annotations (Maybe Code)
 ##    #module-state       Module-State})
 ("lux def" Module
@@ -603,13 +603,13 @@
               (#Apply (#Product Text
                                 (#Product Nat
                                           (#Product (#Apply Ident List)
-                                                    (#Product Bool
+                                                    (#Product Bit
                                                               Type))))
                       List)
               (#Product ## "lux.types"
                (#Apply (#Product Text
                                  (#Product (#Apply Ident List)
-                                           (#Product Bool
+                                           (#Product Bit
                                                      Type)))
                        List)
                (#Product ## "lux.module-annotations"
@@ -808,7 +808,7 @@
 ("lux def" default-macro-meta
  ("lux check" (#Apply (#Product Code Code) List)
   (#Cons [(tag$ ["lux" "macro?"])
-          (bool$ true)]
+          (bit$ true)]
          #Nil))
  (record$ #Nil))
 
@@ -878,13 +878,13 @@
  ("lux check" (#Function Text Code)
   ([_ tag]
    (tuple$ (#Cons [(meta-code ["lux" "Tag"] (tuple$ (#Cons (text$ "lux") (#Cons (text$ tag) #Nil))))
-                   (#Cons [(meta-code ["lux" "Bool"] (bool$ true))
+                   (#Cons [(meta-code ["lux" "Bit"] (bit$ true))
                            #Nil])]))))
  (record$ #Nil))
 
 ("lux def" export-meta
  ("lux check" (#Product Code Code)
-  [(tag$ ["lux" "export?"]) (bool$ true)])
+  [(tag$ ["lux" "export?"]) (bit$ true)])
  (record$ #Nil))
 
 ("lux def" export?-meta
@@ -1080,7 +1080,7 @@
 
 (def:'' (text/= x y)
         #Nil
-        (#Function Text (#Function Text Bool))
+        (#Function Text (#Function Text Bit))
         ("lux text =" x y))
 
 (def:'' (get-rep key env)
@@ -1369,7 +1369,7 @@
 (macro:' #export (& tokens)
          (#Cons [(tag$ ["lux" "doc"])
                  (text$ "## Tuple types:
-                         (& Text Int Bool)
+                         (& Text Int Bit)
 
                          ## Any.
                          (&)")]
@@ -1386,7 +1386,7 @@
 (macro:' #export (| tokens)
          (#Cons [(tag$ ["lux" "doc"])
                  (text$ "## Variant types:
-                         (| Text Int Bool)
+                         (| Text Int Bit)
 
                          ## Nothing.
                          (|)")]
@@ -1506,7 +1506,7 @@
 (def:''' (any? p xs)
          #Nil
          (All [a]
-           (-> (-> a Bool) ($' List a) Bool))
+           (-> (-> a Bit) ($' List a) Bit))
          ({#Nil
            false
 
@@ -1716,7 +1716,7 @@
 
 (macro:' #export (if tokens)
          (list [(tag$ ["lux" "doc"])
-                (text$ "Picks which expression to evaluate based on a boolean test value.
+                (text$ "Picks which expression to evaluate based on a bit test value.
 
                         (if true
                           \"Oh, yeah!\"
@@ -1724,8 +1724,8 @@
 
                         => \"Oh, yeah!\"")])
          ({(#Cons test (#Cons then (#Cons else #Nil)))
-           (return (list (form$ (list (record$ (list [(bool$ true)  then]
-                                                     [(bool$ false) else]))
+           (return (list (form$ (list (record$ (list [(bit$ true)  then]
+                                                     [(bit$ false) else]))
                                       test))))
 
            _
@@ -1833,7 +1833,7 @@
 
 (def:''' (splice replace? untemplate elems)
          #Nil
-         (-> Bool (-> Code ($' Meta Code)) ($' List Code) ($' Meta Code))
+         (-> Bit (-> Code ($' Meta Code)) ($' List Code) ($' Meta Code))
          ({true
            ({#Nil
              (return (tag$ ["lux" "Nil"]))
@@ -1878,9 +1878,9 @@
 
 (def:''' (untemplate replace? subst token)
          #Nil
-         (-> Bool Text Code ($' Meta Code))
-         ({[_ [_ (#Bool value)]]
-           (return (wrap-meta (form$ (list (tag$ ["lux" "Bool"]) (bool$ value)))))
+         (-> Bit Text Code ($' Meta Code))
+         ({[_ [_ (#Bit value)]]
+           (return (wrap-meta (form$ (list (tag$ ["lux" "Bit"]) (bit$ value)))))
 
            [_ [_ (#Nat value)]]
            (return (wrap-meta (form$ (list (tag$ ["lux" "Nat"]) (nat$ value)))))
@@ -2188,13 +2188,13 @@
 (def:''' (every? p xs)
          #Nil
          (All [a]
-           (-> (-> a Bool) ($' List a) Bool))
+           (-> (-> a Bit) ($' List a) Bit))
          (list/fold (function' [_2 _1] (if _1 (p _2) false)) true xs))
 
 (def:''' #export (n/= test subject)
          (list [(tag$ ["lux" "doc"])
                 (text$ "Nat(ural) equivalence.")])
-         (-> Nat Nat Bool)
+         (-> Nat Nat Bit)
          ("lux i64 =" test subject))
 
 (def:''' (high-bits value)
@@ -2217,7 +2217,7 @@
 (def:''' #export (n/< test subject)
          (list [(tag$ ["lux" "doc"])
                 (text$ "Nat(ural) less-than.")])
-         (-> Nat Nat Bool)
+         (-> Nat Nat Bit)
          (let' [testH (high-bits test)
                 subjectH (high-bits subject)]
                (if ("lux int <" subjectH testH)
@@ -2231,7 +2231,7 @@
 (def:''' #export (n/<= test subject)
          (list [(tag$ ["lux" "doc"])
                 (text$ "Nat(ural) less-than-equal.")])
-         (-> Nat Nat Bool)
+         (-> Nat Nat Bit)
          (if (n/< test subject)
            true
            ("lux i64 =" test subject)))
@@ -2239,13 +2239,13 @@
 (def:''' #export (n/> test subject)
          (list [(tag$ ["lux" "doc"])
                 (text$ "Nat(ural) greater-than.")])
-         (-> Nat Nat Bool)
+         (-> Nat Nat Bit)
          (n/< subject test))
 
 (def:''' #export (n/>= test subject)
          (list [(tag$ ["lux" "doc"])
                 (text$ "Nat(ural) greater-than-equal.")])
-         (-> Nat Nat Bool)
+         (-> Nat Nat Bit)
          (if (n/< subject test)
            true
            ("lux i64 =" test subject)))
@@ -2284,20 +2284,20 @@
 (def:''' #export (r/= test subject)
          (list [(tag$ ["lux" "doc"])
                 (text$ "Rev(olution) equivalence.")])
-         (-> Rev Rev Bool)
+         (-> Rev Rev Bit)
          ("lux i64 =" test subject))
 
 (def:''' #export (r/< test subject)
          (list [(tag$ ["lux" "doc"])
                 (text$ "Rev(olution) less-than.")])
-         (-> Rev Rev Bool)
+         (-> Rev Rev Bit)
          (n/< ("lux coerce" Nat test)
               ("lux coerce" Nat subject)))
 
 (def:''' #export (r/<= test subject)
          (list [(tag$ ["lux" "doc"])
                 (text$ "Rev(olution) less-than-equal.")])
-         (-> Rev Rev Bool)
+         (-> Rev Rev Bit)
          (if (n/< ("lux coerce" Nat test)
                   ("lux coerce" Nat subject))
            true
@@ -2306,13 +2306,13 @@
 (def:''' #export (r/> test subject)
          (list [(tag$ ["lux" "doc"])
                 (text$ "Rev(olution) greater-than.")])
-         (-> Rev Rev Bool)
+         (-> Rev Rev Bit)
          (r/< subject test))
 
 (def:''' #export (r/>= test subject)
          (list [(tag$ ["lux" "doc"])
                 (text$ "Rev(olution) greater-than-equal.")])
-         (-> Rev Rev Bool)
+         (-> Rev Rev Bit)
          (if (r/< subject test)
            true
            ("lux i64 =" test subject)))
@@ -2323,19 +2323,19 @@
   [(def:''' #export ( test subject)
             (list [(tag$ ["lux" "doc"])
                    (text$ )])
-            (->   Bool)
+            (->   Bit)
             ( subject test))
    
    (def:''' #export ( test subject)
             (list [(tag$ ["lux" "doc"])
                    (text$ <<-doc>)])
-            (->   Bool)
+            (->   Bit)
             ( subject test))
 
    (def:''' #export ( test subject)
             (list [(tag$ ["lux" "doc"])
                    (text$ <<=-doc>)])
-            (->   Bool)
+            (->   Bit)
             (if ( subject test)
               true
               ( subject test)))
@@ -2343,13 +2343,13 @@
    (def:''' #export ( test subject)
             (list [(tag$ ["lux" "doc"])
                    (text$ <>-doc>)])
-            (->   Bool)
+            (->   Bit)
             ( test subject))
    
    (def:''' #export ( test subject)
             (list [(tag$ ["lux" "doc"])
                    (text$ <>=-doc>)])
-            (->   Bool)
+            (->   Bit)
             (if ( test subject)
               true
               ( subject test)))]
@@ -2536,9 +2536,9 @@
   [f/max Frac f/> "Frac(tion) minimum."]
   )
 
-(def:''' (bool/encode x)
+(def:''' (bit/encode x)
          #Nil
-         (-> Bool Text)
+         (-> Bit Text)
          (if x "true" "false"))
 
 (def:''' (digit-to-text digit)
@@ -2600,17 +2600,17 @@
 
 (def:''' (multiple? div n)
          #Nil
-         (-> Nat Nat Bool)
+         (-> Nat Nat Bit)
          (|> n (n/% div) (n/= +0)))
 
 (def:''' #export (not x)
          (list [(tag$ ["lux" "doc"])
-                (text$ "## Boolean negation.
+                (text$ "## Bit negation.
 
                         (not true) => false
 
                         (not false) => true")])
-         (-> Bool Bool)
+         (-> Bit Bit)
          (if x false true))
 
 (def:''' (find-macro' modules current-module module name)
@@ -2623,8 +2623,8 @@
             gdef (let' [{#module-hash _ #module-aliases _ #definitions bindings #imports _ #tags tags #types types #module-annotations _ #module-state _} ("lux check" Module $module)]
                        (get name bindings))]
            (let' [[def-type def-meta def-value] ("lux check" Definition gdef)]
-                 ({(#Some [_ (#Bool true)])
-                   ({(#Some [_ (#Bool true)])
+                 ({(#Some [_ (#Bit true)])
+                   ({(#Some [_ (#Bit true)])
                      (#Some ("lux coerce" Macro def-value))
 
                      _
@@ -2672,7 +2672,7 @@
 
 (def:''' (macro? ident)
          #Nil
-         (-> Ident ($' Meta Bool))
+         (-> Ident ($' Meta Bit))
          (do Monad
            [ident (normalize ident)
             output (find-macro ident)]
@@ -2858,7 +2858,7 @@
 
 (def:''' (empty? xs)
          #Nil
-         (All [a] (-> ($' List a) Bool))
+         (All [a] (-> ($' List a) Bit))
          ({#Nil true
            _    false}
           xs))
@@ -3030,8 +3030,8 @@
 
 (def:' (code-to-text code)
        (-> Code Text)
-       ({[_ (#Bool value)]
-         (bool/encode value)
+       ({[_ (#Bit value)]
+         (bit/encode value)
 
          [_ (#Nat value)]
          (nat/encode value)
@@ -3171,7 +3171,7 @@
                           #Sunday)
 
                         (def: (weekend? day)
-                          (-> Weekday Bool)
+                          (-> Weekday Bit)
                           (case day
                             (^or #Saturday #Sunday)
                             true
@@ -3193,7 +3193,7 @@
            (fail "Wrong syntax for ^or")))
 
 (def:' (symbol? code)
-       (-> Code Bool)
+       (-> Code Bit)
        (case code
          [_ (#Symbol _)]
          true
@@ -3263,8 +3263,8 @@
 (def:' (process-def-meta-value code)
        (-> Code Code)
        (case code
-         [_ (#Bool value)]
-         (meta-code ["lux" "Bool"] (bool$ value))
+         [_ (#Bit value)]
+         (meta-code ["lux" "Bit"] (bit$ value))
          
          [_ (#Nat value)]
          (meta-code ["lux" "Nat"] (nat$ value))
@@ -3330,7 +3330,7 @@
                                       args))]}))
 
 (def:' (export^ tokens)
-       (-> (List Code) [Bool (List Code)])
+       (-> (List Code) [Bit (List Code)])
        (case tokens
          (#Cons [_ (#Tag [_ "export"])] tokens')
          [true tokens']
@@ -3339,7 +3339,7 @@
          [false tokens]))
 
 (def:' (export ?)
-       (-> Bool (List Code))
+       (-> Bit (List Code))
        (if ?
          (list (' #export))
          (list)))
@@ -3481,13 +3481,13 @@
           (signature: #export (Ord a)
             (: (Equivalence a)
                eq)
-            (: (-> a a Bool)
+            (: (-> a a Bit)
                <)
-            (: (-> a a Bool)
+            (: (-> a a Bit)
                <=)
-            (: (-> a a Bool)
+            (: (-> a a Bit)
                >)
-            (: (-> a a Bool)
+            (: (-> a a Bit)
                >=))"}
   (let [[exported? tokens'] (export^ tokens)
         ?parts (: (Maybe [Ident (List Code) Code (List Code)])
@@ -3792,7 +3792,7 @@
     (find-module module-name)))
 
 (def: (resolve-tag [module name])
-  (-> Ident (Meta [Nat (List Ident) Bool Type]))
+  (-> Ident (Meta [Nat (List Ident) Bit Type]))
   (do Monad
     [=module (find-module module)
      #let [{#module-hash _ #module-aliases _ #definitions bindings #imports _ #tags tags-table #types types #module-annotations _ #module-state _} =module]]
@@ -4180,7 +4180,7 @@
     (list/drop (n/- +1 amount) a+')))
 
 (def: (clean-module nested? relative-root module)
-  (-> Bool Text Text (Meta Text))
+  (-> Bit Text Text (Meta Text))
   (case (count-ups +0 module)
     +0
     (return (if nested?
@@ -4207,7 +4207,7 @@
                   "   Relative Root: " relative-root "\n"))))))
 
 (def: (parse-imports nested? relative-root imports)
-  (-> Bool Text (List Code) (Meta (List Importation)))
+  (-> Bit Text (List Code) (Meta (List Importation)))
   (do Monad
     [imports' (monad/map Monad
                          (: (-> Code (Meta (List Importation)))
@@ -4280,7 +4280,7 @@
                                       (List Text))
                                   (function (_ [name [def-type def-meta def-value]])
                                     (case (get-meta ["lux" "export?"] def-meta)
-                                      (#Some [_ (#Bool true)])
+                                      (#Some [_ (#Bit true)])
                                       (list name)
 
                                       _
@@ -4294,7 +4294,7 @@
     ))
 
 (def: (filter p xs)
-  (All [a] (-> (-> a Bool) (List a) (List a)))
+  (All [a] (-> (-> a Bit) (List a) (List a)))
   (case xs
     #Nil
     (list)
@@ -4305,7 +4305,7 @@
       (filter p xs'))))
 
 (def: (is-member? cases name)
-  (-> (List Text) Text Bool)
+  (-> (List Text) Text Bit)
   (let [output (list/fold (function (_ case prev)
                             (or prev
                                 (text/= case name)))
@@ -4730,7 +4730,7 @@
     (return (list (` (function ((~ g!_) (~ g!arg)) (<| (~+ tokens) (~ g!arg))))))))
 
 (def: (imported-by? import-name module-name)
-  (-> Text Text (Meta Bool))
+  (-> Text Text (Meta Bit))
   (do Monad
     [module (find-module module-name)
      #let [{#module-hash _ #module-aliases _ #definitions _ #imports imports #tags _ #types _ #module-annotations _ #module-state _} module]]
@@ -5154,7 +5154,7 @@
     (^template []
       [[_ _ column] ( _)]
       column)
-    ([#Bool]
+    ([#Bit]
      [#Nat]
      [#Int]
      [#Rev]
@@ -5266,7 +5266,7 @@
         [(update-cursor new-cursor as-text)
          (text/compose (cursor-padding baseline prev-cursor new-cursor)
                        as-text)]))
-    ([#Bool   bool/encode]
+    ([#Bit    bit/encode]
      [#Nat    nat/encode]
      [#Int    int/encode]
      [#Frac   frac/encode]
@@ -5479,7 +5479,7 @@
 (def: (place-tokens label tokens target)
   (-> Text (List Code) Code (Maybe (List Code)))
   (case target
-    (^or [_ (#Bool _)] [_ (#Nat _)] [_ (#Int _)] [_ (#Rev _)] [_ (#Frac _)] [_ (#Text _)] [_ (#Tag _)])
+    (^or [_ (#Bit _)] [_ (#Nat _)] [_ (#Int _)] [_ (#Rev _)] [_ (#Frac _)] [_ (#Text _)] [_ (#Tag _)])
     (#Some (list target))
 
     [_ (#Symbol [prefix name])]
@@ -5525,16 +5525,16 @@
                               (compare  (:: Code/encode show ))
                               (compare true (:: Equivalence =  ))]
 
-                             [(bool true)                             "true"       [_ (#.Bool true)]]
-                             [(bool false)                            "false"      [_ (#.Bool false)]]
+                             [(bit true)                              "true"       [_ (#.Bit true)]]
+                             [(bit false)                             "false"      [_ (#.Bit false)]]
                              [(int 123)                               "123"        [_ (#.Int 123)]]
                              [(frac 123.0)                            "123.0"      [_ (#.Frac 123.0)]]
                              [(text "\n")                             "\"\\n\""    [_ (#.Text "\n")]]
                              [(tag ["yolo" "lol"])                    "#yolo.lol"  [_ (#.Tag ["yolo" "lol"])]]
                              [(symbol ["yolo" "lol"])                 "yolo.lol"   [_ (#.Symbol ["yolo" "lol"])]]
-                             [(form (list (bool true) (int 123)))     "(true 123)" (^ [_ (#.Form (list [_ (#.Bool true)] [_ (#.Int 123)]))])]
-                             [(tuple (list (bool true) (int 123)))    "[true 123]" (^ [_ (#.Tuple (list [_ (#.Bool true)] [_ (#.Int 123)]))])]
-                             [(record (list [(bool true) (int 123)])) "{true 123}" (^ [_ (#.Record (list [[_ (#.Bool true)] [_ (#.Int 123)]]))])]
+                             [(form (list (bit true) (int 123)))     "(true 123)" (^ [_ (#.Form (list [_ (#.Bit true)] [_ (#.Int 123)]))])]
+                             [(tuple (list (bit true) (int 123)))    "[true 123]" (^ [_ (#.Tuple (list [_ (#.Bit true)] [_ (#.Int 123)]))])]
+                             [(record (list [(bit true) (int 123)])) "{true 123}" (^ [_ (#.Record (list [[_ (#.Bit true)] [_ (#.Int 123)]]))])]
                              [(local-tag "lol")                       "#lol"       [_ (#.Tag ["" "lol"])]]
                              [(local-symbol "lol")                    "lol"        [_ (#.Symbol ["" "lol"])]]
                              )]
@@ -5569,7 +5569,7 @@
     (^template []
       (#Named ["lux" ] _)
       type)
-    (["Bool"]
+    (["Bit"]
      ["Nat"]
      ["Int"]
      ["Rev"]
@@ -5591,7 +5591,7 @@
       (^template [  ]
         (#Named ["lux" ] _)
         (wrap ( (:coerce  value))))
-      (["Bool" Bool bool$]
+      (["Bit"  Bit  bit$]
        ["Nat"  Nat  nat$]
        ["Int"  Int  int$]
        ["Rev"  Rev  rev$]
@@ -5690,7 +5690,7 @@
                 _
                 (#.Left (format "Static part " (%t static) " does not match URI: " uri)))
 
-              "Short-cuts can be taken when using boolean tests."
+              "Short-cuts can be taken when using bit tests."
               "The example above can be rewritten as..."
               (case (split (size static) uri)
                 (^multi (#.Some [chunk uri']) (text/= static chunk))
@@ -5738,11 +5738,11 @@
 
 (do-template [   <%> <=> <0> <2>]
   [(def: #export ( n)
-     (->  Bool)
+     (->  Bit)
      (<=> <0> (<%> <2> n)))
 
    (def: #export ( n)
-     (->  Bool)
+     (->  Bit)
      (not ( n)))]
 
   [Nat n/even? n/odd? n/% n/= +0 +2]
@@ -5800,7 +5800,7 @@
 
               "This one should fail:"
               (is? 5 (i/+ 2 3)))}
-  (All [a] (-> a a Bool))
+  (All [a] (-> a a Bit))
   ("lux is" reference sample))
 
 (macro: #export (^@ tokens)
@@ -5987,7 +5987,7 @@
     (#Left "Wrong syntax for char")))
 
 (def: #export (when test f)
-  (All [a] (-> Bool (-> a a) (-> a a)))
+  (All [a] (-> Bit (-> a a) (-> a a)))
   (function (_ value)
     (if test
       (f value)
@@ -6114,7 +6114,7 @@
       (do Monad
         [g!meta (gensym "g!meta")]
         (wrap (` [(~ g!meta) ( (~ ( value)))]))))
-    ([#Bool "Bool" bool$]
+    ([#Bit "Bit" bit$]
      [#Nat "Nat" nat$]
      [#Int "Int" int$]
      [#Rev "Rev" rev$]
diff --git a/stdlib/source/lux/concurrency/actor.lux b/stdlib/source/lux/concurrency/actor.lux
index 81e873def..570316334 100644
--- a/stdlib/source/lux/concurrency/actor.lux
+++ b/stdlib/source/lux/concurrency/actor.lux
@@ -92,7 +92,7 @@
             self)))
 
     (def: #export (alive? actor)
-      (All [s] (-> (Actor s) Bool))
+      (All [s] (-> (Actor s) Bit))
       (case (promise.poll (get@ #obituary (:representation actor)))
         #.None
         true
@@ -102,7 +102,7 @@
 
     (def: #export (send message actor)
       {#.doc "Communicate with an actor through message passing."}
-      (All [s] (-> (Message s) (Actor s) (IO Bool)))
+      (All [s] (-> (Message s) (Actor s) (IO Bit)))
       (if (alive? actor)
         (let [entry [message (promise #.None)]]
           (do Monad
@@ -140,7 +140,7 @@
 (def: #export (poison actor)
   {#.doc "Kills the actor by sending a message that will kill it upon processing,
           but allows the actor to handle previous messages."}
-  (All [s] (-> (Actor s) (IO Bool)))
+  (All [s] (-> (Actor s) (IO Bit)))
   (send (function (_ state self)
           (task.throw poisoned []))
         actor))
diff --git a/stdlib/source/lux/concurrency/atom.lux b/stdlib/source/lux/concurrency/atom.lux
index 8cfc117e4..a06a93b4e 100644
--- a/stdlib/source/lux/concurrency/atom.lux
+++ b/stdlib/source/lux/concurrency/atom.lux
@@ -19,7 +19,7 @@
   {#.doc "Only mutates an atom if you can present it's current value.
 
           That guarantees that atom was not updated since you last read from it."}
-  (All [a] (-> a a (Atom a) (IO Bool)))
+  (All [a] (-> a a (Atom a) (IO Bit)))
   (io ("lux atom compare-and-swap" atom current new)))
 
 (def: #export (update f atom)
diff --git a/stdlib/source/lux/concurrency/frp.lux b/stdlib/source/lux/concurrency/frp.lux
index b75e85939..2e1e10d87 100644
--- a/stdlib/source/lux/concurrency/frp.lux
+++ b/stdlib/source/lux/concurrency/frp.lux
@@ -37,7 +37,7 @@
 
 ## [Values]
 (def: #export (filter predicate input)
-  (All [a] (-> (-> a Bool) (Channel a) (Channel a)))
+  (All [a] (-> (-> a Bit) (Channel a) (Channel a)))
   (let [output (channel [])]
     (exec (io.run (listen (function (_ value)
                             (if (predicate value)
diff --git a/stdlib/source/lux/concurrency/promise.lux b/stdlib/source/lux/concurrency/promise.lux
index c76c4c013..0a03b2c9e 100644
--- a/stdlib/source/lux/concurrency/promise.lux
+++ b/stdlib/source/lux/concurrency/promise.lux
@@ -31,7 +31,7 @@
 
   (def: #export (resolve value (^:representation promise))
     {#.doc "Sets an promise's value if it has not been done yet."}
-    (All [a] (-> a (Promise a) (IO Bool)))
+    (All [a] (-> a (Promise a) (IO Bit)))
     (do io.Monad
       [(^@ old [_value _observers]) (atom.read promise)]
       (case _value
@@ -65,7 +65,7 @@
 
 (def: #export (resolved? promise)
   {#.doc "Checks whether a promise's value has already been resolved."}
-  (All [a] (-> (Promise a) Bool))
+  (All [a] (-> (Promise a) Bit))
   (case (poll promise)
     #.None
     false
diff --git a/stdlib/source/lux/concurrency/semaphore.lux b/stdlib/source/lux/concurrency/semaphore.lux
index 0c01e9389..774acf5fa 100644
--- a/stdlib/source/lux/concurrency/semaphore.lux
+++ b/stdlib/source/lux/concurrency/semaphore.lux
@@ -31,7 +31,7 @@
                         (promise.promise #.None))]
          (do io.Monad
            [state (atom.read semaphore)
-            #let [[ready? state'] (: [Bool State]
+            #let [[ready? state'] (: [Bit State]
                                      (case (get@ #open-positions state)
                                        +0 [false (update@ #waiting-list (|>> (#.Cons signal))
                                                           state)]
diff --git a/stdlib/source/lux/concurrency/stm.lux b/stdlib/source/lux/concurrency/stm.lux
index e3c797b2d..7af73b68d 100644
--- a/stdlib/source/lux/concurrency/stm.lux
+++ b/stdlib/source/lux/concurrency/stm.lux
@@ -166,7 +166,7 @@
     (wrap [a a'])))
 
 (def: (can-commit? tx)
-  (-> Tx Bool)
+  (-> Tx Bit)
   (list.every? (function (_ [_var _original _current])
                  (is? _original (read!! _var)))
                tx))
@@ -186,7 +186,7 @@
   (atom (promise #.None)))
 
 (def: commit-processor-flag
-  (Atom Bool)
+  (Atom Bit)
   (atom false))
 
 (def: (issue-commit commit)
diff --git a/stdlib/source/lux/control/concatenative.lux b/stdlib/source/lux/control/concatenative.lux
index af86fc527..bed6e9dd5 100644
--- a/stdlib/source/lux/control/concatenative.lux
+++ b/stdlib/source/lux/control/concatenative.lux
@@ -101,7 +101,7 @@
 (def: (prepare command)
   (-> Code Code)
   (case command
-    (^or [_ (#.Bool _)]
+    (^or [_ (#.Bit _)]
          [_ (#.Nat _)]  [_ (#.Int _)]
          [_ (#.Rev _)]  [_ (#.Frac _)]
          [_ (#.Text _)]
@@ -210,51 +210,51 @@
   [Nat Nat  n/*  .n/*]
   [Nat Nat  n//  .n//]
   [Nat Nat  n/%  .n/%]
-  [Nat Bool n/=  .n/=]
-  [Nat Bool n/<  .n/<]
-  [Nat Bool n/<= .n/<=]
-  [Nat Bool n/>  .n/>]
-  [Nat Bool n/>= .n/>=]
+  [Nat Bit n/=  .n/=]
+  [Nat Bit n/<  .n/<]
+  [Nat Bit n/<= .n/<=]
+  [Nat Bit n/>  .n/>]
+  [Nat Bit n/>= .n/>=]
 
   [Int Int  i/+  .i/+]
   [Int Int  i/-  .i/-]
   [Int Int  i/*  .i/*]
   [Int Int  i//  .i//]
   [Int Int  i/%  .i/%]
-  [Int Bool i/=  .i/=]
-  [Int Bool i/<  .i/<]
-  [Int Bool i/<= .i/<=]
-  [Int Bool i/>  .i/>]
-  [Int Bool i/>= .i/>=]
+  [Int Bit i/=  .i/=]
+  [Int Bit i/<  .i/<]
+  [Int Bit i/<= .i/<=]
+  [Int Bit i/>  .i/>]
+  [Int Bit i/>= .i/>=]
 
   [Rev Rev  r/+  .r/+]
   [Rev Rev  r/-  .r/-]
   [Rev Rev  r/*  .r/*]
   [Rev Rev  r//  .r//]
   [Rev Rev  r/%  .r/%]
-  [Rev Bool r/=  .r/=]
-  [Rev Bool r/<  .r/<]
-  [Rev Bool r/<= .r/<=]
-  [Rev Bool r/>  .r/>]
-  [Rev Bool r/>= .r/>=]
+  [Rev Bit r/=  .r/=]
+  [Rev Bit r/<  .r/<]
+  [Rev Bit r/<= .r/<=]
+  [Rev Bit r/>  .r/>]
+  [Rev Bit r/>= .r/>=]
 
   [Frac Frac f/+  .f/+]
   [Frac Frac f/-  .f/-]
   [Frac Frac f/*  .f/*]
   [Frac Frac f//  .f//]
   [Frac Frac f/%  .f/%]
-  [Frac Bool f/=  .f/=]
-  [Frac Bool f/<  .f/<]
-  [Frac Bool f/<= .f/<=]
-  [Frac Bool f/>  .f/>]
-  [Frac Bool f/>= .f/>=]
+  [Frac Bit f/=  .f/=]
+  [Frac Bit f/<  .f/<]
+  [Frac Bit f/<= .f/<=]
+  [Frac Bit f/>  .f/>]
+  [Frac Bit f/>= .f/>=]
   )
 
 (def: #export if
   (All [__a __b]
     (=> {then (=> __a __b)
          else (=> __a __b)}
-        __a [Bool then else] __b))
+        __a [Bit then else] __b))
   (function (_ [[[stack test] then] else])
     (.if test
       (then stack)
@@ -269,7 +269,7 @@
 
 (def: #export loop
   (All [___]
-    (=> {test (=> ___ ___ [Bool])}
+    (=> {test (=> ___ ___ [Bit])}
         ___ [test] ___))
   (function (loop [stack pred])
     (let [[stack' verdict] (pred stack)]
@@ -293,7 +293,7 @@
 
 (def: #export do
   (All [__a __b]
-    (=> {pred (=> __a __b [Bool])
+    (=> {pred (=> __a __b [Bit])
          body (=> __b __a)}
         __b [pred body]
         __a [pred body]))
@@ -302,7 +302,7 @@
 
 (def: #export while
   (All [__a __b]
-    (=> {pred (=> __a __b [Bool])
+    (=> {pred (=> __a __b [Bit])
          body (=> __b __a)}
         __a [pred body]
         __b))
@@ -330,11 +330,11 @@
 (word: #export when
   (All [___]
     (=> {body (=> ___ ___)}
-        ___ [Bool body]
+        ___ [Bit body]
         ___))
   swap [call] [drop] if)
 
 (word: #export ?
   (All [a]
-    (=> [Bool a a] [a]))
+    (=> [Bit a a] [a]))
   rotL [drop] [nip] if)
diff --git a/stdlib/source/lux/control/contract.lux b/stdlib/source/lux/control/contract.lux
index 1b4939cb6..9b7427190 100644
--- a/stdlib/source/lux/control/contract.lux
+++ b/stdlib/source/lux/control/contract.lux
@@ -8,7 +8,7 @@
     ["s" syntax (#+ syntax:)]]])
 
 (def: #export (assert! message test)
-  (-> Text Bool [])
+  (-> Text Bit [])
   (if test
     []
     (error! message)))
diff --git a/stdlib/source/lux/control/enum.lux b/stdlib/source/lux/control/enum.lux
index b153beede..4dc825508 100644
--- a/stdlib/source/lux/control/enum.lux
+++ b/stdlib/source/lux/control/enum.lux
@@ -12,7 +12,7 @@
 
 ## [Functions]
 (def: (range' <= succ from to)
-  (All [a] (-> (-> a a Bool) (-> a a) a a (List a)))
+  (All [a] (-> (-> a a Bit) (-> a a) a a (List a)))
   (if (<= to from)
     (#.Cons from (range' <= succ (succ from) to))
     #.Nil))
diff --git a/stdlib/source/lux/control/equivalence.lux b/stdlib/source/lux/control/equivalence.lux
index cddf72542..eb869a81c 100644
--- a/stdlib/source/lux/control/equivalence.lux
+++ b/stdlib/source/lux/control/equivalence.lux
@@ -2,7 +2,7 @@
 
 (signature: #export (Equivalence a)
   {#.doc "Equivalence for a type's instances."}
-  (: (-> a a Bool)
+  (: (-> a a Bit)
      =))
 
 (def: #export (product left right)
diff --git a/stdlib/source/lux/control/exception.lux b/stdlib/source/lux/control/exception.lux
index 41dd22b88..296513718 100644
--- a/stdlib/source/lux/control/exception.lux
+++ b/stdlib/source/lux/control/exception.lux
@@ -26,7 +26,7 @@
 
 ## [Values]
 (def: #export (match? exception error)
-  (All [e] (-> (Exception e) Text Bool))
+  (All [e] (-> (Exception e) Text Bit))
   (text.starts-with? (get@ #label exception) error))
 
 (def: #export (catch exception then try)
@@ -76,7 +76,7 @@
   (#/.Error (construct exception message)))
 
 (def: #export (assert exception message test)
-  (All [e] (-> (Exception e) e Bool (Error Any)))
+  (All [e] (-> (Exception e) e Bit (Error Any)))
   (if test
     (#/.Success [])
     (..throw exception message)))
diff --git a/stdlib/source/lux/control/interval.lux b/stdlib/source/lux/control/interval.lux
index ae8c6ce30..a1084290a 100644
--- a/stdlib/source/lux/control/interval.lux
+++ b/stdlib/source/lux/control/interval.lux
@@ -31,7 +31,7 @@
 
 (do-template [ ]
   [(def: #export ( interval)
-     (All [a] (-> (Interval a) Bool))
+     (All [a] (-> (Interval a) Bit))
      (let [(^open) interval]
        ( bottom top)))]
 
@@ -41,7 +41,7 @@
   )
 
 (def: #export (within? interval elem)
-  (All [a] (-> (Interval a) a Bool))
+  (All [a] (-> (Interval a) a Bit))
   (let [(^open) interval]
     (cond (inner? interval)
           (and (>= bottom elem)
@@ -57,7 +57,7 @@
 
 (do-template [ ]
   [(def: #export ( elem interval)
-     (All [a] (-> a (Interval a) Bool))
+     (All [a] (-> a (Interval a) Bit))
      (let [(^open) interval]
        (=  elem)))]
 
@@ -66,7 +66,7 @@
   )
 
 (def: #export (borders? interval elem)
-  (All [a] (-> (Interval a) a Bool))
+  (All [a] (-> (Interval a) a Bit))
   (or (starts-with? elem interval)
       (ends-with? elem interval)))
 
@@ -90,31 +90,31 @@
                (def: top (pred bottom)))))
 
 (def: #export (precedes? reference sample)
-  (All [a] (-> (Interval a) (Interval a) Bool))
+  (All [a] (-> (Interval a) (Interval a) Bit))
   (let [(^open) reference
         limit (:: reference bottom)]
     (and (< limit (:: sample bottom))
          (< limit (:: sample top)))))
 
 (def: #export (succeeds? reference sample)
-  (All [a] (-> (Interval a) (Interval a) Bool))
+  (All [a] (-> (Interval a) (Interval a) Bit))
   (precedes? sample reference))
 
 (def: #export (meets? reference sample)
-  (All [a] (-> (Interval a) (Interval a) Bool))
+  (All [a] (-> (Interval a) (Interval a) Bit))
   (let [(^open) reference
         limit (:: reference bottom)]
     (and (<= limit (:: sample bottom))
          (= limit (:: sample top)))))
 
 (def: #export (touches? reference sample)
-  (All [a] (-> (Interval a) (Interval a) Bool))
+  (All [a] (-> (Interval a) (Interval a) Bit))
   (or (meets? reference sample)
       (meets? sample reference)))
 
 (do-template [   ]
   [(def: #export ( reference sample)
-     (All [a] (-> (Interval a) (Interval a) Bool))
+     (All [a] (-> (Interval a) (Interval a) Bit))
      (let [(^open) reference]
        (and (=      (:: reference )   (:: sample ))
             ( (:: reference ) (:: sample )))))]
@@ -125,7 +125,7 @@
 
 (do-template [ ]
   [(def: #export ( reference sample)
-     (All [a] (-> a (Interval a) Bool))
+     (All [a] (-> a (Interval a) Bit))
      (let [(^open) sample]
        (and ( reference bottom)
             ( reference top))))]
@@ -141,7 +141,7 @@
            (= top (:: sample top))))))
 
 (def: #export (nested? reference sample)
-  (All [a] (-> (Interval a) (Interval a) Bool))
+  (All [a] (-> (Interval a) (Interval a) Bit))
   (cond (or (singleton? sample)
             (and (inner? reference) (inner? sample))
             (and (outer? reference) (outer? sample)))
@@ -162,7 +162,7 @@
         ))
 
 (def: #export (overlaps? reference sample)
-  (All [a] (-> (Interval a) (Interval a) Bool))
+  (All [a] (-> (Interval a) (Interval a) Bit))
   (let [(^open) reference]
     (and (not (:: Equivalence = reference sample))
          (cond (singleton? sample)
diff --git a/stdlib/source/lux/control/order.lux b/stdlib/source/lux/control/order.lux
index 6a801392d..7b07325a1 100644
--- a/stdlib/source/lux/control/order.lux
+++ b/stdlib/source/lux/control/order.lux
@@ -11,7 +11,7 @@
      eq)
   
   (do-template []
-    [(: (-> a a Bool) )]
+    [(: (-> a a Bit) )]
 
     [<] [<=] [>] [>=]
     )
@@ -20,7 +20,7 @@
 ## [Values]
 (def: #export (order eq <)
   (All [a]
-    (-> (Equivalence a) (-> a a Bool) (Order a)))
+    (-> (Equivalence a) (-> a a Bit) (Order a)))
   (let [> (flip <)]
     (structure (def: eq eq)
                (def: < <)
diff --git a/stdlib/source/lux/control/parser.lux b/stdlib/source/lux/control/parser.lux
index 4c5e827f9..7ad46dba8 100644
--- a/stdlib/source/lux/control/parser.lux
+++ b/stdlib/source/lux/control/parser.lux
@@ -61,7 +61,7 @@
 ## [Parsers]
 (def: #export (assert message test)
   {#.doc "Fails with the given message if the test is false."}
-  (All [s] (-> Text Bool (Parser s Any)))
+  (All [s] (-> Text Bit (Parser s Any)))
   (function (_ input)
     (if test
       (#e.Success [input []])
@@ -254,7 +254,7 @@
     (wrap output)))
 
 (def: #export (filter test parser)
-  (All [s a] (-> (-> a Bool) (Parser s a) (Parser s a)))
+  (All [s a] (-> (-> a Bit) (Parser s a) (Parser s a)))
   (do Monad
     [output parser
      _ (assert "Constraint failed." (test output))]
diff --git a/stdlib/source/lux/control/predicate.lux b/stdlib/source/lux/control/predicate.lux
index 9af533a8f..383d1b907 100644
--- a/stdlib/source/lux/control/predicate.lux
+++ b/stdlib/source/lux/control/predicate.lux
@@ -5,7 +5,7 @@
    [function]])
 
 (type: #export (Predicate a)
-  (-> a Bool))
+  (-> a Bit))
 
 (do-template [   ]
   [(def: #export 
diff --git a/stdlib/source/lux/control/state.lux b/stdlib/source/lux/control/state.lux
index 03965f498..94330ff96 100644
--- a/stdlib/source/lux/control/state.lux
+++ b/stdlib/source/lux/control/state.lux
@@ -135,7 +135,7 @@
       (wrap [state a]))))
 
 (def: #export (while condition body)
-  (All [s] (-> (State s Bool) (State s Any) (State s Any)))
+  (All [s] (-> (State s Bit) (State s Any) (State s Any)))
   (do Monad
     [execute? condition]
     (if execute?
@@ -145,7 +145,7 @@
       (wrap []))))
 
 (def: #export (do-while condition body)
-  (All [s] (-> (State s Bool) (State s Any) (State s Any)))
+  (All [s] (-> (State s Bit) (State s Any) (State s Any)))
   (do Monad
     [_ body]
     (while condition body)))
diff --git a/stdlib/source/lux/data/bit.lux b/stdlib/source/lux/data/bit.lux
new file mode 100644
index 000000000..60cef178b
--- /dev/null
+++ b/stdlib/source/lux/data/bit.lux
@@ -0,0 +1,51 @@
+(.module:
+  [lux #*
+   [control
+    [monoid (#+ Monoid)]
+    [equivalence (#+ Equivalence)]
+    hash
+    [codec (#+ Codec)]]
+   function])
+
+## [Structures]
+(structure: #export _ (Equivalence Bit)
+  (def: (= x y)
+    (if x
+      y
+      (not y))))
+
+(structure: #export _ (Hash Bit)
+  (def: eq Equivalence)
+  (def: (hash value)
+    (case value
+      true +1
+      false +0)))
+
+(do-template [  ]
+  [(structure: #export  (Monoid Bit)
+     (def: identity )
+     (def: (compose x y)
+       ( x y)))]
+
+  [ Or@Monoid false or]
+  [And@Monoid true and]
+  )
+
+(structure: #export _ (Codec Text Bit)
+  (def: (encode x)
+    (if x
+      "true"
+      "false"))
+
+  (def: (decode input)
+    (case input
+      "true"  (#.Right true)
+      "false" (#.Right false)
+      _       (#.Left "Wrong syntax for Bit."))))
+
+## [Values]
+(def: #export complement
+  {#.doc "Generates the complement of a predicate.
+          That is a predicate that returns the oposite of the original predicate."}
+  (All [a] (-> (-> a Bit) (-> a Bit)))
+  (compose not))
diff --git a/stdlib/source/lux/data/bool.lux b/stdlib/source/lux/data/bool.lux
deleted file mode 100644
index b75663ad5..000000000
--- a/stdlib/source/lux/data/bool.lux
+++ /dev/null
@@ -1,51 +0,0 @@
-(.module:
-  [lux #*
-   [control
-    [monoid (#+ Monoid)]
-    [equivalence (#+ Equivalence)]
-    hash
-    [codec (#+ Codec)]]
-   function])
-
-## [Structures]
-(structure: #export _ (Equivalence Bool)
-  (def: (= x y)
-    (if x
-      y
-      (not y))))
-
-(structure: #export _ (Hash Bool)
-  (def: eq Equivalence)
-  (def: (hash value)
-    (case value
-      true +1
-      false +0)))
-
-(do-template [  ]
-  [(structure: #export  (Monoid Bool)
-     (def: identity )
-     (def: (compose x y)
-       ( x y)))]
-
-  [ Or@Monoid false or]
-  [And@Monoid true and]
-  )
-
-(structure: #export _ (Codec Text Bool)
-  (def: (encode x)
-    (if x
-      "true"
-      "false"))
-
-  (def: (decode input)
-    (case input
-      "true"  (#.Right true)
-      "false" (#.Right false)
-      _       (#.Left "Wrong syntax for Bool."))))
-
-## [Values]
-(def: #export complement
-  {#.doc "Generates the complement of a predicate.
-          That is a predicate that returns the oposite of the original predicate."}
-  (All [a] (-> (-> a Bool) (-> a Bool)))
-  (compose not))
diff --git a/stdlib/source/lux/data/collection/array.lux b/stdlib/source/lux/data/collection/array.lux
index 684988954..d8d4ce5fa 100644
--- a/stdlib/source/lux/data/collection/array.lux
+++ b/stdlib/source/lux/data/collection/array.lux
@@ -69,7 +69,7 @@
 
 (def: #export (filter p xs)
   (All [a]
-    (-> (-> a Bool) (Array a) (Array a)))
+    (-> (-> a Bit) (Array a) (Array a)))
   (list/fold (function (_ idx xs')
                (case (read idx xs)
                  #.None
@@ -84,7 +84,7 @@
 
 (def: #export (find p xs)
   (All [a]
-    (-> (-> a Bool) (Array a) (Maybe a)))
+    (-> (-> a Bit) (Array a) (Maybe a)))
   (let [arr-size (size xs)]
     (loop [idx +0]
       (if (n/< arr-size idx)
@@ -101,7 +101,7 @@
 (def: #export (find+ p xs)
   {#.doc "Just like 'find', but with access to the index of each value."}
   (All [a]
-    (-> (-> Nat a Bool) (Array a) (Maybe [Nat a])))
+    (-> (-> Nat a Bit) (Array a) (Maybe [Nat a])))
   (let [arr-size (size xs)]
     (loop [idx +0]
       (if (n/< arr-size idx)
diff --git a/stdlib/source/lux/data/collection/bits.lux b/stdlib/source/lux/data/collection/bits.lux
index b0e506cde..24eaa44a6 100644
--- a/stdlib/source/lux/data/collection/bits.lux
+++ b/stdlib/source/lux/data/collection/bits.lux
@@ -36,11 +36,11 @@
   (|> bits array.size (n/* chunk-size)))
 
 (def: #export empty?
-  (-> Bits Bool)
+  (-> Bits Bit)
   (|>> size (n/= +0)))
 
 (def: #export (get index bits)
-  (-> Nat Bits Bool)
+  (-> Nat Bits Bit)
   (let [[chunk-index bit-index] (n//% chunk-size index)]
     (.and (n/< (array.size bits) chunk-index)
           (|> (array.read chunk-index bits)
@@ -88,7 +88,7 @@
   )
 
 (def: #export (intersects? reference sample)
-  (-> Bits Bits Bool)
+  (-> Bits Bits Bit)
   (let [chunks (n/min (array.size reference)
                       (array.size sample))]
     (loop [idx +0]
diff --git a/stdlib/source/lux/data/collection/dictionary.lux b/stdlib/source/lux/data/collection/dictionary.lux
index 8e967b768..5add5c74a 100644
--- a/stdlib/source/lux/data/collection/dictionary.lux
+++ b/stdlib/source/lux/data/collection/dictionary.lux
@@ -177,12 +177,12 @@
   (->bit-position (level-index level hash)))
 
 (def: (bit-position-is-set? bit bitmap)
-  (-> BitPosition BitMap Bool)
+  (-> BitPosition BitMap Bit)
   (not (n/= clean-bitmap (i64.and bit bitmap))))
 
 ## Figures out whether a bitmap only contains a single bit-position.
 (def: only-bit-position?
-  (-> BitPosition BitMap Bool)
+  (-> BitPosition BitMap Bit)
   n/=)
 
 (def: (set-bit-position bit bitmap)
@@ -272,7 +272,7 @@
 ## used).
 ## So, this test is introduced to detect them.
 (def: (empty?' node)
-  (All [k v] (-> (Node k v) Bool))
+  (All [k v] (-> (Node k v) Bit))
   (`` (case node
         (#Base (~~ (static ..clean-bitmap)) _)
         true
@@ -569,7 +569,7 @@
     (get' root-level (:: Hash hash key) key Hash node)))
 
 (def: #export (contains? key dict)
-  (All [k v] (-> k (Dictionary k v) Bool))
+  (All [k v] (-> k (Dictionary k v) Bit))
   (case (get key dict)
     #.None     false
     (#.Some _) true))
@@ -604,7 +604,7 @@
   (|>> product.right size'))
 
 (def: #export empty?
-  (All [k v] (-> (Dictionary k v) Bool))
+  (All [k v] (-> (Dictionary k v) Bit))
   (|>> size (n/= +0)))
 
 (def: #export (entries dict)
diff --git a/stdlib/source/lux/data/collection/dictionary/ordered.lux b/stdlib/source/lux/data/collection/dictionary/ordered.lux
index 963f178b3..153c17a69 100644
--- a/stdlib/source/lux/data/collection/dictionary/ordered.lux
+++ b/stdlib/source/lux/data/collection/dictionary/ordered.lux
@@ -71,7 +71,7 @@
         ))))
 
 (def: #export (contains? key dict)
-  (All [k v] (-> k (Dictionary k v) Bool))
+  (All [k v] (-> k (Dictionary k v) Bit))
   (let [## (^open "T/") (get@ #order dict)
         ]
     (loop [node (get@ #root dict)]
diff --git a/stdlib/source/lux/data/collection/dictionary/plist.lux b/stdlib/source/lux/data/collection/dictionary/plist.lux
index f1a6dff7e..050185307 100644
--- a/stdlib/source/lux/data/collection/dictionary/plist.lux
+++ b/stdlib/source/lux/data/collection/dictionary/plist.lux
@@ -18,7 +18,7 @@
       (get key properties'))))
 
 (def: #export (contains? key properties)
-  (All [a] (-> Text (PList a) Bool))
+  (All [a] (-> Text (PList a) Bit))
   (case (get key properties)
     (#.Some _)
     true
diff --git a/stdlib/source/lux/data/collection/list.lux b/stdlib/source/lux/data/collection/list.lux
index b3089a01e..c734c140b 100644
--- a/stdlib/source/lux/data/collection/list.lux
+++ b/stdlib/source/lux/data/collection/list.lux
@@ -8,7 +8,7 @@
     [equivalence (#+ Equivalence)]
     [fold]]
    [data
-    bool
+    bit
     [product]]])
 
 ## [Types]
@@ -37,7 +37,7 @@
 
 (def: #export (filter p xs)
   (All [a]
-    (-> (-> a Bool) (List a) (List a)))
+    (-> (-> a Bit) (List a) (List a)))
   (case xs
     #.Nil
     #.Nil
@@ -49,7 +49,7 @@
 
 (def: #export (partition p xs)
   {#.doc "Divide the list into all elements that satisfy a predicate, and all elements that do not."}
-  (All [a] (-> (-> a Bool) (List a) [(List a) (List a)]))
+  (All [a] (-> (-> a Bit) (List a) [(List a) (List a)]))
   [(filter p xs) (filter (complement p) xs)])
 
 (def: #export (as-pairs xs)
@@ -84,7 +84,7 @@
 (do-template [  ]
   [(def: #export ( p xs)
      (All [a]
-       (-> (-> a Bool) (List a) (List a)))
+       (-> (-> a Bit) (List a) (List a)))
      (case xs
        #.Nil
        #.Nil
@@ -113,7 +113,7 @@
 
 (def: (split-with' p ys xs)
   (All [a]
-    (-> (-> a Bool) (List a) (List a) [(List a) (List a)]))
+    (-> (-> a Bit) (List a) (List a) [(List a) (List a)]))
   (case xs
     #.Nil
     [ys xs]
@@ -126,7 +126,7 @@
 (def: #export (split-with p xs)
   {#.doc "Segment the list by using a predicate to tell when to cut."}
   (All [a]
-    (-> (-> a Bool) (List a) [(List a) (List a)]))
+    (-> (-> a Bit) (List a) [(List a) (List a)]))
   (let [[ys' xs'] (split-with' p #.Nil xs)]
     [(reverse ys') xs']))
 
@@ -173,7 +173,7 @@
 (def: #export (find p xs)
   {#.doc "Returns the first value in the list for which the predicate is true."}
   (All [a]
-    (-> (-> a Bool) (List a) (Maybe a)))
+    (-> (-> a Bit) (List a) (Maybe a)))
   (case xs
     #.Nil
     #.None
@@ -234,7 +234,7 @@
 (do-template [  ]
   [(def: #export ( p xs)
      (All [a]
-       (-> (-> a Bool) (List a) Bool))
+       (-> (-> a Bit) (List a) Bit))
      (loop [xs xs]
        (case xs
          #.Nil
@@ -320,7 +320,7 @@
 
 ## [Functions]
 (def: #export (sort < xs)
-  (All [a] (-> (-> a a Bool) (List a) (List a)))
+  (All [a] (-> (-> a a Bit) (List a) (List a)))
   (case xs
     #.Nil
     (list)
@@ -352,13 +352,13 @@
   )
 
 (def: #export (empty? xs)
-  (All [a] (-> (List a) Bool))
+  (All [a] (-> (List a) Bit))
   (case xs
     #.Nil true
     _     false))
 
 (def: #export (member? eq xs x)
-  (All [a] (-> (Equivalence a) (List a) a Bool))
+  (All [a] (-> (Equivalence a) (List a) a Bit))
   (case xs
     #.Nil           false
     (#.Cons x' xs') (or (:: eq = x x')
diff --git a/stdlib/source/lux/data/collection/queue.lux b/stdlib/source/lux/data/collection/queue.lux
index cf3587ece..864dfb67d 100644
--- a/stdlib/source/lux/data/collection/queue.lux
+++ b/stdlib/source/lux/data/collection/queue.lux
@@ -35,11 +35,11 @@
          (list.size rear))))
 
 (def: #export empty?
-  (All [a] (-> (Queue a) Bool))
+  (All [a] (-> (Queue a) Bit))
   (|>> (get@ #front) list.empty?))
 
 (def: #export (member? Equivalence queue member)
-  (All [a] (-> (Equivalence a) (Queue a) a Bool))
+  (All [a] (-> (Equivalence a) (Queue a) a Bit))
   (let [(^slots [#front #rear]) queue]
     (or (list.member? Equivalence front member)
         (list.member? Equivalence rear member))))
diff --git a/stdlib/source/lux/data/collection/queue/priority.lux b/stdlib/source/lux/data/collection/queue/priority.lux
index 6765c6708..dbf6dec75 100644
--- a/stdlib/source/lux/data/collection/queue/priority.lux
+++ b/stdlib/source/lux/data/collection/queue/priority.lux
@@ -42,7 +42,7 @@
         (n/+ (recur left) (recur right))))))
 
 (def: #export (member? Equivalence queue member)
-  (All [a] (-> (Equivalence a) (Queue a) a Bool))
+  (All [a] (-> (Equivalence a) (Queue a) a Bit))
   (case queue
     #.None
     false
diff --git a/stdlib/source/lux/data/collection/row.lux b/stdlib/source/lux/data/collection/row.lux
index 3b3b080eb..197e596e6 100644
--- a/stdlib/source/lux/data/collection/row.lux
+++ b/stdlib/source/lux/data/collection/row.lux
@@ -333,11 +333,11 @@
              list))
 
 (def: #export (member? a/Equivalence vec val)
-  (All [a] (-> (Equivalence a) (Row a) a Bool))
+  (All [a] (-> (Equivalence a) (Row a) a Bit))
   (list.member? a/Equivalence (to-list vec) val))
 
 (def: #export empty?
-  (All [a] (-> (Row a) Bool))
+  (All [a] (-> (Row a) Bit))
   (|>> (get@ #size) (n/= +0)))
 
 ## [Syntax]
diff --git a/stdlib/source/lux/data/collection/sequence.lux b/stdlib/source/lux/data/collection/sequence.lux
index dc8f4a802..0a2350324 100644
--- a/stdlib/source/lux/data/collection/sequence.lux
+++ b/stdlib/source/lux/data/collection/sequence.lux
@@ -10,7 +10,7 @@
     [code]
     ["s" syntax (#+ syntax: Syntax)]]
    [data
-    bool
+    bit
     [collection [list ("list/" Monad)]]]])
 
 ## [Types]
@@ -91,8 +91,8 @@
            [(#.Cons [x tail]) next])
          [(list) xs])))]
   
-  [take-while drop-while split-while (-> a Bool) (pred x)      pred]
-  [take       drop       split       Nat         (n/> +0 pred) (dec pred)]
+  [take-while drop-while split-while (-> a Bit) (pred x)      pred]
+  [take       drop       split       Nat        (n/> +0 pred) (dec pred)]
   )
 
 (def: #export (unfold step init)
@@ -103,7 +103,7 @@
     (pending [x (unfold step next)])))
 
 (def: #export (filter p xs)
-  (All [a] (-> (-> a Bool) (Sequence a) (Sequence a)))
+  (All [a] (-> (-> a Bit) (Sequence a) (Sequence a)))
   (let [[x xs'] (continuation.run xs)]
     (if (p x)
       (pending [x (filter p xs')])
@@ -115,7 +115,7 @@
           The left side contains all entries for which the predicate is true.
 
           The right side contains all entries for which the predicate is false."}
-  (All [a] (-> (-> a Bool) (Sequence a) [(Sequence a) (Sequence a)]))
+  (All [a] (-> (-> a Bit) (Sequence a) [(Sequence a) (Sequence a)]))
   [(filter p xs) (filter (complement p) xs)])
 
 ## [Structures]
diff --git a/stdlib/source/lux/data/collection/set.lux b/stdlib/source/lux/data/collection/set.lux
index 5fa774e9e..11381c683 100644
--- a/stdlib/source/lux/data/collection/set.lux
+++ b/stdlib/source/lux/data/collection/set.lux
@@ -31,7 +31,7 @@
     (|> set :representation (dict.remove elem) :abstraction))
 
   (def: #export (member? set elem)
-    (All [a] (-> (Set a) a Bool))
+    (All [a] (-> (Set a) a Bit))
     (|> set :representation (dict.contains? elem)))
 
   (def: #export to-list
@@ -68,7 +68,7 @@
   )
 
 (def: #export empty?
-  (All [a] (-> (Set a) Bool))
+  (All [a] (-> (Set a) Bit))
   (|>> ..size (n/= +0)))
 
 (def: #export (from-list Hash xs)
@@ -76,9 +76,9 @@
   (list/fold ..add (..new Hash) xs))
 
 (def: #export (sub? super sub)
-  (All [a] (-> (Set a) (Set a) Bool))
+  (All [a] (-> (Set a) (Set a) Bit))
   (list.every? (..member? super) (..to-list sub)))
 
 (def: #export (super? sub super)
-  (All [a] (-> (Set a) (Set a) Bool))
+  (All [a] (-> (Set a) (Set a) Bit))
   (sub? super sub))
diff --git a/stdlib/source/lux/data/collection/set/multi.lux b/stdlib/source/lux/data/collection/set/multi.lux
index 5aff87021..314c0423c 100644
--- a/stdlib/source/lux/data/collection/set/multi.lux
+++ b/stdlib/source/lux/data/collection/set/multi.lux
@@ -96,7 +96,7 @@
                    subject)))
 
   (def: #export (sub? reference subject)
-    (All [a] (-> (Set a) (Set a) Bool))
+    (All [a] (-> (Set a) (Set a) Bit))
     (|> subject
         :representation
         dictionary.entries
@@ -138,11 +138,11 @@
   )
 
 (def: #export (member? set elem)
-  (All [a] (-> (Set a) a Bool))
+  (All [a] (-> (Set a) a Bit))
   (|> set (..multiplicity elem) (n/> +0)))
 
 (def: #export empty?
-  (All [a] (-> (Set a) Bool))
+  (All [a] (-> (Set a) Bit))
   (|>> ..size (n/= +0)))
 
 (def: #export (from-list Hash subject)
@@ -150,5 +150,5 @@
   (list/fold ..add/1 (..new Hash) subject))
 
 (def: #export super?
-  (All [a] (-> (Set a) (Set a) Bool))
+  (All [a] (-> (Set a) (Set a) Bit))
   (function.flip sub?))
diff --git a/stdlib/source/lux/data/collection/set/ordered.lux b/stdlib/source/lux/data/collection/set/ordered.lux
index 7e43d2a4e..b9fff0680 100644
--- a/stdlib/source/lux/data/collection/set/ordered.lux
+++ b/stdlib/source/lux/data/collection/set/ordered.lux
@@ -19,7 +19,7 @@
     (|>> //.new :abstraction))
 
   (def: #export (member? set elem)
-    (All [a] (-> (Set a) a Bool))
+    (All [a] (-> (Set a) a Bit))
     (|> set :representation (//.contains? elem)))
 
   (do-template [ ]
@@ -79,11 +79,11 @@
   )
 
 (def: #export (sub? super sub)
-  (All [a] (-> (Set a) (Set a) Bool))
+  (All [a] (-> (Set a) (Set a) Bit))
   (|> sub
       ..to-list
       (list.every? (..member? super))))
 
 (def: #export (super? sub super)
-  (All [a] (-> (Set a) (Set a) Bool))
+  (All [a] (-> (Set a) (Set a) Bit))
   (sub? super sub))
diff --git a/stdlib/source/lux/data/collection/stack.lux b/stdlib/source/lux/data/collection/stack.lux
index 409993ef1..8a24010e7 100644
--- a/stdlib/source/lux/data/collection/stack.lux
+++ b/stdlib/source/lux/data/collection/stack.lux
@@ -18,7 +18,7 @@
   (list.size stack))
 
 (def: #export (empty? stack)
-  (All [a] (-> (Stack a) Bool))
+  (All [a] (-> (Stack a) Bit))
   (list.empty? stack))
 
 (def: #export (peek stack)
diff --git a/stdlib/source/lux/data/collection/tree/finger.lux b/stdlib/source/lux/data/collection/tree/finger.lux
index 1ce6d63fc..b77fca2ec 100644
--- a/stdlib/source/lux/data/collection/tree/finger.lux
+++ b/stdlib/source/lux/data/collection/tree/finger.lux
@@ -35,7 +35,7 @@
                     (get@ #node right))}))
 
 (def: #export (search pred tree)
-  (All [m a] (-> (-> m Bool) (Tree m a) (Maybe a)))
+  (All [m a] (-> (-> m Bit) (Tree m a) (Maybe a)))
   (let [tag/compose (get@ [#monoid #m.compose] tree)]
     (if (pred (tag tree))
       (loop [_tag (get@ [#monoid #m.identity] tree)
@@ -52,7 +52,7 @@
       #.None)))
 
 (def: #export (found? pred tree)
-  (All [m a] (-> (-> m Bool) (Tree m a) Bool))
+  (All [m a] (-> (-> m Bit) (Tree m a) Bit))
   (case (search pred tree)
     (#.Some _)
     true
diff --git a/stdlib/source/lux/data/collection/tree/rose/zipper.lux b/stdlib/source/lux/data/collection/tree/rose/zipper.lux
index f9a33ce0e..cdaba29fc 100644
--- a/stdlib/source/lux/data/collection/tree/rose/zipper.lux
+++ b/stdlib/source/lux/data/collection/tree/rose/zipper.lux
@@ -44,20 +44,20 @@
   (|> zipper (get@ [#node #rose.children])))
 
 (def: #export (branch? zipper)
-  (All [a] (-> (Zipper a) Bool))
+  (All [a] (-> (Zipper a) Bit))
   (|> zipper children list.empty? not))
 
 (def: #export (leaf? zipper)
-  (All [a] (-> (Zipper a) Bool))
+  (All [a] (-> (Zipper a) Bit))
   (|> zipper branch? not))
 
 (def: #export (end? zipper)
-  (All [a] (-> (Zipper a) Bool))
+  (All [a] (-> (Zipper a) Bit))
   (and (list.empty? (get@ #rights zipper))
        (list.empty? (children zipper))))
 
 (def: #export (root? zipper)
-  (All [a] (-> (Zipper a) Bool))
+  (All [a] (-> (Zipper a) Bit))
   (case (get@ #parent zipper)
     #.None
     true
diff --git a/stdlib/source/lux/data/format/binary.lux b/stdlib/source/lux/data/format/binary.lux
index 4503f21dd..a5dcde900 100644
--- a/stdlib/source/lux/data/format/binary.lux
+++ b/stdlib/source/lux/data/format/binary.lux
@@ -148,14 +148,14 @@
   (Binary Any)
   (ignore []))
 
-(def: #export bool
-  (Binary Bool)
+(def: #export bit
+  (Binary Bit)
   {#read (function (_ [offset blob])
            (case (blob.read/8 offset blob)
              (#error.Success data)
              (case (: Nat data)
-               (^template [ ]
-                  (#error.Success [(inc offset) blob] ))
+               (^template [ ]
+                  (#error.Success [(inc offset) blob] ))
                ([+0 false]
                 [+1 true])
                
@@ -264,8 +264,8 @@
    (function (_ code)
      (let [sequence (..list code)
            code' ($_ ..alt
-                     ## #Bool
-                     ..bool
+                     ## #Bit
+                     ..bit
                      ## #Nat
                      ..nat
                      ## #Int
diff --git a/stdlib/source/lux/data/format/json.lux b/stdlib/source/lux/data/format/json.lux
index 0316b5a9b..4dfa6cb7d 100644
--- a/stdlib/source/lux/data/format/json.lux
+++ b/stdlib/source/lux/data/format/json.lux
@@ -8,7 +8,7 @@
     codec
     ["p" parser ("parser/" Monad)]]
    [data
-    [bool]
+    [bit]
     [text ("text/" Equivalence Monoid)
      ["l" lexer]]
     [number ("frac/" Codec) ("nat/" Codec)]
@@ -28,7 +28,7 @@
   [(type: #export  )]
 
   [Null    Any]
-  [Boolean Bool]
+  [Boolean Bit]
   [Number  Frac]
   [String  Text]
   )
@@ -67,9 +67,9 @@
       (^template [  ]
         [_ ( value)]
         (wrap (list (` (: JSON ( (~ ( value))))))))
-      ([#.Bool code.bool            #Boolean]
-       [#.Frac code.frac            #Number]
-       [#.Text code.text            #String])
+      ([#.Bit  code.bit  #Boolean]
+       [#.Frac code.frac #Number]
+       [#.Text code.text #String])
 
       [_ (#.Tag ["" "null"])]
       (wrap (list (` (: JSON #Null))))
@@ -159,7 +159,7 @@
       (^template [ ]
         [( x') ( y')]
         (::  = x' y'))
-      ([#Boolean bool.Equivalence]
+      ([#Boolean bit.Equivalence]
        [#Number  number.Equivalence]
        [#String  text.Equivalence])
 
@@ -237,16 +237,22 @@
          _
          (fail ($_ text/compose "JSON value is not "  ".")))))]
 
-  [null    Any #Null    "null"]
-  [boolean Bool #Boolean "boolean"]
+  [null    Any  #Null    "null"]
+  [boolean Bit  #Boolean "boolean"]
   [number  Frac #Number  "number"]
   [string  Text #String  "string"]
   )
 
+(def: (encode-boolean value)
+  (-> Bit Text)
+  (if value
+    "true"
+    "false"))
+
 (do-template [       
]
   [(def: #export ( test)
      {#.doc (code.text ($_ text/compose "Asks whether a JSON value is a "  "."))}
-     (->  (Reader Bool))
+     (->  (Reader Bit))
      (do p.Monad
        [head any]
        (case head
@@ -271,7 +277,7 @@
          _
          (fail ($_ text/compose "JSON value is not a "  ".")))))]
 
-  [boolean? boolean! Bool bool.Equivalence   (:: bool.Codec encode)   #Boolean "boolean" id]
+  [boolean? boolean! Bit  bit.Equivalence     encode-boolean                      #Boolean "boolean" id]
   [number?  number!  Frac number.Equivalence (:: number.Codec encode) #Number  "number"  id]
   [string?  string!  Text text.Equivalence   text.encode                         #String  "string"  id]
   )
@@ -360,7 +366,7 @@
 (do-template [  ]
   [(def:  (->  Text) )]
 
-  [show-boolean Boolean (:: bool.Codec encode)]
+  [show-boolean Boolean encode-boolean]
   [show-number  Number (:: number.Codec encode)]
   [show-string  String text.encode])
 
diff --git a/stdlib/source/lux/data/number.lux b/stdlib/source/lux/data/number.lux
index 773300f31..cb322299c 100644
--- a/stdlib/source/lux/data/number.lux
+++ b/stdlib/source/lux/data/number.lux
@@ -149,11 +149,11 @@
 
 (def: #export (not-a-number? number)
   {#.doc "Tests whether a frac is actually not-a-number."}
-  (-> Frac Bool)
+  (-> Frac Bit)
   (not (f/= number number)))
 
 (def: #export (frac? value)
-  (-> Frac Bool)
+  (-> Frac Bit)
   (not (or (not-a-number? value)
            (f/= positive-infinity value)
            (f/= negative-infinity value))))
@@ -574,7 +574,7 @@
 
 (do-template [    ]
   [(def: ( on-left? input)
-     (-> Bool Text Text)
+     (-> Bit Text Text)
      (let [max-num-chars (n//  +64)
            input-size ("lux text size" input)
            zero-padding (let [num-digits-that-need-padding (n/%  input-size)]
@@ -669,7 +669,7 @@
     (#e.Error "Wrong syntax for \"encoding-doc\".")))
 
 (def: (underscore-prefixed? number)
-  (-> Text Bool)
+  (-> Text Bit)
   (case ("lux text index" number "_" +0)
     (#.Some +0)
     true
@@ -827,7 +827,7 @@
       #.None)))
 
 (def: (digits-lt param subject)
-  (-> Digits Digits Bool)
+  (-> Digits Digits Bit)
   (loop [idx +0]
     (and (n/< i64.width idx)
          (let [pd (digits-get idx param)
diff --git a/stdlib/source/lux/data/number/complex.lux b/stdlib/source/lux/data/number/complex.lux
index 134801015..5c9c97d46 100644
--- a/stdlib/source/lux/data/number/complex.lux
+++ b/stdlib/source/lux/data/number/complex.lux
@@ -40,7 +40,7 @@
       (number.not-a-number? (get@ #imaginary complex))))
 
 (def: #export (= param input)
-  (-> Complex Complex Bool)
+  (-> Complex Complex Bit)
   (and (f/= (get@ #real param)
             (get@ #real input))
        (f/= (get@ #imaginary param)
diff --git a/stdlib/source/lux/data/number/i64.lux b/stdlib/source/lux/data/number/i64.lux
index 353a1237a..32b9df2e3 100644
--- a/stdlib/source/lux/data/number/i64.lux
+++ b/stdlib/source/lux/data/number/i64.lux
@@ -67,7 +67,7 @@
   )
 
 (def: #export (set? idx input)
-  (-> Nat (I64 Any) Bool)
+  (-> Nat (I64 Any) Bit)
   (|> input (:coerce I64) (..and (flag idx)) (n/= +0) .not))
 
 (do-template [ 
] diff --git a/stdlib/source/lux/data/number/ratio.lux b/stdlib/source/lux/data/number/ratio.lux index b1aed0cba..2aa332dc6 100644 --- a/stdlib/source/lux/data/number/ratio.lux +++ b/stdlib/source/lux/data/number/ratio.lux @@ -71,7 +71,7 @@ input))) (def: #export (= param input) - (-> Ratio Ratio Bool) + (-> Ratio Ratio Bit) (and (n/= (get@ #numerator param) (get@ #numerator input)) (n/= (get@ #denominator param) @@ -79,7 +79,7 @@ (do-template [ ] [(def: #export ( param input) - (-> Ratio Ratio Bool) + (-> Ratio Ratio Bit) (and ( (n/* (get@ #denominator input) (get@ #numerator param)) (n/* (get@ #denominator param) diff --git a/stdlib/source/lux/data/tainted.lux b/stdlib/source/lux/data/tainted.lux index 903b777d6..7ff754081 100644 --- a/stdlib/source/lux/data/tainted.lux +++ b/stdlib/source/lux/data/tainted.lux @@ -17,7 +17,7 @@ (|>> :representation))) (def: #export (validate pred tainted) - (All [a] (-> (-> a Bool) (Tainted a) (Maybe a))) + (All [a] (-> (-> a Bit) (Tainted a) (Maybe a))) (let [value (trust tainted)] (if (pred value) (#.Some value) diff --git a/stdlib/source/lux/data/text.lux b/stdlib/source/lux/data/text.lux index 3a9e6ab3b..8120f19d5 100644 --- a/stdlib/source/lux/data/text.lux +++ b/stdlib/source/lux/data/text.lux @@ -60,7 +60,7 @@ #.None)) (def: #export (starts-with? prefix x) - (-> Text Text Bool) + (-> Text Text Bit) (case (index-of prefix x) (#.Some +0) true @@ -69,7 +69,7 @@ false)) (def: #export (ends-with? postfix x) - (-> Text Text Bool) + (-> Text Text Bit) (case (last-index-of postfix x) (#.Some n) (n/= (size x) @@ -79,7 +79,7 @@ false)) (def: #export (contains? sub text) - (-> Text Text Bool) + (-> Text Text Bit) (case ("lux text index" text sub +0) (#.Some _) true @@ -200,7 +200,7 @@ (|> texts (list.interpose sep) concat)) (def: #export (empty? text) - (-> Text Bool) + (-> Text Bit) (case text "" true _ false)) @@ -234,7 +234,7 @@ (def: #export (space? char) {#.doc "Checks whether the character is white-space."} - (-> Nat Bool) + (-> Nat Bit) (case char (^or (^ (char "\t")) (^ (char "\v")) (^ (char " ")) (^ (char "\n")) diff --git a/stdlib/source/lux/data/text/format.lux b/stdlib/source/lux/data/text/format.lux index d32862024..4b9717fab 100644 --- a/stdlib/source/lux/data/text/format.lux +++ b/stdlib/source/lux/data/text/format.lux @@ -4,7 +4,7 @@ [monad (#+ do Monad)] ["p" parser]] [data - [bool] + [bit] [number] [text] [ident] @@ -39,7 +39,7 @@ (Format ) )] - [%b Bool (:: bool.Codec encode)] + [%b Bit (:: bit.Codec encode)] [%n Nat (:: number.Codec encode)] [%i Int (:: number.Codec encode)] [%r Rev (:: number.Codec encode)] diff --git a/stdlib/source/lux/data/text/lexer.lux b/stdlib/source/lux/data/text/lexer.lux index 13c49ef8f..d9b07db1e 100644 --- a/stdlib/source/lux/data/text/lexer.lux +++ b/stdlib/source/lux/data/text/lexer.lux @@ -78,7 +78,7 @@ (def: #export (this? reference) {#.doc "Lex a text if it matches the given sample."} - (-> Text (Lexer Bool)) + (-> Text (Lexer Bit)) (function (_ (^@ input [offset tape])) (case (text.index-of' reference offset tape) (^multi (#.Some where) (n/= offset where)) @@ -97,7 +97,7 @@ (def: #export end? {#.doc "Ask if the lexer's input is empty."} - (Lexer Bool) + (Lexer Bit) (function (_ (^@ input [offset tape])) (#e.Success [input (n/= offset (text.size tape))]))) @@ -190,7 +190,7 @@ (def: #export (satisfies p) {#.doc "Only lex characters that satisfy a predicate."} - (-> (-> Nat Bool) (Lexer Text)) + (-> (-> Nat Bit) (Lexer Text)) (function (_ [offset tape]) (case (text.nth offset tape) (#.Some output) diff --git a/stdlib/source/lux/data/text/regex.lux b/stdlib/source/lux/data/text/regex.lux index 8b35b770c..107270225 100644 --- a/stdlib/source/lux/data/text/regex.lux +++ b/stdlib/source/lux/data/text/regex.lux @@ -260,7 +260,7 @@ (#Capturing [(Maybe Text) Nat])) (def: (re-sequential^ capturing? re-scoped^ current-module) - (-> Bool + (-> Bit (-> Text (l.Lexer [Re-Group Code])) Text (l.Lexer [Nat Code])) @@ -351,7 +351,7 @@ (` ((~! unflatten^) (~ alt))))) (def: (re-alternative^ capturing? re-scoped^ current-module) - (-> Bool + (-> Bit (-> Text (l.Lexer [Re-Group Code])) Text (l.Lexer [Nat Code])) diff --git a/stdlib/source/lux/data/text/unicode.lux b/stdlib/source/lux/data/text/unicode.lux index 10b9692ee..11c69be84 100644 --- a/stdlib/source/lux/data/text/unicode.lux +++ b/stdlib/source/lux/data/text/unicode.lux @@ -50,7 +50,7 @@ (|> end (n/- start) inc))) (def: #export (within? segment char) - (All [a] (-> Segment Char Bool)) + (All [a] (-> Segment Char Bit)) (interval.within? (:representation segment) char)) ) diff --git a/stdlib/source/lux/host.js.lux b/stdlib/source/lux/host.js.lux index b3758e3b5..022394f21 100644 --- a/stdlib/source/lux/host.js.lux +++ b/stdlib/source/lux/host.js.lux @@ -23,7 +23,7 @@ [String Text] [Number Frac] - [Boolean Bool] + [Boolean Bit] ) ## [Syntax] diff --git a/stdlib/source/lux/host.jvm.lux b/stdlib/source/lux/host.jvm.lux index 8639ea2c5..927f16c7d 100644 --- a/stdlib/source/lux/host.jvm.lux +++ b/stdlib/source/lux/host.jvm.lux @@ -13,7 +13,7 @@ [product] [text ("text/" Equivalence Monoid) format] - [bool ("bool/" Codec)]] + [bit ("bit/" Codec)]] [macro (#+ with-gensyms Functor Monad) [code] ["s" syntax (#+ syntax: Syntax)]] @@ -147,27 +147,27 @@ [GenericType Code]) (type: Method-Definition - (#ConstructorMethod [Bool + (#ConstructorMethod [Bit (List Type-Paramameter) (List ArgDecl) (List ConstructorArg) Code (List GenericType)]) - (#VirtualMethod [Bool - Bool + (#VirtualMethod [Bit + Bit (List Type-Paramameter) (List ArgDecl) GenericType Code (List GenericType)]) - (#OverridenMethod [Bool + (#OverridenMethod [Bit Class-Declaration (List Type-Paramameter) (List ArgDecl) GenericType Code (List GenericType)]) - (#StaticMethod [Bool + (#StaticMethod [Bit (List Type-Paramameter) (List ArgDecl) GenericType @@ -195,10 +195,10 @@ #import-member-alias Text #import-member-kind ImportMethodKind #import-member-tvars (List Type-Paramameter) - #import-member-args (List [Bool GenericType]) - #import-member-maybe? Bool - #import-member-try? Bool - #import-member-io? Bool}) + #import-member-args (List [Bit GenericType]) + #import-member-maybe? Bit + #import-member-try? Bit + #import-member-io? Bit}) (type: ImportConstructorDecl {}) @@ -210,9 +210,9 @@ (type: ImportFieldDecl {#import-field-mode Primitive-Mode #import-field-name Text - #import-field-static? Bool - #import-field-maybe? Bool - #import-field-setter? Bool + #import-field-static? Bit + #import-field-maybe? Bit + #import-field-setter? Bit #import-field-type GenericType}) (type: Import-Member-Declaration @@ -259,7 +259,7 @@ (^template [ ] (#.Some (' ))) - (["boolean" .Bool] + (["boolean" .Bit] ["byte" .Int] ["short" .Int] ["int" .Int] @@ -277,8 +277,8 @@ (def: (generic-class->type' mode type-params in-array? name+params class->type') - (-> Primitive-Mode (List Type-Paramameter) Bool [Text (List GenericType)] - (-> Primitive-Mode (List Type-Paramameter) Bool GenericType Code) + (-> Primitive-Mode (List Type-Paramameter) Bit [Text (List GenericType)] + (-> Primitive-Mode (List Type-Paramameter) Bit GenericType Code) Code) (case [name+params mode in-array?] (^multi [[prim #.Nil] #ManualPrM false] @@ -295,7 +295,7 @@ (` (primitive (~ (code.text name)) [(~+ =params)]))))) (def: (class->type' mode type-params in-array? class) - (-> Primitive-Mode (List Type-Paramameter) Bool GenericType Code) + (-> Primitive-Mode (List Type-Paramameter) Bit GenericType Code) (case class (#GenericTypeVar name) (case (list.find (function (_ [pname pbounds]) @@ -977,11 +977,11 @@ s.local-symbol))) (def: (import-member-args^ imports type-vars) - (-> Class-Imports (List Type-Paramameter) (Syntax (List [Bool GenericType]))) + (-> Class-Imports (List Type-Paramameter) (Syntax (List [Bit GenericType]))) (s.tuple (p.some (p.seq (s.this? (' #?)) (generic-type^ imports type-vars))))) (def: import-member-return-flags^ - (Syntax [Bool Bool Bool]) + (Syntax [Bit Bit Bit]) ($_ p.seq (s.this? (' #io)) (s.this? (' #try)) (s.this? (' #?)))) (def: primitive-mode^ @@ -1181,7 +1181,7 @@ (with-parens (spaced (list "init" (privacy-modifier$ pm) - (bool/encode strict-fp?) + (bit/encode strict-fp?) (with-brackets (spaced (list/map annotation$ anns))) (with-brackets (spaced (list/map type-param$ type-vars))) (with-brackets (spaced (list/map generic-type$ exs))) @@ -1195,8 +1195,8 @@ (spaced (list "virtual" name (privacy-modifier$ pm) - (bool/encode final?) - (bool/encode strict-fp?) + (bit/encode final?) + (bit/encode strict-fp?) (with-brackets (spaced (list/map annotation$ anns))) (with-brackets (spaced (list/map type-param$ type-vars))) (with-brackets (spaced (list/map generic-type$ exs))) @@ -1216,7 +1216,7 @@ (spaced (list "override" (class-decl$ class-decl) name - (bool/encode strict-fp?) + (bit/encode strict-fp?) (with-brackets (spaced (list/map annotation$ anns))) (with-brackets (spaced (list/map type-param$ type-vars))) (with-brackets (spaced (list/map generic-type$ exs))) @@ -1233,7 +1233,7 @@ (spaced (list "static" name (privacy-modifier$ pm) - (bool/encode strict-fp?) + (bit/encode strict-fp?) (with-brackets (spaced (list/map annotation$ anns))) (with-brackets (spaced (list/map type-param$ type-vars))) (with-brackets (spaced (list/map generic-type$ exs))) @@ -1398,7 +1398,7 @@ (null? "YOLO") "=>" false)} - (-> (primitive "java.lang.Object") Bool) + (-> (primitive "java.lang.Object") Bit) ("jvm object null?" obj)) (syntax: #export (??? expr) @@ -1454,7 +1454,7 @@ (do @ [g!_ (macro.gensym "_") g!obj (macro.gensym "obj")] - (wrap (list (` (: (-> (primitive "java.lang.Object") Bool) + (wrap (list (` (: (-> (primitive "java.lang.Object") Bit) (function ((~ g!_) (~ g!obj)) ((~ (code.text (format "jvm instanceof" ":" (simple-class$ (list) class)))) (~ g!obj)))))))) )) @@ -1480,7 +1480,7 @@ (~ g!obj)))))))) (def: (class-import$ long-name? [full-name params]) - (-> Bool Class-Declaration Code) + (-> Bit Class-Declaration Code) (let [def-name (if long-name? full-name (short-class-name full-name)) @@ -1517,7 +1517,7 @@ (let [(^slots [#import-member-tvars #import-member-args]) commons] (do Monad [arg-inputs (monad.map @ - (: (-> [Bool GenericType] (Meta [Code Code])) + (: (-> [Bit GenericType] (Meta [Code Code])) (function (_ [maybe? _]) (with-gensyms [arg-name] (wrap [arg-name (if maybe? @@ -1527,7 +1527,7 @@ #let [arg-classes (: (List Text) (list/map (|>> product.right (simple-class$ (list/compose type-params import-member-tvars))) import-member-args)) - arg-types (list/map (: (-> [Bool GenericType] Code) + arg-types (list/map (: (-> [Bit GenericType] Code) (function (_ [maybe? arg]) (let [arg-type (class->type (get@ #import-member-mode commons) type-params arg)] (if maybe? @@ -1588,7 +1588,7 @@ ) (def: (free-type-param? [name bounds]) - (-> Type-Paramameter Bool) + (-> Type-Paramameter Bit) (case bounds #.Nil true _ false)) @@ -1621,7 +1621,7 @@ body))) (def: (auto-conv-class? class) - (-> Text Bool) + (-> Text Bit) (case class (^or "byte" "short" "int" "float") true @@ -1828,7 +1828,7 @@ ))) (def: (member-import$ type-params long-name? kind class member) - (-> (List Type-Paramameter) Bool Class-Kind Class-Declaration Import-Member-Declaration (Meta (List Code))) + (-> (List Type-Paramameter) Bit Class-Kind Class-Declaration Import-Member-Declaration (Meta (List Code))) (let [[full-name _] class method-prefix (if long-name? full-name @@ -1838,7 +1838,7 @@ (member-def-interop type-params kind class =args member method-prefix)))) (def: (interface? class) - (All [a] (-> (primitive "java.lang.Class" [a]) Bool)) + (All [a] (-> (primitive "java.lang.Class" [a]) Bit)) ("jvm invokevirtual:java.lang.Class:isInterface:" class)) (def: (load-class class-name) diff --git a/stdlib/source/lux/language/compiler/analysis.lux b/stdlib/source/lux/language/compiler/analysis.lux index 0ca620e42..e9eb3b921 100644 --- a/stdlib/source/lux/language/compiler/analysis.lux +++ b/stdlib/source/lux/language/compiler/analysis.lux @@ -13,7 +13,7 @@ (type: #export #rec Primitive #Unit - (#Bool Bool) + (#Bit Bit) (#Nat Nat) (#Int Int) (#Rev Rev) @@ -80,7 +80,7 @@ (-> Analysis) (|>> #Primitive))] - [bool Bool #Bool] + [bit Bit #Bit] [nat Nat #Nat] [int Int #Int] [rev Rev #Rev] @@ -90,7 +90,7 @@ (type: #export (Variant a) {#lefts Nat - #right? Bool + #right? Bit #value a}) (type: #export (Tuple a) (List a)) @@ -102,7 +102,7 @@ (type: #export (Application c) [c (List c)]) (def: (last? size tag) - (-> Nat Tag Bool) + (-> Nat Tag Bit) (n/= (dec size) tag)) (template: #export (no-op value) @@ -215,7 +215,7 @@ [(template: #export ( content) (#..Simple ( content)))] - [pattern/bool #..Bool] + [pattern/bit #..Bit] [pattern/nat #..Nat] [pattern/int #..Int] [pattern/rev #..Rev] diff --git a/stdlib/source/lux/language/compiler/analysis/case.lux b/stdlib/source/lux/language/compiler/analysis/case.lux index 760ea3b03..2f5162fbd 100644 --- a/stdlib/source/lux/language/compiler/analysis/case.lux +++ b/stdlib/source/lux/language/compiler/analysis/case.lux @@ -163,7 +163,7 @@ (^template [ ] [cursor ] (analyse-primitive inputT cursor (#//.Simple ) next)) - ([Bool (#.Bool pattern-value) (#//.Bool pattern-value)] + ([Bit (#.Bit pattern-value) (#//.Bit pattern-value)] [Nat (#.Nat pattern-value) (#//.Nat pattern-value)] [Int (#.Int pattern-value) (#//.Int pattern-value)] [Rev (#.Rev pattern-value) (#//.Rev pattern-value)] diff --git a/stdlib/source/lux/language/compiler/analysis/case/coverage.lux b/stdlib/source/lux/language/compiler/analysis/case/coverage.lux index bce8512e5..b718c382d 100644 --- a/stdlib/source/lux/language/compiler/analysis/case/coverage.lux +++ b/stdlib/source/lux/language/compiler/analysis/case/coverage.lux @@ -5,7 +5,7 @@ ["ex" exception (#+ exception:)] equivalence] [data - [bool ("bool/" Equivalence)] + [bit ("bit/" Equivalence)] [number] ["e" error ("error/" Monad)] [maybe] @@ -50,18 +50,18 @@ ## as insuficient (since it could lead to runtime errors due to values ## not being handled by any pattern). ## The #Partial tag covers arbitrary partial coverages in a general -## way, while the other tags cover more specific cases for booleans +## way, while the other tags cover more specific cases for bits ## and variants. (type: #export #rec Coverage #Partial - (#Bool Bool) + (#Bit Bit) (#Variant (Maybe Nat) (Dictionary Nat Coverage)) (#Seq Coverage Coverage) (#Alt Coverage Coverage) #Exhaustive) (def: #export (exhaustive? coverage) - (-> Coverage Bool) + (-> Coverage Bit) (case coverage (#Exhaustive _) true @@ -87,11 +87,11 @@ [#///.Frac] [#///.Text]) - ## Bools are the exception, since there is only "true" and - ## "false", which means it is possible for boolean + ## Bits are the exception, since there is only "true" and + ## "false", which means it is possible for bit ## pattern-matching to become exhaustive if complementary parts meet. - (#///.Simple (#///.Bool value)) - (operation/wrap (#Bool value)) + (#///.Simple (#///.Bit value)) + (operation/wrap (#Bit value)) ## Tuple patterns can be exhaustive if there is exhaustiveness for all of ## their sub-patterns. @@ -122,7 +122,7 @@ (dict.put variant-idx value-coverage)))))))) (def: (xor left right) - (-> Bool Bool Bool) + (-> Bit Bit Bit) (or (and left (not right)) (and (not left) right))) @@ -151,8 +151,8 @@ [#Exhaustive #Exhaustive] true - [(#Bool sideR) (#Bool sideS)] - (bool/= sideR sideS) + [(#Bit sideR) (#Bit sideS)] + (bit/= sideR sideS) [(#Variant allR casesR) (#Variant allS casesS)] (and (n/= (cases allR) @@ -194,8 +194,8 @@ [#Partial #Partial] (error/wrap #Partial) - ## 2 boolean coverages are exhaustive if they compliment one another. - (^multi [(#Bool sideA) (#Bool sideSF)] + ## 2 bit coverages are exhaustive if they complement one another. + (^multi [(#Bit sideA) (#Bit sideSF)] (xor sideA sideSF)) (error/wrap #Exhaustive) diff --git a/stdlib/source/lux/language/compiler/analysis/expression.lux b/stdlib/source/lux/language/compiler/analysis/expression.lux index 1c5c8794c..f413b8077 100644 --- a/stdlib/source/lux/language/compiler/analysis/expression.lux +++ b/stdlib/source/lux/language/compiler/analysis/expression.lux @@ -44,7 +44,7 @@ (^template [ ] ( value) ( value)) - ([#.Bool primitive.bool] + ([#.Bit primitive.bit] [#.Nat primitive.nat] [#.Int primitive.int] [#.Rev primitive.rev] diff --git a/stdlib/source/lux/language/compiler/analysis/module.lux b/stdlib/source/lux/language/compiler/analysis/module.lux index 2a2aef5c3..bdc4abf05 100644 --- a/stdlib/source/lux/language/compiler/analysis/module.lux +++ b/stdlib/source/lux/language/compiler/analysis/module.lux @@ -102,7 +102,7 @@ []]))))) (def: #export (exists? module) - (-> Text (Operation Bool)) + (-> Text (Operation Bit)) (extension.lift (function (_ state) (|> state @@ -173,7 +173,7 @@ ((///.throw unknown-module module-name) state))))) (def: #export ( module-name) - (-> Text (Operation Bool)) + (-> Text (Operation Bit)) (extension.lift (function (_ state) (case (|> state (get@ #.modules) (plist.get module-name)) @@ -203,8 +203,8 @@ #.None ((///.throw unknown-module module-name) state)))))] - [tags #.tags (List [Text [Nat (List Ident) Bool Type]])] - [types #.types (List [Text [(List Ident) Bool Type]])] + [tags #.tags (List [Text [Nat (List Ident) Bit Type]])] + [types #.types (List [Text [(List Ident) Bit Type]])] [hash #.module-hash Nat] ) @@ -224,7 +224,7 @@ (wrap []))) (def: #export (declare-tags tags exported? type) - (-> (List Tag) Bool Type (Operation Any)) + (-> (List Tag) Bit Type (Operation Any)) (do ///.Monad [self-name (extension.lift macro.current-module-name) [type-module type-name] (case type diff --git a/stdlib/source/lux/language/compiler/analysis/primitive.lux b/stdlib/source/lux/language/compiler/analysis/primitive.lux index eabbcb7d8..346906909 100644 --- a/stdlib/source/lux/language/compiler/analysis/primitive.lux +++ b/stdlib/source/lux/language/compiler/analysis/primitive.lux @@ -14,7 +14,7 @@ [_ (typeA.infer )] (wrap (#//.Primitive ( value)))))] - [bool Bool #//.Bool] + [bit Bit #//.Bit] [nat Nat #//.Nat] [int Int #//.Int] [rev Rev #//.Rev] diff --git a/stdlib/source/lux/language/compiler/analysis/scope.lux b/stdlib/source/lux/language/compiler/analysis/scope.lux index 2468ede27..3ee0499e8 100644 --- a/stdlib/source/lux/language/compiler/analysis/scope.lux +++ b/stdlib/source/lux/language/compiler/analysis/scope.lux @@ -21,7 +21,7 @@ (type: Foreign (Bindings Text [Type Variable])) (def: (local? name scope) - (-> Text Scope Bool) + (-> Text Scope Bit) (|> scope (get@ [#.locals #.mappings]) (plist.contains? name))) @@ -35,7 +35,7 @@ [type (#reference.Local value)])))) (def: (captured? name scope) - (-> Text Scope Bool) + (-> Text Scope Bit) (|> scope (get@ [#.captured #.mappings]) (plist.contains? name))) @@ -54,7 +54,7 @@ (recur (inc idx) mappings'))))) (def: (reference? name scope) - (-> Text Scope Bool) + (-> Text Scope Bit) (or (local? name scope) (captured? name scope))) diff --git a/stdlib/source/lux/language/compiler/default/repl/type.lux b/stdlib/source/lux/language/compiler/default/repl/type.lux index 84f063e0c..c9b68c06e 100644 --- a/stdlib/source/lux/language/compiler/default/repl/type.lux +++ b/stdlib/source/lux/language/compiler/default/repl/type.lux @@ -40,7 +40,7 @@ [_ (poly.similar )] (wrap (|>> (:coerce ) )))] - [Bool %b] + [Bit %b] [Nat %n] [Int %i] [Rev %r] diff --git a/stdlib/source/lux/language/compiler/extension/analysis/common.lux b/stdlib/source/lux/language/compiler/extension/analysis/common.lux index 55d479052..9616f2533 100644 --- a/stdlib/source/lux/language/compiler/extension/analysis/common.lux +++ b/stdlib/source/lux/language/compiler/extension/analysis/common.lux @@ -63,7 +63,7 @@ (function (_ extension-name analyse args) (do ////.Monad [[var-id varT] (typeA.with-env tc.var)] - ((binary varT varT Bool extension-name) + ((binary varT varT Bit extension-name) analyse args)))) ## "lux try" provides a simple way to interact with the host platform's @@ -167,8 +167,8 @@ (bundle.install "*" (binary Int Int Int)) (bundle.install "/" (binary Int Int Int)) (bundle.install "%" (binary Int Int Int)) - (bundle.install "=" (binary Int Int Bool)) - (bundle.install "<" (binary Int Int Bool)) + (bundle.install "=" (binary Int Int Bit)) + (bundle.install "<" (binary Int Int Bit)) (bundle.install "to-frac" (unary Int Frac)) (bundle.install "char" (unary Int Text))))) @@ -181,8 +181,8 @@ (bundle.install "*" (binary Frac Frac Frac)) (bundle.install "/" (binary Frac Frac Frac)) (bundle.install "%" (binary Frac Frac Frac)) - (bundle.install "=" (binary Frac Frac Bool)) - (bundle.install "<" (binary Frac Frac Bool)) + (bundle.install "=" (binary Frac Frac Bit)) + (bundle.install "<" (binary Frac Frac Bit)) (bundle.install "smallest" (nullary Frac)) (bundle.install "min" (nullary Frac)) (bundle.install "max" (nullary Frac)) @@ -195,8 +195,8 @@ Bundle (<| (bundle.prefix "text") (|> bundle.empty - (bundle.install "=" (binary Text Text Bool)) - (bundle.install "<" (binary Text Text Bool)) + (bundle.install "=" (binary Text Text Bit)) + (bundle.install "<" (binary Text Text Bit)) (bundle.install "concat" (binary Text Text Text)) (bundle.install "index" (trinary Text Text Nat (type (Maybe Nat)))) (bundle.install "size" (unary Text Nat)) @@ -289,7 +289,7 @@ (function (_ extension-name analyse args) (do ////.Monad [[var-id varT] (typeA.with-env tc.var)] - ((trinary (type (Atom varT)) varT varT Bool extension-name) + ((trinary (type (Atom varT)) varT varT Bit extension-name) analyse args)))) (def: bundle::atom diff --git a/stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux b/stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux index d25be6e40..876448b5b 100644 --- a/stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux +++ b/stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux @@ -167,8 +167,8 @@ (bundle.install "*" (common.binary )) (bundle.install "/" (common.binary )) (bundle.install "%" (common.binary )) - (bundle.install "=" (common.binary Boolean)) - (bundle.install "<" (common.binary Boolean)) + (bundle.install "=" (common.binary Bit)) + (bundle.install "<" (common.binary Bit)) (bundle.install "and" (common.binary )) (bundle.install "or" (common.binary )) (bundle.install "xor" (common.binary )) @@ -191,8 +191,8 @@ (bundle.install "*" (common.binary )) (bundle.install "/" (common.binary )) (bundle.install "%" (common.binary )) - (bundle.install "=" (common.binary Boolean)) - (bundle.install "<" (common.binary Boolean)) + (bundle.install "=" (common.binary Bit)) + (bundle.install "<" (common.binary Bit)) )))] [bundle::float "float" Float] @@ -203,8 +203,8 @@ Bundle (<| (bundle.prefix "char") (|> bundle.empty - (bundle.install "=" (common.binary Character Character Boolean)) - (bundle.install "<" (common.binary Character Character Boolean)) + (bundle.install "=" (common.binary Character Character Bit)) + (bundle.install "<" (common.binary Character Character Bit)) ))) (def: #export boxes @@ -398,7 +398,7 @@ (case args (^ (list objectC)) (do ////.Monad - [_ (typeA.infer Bool) + [_ (typeA.infer Bit) [objectT objectA] (typeA.with-inference (analyse objectC)) _ (check-object objectT)] @@ -493,7 +493,7 @@ (////.throw unknown-class name)))) (def: (sub-class? super sub) - (-> Text Text (Operation Bool)) + (-> Text Text (Operation Bit)) (do ////.Monad [super (load-class super) sub (load-class sub)] @@ -545,7 +545,7 @@ (case classC [_ (#.Text class)] (do ////.Monad - [_ (typeA.infer Bool) + [_ (typeA.infer Bit) [objectT objectA] (typeA.with-inference (analyse objectC)) object-class (check-object objectT) @@ -674,7 +674,7 @@ [valueT valueA] (typeA.with-inference (analyse valueC)) from-name (check-jvm valueT) - can-cast? (: (Operation Bool) + can-cast? (: (Operation Bit) (case [from-name to-name] (^template [ ] (^or [ ] @@ -773,7 +773,7 @@ (////.throw unknown-field (format class-name "#" field-name))))) (def: (static-field class-name field-name) - (-> Text Text (Operation [Type Bool])) + (-> Text Text (Operation [Type Bit])) (do ////.Monad [[class fieldJ] (find-field class-name field-name) #let [modifiers (Field::getModifiers [] fieldJ)]] @@ -785,7 +785,7 @@ (////.throw not-a-static-field (format class-name "#" field-name))))) (def: (virtual-field class-name field-name objectT) - (-> Text Text Type (Operation [Type Bool])) + (-> Text Text Type (Operation [Type Bit])) (do ////.Monad [[class fieldJ] (find-field class-name field-name) #let [modifiers (Field::getModifiers [] fieldJ)]] @@ -927,7 +927,7 @@ #Interface) (def: (check-method class method-name method-style arg-classes method) - (-> (Class Object) Text Method-Style (List Text) Method (Operation Bool)) + (-> (Class Object) Text Method-Style (List Text) Method (Operation Bit)) (do ////.Monad [parameters (|> (Method::getGenericParameterTypes [] method) array.to-list @@ -956,7 +956,7 @@ (list.zip2 arg-classes parameters)))))) (def: (check-constructor class arg-classes constructor) - (-> (Class Object) (List Text) (Constructor Object) (Operation Bool)) + (-> (Class Object) (List Text) (Constructor Object) (Operation Bit)) (do ////.Monad [parameters (|> (Constructor::getGenericParameterTypes [] constructor) array.to-list diff --git a/stdlib/source/lux/language/compiler/meta/cache.lux b/stdlib/source/lux/language/compiler/meta/cache.lux index 753a66e89..4a35d81d4 100644 --- a/stdlib/source/lux/language/compiler/meta/cache.lux +++ b/stdlib/source/lux/language/compiler/meta/cache.lux @@ -5,7 +5,7 @@ ["ex" exception (#+ exception:)] pipe] [data - [bool ("bool/" Equivalence)] + [bit ("bit/" Equivalence)] [maybe] [error] [product] @@ -82,7 +82,7 @@ (do @ [_ (..delete System file)] (wrap true))))))] - [(list.every? (bool/= true)) + [(list.every? (bit/= true)) (if> [(..delete System document)] [(wrap [])])])))) @@ -91,7 +91,7 @@ (|> root (do> (:: System &monad) [(..cached System)] - [(list.filter (bool.complement (set.member? wanted-modules))) + [(list.filter (bit.complement (set.member? wanted-modules))) (monad.map @ (un-install System root))]))) ## Load diff --git a/stdlib/source/lux/language/compiler/synthesis.lux b/stdlib/source/lux/language/compiler/synthesis.lux index 05be98f3c..202260fa2 100644 --- a/stdlib/source/lux/language/compiler/synthesis.lux +++ b/stdlib/source/lux/language/compiler/synthesis.lux @@ -15,7 +15,7 @@ (type: #export State {#scope-arity Arity #resolver Resolver - #direct? Bool + #direct? Bit #locals Nat}) (def: #export fresh-resolver @@ -30,7 +30,7 @@ #locals +0}) (type: #export Primitive - (#Bool Bool) + (#Bit Bit) (#I64 I64) (#F64 Frac) (#Text Text)) @@ -110,7 +110,7 @@ [(template: #export ( content) (#..Test ( content)))] - [path/bool #..Bool] + [path/bit #..Bit] [path/i64 #..I64] [path/f64 #..F64] [path/text #..Text] @@ -187,7 +187,7 @@ [scope-arity #scope-arity Arity] [resolver #resolver Resolver] - [direct? #direct? Bool] + [direct? #direct? Bit] [locals #locals Nat] ) @@ -201,7 +201,7 @@ [(template: #export ( content) (#..Primitive ( content)))] - [bool #..Bool] + [bit #..Bit] [i64 #..I64] [f64 #..F64] [text #..Text] diff --git a/stdlib/source/lux/language/compiler/synthesis/case.lux b/stdlib/source/lux/language/compiler/synthesis/case.lux index de7a4f9fd..0c23d1f52 100644 --- a/stdlib/source/lux/language/compiler/synthesis/case.lux +++ b/stdlib/source/lux/language/compiler/synthesis/case.lux @@ -6,7 +6,7 @@ [monad (#+ do)]] [data [product] - [bool ("bool/" Equivalence)] + [bit ("bit/" Equivalence)] [text ("text/" Equivalence) format] [number ("frac/" Equivalence)] @@ -30,7 +30,7 @@ ( value) (operation/map (|>> (#//.Seq (#//.Test (|> value )))) bodyC)) - ([#analysis.Bool #//.Bool] + ([#analysis.Bit #//.Bit] [#analysis.Nat (<| #//.I64 .i64)] [#analysis.Int (<| #//.I64 .i64)] [#analysis.Rev (<| #//.I64 .i64)] @@ -101,7 +101,7 @@ (if ( leftV rightV) rightP )) - ([#//.Bool bool/=] + ([#//.Bit bit/=] [#//.I64 (:coerce (Equivalence I64) i/=)] [#//.F64 frac/=] [#//.Text text/=]) @@ -152,10 +152,10 @@ headB/bodyS]))))) - (as-is (^or (^ [[(analysis.pattern/bool true) thenA] - (list [(analysis.pattern/bool false) elseA])]) - (^ [[(analysis.pattern/bool false) elseA] - (list [(analysis.pattern/bool true) thenA])])) + (as-is (^or (^ [[(analysis.pattern/bit true) thenA] + (list [(analysis.pattern/bit false) elseA])]) + (^ [[(analysis.pattern/bit false) elseA] + (list [(analysis.pattern/bit true) thenA])])) (do @ [thenS (synthesize^ thenA) elseS (synthesize^ elseA)] diff --git a/stdlib/source/lux/language/compiler/synthesis/expression.lux b/stdlib/source/lux/language/compiler/synthesis/expression.lux index 80480de68..0d780d444 100644 --- a/stdlib/source/lux/language/compiler/synthesis/expression.lux +++ b/stdlib/source/lux/language/compiler/synthesis/expression.lux @@ -29,7 +29,7 @@ (^template [ ] ( value) ( value)) - ([#analysis.Bool #//.Bool] + ([#analysis.Bit #//.Bit] [#analysis.Frac #//.F64] [#analysis.Text #//.Text]) diff --git a/stdlib/source/lux/language/compiler/synthesis/function.lux b/stdlib/source/lux/language/compiler/synthesis/function.lux index 92e75dc94..67f0dda46 100644 --- a/stdlib/source/lux/language/compiler/synthesis/function.lux +++ b/stdlib/source/lux/language/compiler/synthesis/function.lux @@ -19,11 +19,11 @@ [analysis (#+ Environment Arity Analysis)]]]]) (def: #export nested? - (-> Arity Bool) + (-> Arity Bit) (n/> +1)) (def: #export (adjust up-arity after? var) - (-> Arity Bool Variable Variable) + (-> Arity Bit Variable Variable) (case var (#reference.Local register) (if (and after? (n/>= up-arity register)) diff --git a/stdlib/source/lux/language/compiler/synthesis/loop.lux b/stdlib/source/lux/language/compiler/synthesis/loop.lux index 564fe5421..eeb1adcc7 100644 --- a/stdlib/source/lux/language/compiler/synthesis/loop.lux +++ b/stdlib/source/lux/language/compiler/synthesis/loop.lux @@ -19,7 +19,7 @@ (-> a (Maybe a))) (def: (some? maybe) - (All [a] (-> (Maybe a) Bool)) + (All [a] (-> (Maybe a) Bit)) (case maybe (#.Some _) true #.None false)) @@ -30,11 +30,11 @@ (template: (recursive-apply args) (#//.Apply (self) args)) -(def: proper Bool true) -(def: improper Bool false) +(def: proper Bit true) +(def: improper Bit false) (def: (proper? exprS) - (-> Synthesis Bool) + (-> Synthesis Bit) (case exprS (^ (self)) improper diff --git a/stdlib/source/lux/language/compiler/translation/scheme/case.jvm.lux b/stdlib/source/lux/language/compiler/translation/scheme/case.jvm.lux index 3ef368c18..f7b1adb7a 100644 --- a/stdlib/source/lux/language/compiler/translation/scheme/case.jvm.lux +++ b/stdlib/source/lux/language/compiler/translation/scheme/case.jvm.lux @@ -28,7 +28,7 @@ bodyO)))) (def: #export (record-get translate valueS pathP) - (-> Compiler Synthesis (List [Nat Bool]) + (-> Compiler Synthesis (List [Nat Bit]) (Operation Expression)) (do compiler.Monad [valueO (translate valueS)] @@ -118,7 +118,7 @@ (^ ( value)) (operation/wrap (_.when (|> value (<=> cursor-top) _.not/1) fail-pm!))) - ([synthesis.path/bool _.bool _.eqv?/2] + ([synthesis.path/bit _.bool _.eqv?/2] [synthesis.path/i64 _.int _.=/2] [synthesis.path/f64 _.float _.=/2] [synthesis.path/text _.string _.eqv?/2]) diff --git a/stdlib/source/lux/language/compiler/translation/scheme/expression.jvm.lux b/stdlib/source/lux/language/compiler/translation/scheme/expression.jvm.lux index d7ef01e61..3cbefbf69 100644 --- a/stdlib/source/lux/language/compiler/translation/scheme/expression.jvm.lux +++ b/stdlib/source/lux/language/compiler/translation/scheme/expression.jvm.lux @@ -19,7 +19,7 @@ (^template [ ] (^ ( value)) ( value)) - ([synthesis.bool primitive.bool] + ([synthesis.bit primitive.bit] [synthesis.i64 primitive.i64] [synthesis.f64 primitive.f64] [synthesis.text primitive.text]) diff --git a/stdlib/source/lux/language/compiler/translation/scheme/primitive.jvm.lux b/stdlib/source/lux/language/compiler/translation/scheme/primitive.jvm.lux index fea12c6c3..6ff146393 100644 --- a/stdlib/source/lux/language/compiler/translation/scheme/primitive.jvm.lux +++ b/stdlib/source/lux/language/compiler/translation/scheme/primitive.jvm.lux @@ -6,8 +6,8 @@ [host ["_" scheme (#+ Expression)]]] [//runtime (#+ Operation)]) -(def: #export bool - (-> Bool (Operation Expression)) +(def: #export bit + (-> Bit (Operation Expression)) (|>> _.bool operation/wrap)) (def: #export i64 diff --git a/stdlib/source/lux/language/compiler/translation/scheme/runtime.jvm.lux b/stdlib/source/lux/language/compiler/translation/scheme/runtime.jvm.lux index a1ce941d2..a84677144 100644 --- a/stdlib/source/lux/language/compiler/translation/scheme/runtime.jvm.lux +++ b/stdlib/source/lux/language/compiler/translation/scheme/runtime.jvm.lux @@ -33,7 +33,7 @@ (def: #export variant-tag "lux-variant") (def: (flag value) - (-> Bool Computation) + (-> Bit Computation) (if value (_.string "") _.nil)) diff --git a/stdlib/source/lux/language/host/scheme.lux b/stdlib/source/lux/language/host/scheme.lux index f93f3b671..d2edd6fac 100644 --- a/stdlib/source/lux/language/host/scheme.lux +++ b/stdlib/source/lux/language/host/scheme.lux @@ -62,7 +62,7 @@ (:abstraction "'()")) (def: #export bool - (-> Bool Computation) + (-> Bit Computation) (|>> (case> true "#t" false "#f") :abstraction)) diff --git a/stdlib/source/lux/language/reference.lux b/stdlib/source/lux/language/reference.lux index 0e66497a1..0f4ee03a5 100644 --- a/stdlib/source/lux/language/reference.lux +++ b/stdlib/source/lux/language/reference.lux @@ -58,7 +58,7 @@ (def: #export self Reference (..local +0)) (def: #export self? - (-> Variable Bool) + (-> Variable Bit) (|>> ..variable (case> (^ (..local +0)) true diff --git a/stdlib/source/lux/language/syntax.lux b/stdlib/source/lux/language/syntax.lux index e924694c3..e31356dcb 100644 --- a/stdlib/source/lux/language/syntax.lux +++ b/stdlib/source/lux/language/syntax.lux @@ -580,7 +580,7 @@ [where (case value (^template [ ] ["" ] - (#.Bool )) + (#.Bit )) (["true" true] ["false" false]) @@ -591,9 +591,9 @@ module) (exception: #export (unrecognized-input {[file line column] Cursor}) - (format " File: " file "\n" - " Line: " (%n line) "\n" - "Column: " (%n column) "\n")) + (ex.report ["File" file] + ["Line" (%n line)] + ["Column" (%n column)])) (def: (ast current-module aliases) (-> Text Aliases Cursor (l.Lexer [Cursor Code])) diff --git a/stdlib/source/lux/language/type.lux b/stdlib/source/lux/language/type.lux index 09c30fd03..cdb43422d 100644 --- a/stdlib/source/lux/language/type.lux +++ b/stdlib/source/lux/language/type.lux @@ -313,7 +313,7 @@ ) (def: #export (quantified? type) - (-> Type Bool) + (-> Type Bit) (case type (#.Named [module name] _type) (quantified? _type) diff --git a/stdlib/source/lux/language/type/check.lux b/stdlib/source/lux/language/type/check.lux index 60864008f..3308c497b 100644 --- a/stdlib/source/lux/language/type/check.lux +++ b/stdlib/source/lux/language/type/check.lux @@ -39,7 +39,7 @@ (type: #export Assumption {#subsumption [Type Type] - #verdict Bool}) + #verdict Bit}) (type: #export (Check a) (-> Type-Context (e.Error [Type-Context a]))) @@ -186,7 +186,7 @@ #.None (ex.throw unknown-type-var id))))] - [bound? Bool false true] + [bound? Bit false true] [read (Maybe Type) #.None (#.Some bound)] ) @@ -320,7 +320,7 @@ (#e.Error message))) (def: #export (assert message test) - (-> Text Bool (Check Any)) + (-> Text Bit (Check Any)) (function (_ context) (if test (#e.Success [context []]) @@ -337,7 +337,7 @@ (right context)))) (def: (assumed? [e a] assumptions) - (-> [Type Type] (List Assumption) (Maybe Bool)) + (-> [Type Type] (List Assumption) (Maybe Bit)) (:: maybe.Monad map product.right (list.find (function (_ [[fe fa] status]) (and (type/= e fe) @@ -345,7 +345,7 @@ assumptions))) (def: (assume! ea status assumptions) - (-> [Type Type] Bool (List Assumption) (List Assumption)) + (-> [Type Type] Bit (List Assumption) (List Assumption)) (#.Cons [ea status] assumptions)) (def: (on id type then else) @@ -633,7 +633,7 @@ (def: #export (checks? expected actual) {#.doc "A simple type-checking function that just returns a yes/no answer."} - (-> Type Type Bool) + (-> Type Type Bit) (case (run fresh-context (check expected actual)) (#e.Error error) false diff --git a/stdlib/source/lux/macro.lux b/stdlib/source/lux/macro.lux index a39168fa7..d063f1ab2 100644 --- a/stdlib/source/lux/macro.lux +++ b/stdlib/source/lux/macro.lux @@ -98,7 +98,7 @@ (def: #export (assert message test) {#.doc "Fails with the given message if the test is false."} - (-> Text Bool (Meta Any)) + (-> Text Bit (Meta Any)) (function (_ compiler) (if test (#e.Success [compiler []]) @@ -171,7 +171,7 @@ _ #.None))] - [get-bool-ann #.Bool Bool] + [get-bit-ann #.Bit Bit] [get-int-ann #.Int Int] [get-frac-ann #.Frac Frac] [get-text-ann #.Text Text] @@ -189,13 +189,13 @@ (def: #export (flag-set? flag-name anns) {#.doc "Finds out whether an annotation-as-a-flag is set (has value 'true')."} - (-> Ident Code Bool) - (maybe.default false (get-bool-ann flag-name anns))) + (-> Ident Code Bit) + (maybe.default false (get-bit-ann flag-name anns))) (do-template [ ] [(def: #export {#.doc (code.text ($_ text/compose "Checks whether a definition is " "."))} - (-> Code Bool) + (-> Code Bit) (flag-set? (ident-for )))] [export? #.export? "exported"] @@ -207,7 +207,7 @@ ) (def: #export (aliased? annotations) - (-> Code Bool) + (-> Code Bit) (case (get-symbol-ann (ident-for #.alias) annotations) (#.Some _) true @@ -417,7 +417,7 @@ (fail "Macro expanded to more than 1 element.")))) (def: #export (module-exists? module) - (-> Text (Meta Bool)) + (-> Text (Meta Bit)) (function (_ compiler) (#e.Success [compiler (case (get module (get@ #.modules compiler)) (#.Some _) @@ -465,7 +465,7 @@ {#.doc "Looks-up the type of a local variable somewhere in the environment."} (-> Text (Meta Type)) (function (_ compiler) - (let [test (: (-> [Text [Type Any]] Bool) + (let [test (: (-> [Text [Type Any]] Bit) (|>> product.left (text/= name)))] (case (do maybe.Monad [scope (list.find (function (_ env) @@ -607,13 +607,13 @@ (wrap imports))) (def: #export (imported-by? import module) - (-> Text Text (Meta Bool)) + (-> Text Text (Meta Bit)) (do Monad [(^slots [#.imports]) (find-module module)] (wrap (list.any? (text/= import) imports)))) (def: #export (imported? import) - (-> Text (Meta Bool)) + (-> Text (Meta Bit)) (let [(^open) Monad] (|> current-module-name (map find-module) join @@ -697,7 +697,7 @@ (def: (foo bar baz) (-> Int Int Int) (i/+ bar baz))))} - (case (: (Maybe [Bool Code]) + (case (: (Maybe [Bit Code]) (case tokens (^ (list [_ (#.Tag ["" "omit"])] token)) diff --git a/stdlib/source/lux/macro/code.lux b/stdlib/source/lux/macro/code.lux index d8763c3e5..67be6ce56 100644 --- a/stdlib/source/lux/macro/code.lux +++ b/stdlib/source/lux/macro/code.lux @@ -1,17 +1,18 @@ (.module: [lux (#- nat int rev) - [control [equivalence (#+ Equivalence)]] + [control + [equivalence (#+ Equivalence)]] [data - bool + bit number [text (#+ Equivalence) ("text/" Monoid)] ident - [collection [list #* ("list/" Functor Fold)]] + [collection [list ("list/" Functor Fold)]] ]]) ## [Types] ## (type: (Code' w) -## (#.Bool Bool) +## (#.Bit Bit) ## (#.Nat Nat) ## (#.Int Int) ## (#.Frac Frac) @@ -34,7 +35,7 @@ (-> Code) [_cursor ( x)])] - [bool Bool #.Bool] + [bit Bit #.Bit] [nat Nat #.Nat] [int Int #.Int] [rev Rev #.Rev] @@ -63,7 +64,7 @@ (^template [ ] [[_ ( x')] [_ ( y')]] (:: = x' y')) - ([#.Bool Equivalence] + ([#.Bit Equivalence] [#.Nat Equivalence] [#.Int Equivalence] [#.Rev Equivalence] @@ -74,20 +75,13 @@ (^template [] [[_ ( xs')] [_ ( ys')]] - (and (:: Equivalence = (size xs') (size ys')) - (list/fold (function (_ [x' y'] old) - (and old (= x' y'))) - true - (zip2 xs' ys')))) + (:: (list.Equivalence =) = xs' ys')) ([#.Form] [#.Tuple]) [[_ (#.Record xs')] [_ (#.Record ys')]] - (and (:: Equivalence = (size xs') (size ys')) - (list/fold (function (_ [[xl' xr'] [yl' yr']] old) - (and old (= xl' yl') (= xr' yr'))) - true - (zip2 xs' ys'))) + (:: (list.Equivalence (equivalence.product = =)) + = xs' ys') _ false))) @@ -99,7 +93,7 @@ (^template [ ] [_ ( value)] (:: encode value)) - ([#.Bool Codec] + ([#.Bit Codec] [#.Nat Codec] [#.Int Codec] [#.Rev Codec] @@ -114,12 +108,19 @@ (^template [ ] [_ ( members)] - ($_ text/compose (|> members (list/map to-text) (interpose " ") (text.join-with "")) )) + ($_ text/compose (|> members (list/map to-text) (list.interpose " ") (text.join-with "")) )) ([#.Form "(" ")"] [#.Tuple "[" "]"]) [_ (#.Record pairs)] - ($_ text/compose "{" (|> pairs (list/map (function (_ [left right]) ($_ text/compose (to-text left) " " (to-text right)))) (interpose " ") (text.join-with "")) "}") + ($_ text/compose + "{" + (|> pairs + (list/map (function (_ [left right]) + ($_ text/compose (to-text left) " " (to-text right)))) + (list.interpose " ") + (text.join-with "")) + "}") )) (def: #export (replace original substitute ast) diff --git a/stdlib/source/lux/macro/poly.lux b/stdlib/source/lux/macro/poly.lux index 7a7375e12..7c86a952a 100644 --- a/stdlib/source/lux/macro/poly.lux +++ b/stdlib/source/lux/macro/poly.lux @@ -13,7 +13,7 @@ ["dict" dictionary (#+ Dictionary)]] [number ("nat/" Codec)] [product] - [bool] + [bit] [maybe] [ident ("ident/" Equivalence Codec)] ["e" error]] @@ -354,7 +354,7 @@ ((~' wrap) (.list (~ g!output)))))))))))) (def: (common-poly-name? poly-func) - (-> Text Bool) + (-> Text Bit) (text.contains? "?" poly-func)) (def: (derivation-name poly args) diff --git a/stdlib/source/lux/macro/poly/equivalence.lux b/stdlib/source/lux/macro/poly/equivalence.lux index 189179e13..66bc621ca 100644 --- a/stdlib/source/lux/macro/poly/equivalence.lux +++ b/stdlib/source/lux/macro/poly/equivalence.lux @@ -17,7 +17,7 @@ [tree [rose]]] [number ("nat/" Codec)] [product] - [bool] + [bit] [maybe]] [time ["du" duration] @@ -50,7 +50,7 @@ ))))] [(poly.exactly Any) (function ((~ g!_) (~ g!_) (~ g!_)) true)] - [(poly.similar Bool) bool.Equivalence] + [(poly.similar Bit) bit.Equivalence] [(poly.similar Nat) number.Equivalence] [(poly.similar Int) number.Equivalence] [(poly.similar Rev) number.Equivalence] diff --git a/stdlib/source/lux/macro/poly/json.lux b/stdlib/source/lux/macro/poly/json.lux index 0474c3d4b..1f5b4aab6 100644 --- a/stdlib/source/lux/macro/poly/json.lux +++ b/stdlib/source/lux/macro/poly/json.lux @@ -6,7 +6,7 @@ codec ["p" parser]] [data - [bool] + [bit] maybe ["e" error] [sum] @@ -91,7 +91,7 @@ ))))] [(poly.exactly Any) (function ((~ g!_) (~ (code.symbol ["" "0"]))) #//.Null)] - [(poly.similar Bool) (|>> #//.Boolean)] + [(poly.similar Bit) (|>> #//.Boolean)] [(poly.similar Nat) (:: (~! ..Codec) (~' encode))] [(poly.similar Int) (:: (~! ..Codec) (~' encode))] [(poly.similar Frac) (|>> #//.Number)] @@ -206,8 +206,8 @@ (wrap (` (: (~ (@JSON//decode inputT)) ))))] - [(poly.exactly Any) //.null] - [(poly.similar Bool) //.boolean] + [(poly.exactly Any) //.null] + [(poly.similar Bit) //.boolean] [(poly.similar Nat) (p.codec (~! ..Codec) //.any)] [(poly.similar Int) (p.codec (~! ..Codec) //.any)] [(poly.similar Frac) //.number] @@ -296,18 +296,18 @@ (syntax: #export (Codec inputT) {#.doc (doc "A macro for automatically producing JSON codecs." (type: Variant - (#Case0 Bool) + (#Case0 Bit) (#Case1 Text) (#Case2 Frac)) (type: Record - {#bool Bool + {#bit Bit #frac Frac #text Text #maybe (Maybe Frac) #list (List Frac) #variant Variant - #tuple [Bool Frac Text] + #tuple [Bit Frac Text] #dict (Dictionary Text Frac)}) (derived: (Codec Record)))} diff --git a/stdlib/source/lux/macro/syntax.lux b/stdlib/source/lux/macro/syntax.lux index 3b6623b3e..630dd5a0e 100644 --- a/stdlib/source/lux/macro/syntax.lux +++ b/stdlib/source/lux/macro/syntax.lux @@ -6,7 +6,7 @@ [equivalence (#+ Equivalence)] ["p" parser]] [data - [bool] + [bit] [number] [text ("text/" Monoid)] [ident] @@ -54,7 +54,7 @@ _ (#error.Error ($_ text/compose "Cannot parse " (remaining-inputs tokens))))))] - [ bool Bool #.Bool bool.Equivalence "bool"] + [ bit Bit #.Bit bit.Equivalence "bit"] [ nat Nat #.Nat number.Equivalence "nat"] [ int Int #.Int number.Equivalence "int"] [ rev Rev #.Rev number.Equivalence "rev"] @@ -66,7 +66,7 @@ (def: #export (this? ast) {#.doc "Asks if the given Code is the next input."} - (-> Code (Syntax Bool)) + (-> Code (Syntax Bit)) (function (_ tokens) (case tokens (#.Cons [token tokens']) @@ -152,7 +152,7 @@ (def: #export end? {#.doc "Checks whether there are no more inputs."} - (Syntax Bool) + (Syntax Bit) (function (_ tokens) (case tokens #.Nil (#error.Success [tokens true]) @@ -212,7 +212,7 @@ (with-brackets (spaced (list/map constructor-arg$ constructor-args))) (with-brackets (spaced (list/map (method-def$ id) methods))))))] (wrap (list (` ((~ (code.text def-code)))))))))} - (let [[exported? tokens] (: [Bool (List Code)] + (let [[exported? tokens] (: [Bit (List Code)] (case tokens (^ (list& [_ (#.Tag ["" "export"])] tokens')) [true tokens'] diff --git a/stdlib/source/lux/macro/syntax/common/reader.lux b/stdlib/source/lux/macro/syntax/common/reader.lux index 58a502c56..408edae91 100644 --- a/stdlib/source/lux/macro/syntax/common/reader.lux +++ b/stdlib/source/lux/macro/syntax/common/reader.lux @@ -14,7 +14,7 @@ ## Exports (def: #export export - (Syntax Bool) + (Syntax Bit) (p.either (p.after (s.this (' #export)) (parser/wrap true)) (parser/wrap false))) diff --git a/stdlib/source/lux/macro/syntax/common/writer.lux b/stdlib/source/lux/macro/syntax/common/writer.lux index d482bc2c3..7a7416894 100644 --- a/stdlib/source/lux/macro/syntax/common/writer.lux +++ b/stdlib/source/lux/macro/syntax/common/writer.lux @@ -8,7 +8,7 @@ [//]) (def: #export (export exported?) - (-> Bool (List Code)) + (-> Bit (List Code)) (if exported? (list (' #export)) (list))) diff --git a/stdlib/source/lux/math.lux b/stdlib/source/lux/math.lux index c04f31c73..d90db4a33 100644 --- a/stdlib/source/lux/math.lux +++ b/stdlib/source/lux/math.lux @@ -192,7 +192,7 @@ (<| p.rec (function (_ infix^)) ($_ p.alt ($_ p.either - (parser/map code.bool s.bool) + (parser/map code.bit s.bit) (parser/map code.nat s.nat) (parser/map code.int s.int) (parser/map code.rev s.rev) diff --git a/stdlib/source/lux/math/modular.lux b/stdlib/source/lux/math/modular.lux index cef3cbf6f..bb15adac1 100644 --- a/stdlib/source/lux/math/modular.lux +++ b/stdlib/source/lux/math/modular.lux @@ -48,7 +48,7 @@ " Sample: " (int/encode (to-int sample)) "\n")) (def: #export (congruent? modulus reference sample) - (All [m] (-> (Modulus m) Int Int Bool)) + (All [m] (-> (Modulus m) Int Int Bit)) (|> sample (i/- reference) (i/% (to-int modulus)) @@ -116,7 +116,7 @@ (do-template [ ] [(def: #export ( reference sample) - (All [m] (-> (Mod m) (Mod m) Bool)) + (All [m] (-> (Mod m) (Mod m) Bit)) (let [[reference _] (:representation reference) [sample _] (:representation sample)] ( reference sample)))] diff --git a/stdlib/source/lux/math/random.lux b/stdlib/source/lux/math/random.lux index 2ddb64f32..86c7d9efd 100644 --- a/stdlib/source/lux/math/random.lux +++ b/stdlib/source/lux/math/random.lux @@ -63,7 +63,7 @@ (def: #export (filter pred gen) {#.doc "Retries the generator until the output satisfies a predicate."} - (All [a] (-> (-> a Bool) (Random a) (Random a))) + (All [a] (-> (-> a Bit) (Random a) (Random a))) (do Monad [sample gen] (if (pred sample) @@ -82,8 +82,8 @@ #.None (refine refiner gen)))) -(def: #export bool - (Random Bool) +(def: #export bit + (Random Bit) (function (_ prng) (let [[prng output] (prng [])] [prng (|> output (i64.and +1) (n/= +1))]))) @@ -164,7 +164,7 @@ {#.doc "Heterogeneous alternative combinator."} (All [a b] (-> (Random a) (Random b) (Random (| a b)))) (do Monad - [? bool] + [? bit] (if ? (do @ [=left left] @@ -177,7 +177,7 @@ {#.doc "Homogeneous alternative combinator."} (All [a] (-> (Random a) (Random a) (Random a))) (do Monad - [? bool] + [? bit] (if ? left right))) @@ -192,7 +192,7 @@ (def: #export (maybe value-gen) (All [a] (-> (Random a) (Random (Maybe a)))) (do Monad - [some? bool] + [some? bit] (if some? (do @ [value value-gen] diff --git a/stdlib/source/lux/test.lux b/stdlib/source/lux/test.lux index 00cbcca91..d4fb7108f 100644 --- a/stdlib/source/lux/test.lux +++ b/stdlib/source/lux/test.lux @@ -49,7 +49,7 @@ (def: #export (assert message condition) {#.doc "Check that a condition is true, and fail with the given message otherwise."} - (-> Text Bool (Promise [Counters Text])) + (-> Text Bit (Promise [Counters Text])) (<| (:: promise.Monad wrap) (if condition [success (format "[Success] " message)] @@ -57,7 +57,7 @@ (def: #export (test message condition) {#.doc "Check that a condition is true, and fail with the given message otherwise."} - (-> Text Bool Test) + (-> Text Bit Test) (:: r.Monad wrap (assert message condition))) (def: (run' tests) @@ -83,7 +83,7 @@ (wrap (list/fold add-counters start test-runs)))) (def: failed? - (-> Counters Bool) + (-> Counters Bit) (|>> product.right (n/> +0))) (def: #export (seed value test) diff --git a/stdlib/source/lux/time/date.lux b/stdlib/source/lux/time/date.lux index 068936f47..e80db8bac 100644 --- a/stdlib/source/lux/time/date.lux +++ b/stdlib/source/lux/time/date.lux @@ -198,7 +198,7 @@ (get@ #day sample))))) (def: (date/< reference sample) - (-> Date Date Bool) + (-> Date Date Bit) (or (i/< (get@ #year reference) (get@ #year sample)) (:: Order < @@ -265,11 +265,11 @@ (row.update [+1] inc normal-months)) (def: (divisible? factor input) - (-> Int Int Bool) + (-> Int Int Bit) (|> input (i/% factor) (i/= 0))) (def: (leap-year? year) - (-> Int Bool) + (-> Int Bit) (and (divisible? 4 year) (or (not (divisible? 100 year)) (divisible? 400 year)))) diff --git a/stdlib/source/lux/time/duration.lux b/stdlib/source/lux/time/duration.lux index 92e35a7fb..b9300b7c3 100644 --- a/stdlib/source/lux/time/duration.lux +++ b/stdlib/source/lux/time/duration.lux @@ -61,7 +61,7 @@ (do-template [ ] [(def: #export ( duration) - (-> Duration Bool) + (-> Duration Bit) ( 0 (:representation duration)))] [positive? i/>] diff --git a/stdlib/source/lux/time/instant.lux b/stdlib/source/lux/time/instant.lux index ce97cecea..9002ff9ef 100644 --- a/stdlib/source/lux/time/instant.lux +++ b/stdlib/source/lux/time/instant.lux @@ -80,11 +80,11 @@ ## Codec::encode (def: (divisible? factor input) - (-> Int Int Bool) + (-> Int Int Bit) (|> input (i/% factor) (i/= 0))) (def: (leap-year? year) - (-> Int Bool) + (-> Int Bit) (and (divisible? 4 year) (or (not (divisible? 100 year)) (divisible? 400 year)))) diff --git a/stdlib/source/lux/type/implicit.lux b/stdlib/source/lux/type/implicit.lux index 8e1c92f84..b2c747028 100644 --- a/stdlib/source/lux/type/implicit.lux +++ b/stdlib/source/lux/type/implicit.lux @@ -9,7 +9,6 @@ [number] [collection [list ("list/" Monad Fold)] ["dict" dictionary (#+ Dictionary)]] - [bool] [product] [maybe]] [macro (#+ Monad) @@ -285,7 +284,7 @@ (do Monad [alts import-structs] (test alts))))) (def: (var? input) - (-> Code Bool) + (-> Code Bit) (case input [_ (#.Symbol _)] true diff --git a/stdlib/source/lux/type/object/interface.lux b/stdlib/source/lux/type/object/interface.lux index c90965c2d..42284b4b3 100644 --- a/stdlib/source/lux/type/object/interface.lux +++ b/stdlib/source/lux/type/object/interface.lux @@ -98,7 +98,7 @@ (~ g!method))))) (def: (definition export [interface parameters] g!self-object g!ext g!states (^open)) - (-> Bool Declaration Code Code (List Code) Method Code) + (-> Bit Declaration Code Code (List Code) Method Code) (let [g!method (code.local-symbol name) g!parameters (list/map code.local-symbol parameters) g!type-vars (list/map code.local-symbol type-vars) @@ -125,7 +125,7 @@ (def: no-parent Ident ["" ""]) (def: (no-parent? parent) - (-> Ident Bool) + (-> Ident Bit) (ident/= no-parent parent)) (def: (with-interface parent interface) @@ -247,7 +247,7 @@ ) (def: (getterN export interface g!parameters g!ext g!child ancestors) - (-> Bool Text (List Code) Code Code (List Ident) + (-> Bit Text (List Code) Code Code (List Ident) Code) (let [g!get (code.local-symbol (getN interface)) g!interface (code.local-symbol interface) @@ -266,7 +266,7 @@ (~ g!_state)))))) (def: (setterN export interface g!parameters g!ext g!child ancestors) - (-> Bool Text (List Code) Code Code (List Ident) + (-> Bit Text (List Code) Code Code (List Ident) Code) (let [g!set (code.local-symbol (setN interface)) g!interface (code.local-symbol interface) @@ -289,7 +289,7 @@ (~ g!build-up)))))) (def: (updaterN export interface g!parameters g!ext g!child ancestors) - (-> Bool Text (List Code) Code Code (List Ident) + (-> Bit Text (List Code) Code Code (List Ident) Code) (let [g!update (code.local-symbol (updateN interface)) g!interface (code.local-symbol interface) diff --git a/stdlib/source/lux/type/object/protocol.lux b/stdlib/source/lux/type/object/protocol.lux index 495aaebd4..ebbf9cc4b 100644 --- a/stdlib/source/lux/type/object/protocol.lux +++ b/stdlib/source/lux/type/object/protocol.lux @@ -78,7 +78,7 @@ (Method (~ inputC) (~ outputC) (~ g!return))))))) (def: (method|c export protocol method) - (-> Bool cs.Declaration Method-Syntax (Meta Code)) + (-> Bit cs.Declaration Method-Syntax (Meta Code)) (let [methodC (code.local-symbol (get@ #method-name method)) tagC (code.local-tag (get@ #method-name method)) protocolC (code.local-symbol (get@ #cs.declaration-name protocol)) @@ -110,7 +110,7 @@ (` ((~ tagC) ((~ protocolC) (~ g!return)))))) (def: (class|c export protocol class) - (-> Bool cs.Declaration Class-Syntax (Meta Code)) + (-> Bit cs.Declaration Class-Syntax (Meta Code)) (let [classC (code.local-symbol (get@ #class-name class)) tagC (code.local-tag (get@ #class-name class)) protocolC (code.local-symbol (get@ #cs.declaration-name protocol)) @@ -138,7 +138,7 @@ (class|w g!return))) (def: (super|c export protocol) - (-> Bool cs.Declaration (| Method-Syntax Class-Syntax) (Meta Code)) + (-> Bit cs.Declaration (| Method-Syntax Class-Syntax) (Meta Code)) (sum.either (method|c export protocol) (class|c export protocol))) diff --git a/stdlib/source/lux/world/file.lux b/stdlib/source/lux/world/file.lux index d62c77182..6630f8a60 100644 --- a/stdlib/source/lux/world/file.lux +++ b/stdlib/source/lux/world/file.lux @@ -52,14 +52,14 @@ [last-modified Instant]) (do-template [] - [(: (-> File (m Bool)) + [(: (-> File (m Bit)) )] [file?] [directory?] ) - (: (-> Permission File (m Bool)) + (: (-> Permission File (m Bit)) can?) (do-template [] @@ -240,7 +240,7 @@ })) (def: #export (exists? System file) - (All [m] (-> (System m) File (m Bool))) + (All [m] (-> (System m) File (m Bit))) (|> file (do> (:: System &monad) [(:: System file?)] diff --git a/stdlib/test/test/lux/concurrency/promise.lux b/stdlib/test/test/lux/concurrency/promise.lux index f0b0bb865..29bab782c 100644 --- a/stdlib/test/test/lux/concurrency/promise.lux +++ b/stdlib/test/test/lux/concurrency/promise.lux @@ -61,7 +61,7 @@ (test "Cannot re-resolve a resolved promise." (and (not (io.run (&.resolve false (&/wrap true)))) - (io.run (&.resolve true (: (&.Promise Bool) (&.promise #.None)))))) + (io.run (&.resolve true (: (&.Promise Bit) (&.promise #.None)))))) (wrap (do &.Monad [?none (&.time-out +100 (&.delay +200 true)) diff --git a/stdlib/test/test/lux/control/exception.lux b/stdlib/test/test/lux/control/exception.lux index 85b331620..9e11dbe0f 100644 --- a/stdlib/test/test/lux/control/exception.lux +++ b/stdlib/test/test/lux/control/exception.lux @@ -22,9 +22,9 @@ (context: "Exceptions" (<| (times +100) (do @ - [should-throw? r.bool - which? r.bool - should-catch? r.bool + [should-throw? r.bit + which? r.bit + should-catch? r.bit default-val r.nat some-val r.nat another-val r.nat diff --git a/stdlib/test/test/lux/control/parser.lux b/stdlib/test/test/lux/control/parser.lux index a8ec24446..6028eed1a 100644 --- a/stdlib/test/test/lux/control/parser.lux +++ b/stdlib/test/test/lux/control/parser.lux @@ -16,13 +16,13 @@ ## [Utils] (def: (should-fail input) - (All [a] (-> (Error a) Bool)) + (All [a] (-> (Error a) Bit)) (case input (#error.Error _) true _ false)) (def: (enforced? parser input) - (All [s] (-> (&.Parser s Any) s Bool)) + (All [s] (-> (&.Parser s Any) s Bit)) (case (&.run input parser) (#error.Success [_ []]) true @@ -31,7 +31,7 @@ false)) (def: (found? parser input) - (All [s] (-> (&.Parser s Bool) s Bool)) + (All [s] (-> (&.Parser s Bit) s Bit)) (case (&.run input parser) (#error.Success [_ true]) true @@ -40,7 +40,7 @@ false)) (def: (fails? input) - (All [a] (-> (Error a) Bool)) + (All [a] (-> (Error a) Bit)) (case input (#error.Error _) true @@ -60,9 +60,9 @@ (context: "Assertions" (test "Can make assertions while parsing." (and (match [] - (&.run (list (code.bool true) (code.int 123)) + (&.run (list (code.bit true) (code.int 123)) (&.assert "yolo" true))) - (fails? (&.run (list (code.bool true) (code.int 123)) + (fails? (&.run (list (code.bit true) (code.int 123)) (&.assert "yolo" false)))))) (context: "Combinators [Part 1]" @@ -105,14 +105,14 @@ (match -123 (&.run (list (code.int -123) (code.int 456) (code.int 789)) (&.either positive s.int))) - (fails? (&.run (list (code.bool true) (code.int 456) (code.int 789)) + (fails? (&.run (list (code.bit true) (code.int 456) (code.int 789)) (&.either positive s.int)))))) (test "Can create the opposite/negation of any parser." (and (fails? (&.run (list (code.int 123) (code.int 456) (code.int 789)) (&.not s.int))) (match [] - (&.run (list (code.bool true) (code.int 456) (code.int 789)) + (&.run (list (code.bit true) (code.int 456) (code.int 789)) (&.not s.int))))) )) diff --git a/stdlib/test/test/lux/control/region.lux b/stdlib/test/test/lux/control/region.lux index 606be66bf..544b42982 100644 --- a/stdlib/test/test/lux/control/region.lux +++ b/stdlib/test/test/lux/control/region.lux @@ -18,7 +18,7 @@ (do-template [ ] [(def: ( result) - (All [a] (-> (Error a) Bool)) + (All [a] (-> (Error a) Bit)) (case result (#e.Success _) (#e.Error _) ))] diff --git a/stdlib/test/test/lux/control/state.lux b/stdlib/test/test/lux/control/state.lux index 9f352df48..c39be3197 100644 --- a/stdlib/test/test/lux/control/state.lux +++ b/stdlib/test/test/lux/control/state.lux @@ -12,7 +12,7 @@ lux/test) (def: (with-conditions [state output] computation) - (-> [Nat Nat] (&.State Nat Nat) Bool) + (-> [Nat Nat] (&.State Nat Nat) Bit) (|> computation (&.run state) product.right diff --git a/stdlib/test/test/lux/data/bit.lux b/stdlib/test/test/lux/data/bit.lux new file mode 100644 index 000000000..f9ab9551f --- /dev/null +++ b/stdlib/test/test/lux/data/bit.lux @@ -0,0 +1,38 @@ +(.module: + [lux #* + [control + ["M" monad (#+ do Monad)]] + [io] + [data + bit] + [math + ["r" random]]] + lux/test) + +(context: "Bit operations." + (<| (times +100) + (do @ + [value r.bit] + (test "" (and (not (and value (not value))) + (or value (not value)) + + (not (:: Or@Monoid identity)) + (:: Or@Monoid compose value (not value)) + (:: And@Monoid identity) + (not (:: And@Monoid compose value (not value))) + + (:: Equivalence = value (not (not value))) + (not (:: Equivalence = value (not value))) + + (not (:: Equivalence = value ((complement id) value))) + (:: Equivalence = value ((complement not) value)) + + (case (|> value + (:: Codec encode) + (:: Codec decode)) + (#.Right dec-value) + (:: Equivalence = value dec-value) + + (#.Left _) + false) + ))))) diff --git a/stdlib/test/test/lux/data/bool.lux b/stdlib/test/test/lux/data/bool.lux deleted file mode 100644 index 0413c2632..000000000 --- a/stdlib/test/test/lux/data/bool.lux +++ /dev/null @@ -1,38 +0,0 @@ -(.module: - [lux #* - [control - ["M" monad (#+ do Monad)]] - [io] - [data - bool] - [math - ["r" random]]] - lux/test) - -(context: "Boolean operations." - (<| (times +100) - (do @ - [value r.bool] - (test "" (and (not (and value (not value))) - (or value (not value)) - - (not (:: Or@Monoid identity)) - (:: Or@Monoid compose value (not value)) - (:: And@Monoid identity) - (not (:: And@Monoid compose value (not value))) - - (:: Equivalence = value (not (not value))) - (not (:: Equivalence = value (not value))) - - (not (:: Equivalence = value ((complement id) value))) - (:: Equivalence = value ((complement not) value)) - - (case (|> value - (:: Codec encode) - (:: Codec decode)) - (#.Right dec-value) - (:: Equivalence = value dec-value) - - (#.Left _) - false) - ))))) diff --git a/stdlib/test/test/lux/data/collection/list.lux b/stdlib/test/test/lux/data/collection/list.lux index f7e73ef9b..0945a9abb 100644 --- a/stdlib/test/test/lux/data/collection/list.lux +++ b/stdlib/test/test/lux/data/collection/list.lux @@ -5,7 +5,7 @@ [monad (#+ do Monad)] pipe] [data [number] - [bool] + [bit] [product] [maybe] [collection @@ -48,7 +48,7 @@ (test "Filtering by a predicate and its complement should result in a number of elements equal to the original list." (and (n/= (&.size sample) (n/+ (&.size (&.filter n/even? sample)) - (&.size (&.filter (bool.complement n/even?) sample)))) + (&.size (&.filter (bit.complement n/even?) sample)))) (let [[plus minus] (&.partition n/even? sample)] (n/= (&.size sample) (n/+ (&.size plus) @@ -56,9 +56,9 @@ (test "If every element in a list satisfies a predicate, there can't be any that satisfy its complement." (if (&.every? n/even? sample) - (and (not (&.any? (bool.complement n/even?) sample)) - (&.empty? (&.filter (bool.complement n/even?) sample))) - (&.any? (bool.complement n/even?) sample))) + (and (not (&.any? (bit.complement n/even?) sample)) + (&.empty? (&.filter (bit.complement n/even?) sample))) + (&.any? (bit.complement n/even?) sample))) (test "Any element of the list can be considered its member." (let [elem (maybe.assume (&.nth idx sample))] @@ -196,11 +196,11 @@ (#.Some found) (and (n/even? found) (&.any? n/even? sample) - (not (&.every? (bool.complement n/even?) sample))) + (not (&.every? (bit.complement n/even?) sample))) #.None (and (not (&.any? n/even? sample)) - (&.every? (bool.complement n/even?) sample)))) + (&.every? (bit.complement n/even?) sample)))) (test "You can iteratively construct a list, generating values until you're done." (= (&.n/range +0 (dec size)) diff --git a/stdlib/test/test/lux/data/format/json.lux b/stdlib/test/test/lux/data/format/json.lux index e3b3c6f66..f648dce28 100644 --- a/stdlib/test/test/lux/data/format/json.lux +++ b/stdlib/test/test/lux/data/format/json.lux @@ -9,7 +9,7 @@ ["p" parser]] [data ["e" error] - [bool] + [bit] [maybe] [number] ["." text @@ -50,7 +50,7 @@ [size (:: @ map (n/% +2) r.nat)] ($_ r.alt (:: @ wrap []) - r.bool + r.bit (|> r.frac (:: @ map (f/* 1_000_000.0))) (r.unicode size) (r.row size gen-json) @@ -77,7 +77,7 @@ )))) (type: Variant - (#Case0 Bool) + (#Case0 Bit) (#Case1 Text) (#Case2 Frac)) @@ -86,14 +86,14 @@ (#Addition Frac Recursive)) (type: Record - {#bool Bool + {#bit Bit #frac Frac #text Text #maybe (Maybe Frac) #list (List Frac) #dict (d.Dictionary Text Frac) ## #variant Variant - ## #tuple [Bool Frac Text] + ## #tuple [Bit Frac Text] #recursive Recursive ## #instant ti.Instant #duration tdu.Duration @@ -118,14 +118,14 @@ (do r.Monad [size (:: @ map (n/% +2) r.nat)] ($_ r.seq - r.bool + r.bit r.frac (r.unicode size) (r.maybe r.frac) (r.list size r.frac) (r.dictionary text.Hash size (r.unicode size) r.frac) - ## ($_ r.alt r.bool (r.unicode size) r.frac) - ## ($_ r.seq r.bool r.frac (r.unicode size)) + ## ($_ r.alt r.bit (r.unicode size) r.frac) + ## ($_ r.seq r.bit r.frac (r.unicode size)) gen-recursive ## _instant.instant _duration.duration @@ -140,7 +140,7 @@ (let [variant/= (function (_ left right) (case [left right] [(#Case0 left') (#Case0 right')] - (:: bool.Equivalence = left' right') + (:: bit.Equivalence = left' right') [(#Case1 left') (#Case1 right')] (:: text.Equivalence = left' right') @@ -150,7 +150,7 @@ _ false))] - (and (:: bool.Equivalence = (get@ #bool recL) (get@ #bool recR)) + (and (:: bit.Equivalence = (get@ #bit recL) (get@ #bit recR)) (f/= (get@ #frac recL) (get@ #frac recR)) (:: text.Equivalence = (get@ #text recL) (get@ #text recR)) (:: (maybe.Equivalence number.Equivalence) = (get@ #maybe recL) (get@ #maybe recR)) @@ -159,7 +159,7 @@ ## (variant/= (get@ #variant recL) (get@ #variant recR)) ## (let [[tL0 tL1 tL2] (get@ #tuple recL) ## [tR0 tR1 tR2] (get@ #tuple recR)] - ## (and (:: bool.Equivalence = tL0 tR0) + ## (and (:: bit.Equivalence = tL0 tR0) ## (f/= tL1 tR1) ## (:: text.Equivalence = tL2 tR2))) (:: Equivalence = (get@ #recursive recL) (get@ #recursive recR)) diff --git a/stdlib/test/test/lux/data/number/complex.lux b/stdlib/test/test/lux/data/number/complex.lux index 03ec307ff..15d759ba7 100644 --- a/stdlib/test/test/lux/data/number/complex.lux +++ b/stdlib/test/test/lux/data/number/complex.lux @@ -19,7 +19,7 @@ (def: margin-of-error Frac 1.0e-9) (def: (within? margin standard value) - (-> Frac &.Complex &.Complex Bool) + (-> Frac &.Complex &.Complex Bit) (let [real-dist (frac/abs (f/- (get@ #&.real standard) (get@ #&.real value))) imgn-dist (frac/abs (f/- (get@ #&.imaginary standard) @@ -161,7 +161,7 @@ )))) (def: (trigonometric-symmetry forward backward angle) - (-> (-> &.Complex &.Complex) (-> &.Complex &.Complex) &.Complex Bool) + (-> (-> &.Complex &.Complex) (-> &.Complex &.Complex) &.Complex Bit) (let [normal (|> angle forward backward)] (|> normal forward backward (within? margin-of-error normal)))) diff --git a/stdlib/test/test/lux/data/number/i64.lux b/stdlib/test/test/lux/data/number/i64.lux index 1dd9dd314..52b80ea25 100644 --- a/stdlib/test/test/lux/data/number/i64.lux +++ b/stdlib/test/test/lux/data/number/i64.lux @@ -39,7 +39,7 @@ (n/= &.width (n/+ (&.count pattern) (&.count (&.not pattern))))) - (test "Can do simple binary boolean logic." + (test "Can do simple binary logic." (and (n/= +0 (&.and pattern (&.not pattern))) diff --git a/stdlib/test/test/lux/data/text/lexer.lux b/stdlib/test/test/lux/data/text/lexer.lux index 25abe3ae4..b02082357 100644 --- a/stdlib/test/test/lux/data/text/lexer.lux +++ b/stdlib/test/test/lux/data/text/lexer.lux @@ -18,13 +18,13 @@ ## [Utils] (def: (should-fail input) - (All [a] (-> (E.Error a) Bool)) + (All [a] (-> (E.Error a) Bit)) (case input (#.Left _) true _ false)) (def: (should-passT test input) - (-> Text (E.Error Text) Bool) + (-> Text (E.Error Text) Bit) (case input (#.Right output) (text/= test output) @@ -33,7 +33,7 @@ false)) (def: (should-passL test input) - (-> (List Text) (E.Error (List Text)) Bool) + (-> (List Text) (E.Error (List Text)) Bit) (let [(^open "list/") (list.Equivalence text.Equivalence)] (case input (#.Right output) @@ -43,7 +43,7 @@ false))) (def: (should-passE test input) - (-> (Either Text Text) (E.Error (Either Text Text)) Bool) + (-> (Either Text Text) (E.Error (Either Text Text)) Bit) (case input (#.Right output) (case [test output] diff --git a/stdlib/test/test/lux/data/text/regex.lux b/stdlib/test/test/lux/data/text/regex.lux index 16970af9c..ff09a55db 100644 --- a/stdlib/test/test/lux/data/text/regex.lux +++ b/stdlib/test/test/lux/data/text/regex.lux @@ -20,7 +20,7 @@ ## [Utils] (def: (should-pass regex input) - (-> (lexer.Lexer Text) Text Bool) + (-> (lexer.Lexer Text) Text Bit) (|> (lexer.run input regex) (case> (#.Right parsed) (text/= parsed input) @@ -29,7 +29,7 @@ false))) (def: (should-passT test regex input) - (-> Text (lexer.Lexer Text) Text Bool) + (-> Text (lexer.Lexer Text) Text Bit) (|> (lexer.run input regex) (case> (#.Right parsed) (text/= test parsed) @@ -38,7 +38,7 @@ false))) (def: (should-fail regex input) - (All [a] (-> (lexer.Lexer a) Text Bool)) + (All [a] (-> (lexer.Lexer a) Text Bit)) (|> (lexer.run input regex) (case> (#.Left _) true _ false))) diff --git a/stdlib/test/test/lux/language/compiler/analysis/case.lux b/stdlib/test/test/lux/language/compiler/analysis/case.lux index 4e01ae3bd..14b762271 100644 --- a/stdlib/test/test/lux/language/compiler/analysis/case.lux +++ b/stdlib/test/test/lux/language/compiler/analysis/case.lux @@ -44,9 +44,9 @@ (wrap (#.Cons head tail+))))) (def: #export (exhaustive-branches allow-literals? variantTC inputC) - (-> Bool (List [Code Code]) Code (r.Random (List Code))) + (-> Bit (List [Code Code]) Code (r.Random (List Code))) (case inputC - [_ (#.Bool _)] + [_ (#.Bit _)] (random/wrap (list (' true) (' false))) (^template [ ] diff --git a/stdlib/test/test/lux/language/compiler/analysis/function.lux b/stdlib/test/test/lux/language/compiler/analysis/function.lux index 1edbfd949..32ef59e3f 100644 --- a/stdlib/test/test/lux/language/compiler/analysis/function.lux +++ b/stdlib/test/test/lux/language/compiler/analysis/function.lux @@ -35,7 +35,7 @@ (def: analyse (expression.analyser (:coerce language.Eval []))) (def: (check-apply expectedT num-args analysis) - (-> Type Nat (Operation Analysis) Bool) + (-> Type Nat (Operation Analysis) Bit) (|> analysis (typeA.with-type expectedT) (compiler.run [analysisE.bundle (init.compiler [])]) diff --git a/stdlib/test/test/lux/language/compiler/analysis/primitive.lux b/stdlib/test/test/lux/language/compiler/analysis/primitive.lux index 8cd764b00..fadde9bb0 100644 --- a/stdlib/test/test/lux/language/compiler/analysis/primitive.lux +++ b/stdlib/test/test/lux/language/compiler/analysis/primitive.lux @@ -36,7 +36,7 @@ [(r.seq (random/wrap ) (random/map ))] [Any code.tuple (r.list +0 ..unit)] - [Bool code.bool r.bool] + [Bit code.bit r.bit] [Nat code.nat r.nat] [Int code.int r.int] [Rev code.rev r.rev] @@ -83,7 +83,7 @@ _ false))))] - ["bool" Bool #analysis.Bool r.bool code.bool] + ["bit" Bit #analysis.Bit r.bit code.bit] ["nat" Nat #analysis.Nat r.nat code.nat] ["int" Int #analysis.Int r.int code.int] ["rev" Rev #analysis.Rev r.rev code.rev] diff --git a/stdlib/test/test/lux/language/compiler/analysis/procedure/common.lux b/stdlib/test/test/lux/language/compiler/analysis/procedure/common.lux index e3b8cc9b5..7ea4a23bd 100644 --- a/stdlib/test/test/lux/language/compiler/analysis/procedure/common.lux +++ b/stdlib/test/test/lux/language/compiler/analysis/procedure/common.lux @@ -30,7 +30,7 @@ (do-template [ ] [(def: ( procedure params output-type) - (-> Text (List Code) Type Bool) + (-> Text (List Code) Type Bit) (|> (scope.with-scope "" (typeA.with-type output-type (_primitive.analyse (` ((~ (code.text procedure)) (~+ params)))))) @@ -53,9 +53,9 @@ (r.filter (|>> product.left (type/= primT) not)))] ($_ seq (test "Can test for reference equality." - (check-success+ "lux is" (list primC primC) Bool)) + (check-success+ "lux is" (list primC primC) Bit)) (test "Reference equality must be done with elements of the same type." - (check-failure+ "lux is" (list primC antiC) Bool)) + (check-failure+ "lux is" (list primC antiC) Bit)) (test "Can 'try' risky IO computations." (check-success+ "lux try" (list (` ([(~' _) (~' _)] (~ primC)))) @@ -100,9 +100,9 @@ (test "Can calculate remainder of integers." (check-success+ "lux int %" (list subjectC paramC) Int)) (test "Can test equivalence of integers." - (check-success+ "lux int =" (list subjectC paramC) Bool)) + (check-success+ "lux int =" (list subjectC paramC) Bit)) (test "Can compare integers." - (check-success+ "lux int <" (list subjectC paramC) Bool)) + (check-success+ "lux int <" (list subjectC paramC) Bit)) (test "Can convert integer to fraction." (check-success+ "lux int to-frac" (list subjectC) Frac)) (test "Can convert integer to text." @@ -127,9 +127,9 @@ (test "Can calculate remainder of frac numbers." (check-success+ "lux frac %" (list subjectC paramC) Frac)) (test "Can test equivalence of frac numbers." - (check-success+ "lux frac =" (list subjectC paramC) Bool)) + (check-success+ "lux frac =" (list subjectC paramC) Bit)) (test "Can compare frac numbers." - (check-success+ "lux frac <" (list subjectC paramC) Bool)) + (check-success+ "lux frac <" (list subjectC paramC) Bit)) (test "Can obtain minimum frac number." (check-success+ "lux frac min" (list) Frac)) (test "Can obtain maximum frac number." @@ -154,9 +154,9 @@ toC (|> r.nat (:: @ map code.nat))] ($_ seq (test "Can test text equivalence." - (check-success+ "lux text =" (list subjectC paramC) Bool)) + (check-success+ "lux text =" (list subjectC paramC) Bit)) (test "Compare texts in lexicographical order." - (check-success+ "lux text <" (list subjectC paramC) Bool)) + (check-success+ "lux text <" (list subjectC paramC) Bit)) (test "Can concatenate one text to another." (check-success+ "lux text concat" (list subjectC paramC) Text)) (test "Can find the index of a piece of text inside a larger one that (may) contain it." @@ -262,7 +262,7 @@ (test "Can swap the value of an atomic reference." (|> (scope.with-scope "" (scope.with-local [var-name atomT] - (typeA.with-type Bool + (typeA.with-type Bit (_primitive.analyse (` ("lux atom compare-and-swap" (~ (code.symbol ["" var-name])) (~ elemC) diff --git a/stdlib/test/test/lux/language/compiler/analysis/reference.lux b/stdlib/test/test/lux/language/compiler/analysis/reference.lux index 00ab606a3..d68e2e8f4 100644 --- a/stdlib/test/test/lux/language/compiler/analysis/reference.lux +++ b/stdlib/test/test/lux/language/compiler/analysis/reference.lux @@ -31,7 +31,7 @@ (def: analyse (expression.analyser (:coerce language.Eval []))) -(type: Check (-> (e.Error Any) Bool)) +(type: Check (-> (e.Error Any) Bit)) (do-template [ ] [(def: @@ -47,7 +47,7 @@ ) (def: (reach-test var-name [export? def-module] [import? dependent-module] check!) - (-> Text [Bool Text] [Bool Text] Check Bool) + (-> Text [Bit Text] [Bit Text] Check Bit) (|> (do compiler.Monad [_ (module.with-module +0 def-module (module.define var-name [Any diff --git a/stdlib/test/test/lux/language/compiler/analysis/structure.lux b/stdlib/test/test/lux/language/compiler/analysis/structure.lux index 664e6e29f..8d8ce4cd0 100644 --- a/stdlib/test/test/lux/language/compiler/analysis/structure.lux +++ b/stdlib/test/test/lux/language/compiler/analysis/structure.lux @@ -4,7 +4,7 @@ [monad (#+ do)] pipe] [data - [bool ("bool/" Equivalence)] + [bit ("bit/" Equivalence)] ["e" error] [product] [maybe] @@ -36,7 +36,7 @@ (do-template [ ] [(def: #export - (All [a] (-> (Operation a) Bool)) + (All [a] (-> (Operation a) Bit)) (|>> (compiler.run [analysisE.bundle (init.compiler [])]) (case> (#e.Success _) @@ -49,16 +49,16 @@ ) (def: (check-sum' size tag variant) - (-> Nat Tag (Variant Analysis) Bool) + (-> Nat Tag (Variant Analysis) Bit) (let [variant-tag (if (get@ #analysis.right? variant) (inc (get@ #analysis.lefts variant)) (get@ #analysis.lefts variant))] (|> size dec (n/= tag) - (bool/= (get@ #analysis.right? variant)) + (bit/= (get@ #analysis.right? variant)) (and (n/= tag variant-tag))))) (def: (check-sum type size tag analysis) - (-> Type Nat Tag (Operation Analysis) Bool) + (-> Type Nat Tag (Operation Analysis) Bit) (|> analysis (typeA.with-type type) (compiler.run [analysisE.bundle (init.compiler [])]) @@ -77,7 +77,7 @@ (module.with-module +0 module))) (def: (check-variant module tags type size tag analysis) - (-> Text (List module.Tag) Type Nat Tag (Operation Analysis) Bool) + (-> Text (List module.Tag) Type Nat Tag (Operation Analysis) Bit) (|> analysis (tagged module tags type) (typeA.with-type type) @@ -91,11 +91,11 @@ false))) (def: (right-size? size) - (-> Nat (-> Analysis Bool)) + (-> Nat (-> Analysis Bit)) (|>> analysis.tuple list.size (n/= size))) (def: (check-record-inference module tags type size analysis) - (-> Text (List module.Tag) Type Nat (Operation [Type Analysis]) Bool) + (-> Text (List module.Tag) Type Nat (Operation [Type Analysis]) Bit) (|> analysis (tagged module tags type) (compiler.run [analysisE.bundle (init.compiler [])]) diff --git a/stdlib/test/test/lux/language/compiler/synthesis/case.lux b/stdlib/test/test/lux/language/compiler/synthesis/case.lux index 264bc0967..ff84207a1 100644 --- a/stdlib/test/test/lux/language/compiler/synthesis/case.lux +++ b/stdlib/test/test/lux/language/compiler/synthesis/case.lux @@ -60,15 +60,15 @@ (context: "If expressions." (<| (times +100) (do @ - [then|else r.bool + [then|else r.bit inputA //primitive.primitive thenA //primitive.primitive elseA //primitive.primitive #let [thenB (: Branch - [(#analysisL.Simple (#analysisL.Bool true)) + [(#analysisL.Simple (#analysisL.Bit true)) thenA]) elseB (: Branch - [(#analysisL.Simple (#analysisL.Bool false)) + [(#analysisL.Simple (#analysisL.Bit false)) elseA]) ifA (if then|else (analysisL.control/case [inputA [thenB (list elseB)]]) diff --git a/stdlib/test/test/lux/language/compiler/synthesis/function.lux b/stdlib/test/test/lux/language/compiler/synthesis/function.lux index 51b2a2e17..0116033bd 100644 --- a/stdlib/test/test/lux/language/compiler/synthesis/function.lux +++ b/stdlib/test/test/lux/language/compiler/synthesis/function.lux @@ -30,7 +30,7 @@ (r.rec (function (_ constant-function) (do r.Monad - [function? r.bool] + [function? r.bit] (if function? (do @ [[arity bodyA predictionA] constant-function] @@ -62,7 +62,7 @@ (dict.new number.Hash)) (list.enumerate current-env))] (do @ - [nest? r.bool] + [nest? r.bit] (if nest? (do @ [num-picks (:: @ map (n/max +1) (pick (inc current-env/size))) @@ -91,7 +91,7 @@ nest? true] (if nest? (do r.Monad - [nest?' r.bool + [nest?' r.bit [arity' bodyA predictionA] (recur (inc arity) nest?')] (wrap [arity' (#analysisL.Function (list) bodyA) diff --git a/stdlib/test/test/lux/language/compiler/synthesis/primitive.lux b/stdlib/test/test/lux/language/compiler/synthesis/primitive.lux index 3bea7682d..c804b94ff 100644 --- a/stdlib/test/test/lux/language/compiler/synthesis/primitive.lux +++ b/stdlib/test/test/lux/language/compiler/synthesis/primitive.lux @@ -24,7 +24,7 @@ [primitive (: (r.Random analysisL.Primitive) ($_ r.alt (wrap []) - r.bool + r.bit r.nat r.int r.rev @@ -33,14 +33,14 @@ (wrap (#analysisL.Primitive primitive)))) (def: #export (corresponds? analysis synthesis) - (-> Analysis Synthesis Bool) + (-> Analysis Synthesis Bit) (case [synthesis analysis] [(#//.Primitive (#//.Text valueS)) (#analysisL.Primitive (#analysisL.Unit valueA))] (is? valueS (:coerce Text valueA)) - [(#//.Primitive (#//.Bool valueS)) - (#analysisL.Primitive (#analysisL.Bool valueA))] + [(#//.Primitive (#//.Bit valueS)) + (#analysisL.Primitive (#analysisL.Bit valueA))] (is? valueS valueA) [(#//.Primitive (#//.I64 valueS)) @@ -69,7 +69,7 @@ (context: "Primitives." (<| (times +100) (do @ - [%bool% r.bool + [%bit% r.bit %nat% r.nat %int% r.int %rev% r.rev @@ -88,7 +88,7 @@ false)))] ["unit" #analysisL.Unit #//.Text //.unit] - ["bool" #analysisL.Bool #//.Bool %bool%] + ["bit" #analysisL.Bit #//.Bit %bit%] ["nat" #analysisL.Nat #//.I64 (.i64 %nat%)] ["int" #analysisL.Int #//.I64 (.i64 %int%)] ["rev" #analysisL.Rev #//.I64 (.i64 %rev%)] diff --git a/stdlib/test/test/lux/language/compiler/synthesis/structure.lux b/stdlib/test/test/lux/language/compiler/synthesis/structure.lux index 0b9f705ff..db56757d1 100644 --- a/stdlib/test/test/lux/language/compiler/synthesis/structure.lux +++ b/stdlib/test/test/lux/language/compiler/synthesis/structure.lux @@ -5,7 +5,7 @@ [monad (#+ do)] pipe] [data - [bool ("bool/" Equivalence)] + [bit ("bit/" Equivalence)] [product] [error] [collection @@ -35,7 +35,7 @@ (case> (#error.Success (#//.Structure (#//.Variant [leftsS right?S valueS]))) (let [tagS (if right?S (inc leftsS) leftsS)] (and (n/= tagA tagS) - (|> tagS (n/= (dec size)) (bool/= right?S)) + (|> tagS (n/= (dec size)) (bit/= right?S)) (//primitive.corresponds? memberA valueS))) _ diff --git a/stdlib/test/test/lux/language/syntax.lux b/stdlib/test/test/lux/language/syntax.lux index 22420e3eb..8c93867aa 100644 --- a/stdlib/test/test/lux/language/syntax.lux +++ b/stdlib/test/test/lux/language/syntax.lux @@ -47,7 +47,7 @@ (r.Random Code) (let [numeric^ (: (r.Random Code) ($_ r.either - (|> r.bool (r/map code.bool)) + (|> r.bit (r/map code.bit)) (|> r.nat (r/map code.nat)) (|> r.int (r/map code.int)) (|> r.rev (r/map code.rev)) @@ -116,7 +116,7 @@ (do @ [numerator (|> r.nat (:: @ map (|>> (n/% +100) .int int-to-frac))) denominator (|> r.nat (:: @ map (|>> (n/% +100) (n/max +1) .int int-to-frac))) - signed? r.bool + signed? r.bit #let [expected (|> numerator (f// denominator) (f/* (if signed? -1.0 1.0)))]] (test "Can parse frac ratio syntax." (case (&.read "" (dict.new text.Hash) diff --git a/stdlib/test/test/lux/language/type.lux b/stdlib/test/test/lux/language/type.lux index 7be06000b..5f2cff09b 100644 --- a/stdlib/test/test/lux/language/type.lux +++ b/stdlib/test/test/lux/language/type.lux @@ -57,14 +57,14 @@ (test "Can apply quantified types (universal and existential quantification)." (and (maybe.default false (do maybe.Monad - [partial (&.apply (list Bool) Ann) + [partial (&.apply (list Bit) Ann) full (&.apply (list Int) partial)] - (wrap (:: &.Equivalence = full (#.Product Bool Int))))) - (|> (&.apply (list Bool) Text) + (wrap (:: &.Equivalence = full (#.Product Bit Int))))) + (|> (&.apply (list Bit) Text) (case> #.None true _ false))))) (context: "Naming" - (let [base (#.Named ["" "a"] (#.Product Bool Int)) + (let [base (#.Named ["" "a"] (#.Product Bit Int)) aliased (#.Named ["" "c"] (#.Named ["" "b"] base))] diff --git a/stdlib/test/test/lux/language/type/check.lux b/stdlib/test/test/lux/language/type/check.lux index 8fe7f2bf6..c2db4533c 100644 --- a/stdlib/test/test/lux/language/type/check.lux +++ b/stdlib/test/test/lux/language/type/check.lux @@ -50,7 +50,7 @@ ))))) (def: (valid-type? type) - (-> Type Bool) + (-> Type Bit) (case type (#.Primitive name params) (list.every? valid-type? params) @@ -70,7 +70,7 @@ false)) (def: (type-checks? input) - (-> (@.Check []) Bool) + (-> (@.Check []) Bit) (case (@.run @.fresh-context input) (#.Right []) true @@ -177,20 +177,20 @@ (test "Cannot rebind already bound type-vars." (not (type-checks? (do @.Monad [[id var] @.var - _ (@.check var .Bool)] + _ (@.check var .Bit)] (@.check var .Nat))))) (test "If the type bound to a var is a super-type to another, then the var is also a super-type." (type-checks? (do @.Monad [[id var] @.var _ (@.check var Any)] - (@.check var .Bool)))) + (@.check var .Bit)))) (test "If the type bound to a var is a sub-type of another, then the var is also a sub-type." (type-checks? (do @.Monad [[id var] @.var _ (@.check var Nothing)] - (@.check .Bool var)))) + (@.check .Bit var)))) )) (def: (build-ring num-connections) diff --git a/stdlib/test/test/lux/macro/code.lux b/stdlib/test/test/lux/macro/code.lux index 6c5a28265..0dfcd8fa0 100644 --- a/stdlib/test/test/lux/macro/code.lux +++ b/stdlib/test/test/lux/macro/code.lux @@ -18,17 +18,17 @@ (and (text/= (&.to-text )) (:: &.Equivalence = )))] - [(&.bool true) "true"] - [(&.bool false) "false"] - [(&.int 123) "123"] - [(&.frac 123.0) "123.0"] - [(&.text "\n") "\"\\n\""] - [(&.tag ["yolo" "lol"]) "#yolo.lol"] - [(&.symbol ["yolo" "lol"]) "yolo.lol"] - [(&.form (list (&.bool true) (&.int 123))) "(true 123)"] - [(&.tuple (list (&.bool true) (&.int 123))) "[true 123]"] - [(&.record (list [(&.bool true) (&.int 123)])) "{true 123}"] - [(&.local-tag "lol") "#lol"] - [(&.local-symbol "lol") "lol"] + [(&.bit true) "true"] + [(&.bit false) "false"] + [(&.int 123) "123"] + [(&.frac 123.0) "123.0"] + [(&.text "\n") "\"\\n\""] + [(&.tag ["yolo" "lol"]) "#yolo.lol"] + [(&.symbol ["yolo" "lol"]) "yolo.lol"] + [(&.form (list (&.bit true) (&.int 123))) "(true 123)"] + [(&.tuple (list (&.bit true) (&.int 123))) "[true 123]"] + [(&.record (list [(&.bit true) (&.int 123)])) "{true 123}"] + [(&.local-tag "lol") "#lol"] + [(&.local-symbol "lol") "lol"] )] ($_ seq ))) diff --git a/stdlib/test/test/lux/macro/poly/equivalence.lux b/stdlib/test/test/lux/macro/poly/equivalence.lux index 3ae57cd40..d6b48428a 100644 --- a/stdlib/test/test/lux/macro/poly/equivalence.lux +++ b/stdlib/test/test/lux/macro/poly/equivalence.lux @@ -5,7 +5,7 @@ [monad (#+ do Monad)] [equivalence (#+ Equivalence)]] [data - [bool] + [bit] [maybe] [number ("int/" Number)] ["." text @@ -20,7 +20,7 @@ ## [Utils] (type: Variant - (#Case0 Bool) + (#Case0 Bit) (#Case1 Int) (#Case2 Frac)) @@ -29,7 +29,7 @@ (#Addition Frac Recursive)) (type: Record - {#bool Bool + {#bit Bit #int Int #frac Frac #text Text @@ -51,13 +51,13 @@ [size (:: @ map (n/% +2) r.nat) #let [gen-int (|> r.int (:: @ map (|>> int/abs (i/% 1_000_000))))]] ($_ r.seq - r.bool + r.bit gen-int r.frac (r.unicode size) (r.maybe gen-int) (r.list size gen-int) - ($_ r.alt r.bool gen-int r.frac) + ($_ r.alt r.bit gen-int r.frac) ($_ r.seq gen-int r.frac (r.unicode size)) gen-recursive))) diff --git a/stdlib/test/test/lux/macro/syntax.lux b/stdlib/test/test/lux/macro/syntax.lux index 8d2b5ff8c..35e25734f 100644 --- a/stdlib/test/test/lux/macro/syntax.lux +++ b/stdlib/test/test/lux/macro/syntax.lux @@ -6,7 +6,7 @@ [equivalence (#+ Equivalence)] ["p" parser]] [data - [bool] + [bit] [ident] ["e" error] [number] @@ -21,7 +21,7 @@ ## [Utils] (def: (enforced? parser input) - (-> (Syntax []) (List Code) Bool) + (-> (Syntax []) (List Code) Bit) (case (p.run input parser) (#.Right [_ []]) true @@ -30,7 +30,7 @@ false)) (def: (found? parser input) - (-> (Syntax Bool) (List Code) Bool) + (-> (Syntax Bit) (List Code) Bit) (case (p.run input parser) (#.Right [_ true]) true @@ -39,7 +39,7 @@ false)) (def: (equals? Equivalence reference parser input) - (All [a] (-> (Equivalence a) a (Syntax a) (List Code) Bool)) + (All [a] (-> (Equivalence a) a (Syntax a) (List Code) Bit)) (case (p.run input parser) (#.Right [_ output]) (:: Equivalence = reference output) @@ -48,7 +48,7 @@ false)) (def: (fails? input) - (All [a] (-> (e.Error a) Bool)) + (All [a] (-> (e.Error a) Bit)) (case input (#.Left _) true @@ -73,7 +73,7 @@ (found? (s.this? ( )) (list ( ))) (enforced? (s.this ( )) (list ( )))))] - ["Can parse Bool syntax." true code.bool bool.Equivalence s.bool] + ["Can parse Bit syntax." true code.bit bit.Equivalence s.bit] ["Can parse Nat syntax." +123 code.nat number.Equivalence s.nat] ["Can parse Int syntax." 123 code.int number.Equivalence s.int] ["Can parse Rev syntax." .123 code.rev number.Equivalence s.rev] @@ -105,21 +105,21 @@ [ (do-template [ ] [(test (format "Can parse " " syntax.") (and (match [true 123] - (p.run (list ( (list (code.bool true) (code.int 123)))) - ( (p.seq s.bool s.int)))) + (p.run (list ( (list (code.bit true) (code.int 123)))) + ( (p.seq s.bit s.int)))) (match true - (p.run (list ( (list (code.bool true)))) - ( s.bool))) - (fails? (p.run (list ( (list (code.bool true) (code.int 123)))) - ( s.bool))) + (p.run (list ( (list (code.bit true)))) + ( s.bit))) + (fails? (p.run (list ( (list (code.bit true) (code.int 123)))) + ( s.bit))) (match (#.Left true) - (p.run (list ( (list (code.bool true)))) - ( (p.alt s.bool s.int)))) + (p.run (list ( (list (code.bit true)))) + ( (p.alt s.bit s.int)))) (match (#.Right 123) (p.run (list ( (list (code.int 123)))) - ( (p.alt s.bool s.int)))) + ( (p.alt s.bit s.int)))) (fails? (p.run (list ( (list (code.frac 123.0)))) - ( (p.alt s.bool s.int))))))] + ( (p.alt s.bit s.int))))))] ["form" s.form code.form] ["tuple" s.tuple code.tuple])] @@ -128,15 +128,15 @@ (test "Can parse record syntax." (match [true 123] - (p.run (list (code.record (list [(code.bool true) (code.int 123)]))) - (s.record (p.seq s.bool s.int))))) + (p.run (list (code.record (list [(code.bit true) (code.int 123)]))) + (s.record (p.seq s.bit s.int))))) ))) (context: "Combinators" ($_ seq (test "Can parse any Code." - (match [_ (#.Bool true)] - (p.run (list (code.bool true) (code.int 123)) + (match [_ (#.Bit true)] + (p.run (list (code.bit true) (code.int 123)) s.any))) (test "Can check whether the end has been reached." @@ -144,13 +144,13 @@ (p.run (list) s.end?)) (match false - (p.run (list (code.bool true)) + (p.run (list (code.bit true)) s.end?)))) (test "Can ensure the end has been reached." (and (match [] (p.run (list) s.end!)) - (fails? (p.run (list (code.bool true)) + (fails? (p.run (list (code.bit true)) s.end!)))) )) diff --git a/stdlib/test/test/lux/math.lux b/stdlib/test/test/lux/math.lux index ab12c4894..920b0c951 100644 --- a/stdlib/test/test/lux/math.lux +++ b/stdlib/test/test/lux/math.lux @@ -4,21 +4,21 @@ [control [monad (#+ do Monad)]] [data - [bool ("bool/" Equivalence)] + [bit ("bit/" Equivalence)] [number ("frac/" Number)]] ["&" math ["r" random]]] lux/test) (def: (within? margin-of-error standard value) - (-> Frac Frac Frac Bool) + (-> Frac Frac Frac Bit) (f/< margin-of-error (frac/abs (f/- standard value)))) (def: margin Frac 0.0000001) (def: (trigonometric-symmetry forward backward angle) - (-> (-> Frac Frac) (-> Frac Frac) Frac Bool) + (-> (-> Frac Frac) (-> Frac Frac) Frac Bit) (let [normal (|> angle forward backward)] (|> normal forward backward (within? margin normal)))) @@ -114,12 +114,12 @@ (&.infix [(n/* +3 +9) &.n/gcd +450]))) (test "Can use non-numerical functions/macros as operators." - (bool/= (and (n/< y x) (n/< z y)) - (&.infix [[x n/< y] and [y n/< z]]))) - - (test "Can combine boolean operations in special ways via special keywords." - (and (bool/= (and (n/< y x) (n/< z y)) - (&.infix [#and x n/< y n/< z])) - (bool/= (and (n/< y x) (n/> z y)) - (&.infix [#and x n/< y n/> z])))) + (bit/= (and (n/< y x) (n/< z y)) + (&.infix [[x n/< y] and [y n/< z]]))) + + (test "Can combine bit operations in special ways via special keywords." + (and (bit/= (and (n/< y x) (n/< z y)) + (&.infix [#and x n/< y n/< z])) + (bit/= (and (n/< y x) (n/> z y)) + (&.infix [#and x n/< y n/> z])))) )))) diff --git a/stdlib/test/test/lux/math/logic/fuzzy.lux b/stdlib/test/test/lux/math/logic/fuzzy.lux index 53e183b35..104c0cf76 100644 --- a/stdlib/test/test/lux/math/logic/fuzzy.lux +++ b/stdlib/test/test/lux/math/logic/fuzzy.lux @@ -4,7 +4,7 @@ [control [monad (#+ do Monad)]] [data - [bool ("bool/" Equivalence)] + [bit ("bit/" Equivalence)] [number] [text format] @@ -46,14 +46,14 @@ (r/= ~false (&.membership top triangle)))) (test "Values within range, will have membership > 0." - (bool/= (r/> ~false (&.membership sample triangle)) - (and ( bottom sample) - ( top sample)))) + (bit/= (r/> ~false (&.membership sample triangle)) + (and ( bottom sample) + ( top sample)))) (test "Values outside of range, will have membership = 0." - (bool/= (r/= ~false (&.membership sample triangle)) - (or ( bottom sample) - ( top sample)))) + (bit/= (r/= ~false (&.membership sample triangle)) + (or ( bottom sample) + ( top sample)))) ))))] ["Rev" number.Hash r.rev &.triangle r/< r/<= r/> r/>=] @@ -88,19 +88,19 @@ (r/= ~false (&.membership top trapezoid)))) (test "Values within inner range will have membership = 1" - (bool/= (r/= ~true (&.membership sample trapezoid)) - (and ( middle-bottom sample) - ( middle-top sample)))) + (bit/= (r/= ~true (&.membership sample trapezoid)) + (and ( middle-bottom sample) + ( middle-top sample)))) (test "Values within range, will have membership > 0." - (bool/= (r/> ~false (&.membership sample trapezoid)) - (and ( bottom sample) - ( top sample)))) + (bit/= (r/> ~false (&.membership sample trapezoid)) + (and ( bottom sample) + ( top sample)))) (test "Values outside of range, will have membership = 0." - (bool/= (r/= ~false (&.membership sample trapezoid)) - (or ( bottom sample) - ( top sample)))) + (bit/= (r/= ~false (&.membership sample trapezoid)) + (or ( bottom sample) + ( top sample)))) ))))] ["Rev" number.Hash r.rev &.trapezoid r/< r/<= r/> r/>=] @@ -142,10 +142,10 @@ (~not (&.membership sample (&.complement left))))) (test "Membership in the difference will never be higher than in the set being subtracted." - (bool/= (r/> (&.membership sample right) - (&.membership sample left)) - (r/< (&.membership sample left) - (&.membership sample (&.difference left right))))) + (bit/= (r/> (&.membership sample right) + (&.membership sample left)) + (r/< (&.membership sample left) + (&.membership sample (&.difference left right))))) )))) (context: "From predicates and sets" @@ -156,13 +156,13 @@ ($_ seq (test "Values that satisfy a predicate have membership = 1. Values that don't have membership = 0." - (bool/= (r/= ~true (&.membership sample (&.from-predicate n/even?))) - (n/even? sample))) + (bit/= (r/= ~true (&.membership sample (&.from-predicate n/even?))) + (n/even? sample))) (test "Values that belong to a set have membership = 1. Values that don't have membership = 0." - (bool/= (r/= ~true (&.membership sample (&.from-set set-10))) - (set.member? set-10 sample))) + (bit/= (r/= ~true (&.membership sample (&.from-set set-10))) + (set.member? set-10 sample))) )))) (context: "Thresholds" @@ -175,10 +175,10 @@ member? (&.to-predicate threshold fuzzy)]] ($_ seq (test "Can increase the threshold of membership of a fuzzy set." - (bool/= (r/> ~false (&.membership sample vip-fuzzy)) - (r/> threshold (&.membership sample fuzzy)))) + (bit/= (r/> ~false (&.membership sample vip-fuzzy)) + (r/> threshold (&.membership sample fuzzy)))) (test "Can turn fuzzy sets into predicates through a threshold." - (bool/= (member? sample) - (r/> threshold (&.membership sample fuzzy)))) + (bit/= (member? sample) + (r/> threshold (&.membership sample fuzzy)))) )))) diff --git a/stdlib/test/test/lux/math/modular.lux b/stdlib/test/test/lux/math/modular.lux index 8bbaf1292..47b8b8aba 100644 --- a/stdlib/test/test/lux/math/modular.lux +++ b/stdlib/test/test/lux/math/modular.lux @@ -4,7 +4,7 @@ [monad (#+ do)]] [data [product] - [bool ("bool/" Equivalence)] + [bit ("bit/" Equivalence)] ["e" error] [text format]] @@ -39,20 +39,20 @@ (def: (comparison m/? i/?) (All [m] - (-> (-> (/.Mod m) (/.Mod m) Bool) - (-> Int Int Bool) - (-> (/.Mod m) (/.Mod m) Bool))) + (-> (-> (/.Mod m) (/.Mod m) Bit) + (-> Int Int Bit) + (-> (/.Mod m) (/.Mod m) Bit))) (function (_ param subject) - (bool/= (m/? param subject) - (i/? (value param) - (value subject))))) + (bit/= (m/? param subject) + (i/? (value param) + (value subject))))) (def: (arithmetic modulus m/! i/!) (All [m] (-> (/.Modulus m) (-> (/.Mod m) (/.Mod m) (/.Mod m)) (-> Int Int Int) - (-> (/.Mod m) (/.Mod m) Bool))) + (-> (/.Mod m) (/.Mod m) Bit))) (function (_ param subject) (|> (i/! (value param) (value subject)) @@ -91,13 +91,13 @@ ((comparison /.m/>= i/>=) param subject))) (test "Mod'ed values are ordered." - (and (bool/= (/.m/< param subject) - (not (/.m/>= param subject))) - (bool/= (/.m/> param subject) - (not (/.m/<= param subject))) - (bool/= (/.m/= param subject) - (not (or (/.m/< param subject) - (/.m/> param subject)))))) + (and (bit/= (/.m/< param subject) + (not (/.m/>= param subject))) + (bit/= (/.m/> param subject) + (not (/.m/<= param subject))) + (bit/= (/.m/= param subject) + (not (or (/.m/< param subject) + (/.m/> param subject)))))) (test "Can do arithmetic." (and ((arithmetic normalM /.m/+ i/+) param subject) @@ -145,6 +145,6 @@ (/.congruent? normalM _subject _subject)) (test "If 2 numbers are congruent under a modulus, then they must also be equal under the same modulus." - (bool/= (/.congruent? normalM _param _subject) - (/.m/= param subject))) + (bit/= (/.congruent? normalM _param _subject) + (/.m/= param subject))) )))) diff --git a/stdlib/test/test/lux/type/implicit.lux b/stdlib/test/test/lux/type/implicit.lux index e19f672e0..71e2f29c6 100644 --- a/stdlib/test/test/lux/type/implicit.lux +++ b/stdlib/test/test/lux/type/implicit.lux @@ -6,7 +6,7 @@ [functor] [monad (#+ do Monad)]] [data - [bool ("bool/" Equivalence)] + [bit ("bit/" Equivalence)] [number] [collection [list]]] [math @@ -22,8 +22,8 @@ ($_ seq (test "Can automatically select first-order structures." (let [(^open "list/") (list.Equivalence number.Equivalence)] - (and (bool/= (:: number.Equivalence = x y) - (::: = x y)) + (and (bit/= (:: number.Equivalence = x y) + (::: = x y)) (list/= (list.n/range +1 +10) (::: map inc (list.n/range +0 +9))) ))) diff --git a/stdlib/test/test/lux/type/object/protocol.lux b/stdlib/test/test/lux/type/object/protocol.lux index 0ec93442b..2e2ae212f 100644 --- a/stdlib/test/test/lux/type/object/protocol.lux +++ b/stdlib/test/test/lux/type/object/protocol.lux @@ -23,9 +23,9 @@ ((counter +0) (message []))) (protocol: Protocol0 - (method0 [Bool Nat Text] Bool) - (method1 [Nat Text Bool] Nat) - (method2 [Text Bool Nat] Text)) + (method0 [Bit Nat Text] Bit) + (method1 [Nat Text Bit] Nat) + (method2 [Text Bit Nat] Text)) (type: Object0 (Object Protocol0)) diff --git a/stdlib/test/test/lux/world/blob.lux b/stdlib/test/test/lux/world/blob.lux index f93b4e5dd..ea9dc4087 100644 --- a/stdlib/test/test/lux/world/blob.lux +++ b/stdlib/test/test/lux/world/blob.lux @@ -20,7 +20,7 @@ ["_eq" equivalence]]]]) (def: (succeed result) - (-> (e.Error Bool) Bool) + (-> (e.Error Bit) Bit) (case result (#e.Error _) false @@ -40,7 +40,7 @@ (:: r.Monad wrap output))))) (def: (bits-io bytes read write value) - (-> Nat (-> Nat /.Blob (e.Error Nat)) (-> Nat Nat /.Blob (e.Error Any)) Nat Bool) + (-> Nat (-> Nat /.Blob (e.Error Nat)) (-> Nat Nat /.Blob (e.Error Any)) Nat Bit) (let [blob (/.create +8) bits (n/* +8 bytes) capped-value (|> +1 (i64.left-shift bits) dec (i64.and value))] diff --git a/stdlib/test/test/lux/world/net/tcp.lux b/stdlib/test/test/lux/world/net/tcp.lux index 26b7703ea..1c315c7f5 100644 --- a/stdlib/test/test/lux/world/net/tcp.lux +++ b/stdlib/test/test/lux/world/net/tcp.lux @@ -42,7 +42,7 @@ (wrap (do P.Monad [result (do T.Monad [[server-close server] (@.server port) - #let [from-worked? (: (T.Task Bool) + #let [from-worked? (: (T.Task Bit) (P.promise #.Nil)) _ (frp/map (function (_ socket) (do @ -- cgit v1.2.3