From f11afb9d2dfe2d59b41e8056eb8c4ae65268415f Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 9 Apr 2022 00:46:03 -0400 Subject: Re-branded "abstract" types as "primitive" types. --- .github/workflows/test.yml | 2 + lux-mode/lux-mode.el | 4 +- .../library/lux/control/concurrency/actor.lux | 24 +- .../library/lux/control/concurrency/async.lux | 4 +- .../library/lux/control/concurrency/atom.lux | 4 +- .../source/library/lux/control/concurrency/frp.lux | 1 - .../library/lux/control/concurrency/semaphore.lux | 8 +- .../source/library/lux/control/concurrency/stm.lux | 4 +- stdlib/source/library/lux/control/io.lux | 4 +- stdlib/source/library/lux/control/lazy.lux | 4 +- .../library/lux/control/security/capability.lux | 4 +- .../source/library/lux/control/security/policy.lux | 6 +- stdlib/source/library/lux/control/thread.lux | 4 +- .../library/lux/data/collection/queue/priority.lux | 4 +- .../library/lux/data/collection/set/multi.lux | 4 +- .../library/lux/data/collection/set/ordered.lux | 4 +- .../source/library/lux/data/collection/stack.lux | 4 +- .../library/lux/data/collection/tree/finger.lux | 4 +- stdlib/source/library/lux/data/color.lux | 4 +- stdlib/source/library/lux/data/format/css.lux | 8 +- .../source/library/lux/data/format/css/class.lux | 4 +- stdlib/source/library/lux/data/format/css/id.lux | 4 +- .../library/lux/data/format/css/property.lux | 4 +- .../source/library/lux/data/format/css/query.lux | 8 +- .../library/lux/data/format/css/selector.lux | 16 +- .../source/library/lux/data/format/css/style.lux | 4 +- .../source/library/lux/data/format/css/value.lux | 18 +- stdlib/source/library/lux/data/format/html.lux | 10 +- stdlib/source/library/lux/data/format/markdown.lux | 8 +- stdlib/source/library/lux/data/format/tar.lux | 16 +- stdlib/source/library/lux/data/text/buffer.lux | 4 +- stdlib/source/library/lux/data/text/encoding.lux | 4 +- .../source/library/lux/data/text/unicode/block.lux | 4 +- .../source/library/lux/data/text/unicode/set.lux | 4 +- stdlib/source/library/lux/ffi.lux | 6 +- stdlib/source/library/lux/locale.lux | 4 +- stdlib/source/library/lux/locale/language.lux | 4 +- stdlib/source/library/lux/locale/territory.lux | 4 +- stdlib/source/library/lux/math/modular.lux | 4 +- stdlib/source/library/lux/math/modulus.lux | 4 +- stdlib/source/library/lux/target/common_lisp.lux | 8 +- stdlib/source/library/lux/target/js.lux | 8 +- .../library/lux/target/jvm/bytecode/address.lux | 4 +- .../jvm/bytecode/environment/limit/registry.lux | 4 +- .../jvm/bytecode/environment/limit/stack.lux | 4 +- .../lux/target/jvm/bytecode/instruction.lux | 4 +- stdlib/source/library/lux/target/jvm/constant.lux | 6 +- .../source/library/lux/target/jvm/constant/tag.lux | 4 +- .../library/lux/target/jvm/encoding/name.lux | 4 +- .../library/lux/target/jvm/encoding/signed.lux | 6 +- .../library/lux/target/jvm/encoding/unsigned.lux | 6 +- stdlib/source/library/lux/target/jvm/index.lux | 4 +- stdlib/source/library/lux/target/jvm/modifier.lux | 4 +- stdlib/source/library/lux/target/jvm/type.lux | 4 +- .../library/lux/target/jvm/type/category.lux | 20 +- .../library/lux/target/jvm/type/descriptor.lux | 4 +- stdlib/source/library/lux/target/jvm/type/lux.lux | 4 +- .../library/lux/target/jvm/type/reflection.lux | 4 +- .../library/lux/target/jvm/type/signature.lux | 4 +- stdlib/source/library/lux/target/lua.lux | 8 +- stdlib/source/library/lux/target/php.lux | 8 +- stdlib/source/library/lux/target/python.lux | 10 +- stdlib/source/library/lux/target/r.lux | 10 +- stdlib/source/library/lux/target/ruby.lux | 8 +- stdlib/source/library/lux/target/scheme.lux | 8 +- stdlib/source/library/lux/time.lux | 4 +- stdlib/source/library/lux/time/date.lux | 4 +- stdlib/source/library/lux/time/duration.lux | 4 +- stdlib/source/library/lux/time/instant.lux | 4 +- stdlib/source/library/lux/time/year.lux | 4 +- .../library/lux/tool/compiler/meta/archive.lux | 4 +- .../library/lux/tool/compiler/meta/archive/key.lux | 4 +- .../tool/compiler/meta/archive/module/document.lux | 4 +- .../lux/tool/compiler/meta/archive/registry.lux | 4 +- stdlib/source/library/lux/type/abstract.lux | 263 --------------------- stdlib/source/library/lux/type/dynamic.lux | 10 +- stdlib/source/library/lux/type/primitive.lux | 263 +++++++++++++++++++++ stdlib/source/library/lux/type/quotient.lux | 6 +- stdlib/source/library/lux/type/refinement.lux | 4 +- stdlib/source/library/lux/type/resource.lux | 10 +- stdlib/source/library/lux/type/unit.lux | 4 +- stdlib/source/library/lux/world/db/sql.lux | 6 +- stdlib/source/library/lux/world/file/watch.lux | 4 +- stdlib/source/library/lux/world/net/http/mime.lux | 4 +- .../source/program/aedifex/artifact/time/date.lux | 4 +- stdlib/source/program/aedifex/hash.lux | 8 +- stdlib/source/test/lux/type.lux | 4 +- stdlib/source/test/lux/type/abstract.lux | 104 -------- stdlib/source/test/lux/type/primitive.lux | 104 ++++++++ 89 files changed, 616 insertions(+), 615 deletions(-) delete mode 100644 stdlib/source/library/lux/type/abstract.lux create mode 100644 stdlib/source/library/lux/type/primitive.lux delete mode 100644 stdlib/source/test/lux/type/abstract.lux create mode 100644 stdlib/source/test/lux/type/primitive.lux diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ab2d26cfb..6f8a11c60 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,5 +51,7 @@ jobs: - uses: ./.github/workflows/setup_aedifex # https://github.com/marketplace/actions/setup-lua-luajit - uses: xpol/setup-lua@v0.3 + with: + lua-version: "5.4.2" - run: cd ./stdlib/ && ../lux.sh with lua with bibliotheca test diff --git a/lux-mode/lux-mode.el b/lux-mode/lux-mode.el index ceb7cdabe..f1ddc794a 100644 --- a/lux-mode/lux-mode.el +++ b/lux-mode/lux-mode.el @@ -374,7 +374,7 @@ Called by `imenu--generic-function'." "Interface" "type")) (type//checking (altRE "is" "as" "let" "as_expected" "type_of" "sharing" "by_example" "hole")) - (type//abstract (altRE "abstract:" "abstraction" "representation" "transmutation")) + (type//primitive (altRE "primitive:" "abstraction" "representation" "transmutation")) (type//unit (altRE "unit:" "scale:")) (type//poly (altRE "poly:")) (type//dynamic (altRE "dynamic" "static")) @@ -409,7 +409,7 @@ Called by `imenu--generic-function'." control//contract)) (type (altRE type//syntax type//checking - type//abstract + type//primitive type//unit type//poly type//dynamic diff --git a/stdlib/source/library/lux/control/concurrency/actor.lux b/stdlib/source/library/lux/control/concurrency/actor.lux index 25fad05eb..18b114cd1 100644 --- a/stdlib/source/library/lux/control/concurrency/actor.lux +++ b/stdlib/source/library/lux/control/concurrency/actor.lux @@ -29,7 +29,7 @@ ["n" nat]]] ["[0]" meta {"+" monad}] [type {"+" sharing} - ["[0]" abstract {"+" abstract: representation abstraction}]]]] + ["[0]" primitive {"+" primitive: representation abstraction}]]]] [// ["[0]" atom {"+" Atom atom}] ["[0]" async {"+" Async Resolver} ("[1]#[0]" monad)] @@ -61,7 +61,7 @@ {.#None} (in {.#End})))) - (abstract: .public (Actor s) + (primitive: .public (Actor s) (Record [#obituary [(Async ) (Resolver )] @@ -262,16 +262,16 @@ (syntax: .public (actor: [[export_policy [name vars] state_type [?on_mail messages]] ..actorP]) (with_symbols [g!_] (do meta.monad - [g!type (macro.symbol (format name "_abstract_type")) + [g!type (macro.symbol (format name "_primitive_type")) .let [g!actor (code.local name) g!vars (list#each code.local vars)]] - (in (list (` ((~! abstract:) (~ export_policy) ((~ g!type) (~+ g!vars)) + (in (list (` ((~! primitive:) (~ export_policy) ((~ g!type) (~+ g!vars)) (~ state_type) (def: (~ export_policy) (~ g!actor) (All ((~ g!_) (~+ g!vars)) (..Behavior (~ state_type) ((~ g!type) (~+ g!vars)))) - [..#on_init (|>> ((~! abstract.abstraction) (~ g!type))) + [..#on_init (|>> ((~! primitive.abstraction) (~ g!type))) ..#on_mail (~ (..on_mail g!_ ?on_mail))]) (~+ messages)))))))) @@ -319,10 +319,10 @@ (syntax: .public (message: [[export_policy signature output_type body] ..messageP]) (with_symbols [g!_ g!return] (do meta.monad - [actor_scope abstract.current - .let [g!type (code.local (the abstract.#name actor_scope)) + [actor_scope primitive.current + .let [g!type (code.local (the primitive.#name actor_scope)) g!message (code.local (the #name signature)) - g!actor_vars (the abstract.#type_vars actor_scope) + g!actor_vars (the primitive.#type_vars actor_scope) g!all_vars (|> signature (the #vars) (list#each code.local) (list#composite g!actor_vars)) g!inputsC (|> signature (the #inputs) (list#each product.left)) g!inputsT (|> signature (the #inputs) (list#each product.right)) @@ -331,15 +331,15 @@ (in (list (` (def: (~ export_policy) ((~ g!message) (~+ g!inputsC)) (All ((~ g!_) (~+ g!all_vars)) (-> (~+ g!inputsT) - (..Message (~ (the abstract.#abstraction actor_scope)) + (..Message (~ (the primitive.#abstraction actor_scope)) (~ output_type)))) (function ((~ g!_) (~ g!state) (~ g!self)) - (let [(~ g!state) (as (~ (the abstract.#representation actor_scope)) + (let [(~ g!state) (as (~ (the primitive.#representation actor_scope)) (~ g!state))] (|> (~ body) - (is ((~! async.Async) ((~! try.Try) [(~ (the abstract.#representation actor_scope)) + (is ((~! async.Async) ((~! try.Try) [(~ (the primitive.#representation actor_scope)) (~ output_type)]))) - (as ((~! async.Async) ((~! try.Try) [(~ (the abstract.#abstraction actor_scope)) + (as ((~! async.Async) ((~! try.Try) [(~ (the primitive.#abstraction actor_scope)) (~ output_type)])))))))) ))))) diff --git a/stdlib/source/library/lux/control/concurrency/async.lux b/stdlib/source/library/lux/control/concurrency/async.lux index f72f51abb..afd05d94b 100644 --- a/stdlib/source/library/lux/control/concurrency/async.lux +++ b/stdlib/source/library/lux/control/concurrency/async.lux @@ -15,13 +15,13 @@ [macro ["^" pattern]] [type {"+" sharing} - [abstract "*"] + [primitive "*"] ["[0]" variance {"+" Mutable}]]]] [// ["[0]" thread] ["[0]" atom {"+" Atom atom}]]) -(abstract: .public (Async'' a) +(primitive: .public (Async'' a) (Atom [(Maybe a) (List (-> a (IO Any)))]) (type: .public (Async' r w) diff --git a/stdlib/source/library/lux/control/concurrency/atom.lux b/stdlib/source/library/lux/control/concurrency/atom.lux index 8bef7b29b..d5f9299f7 100644 --- a/stdlib/source/library/lux/control/concurrency/atom.lux +++ b/stdlib/source/library/lux/control/concurrency/atom.lux @@ -14,7 +14,7 @@ ["[0]" array "_" ["[1]" \\unsafe]]]] [type - [abstract "*"] + [primitive "*"] ["[0]" variance {"+" Mutable}]]]]) (with_expansions [ (these (ffi.import: (java/util/concurrent/atomic/AtomicReference a) @@ -26,7 +26,7 @@ @.jvm (these))) -(abstract: .public (Atom'' a) +(primitive: .public (Atom'' a) (with_expansions [ (java/util/concurrent/atomic/AtomicReference a)] (for @.old @.jvm diff --git a/stdlib/source/library/lux/control/concurrency/frp.lux b/stdlib/source/library/lux/control/concurrency/frp.lux index df890ccc1..d0f9799b1 100644 --- a/stdlib/source/library/lux/control/concurrency/frp.lux +++ b/stdlib/source/library/lux/control/concurrency/frp.lux @@ -12,7 +12,6 @@ ["[0]" exception {"+" exception:}] ["[0]" io {"+" IO io}]] [type {"+" sharing} - [abstract "*"] ["[0]" variance {"+" Mutable}]]]] [// ["[0]" atom {"+" Atom}] diff --git a/stdlib/source/library/lux/control/concurrency/semaphore.lux b/stdlib/source/library/lux/control/concurrency/semaphore.lux index e534fc2de..5661894ad 100644 --- a/stdlib/source/library/lux/control/concurrency/semaphore.lux +++ b/stdlib/source/library/lux/control/concurrency/semaphore.lux @@ -18,7 +18,7 @@ ["n" nat] ["i" int]]] [type - ["[0]" abstract "*"] + ["[0]" primitive "*"] ["[0]" refinement]]]] [// ["[0]" atom {"+" Atom}] @@ -30,7 +30,7 @@ #open_positions Int #waiting_list (Queue (Resolver Any))])) -(abstract: .public Semaphore +(primitive: .public Semaphore (Atom State) (def: most_positions_possible @@ -94,7 +94,7 @@ (in {try.#Success (the #open_positions post)}))))))) ) -(abstract: .public Mutex +(primitive: .public Mutex Semaphore (def: .public (mutex _) @@ -124,7 +124,7 @@ (type: .public Limit (~ (refinement.type limit))) -(abstract: .public Barrier +(primitive: .public Barrier (Record [#limit Limit #count (Atom Nat) diff --git a/stdlib/source/library/lux/control/concurrency/stm.lux b/stdlib/source/library/lux/control/concurrency/stm.lux index 94365f4f4..f6d1423c3 100644 --- a/stdlib/source/library/lux/control/concurrency/stm.lux +++ b/stdlib/source/library/lux/control/concurrency/stm.lux @@ -16,7 +16,7 @@ [macro ["^" pattern]] [type {"+" sharing} - [abstract "*"] + [primitive "*"] ["[0]" variance {"+" Mutable}]]]] [// ["[0]" atom {"+" Atom atom}] @@ -26,7 +26,7 @@ (type: (Observer a) (-> a (IO Any))) -(abstract: .public (Var'' a) +(primitive: .public (Var'' a) (Atom [a (List (Sink a))]) (type: .public (Var' r w) diff --git a/stdlib/source/library/lux/control/io.lux b/stdlib/source/library/lux/control/io.lux index 96a1288f4..297442420 100644 --- a/stdlib/source/library/lux/control/io.lux +++ b/stdlib/source/library/lux/control/io.lux @@ -9,12 +9,12 @@ [parser ["<[0]>" code]]] [type - [abstract "*"]] + [primitive "*"]] [macro {"+" with_symbols} [syntax {"+" syntax:}] ["[0]" template]]]]) -(abstract: .public (IO a) +(primitive: .public (IO a) (-> Any a) (def: label diff --git a/stdlib/source/library/lux/control/lazy.lux b/stdlib/source/library/lux/control/lazy.lux index 25c821be5..3c0116e14 100644 --- a/stdlib/source/library/lux/control/lazy.lux +++ b/stdlib/source/library/lux/control/lazy.lux @@ -15,9 +15,9 @@ [macro {"+" with_symbols} [syntax {"+" syntax:}]] [type {"+" sharing} - [abstract "*"]]]]) + [primitive "*"]]]]) -(abstract: .public (Lazy a) +(primitive: .public (Lazy a) (-> [] a) (def: (lazy' generator) diff --git a/stdlib/source/library/lux/control/security/capability.lux b/stdlib/source/library/lux/control/security/capability.lux index 9affbf537..84f146614 100644 --- a/stdlib/source/library/lux/control/security/capability.lux +++ b/stdlib/source/library/lux/control/security/capability.lux @@ -15,7 +15,7 @@ [collection ["[0]" list ("[1]#[0]" functor)]]] [type - [abstract "*"]] + [primitive "*"]] ["[0]" meta] ["[0]" macro ["[0]" code] @@ -23,7 +23,7 @@ ["|[0]|" export] ["|[0]|" declaration]]]]]) -(abstract: .public (Capability brand input output) +(primitive: .public (Capability brand input output) (-> input output) (def: capability diff --git a/stdlib/source/library/lux/control/security/policy.lux b/stdlib/source/library/lux/control/security/policy.lux index de357b6e2..a05faeae2 100644 --- a/stdlib/source/library/lux/control/security/policy.lux +++ b/stdlib/source/library/lux/control/security/policy.lux @@ -6,9 +6,9 @@ [apply {"+" Apply}] [monad {"+" Monad}]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) -(abstract: .public (Policy brand value label) +(primitive: .public (Policy brand value label) value (type: .public (Can_Upgrade brand label value) @@ -77,7 +77,7 @@ ) (template [ ] - [(abstract: .public + [(primitive: .public Any (type: .public diff --git a/stdlib/source/library/lux/control/thread.lux b/stdlib/source/library/lux/control/thread.lux index 94de4803a..cc65e598d 100644 --- a/stdlib/source/library/lux/control/thread.lux +++ b/stdlib/source/library/lux/control/thread.lux @@ -13,13 +13,13 @@ ["[0]" array "_" ["[1]" \\unsafe {"+" Array}]]]] [type - [abstract "*"] + [primitive "*"] ["[0]" variance {"+" Mutable}]]]]) (type: .public (Thread ! a) (-> ! a)) -(abstract: .public (Box'' t a) +(primitive: .public (Box'' t a) (Array a) (type: .public (Box' t r w) diff --git a/stdlib/source/library/lux/data/collection/queue/priority.lux b/stdlib/source/library/lux/data/collection/queue/priority.lux index 904858147..b399fc342 100644 --- a/stdlib/source/library/lux/data/collection/queue/priority.lux +++ b/stdlib/source/library/lux/data/collection/queue/priority.lux @@ -14,7 +14,7 @@ [number ["n" nat ("[1]#[0]" interval)]]] [type {"+" by_example} - [abstract {"+" abstract: abstraction representation}]]]]) + [primitive {"+" primitive: abstraction representation}]]]]) (type: .public Priority Nat) @@ -37,7 +37,7 @@ @)) -(abstract: .public (Queue a) +(primitive: .public (Queue a) (Maybe (Tree :@: Priority a)) (def: .public empty diff --git a/stdlib/source/library/lux/data/collection/set/multi.lux b/stdlib/source/library/lux/data/collection/set/multi.lux index 7654c4239..7c741594e 100644 --- a/stdlib/source/library/lux/data/collection/set/multi.lux +++ b/stdlib/source/library/lux/data/collection/set/multi.lux @@ -14,13 +14,13 @@ [number ["n" nat]]] [type - ["[0]" abstract {"+" abstract: abstraction representation}]]]] + ["[0]" primitive {"+" primitive: abstraction representation}]]]] ["[0]" // [// ["[0]" list ("[1]#[0]" mix monoid)] ["[0]" dictionary {"+" Dictionary}]]]) -(abstract: .public (Set a) +(primitive: .public (Set a) (Dictionary a Nat) (def: .public empty diff --git a/stdlib/source/library/lux/data/collection/set/ordered.lux b/stdlib/source/library/lux/data/collection/set/ordered.lux index f79a1b640..2852070ae 100644 --- a/stdlib/source/library/lux/data/collection/set/ordered.lux +++ b/stdlib/source/library/lux/data/collection/set/ordered.lux @@ -10,9 +10,9 @@ [dictionary ["/" ordered]]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) -(abstract: .public (Set a) +(primitive: .public (Set a) (/.Dictionary a a) (def: .public empty diff --git a/stdlib/source/library/lux/data/collection/stack.lux b/stdlib/source/library/lux/data/collection/stack.lux index 26dea90cc..1dc7266ad 100644 --- a/stdlib/source/library/lux/data/collection/stack.lux +++ b/stdlib/source/library/lux/data/collection/stack.lux @@ -8,9 +8,9 @@ [collection ["//" list]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) -(abstract: .public (Stack a) +(primitive: .public (Stack a) (List a) (def: .public empty diff --git a/stdlib/source/library/lux/data/collection/tree/finger.lux b/stdlib/source/library/lux/data/collection/tree/finger.lux index 3c8e5e1db..19e3dae15 100644 --- a/stdlib/source/library/lux/data/collection/tree/finger.lux +++ b/stdlib/source/library/lux/data/collection/tree/finger.lux @@ -8,10 +8,10 @@ [collection ["[0]" list ("[1]#[0]" monoid)]]] [type - [abstract {"+" abstract: abstraction representation}]]]]) + [primitive {"+" primitive: abstraction representation}]]]]) ... https://en.wikipedia.org/wiki/Finger_tree -(abstract: .public (Tree @ t v) +(primitive: .public (Tree @ t v) (Record [#monoid (Monoid t) #tag t diff --git a/stdlib/source/library/lux/data/color.lux b/stdlib/source/library/lux/data/color.lux index a6ce4338d..e29a9260d 100644 --- a/stdlib/source/library/lux/data/color.lux +++ b/stdlib/source/library/lux/data/color.lux @@ -16,7 +16,7 @@ ["[0]" rev ("[1]#[0]" interval)] ["[0]" i64]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) (def: rgb_limit 256) (def: top (-- rgb_limit)) @@ -51,7 +51,7 @@ (type: .public HSB [Frac Frac Frac]) -(abstract: .public Color +(primitive: .public Color RGB (def: .public (of_rgb [red green blue]) diff --git a/stdlib/source/library/lux/data/format/css.lux b/stdlib/source/library/lux/data/format/css.lux index 4fc18ca76..f3f5c445f 100644 --- a/stdlib/source/library/lux/data/format/css.lux +++ b/stdlib/source/library/lux/data/format/css.lux @@ -13,7 +13,7 @@ [number ["[0]" nat]]] [type - [abstract {"-" Frame pattern}]] + [primitive {"-" Frame pattern}]] [world [net {"+" URL}]]]] ["[0]" / "_" @@ -24,10 +24,10 @@ ["[1][0]" style] ["[1][0]" query {"+" Query}]]) -(abstract: .public Common Any) -(abstract: .public Special Any) +(primitive: .public Common Any) +(primitive: .public Special Any) -(abstract: .public (CSS brand) +(primitive: .public (CSS brand) Text (def: .public css diff --git a/stdlib/source/library/lux/data/format/css/class.lux b/stdlib/source/library/lux/data/format/css/class.lux index 59aa80efb..4c9018688 100644 --- a/stdlib/source/library/lux/data/format/css/class.lux +++ b/stdlib/source/library/lux/data/format/css/class.lux @@ -11,9 +11,9 @@ [syntax {"+" syntax:}] ["[0]" code]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) -(abstract: .public Class +(primitive: .public Class Text (def: .public class diff --git a/stdlib/source/library/lux/data/format/css/id.lux b/stdlib/source/library/lux/data/format/css/id.lux index ea1d66aa5..8eb73d0e7 100644 --- a/stdlib/source/library/lux/data/format/css/id.lux +++ b/stdlib/source/library/lux/data/format/css/id.lux @@ -11,9 +11,9 @@ [syntax {"+" syntax:}] ["[0]" code]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) -(abstract: .public ID +(primitive: .public ID Text (def: .public id diff --git a/stdlib/source/library/lux/data/format/css/property.lux b/stdlib/source/library/lux/data/format/css/property.lux index 5035ee8de..821b4b03f 100644 --- a/stdlib/source/library/lux/data/format/css/property.lux +++ b/stdlib/source/library/lux/data/format/css/property.lux @@ -7,7 +7,7 @@ [data ["[0]" text]] [type - [abstract "*"]] + [primitive "*"]] [macro ["[0]" template] ["[0]" code] @@ -57,7 +57,7 @@ (syntax: (text_symbol [symbol s.text]) (in (list (code.local (text.replaced "-" "_" symbol))))) -(abstract: .public (Property brand) +(primitive: .public (Property brand) Text (def: .public name diff --git a/stdlib/source/library/lux/data/format/css/query.lux b/stdlib/source/library/lux/data/format/css/query.lux index 18ab53a99..697529704 100644 --- a/stdlib/source/library/lux/data/format/css/query.lux +++ b/stdlib/source/library/lux/data/format/css/query.lux @@ -12,7 +12,7 @@ ["[0]" code] [syntax {"+" syntax:}]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" // "_" ["[1][0]" value {"+" Value Length Count Resolution Ratio Orientation Scan Boolean Update @@ -24,7 +24,7 @@ (syntax: (text_symbol [symbol s.text]) (in (list (code.local (text.replaced "-" "_" symbol))))) -(abstract: .public Media +(primitive: .public Media Text (def: .public media @@ -42,7 +42,7 @@ ["speech"] )) -(abstract: .public Feature +(primitive: .public Feature Text (def: .public feature @@ -102,7 +102,7 @@ ) ) -(abstract: .public Query +(primitive: .public Query Text (def: .public query diff --git a/stdlib/source/library/lux/data/format/css/selector.lux b/stdlib/source/library/lux/data/format/css/selector.lux index 405af9952..c1fece6e7 100644 --- a/stdlib/source/library/lux/data/format/css/selector.lux +++ b/stdlib/source/library/lux/data/format/css/selector.lux @@ -9,7 +9,7 @@ [number ["i" int]]] [type - [abstract "*"]] + [primitive "*"]] [macro ["[0]" template]]]] ["[0]" // "_" @@ -21,21 +21,21 @@ (type: .public Tag Label) (type: .public Attribute Label) -(abstract: .public (Generic brand) Any) +(primitive: .public (Generic brand) Any) (template [ ] - [(abstract: Any) + [(primitive: Any) (type: .public (Generic ))] [Can_Chain Can_Chain'] [Cannot_Chain Cannot_Chain'] ) -(abstract: .public Unique Any) -(abstract: .public Specific Any) -(abstract: .public Composite Any) +(primitive: .public Unique Any) +(primitive: .public Specific Any) +(primitive: .public Composite Any) -(abstract: .public (Selector kind) +(primitive: .public (Selector kind) Text (def: .public selector @@ -167,7 +167,7 @@ (format ":not") abstraction)) - (abstract: .public Index + (primitive: .public Index Text (def: .public index diff --git a/stdlib/source/library/lux/data/format/css/style.lux b/stdlib/source/library/lux/data/format/css/style.lux index 6404b2216..424a16d66 100644 --- a/stdlib/source/library/lux/data/format/css/style.lux +++ b/stdlib/source/library/lux/data/format/css/style.lux @@ -7,12 +7,12 @@ [collection ["[0]" list ("[1]#[0]" mix)]]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" // "_" ["[1][0]" value {"+" Value}] ["[1][0]" property {"+" Property}]]) -(abstract: .public Style +(primitive: .public Style Text (def: .public empty diff --git a/stdlib/source/library/lux/data/format/css/value.lux b/stdlib/source/library/lux/data/format/css/value.lux index 481d2996c..01c011ac3 100644 --- a/stdlib/source/library/lux/data/format/css/value.lux +++ b/stdlib/source/library/lux/data/format/css/value.lux @@ -23,7 +23,7 @@ ["r" rev] ["f" frac]]] [type - [abstract "*"]] + [primitive "*"]] [world [net {"+" URL}]]]] [// @@ -33,7 +33,7 @@ (in (list (code.local (text.replaced "-" "_" symbol))))) (template: (enumeration: + +) - [(abstract: .public + [(primitive: .public (def: .public @@ -62,7 +62,7 @@ raw (|> raw (text.split_at 1) maybe.trusted product.right)))) -(abstract: .public (Value brand) +(primitive: .public (Value brand) Text (def: .public value @@ -77,11 +77,11 @@ [unset "unset"] ) - (abstract: .public (Numeric kind) Any) + (primitive: .public (Numeric kind) Any) (template [] [(with_expansions [' (template.symbol [ "'"])] - (abstract: .public ' Any) + (primitive: .public ' Any) (type: .public (Numeric ')))] @@ -92,7 +92,7 @@ ) (template [ + +] - [(abstract: .public Any) + [(primitive: .public Any) (`` (template [ ] [(def: .public @@ -892,7 +892,7 @@ (abstraction (format (%.nat horizontal) ..slice_separator (%.nat vertical)))) - (abstract: .public Stop + (primitive: .public Stop Text (def: .public stop @@ -912,7 +912,7 @@ (representation Value start) ..stop_separator (representation Value end)))) - (abstract: .public Hint + (primitive: .public Hint Text (def: .public hint @@ -931,7 +931,7 @@ (type: .public (List/1 a) [a (List a)]) - (abstract: .public Angle + (primitive: .public Angle Text (def: .public angle diff --git a/stdlib/source/library/lux/data/format/html.lux b/stdlib/source/library/lux/data/format/html.lux index 0a1c861fc..b1ebb9a65 100644 --- a/stdlib/source/library/lux/data/format/html.lux +++ b/stdlib/source/library/lux/data/format/html.lux @@ -15,7 +15,7 @@ [target ["[0]" js]] [type - [abstract "*"]] + [primitive "*"]] [world [net {"+" URL}]]]] [// @@ -79,11 +79,11 @@ (-> Tag Text) (text.enclosed [""])) -(abstract: .public (HTML brand) +(primitive: .public (HTML brand) Text (.template [ ] - [(abstract: Any) + [(primitive: Any) (type: .public (HTML ))] [Meta Meta'] @@ -101,11 +101,11 @@ ) (.template [ +] - [(abstract: ( brand) Any) + [(primitive: ( brand) Any) (type: .public (HTML ( Any))) (`` (.template [ ] - [(abstract: Any) + [(primitive: Any) (type: .public (HTML ( )))] (~~ (template.spliced +))))] diff --git a/stdlib/source/library/lux/data/format/markdown.lux b/stdlib/source/library/lux/data/format/markdown.lux index f9acd6890..ed56b0853 100644 --- a/stdlib/source/library/lux/data/format/markdown.lux +++ b/stdlib/source/library/lux/data/format/markdown.lux @@ -7,7 +7,7 @@ [collection ["[0]" list ("[1]#[0]" functor)]]] [type - [abstract "*"]] + [primitive "*"]] [world [net {"+" URL}]]]]) @@ -31,10 +31,10 @@ (text.replaced "." "\.") (text.replaced "!" "\!"))) -(abstract: .public Span Any) -(abstract: .public Block Any) +(primitive: .public Span Any) +(primitive: .public Block Any) -(abstract: .public (Markdown brand) +(primitive: .public (Markdown brand) Text (def: .public empty diff --git a/stdlib/source/library/lux/data/format/tar.lux b/stdlib/source/library/lux/data/format/tar.lux index b1ceb5bbf..7cdd1cf58 100644 --- a/stdlib/source/library/lux/data/format/tar.lux +++ b/stdlib/source/library/lux/data/format/tar.lux @@ -37,7 +37,7 @@ [world ["[0]" file]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) (type: Size Nat) @@ -76,7 +76,7 @@ "Value" (%.nat value) "Maximum" (%.nat (-- )))) - (abstract: .public + (primitive: .public Nat (def: .public ( value) @@ -161,7 +161,7 @@ [value (# n.octal decoded digits)] (..big value))))) -(abstract: Checksum +(primitive: Checksum Text (def: from_checksum @@ -250,7 +250,7 @@ (binary!.slice 0 (++ end) string)))))))) (template [ ] - [(abstract: .public + [(primitive: .public (exception: .public ( [value Text]) @@ -307,7 +307,7 @@ (def: magic_size Size 7) -(abstract: Magic +(primitive: Magic Text (def: ustar @@ -394,7 +394,7 @@ ... devminor (..small_number ..device_size))) -(abstract: Link_Flag +(primitive: Link_Flag Char (def: link_flag @@ -442,7 +442,7 @@ (exception.except ..invalid_link_flag [(.nat it)])))))) ) -(abstract: .public Mode +(primitive: .public Mode Nat (def: .public mode @@ -530,7 +530,7 @@ (list.repeated ..content_size) (list#mix n.* 1))) -(abstract: .public Content +(primitive: .public Content [Big Binary] (def: .public (content content) diff --git a/stdlib/source/library/lux/data/text/buffer.lux b/stdlib/source/library/lux/data/text/buffer.lux index 3aef48a85..4e51b721c 100644 --- a/stdlib/source/library/lux/data/text/buffer.lux +++ b/stdlib/source/library/lux/data/text/buffer.lux @@ -16,7 +16,7 @@ [number ["n" nat]]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" //]) (with_expansions [ (these (import: java/lang/CharSequence @@ -48,7 +48,7 @@ ) (these)))) -(`` (abstract: .public Buffer +(`` (primitive: .public Buffer (for @.old [Nat (-> java/lang/StringBuilder java/lang/StringBuilder)] @.jvm [Nat (-> java/lang/StringBuilder java/lang/StringBuilder)] @.js [Nat (-> (JS_Array Text) (JS_Array Text))] diff --git a/stdlib/source/library/lux/data/text/encoding.lux b/stdlib/source/library/lux/data/text/encoding.lux index 643c279ae..0286b4700 100644 --- a/stdlib/source/library/lux/data/text/encoding.lux +++ b/stdlib/source/library/lux/data/text/encoding.lux @@ -4,10 +4,10 @@ [macro ["[0]" template]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) ... https://en.wikipedia.org/wiki/Character_encoding#Common_character_encodings -(abstract: .public Encoding +(primitive: .public Encoding Text (template [ ] diff --git a/stdlib/source/library/lux/data/text/unicode/block.lux b/stdlib/source/library/lux/data/text/unicode/block.lux index e0da6cb16..af1825a48 100644 --- a/stdlib/source/library/lux/data/text/unicode/block.lux +++ b/stdlib/source/library/lux/data/text/unicode/block.lux @@ -11,10 +11,10 @@ ["n" nat ("[1]#[0]" interval)] ["[0]" i64]]] [type - [abstract "*"]]]] + [primitive "*"]]]] [/// {"+" Char}]) -(abstract: .public Block +(primitive: .public Block (Interval Char) (implementation: .public monoid diff --git a/stdlib/source/library/lux/data/text/unicode/set.lux b/stdlib/source/library/lux/data/text/unicode/set.lux index 155507178..1bd7ca2af 100644 --- a/stdlib/source/library/lux/data/text/unicode/set.lux +++ b/stdlib/source/library/lux/data/text/unicode/set.lux @@ -10,7 +10,7 @@ ["[0]" tree "_" ["[1]" finger {"+" Tree}]]]] [type {"+" by_example} - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" / "_" ["/[1]" // "_" [// {"+" Char}] @@ -26,7 +26,7 @@ @)) -(abstract: .public Set +(primitive: .public Set (Tree :@: Block []) (def: .public (composite left right) diff --git a/stdlib/source/library/lux/ffi.lux b/stdlib/source/library/lux/ffi.lux index 5d2b400a0..577eaec98 100644 --- a/stdlib/source/library/lux/ffi.lux +++ b/stdlib/source/library/lux/ffi.lux @@ -21,7 +21,7 @@ ["[0]" code] ["[0]" template]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) (with_expansions [ (for @.js "js constant" @.python "python constant" @@ -51,7 +51,7 @@ @.python "python function" @.lua "lua function" (these))] - (abstract: .public (Object brand) Any) + (primitive: .public (Object brand) Any) (with_expansions [ (for @.js (these [Symbol] [Null] @@ -64,7 +64,7 @@ ] (template [] [(with_expansions [ (template.symbol [ "'"])] - (abstract: + (primitive: Any (type: .public diff --git a/stdlib/source/library/lux/locale.lux b/stdlib/source/library/lux/locale.lux index 8519516a9..6500deb55 100644 --- a/stdlib/source/library/lux/locale.lux +++ b/stdlib/source/library/lux/locale.lux @@ -11,12 +11,12 @@ ["%" format {"+" format}] ["[0]" encoding {"+" Encoding}]]] [type - [abstract "*"]]]] + [primitive "*"]]]] [/ ["[0]" language {"+" Language}] ["[0]" territory {"+" Territory}]]) -(abstract: .public Locale +(primitive: .public Locale Text (def: territory_separator "_") diff --git a/stdlib/source/library/lux/locale/language.lux b/stdlib/source/library/lux/locale/language.lux index cd51ac019..3a56db5cf 100644 --- a/stdlib/source/library/lux/locale/language.lux +++ b/stdlib/source/library/lux/locale/language.lux @@ -7,12 +7,12 @@ [data ["[0]" text]] [type - [abstract "*"]] + [primitive "*"]] [macro ["[0]" template]]]]) ... https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes -(abstract: .public Language +(primitive: .public Language (Record [#name Text #code Text]) diff --git a/stdlib/source/library/lux/locale/territory.lux b/stdlib/source/library/lux/locale/territory.lux index 8cc984ec7..c654d8650 100644 --- a/stdlib/source/library/lux/locale/territory.lux +++ b/stdlib/source/library/lux/locale/territory.lux @@ -7,12 +7,12 @@ [data ["[0]" text]] [type - [abstract "*"]] + [primitive "*"]] [macro ["[0]" template]]]]) ... https://en.wikipedia.org/wiki/ISO_3166-1 -(abstract: .public Territory +(primitive: .public Territory (Record [#name Text #short Text diff --git a/stdlib/source/library/lux/math/modular.lux b/stdlib/source/library/lux/math/modular.lux index 8808e01c2..4de567862 100644 --- a/stdlib/source/library/lux/math/modular.lux +++ b/stdlib/source/library/lux/math/modular.lux @@ -23,11 +23,11 @@ [number ["i" int ("[1]#[0]" decimal)]]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" // "_" ["[1]" modulus {"+" Modulus}]]) -(abstract: .public (Mod m) +(primitive: .public (Mod m) (Record [#modulus (Modulus m) #value Int]) diff --git a/stdlib/source/library/lux/math/modulus.lux b/stdlib/source/library/lux/math/modulus.lux index dfc630966..f7f0ac6c1 100644 --- a/stdlib/source/library/lux/math/modulus.lux +++ b/stdlib/source/library/lux/math/modulus.lux @@ -16,11 +16,11 @@ [number ["i" int]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) (exception: .public zero_cannot_be_a_modulus) -(abstract: .public (Modulus %) +(primitive: .public (Modulus %) Int (def: .public (modulus value) diff --git a/stdlib/source/library/lux/target/common_lisp.lux b/stdlib/source/library/lux/target/common_lisp.lux index ba8ce8d02..d410458f4 100644 --- a/stdlib/source/library/lux/target/common_lisp.lux +++ b/stdlib/source/library/lux/target/common_lisp.lux @@ -14,13 +14,13 @@ [number ["f" frac]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) (def: as_form (-> Text Text) (text.enclosed ["(" ")"])) -(abstract: .public (Code brand) +(primitive: .public (Code brand) Text (def: .public manual @@ -33,7 +33,7 @@ (template [ ] [(with_expansions [ (template.symbol [ "'"])] - (`` (abstract: .public ( brand) Any)) + (`` (primitive: .public ( brand) Any)) (`` (type: .public ( brand) ( ( brand)))))] @@ -47,7 +47,7 @@ (template [ ] [(with_expansions [ (template.symbol [ "'"])] - (`` (abstract: .public Any)) + (`` (primitive: .public Any)) (`` (type: .public ( ))))] [Label Code] diff --git a/stdlib/source/library/lux/target/js.lux b/stdlib/source/library/lux/target/js.lux index 5d24ab3d7..c0c178bc1 100644 --- a/stdlib/source/library/lux/target/js.lux +++ b/stdlib/source/library/lux/target/js.lux @@ -15,7 +15,7 @@ ["i" int] ["f" frac]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) (def: expression (text.enclosed ["(" ")"])) @@ -33,7 +33,7 @@ (|>> (format \n+) (text.replaced text.new_line (format text.new_line text.tab)))) -(abstract: .public (Code brand) +(primitive: .public (Code brand) Text (def: .public code @@ -42,7 +42,7 @@ (template [ +] [(with_expansions [ (template.symbol [ "'"])] - (abstract: ( brand) Any) + (primitive: ( brand) Any) (`` (type: .public (|> Any (~~ (template.spliced +))))))] [Expression [Code]] @@ -53,7 +53,7 @@ (template [ +] [(with_expansions [ (template.symbol [ "'"])] - (abstract: Any) + (primitive: Any) (`` (type: .public (|> (~~ (template.spliced +))))))] [Var [Location' Computation' Expression' Code]] diff --git a/stdlib/source/library/lux/target/jvm/bytecode/address.lux b/stdlib/source/library/lux/target/jvm/bytecode/address.lux index 94f53c258..7edce6747 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode/address.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode/address.lux @@ -15,7 +15,7 @@ [number ["n" nat]]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" // "_" [jump {"+" Big_Jump}] ["/[1]" // "_" @@ -23,7 +23,7 @@ ["[1][0]" unsigned {"+" U2}] ["[1][0]" signed {"+" S4}]]]]) -(abstract: .public Address +(primitive: .public Address U2 (def: .public value diff --git a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/registry.lux b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/registry.lux index cc99cdaed..334a2cb15 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/registry.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/registry.lux @@ -14,7 +14,7 @@ [number ["n" nat]]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" ///// "_" [encoding ["[1][0]" unsigned {"+" U1 U2}]] @@ -28,7 +28,7 @@ (def: normal 1) (def: wide 2) -(abstract: .public Registry +(primitive: .public Registry U2 (def: .public registry diff --git a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/stack.lux b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/stack.lux index 4722fde9e..414a74ddd 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/stack.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/stack.lux @@ -12,12 +12,12 @@ [format [binary {"+" Writer}]]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" ///// "_" [encoding ["[1][0]" unsigned {"+" U2}]]]) -(abstract: .public Stack +(primitive: .public Stack U2 (template [ ] diff --git a/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux b/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux index b899cd83d..90569a287 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux @@ -23,7 +23,7 @@ [number {"+" hex} ["n" nat]]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" // "_" ["[1][0]" address {"+" Address}] ["[1][0]" jump {"+" Jump Big_Jump}] @@ -222,7 +222,7 @@ [(n.+ (///unsigned.value ..size/211) size) (|>> mutation ((trinary/211' opcode input0 input1 input2)))])]) -(abstract: .public Primitive_Array_Type +(primitive: .public Primitive_Array_Type U1 (def: code diff --git a/stdlib/source/library/lux/target/jvm/constant.lux b/stdlib/source/library/lux/target/jvm/constant.lux index e1fc0337e..b0dfc7cda 100644 --- a/stdlib/source/library/lux/target/jvm/constant.lux +++ b/stdlib/source/library/lux/target/jvm/constant.lux @@ -22,7 +22,7 @@ ["[0]" int] ["[0]" frac]]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" / "_" ["[1][0]" tag] ["/[1]" // "_" @@ -40,7 +40,7 @@ (Writer UTF8) binaryF.utf8_16) -(abstract: .public Class +(primitive: .public Class (Index UTF8) (def: .public index @@ -82,7 +82,7 @@ "[1]::[0]" ("static" doubleToRawLongBits [double] long)) -(abstract: .public (Value kind) +(primitive: .public (Value kind) kind (def: .public value diff --git a/stdlib/source/library/lux/target/jvm/constant/tag.lux b/stdlib/source/library/lux/target/jvm/constant/tag.lux index 21a53ae56..440dbc581 100644 --- a/stdlib/source/library/lux/target/jvm/constant/tag.lux +++ b/stdlib/source/library/lux/target/jvm/constant/tag.lux @@ -9,12 +9,12 @@ [format [binary {"+" Writer}]]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" /// "_" [encoding ["[1][0]" unsigned {"+" U1} ("u1//[0]" equivalence)]]]) -(abstract: .public Tag +(primitive: .public Tag U1 (implementation: .public equivalence diff --git a/stdlib/source/library/lux/target/jvm/encoding/name.lux b/stdlib/source/library/lux/target/jvm/encoding/name.lux index 666251728..1479e35dd 100644 --- a/stdlib/source/library/lux/target/jvm/encoding/name.lux +++ b/stdlib/source/library/lux/target/jvm/encoding/name.lux @@ -5,7 +5,7 @@ ["[0]" text ["%" format {"+" format}]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) (def: .public internal_separator "/") (def: .public external_separator ".") @@ -13,7 +13,7 @@ (type: .public External Text) -(abstract: .public Internal +(primitive: .public Internal Text (def: .public internal diff --git a/stdlib/source/library/lux/target/jvm/encoding/signed.lux b/stdlib/source/library/lux/target/jvm/encoding/signed.lux index c56ada38f..be0f564e3 100644 --- a/stdlib/source/library/lux/target/jvm/encoding/signed.lux +++ b/stdlib/source/library/lux/target/jvm/encoding/signed.lux @@ -20,9 +20,9 @@ ["n" nat] ["i" int]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) -(abstract: .public (Signed brand) +(primitive: .public (Signed brand) Int (def: .public value @@ -49,7 +49,7 @@ (template [ <+> <->] [(with_expansions [ (template.symbol [ "'"])] - (abstract: Any) + (primitive: Any) (type: .public (Signed ))) (def: .public ) diff --git a/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux b/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux index ec8b7b068..66506f3b0 100644 --- a/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux +++ b/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux @@ -19,9 +19,9 @@ ["n" nat] ["[0]" i64]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) -(abstract: .public (Unsigned brand) +(primitive: .public (Unsigned brand) Nat (def: .public value @@ -61,7 +61,7 @@ (template [ <+> <-> ] [(with_expansions [ (template.symbol [ "'"])] - (abstract: .public Any) + (primitive: .public Any) (type: .public (Unsigned ))) (def: .public ) diff --git a/stdlib/source/library/lux/target/jvm/index.lux b/stdlib/source/library/lux/target/jvm/index.lux index 9afae818a..42c0e4c15 100644 --- a/stdlib/source/library/lux/target/jvm/index.lux +++ b/stdlib/source/library/lux/target/jvm/index.lux @@ -7,7 +7,7 @@ [format [binary {"+" Writer}]]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" // "_" [encoding ["[1][0]" unsigned {"+" U2}]]]) @@ -15,7 +15,7 @@ (def: .public length //unsigned.bytes/2) -(abstract: .public (Index kind) +(primitive: .public (Index kind) U2 (def: .public index diff --git a/stdlib/source/library/lux/target/jvm/modifier.lux b/stdlib/source/library/lux/target/jvm/modifier.lux index 0e4097cb0..d573f0aeb 100644 --- a/stdlib/source/library/lux/target/jvm/modifier.lux +++ b/stdlib/source/library/lux/target/jvm/modifier.lux @@ -18,12 +18,12 @@ ["[0]" number {"+" hex} ["[0]" i64]]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" // "_" [encoding ["[1][0]" unsigned]]]) -(abstract: .public (Modifier of) +(primitive: .public (Modifier of) //unsigned.U2 (def: .public code diff --git a/stdlib/source/library/lux/target/jvm/type.lux b/stdlib/source/library/lux/target/jvm/type.lux index 06191a89f..c2f40a5a5 100644 --- a/stdlib/source/library/lux/target/jvm/type.lux +++ b/stdlib/source/library/lux/target/jvm/type.lux @@ -15,7 +15,7 @@ [number ["n" nat]]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" // "_" [encoding ["[1][0]" name {"+" External}]]] @@ -25,7 +25,7 @@ ["[1][0]" descriptor {"+" Descriptor}] ["[1][0]" reflection {"+" Reflection}]]) -(abstract: .public (Type category) +(primitive: .public (Type category) [(Signature category) (Descriptor category) (Reflection category)] diff --git a/stdlib/source/library/lux/target/jvm/type/category.lux b/stdlib/source/library/lux/target/jvm/type/category.lux index 82080666d..f10e42ebd 100644 --- a/stdlib/source/library/lux/target/jvm/type/category.lux +++ b/stdlib/source/library/lux/target/jvm/type/category.lux @@ -4,26 +4,26 @@ [macro ["[0]" template]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) -(abstract: Void' Any) -(abstract: .public (Value' kind) Any) -(abstract: .public (Return' kind) Any) -(abstract: .public Method Any) +(primitive: Void' Any) +(primitive: .public (Value' kind) Any) +(primitive: .public (Return' kind) Any) +(primitive: .public Method Any) (type: .public Return (<| Return' Any)) (type: .public Value (<| Return' Value' Any)) (type: .public Void (<| Return' Void')) -(abstract: (Object' brand) Any) +(primitive: (Object' brand) Any) (type: .public Object (<| Return' Value' Object' Any)) -(abstract: (Parameter' brand) Any) +(primitive: (Parameter' brand) Any) (type: .public Parameter (<| Return' Value' Object' Parameter' Any)) (template [ ] [(with_expansions [ (template.symbol [ "'"])] - (abstract: Any) + (primitive: Any) (type: .public (`` (<| Return' Value' (~~ (template.spliced )) ))))] @@ -33,5 +33,5 @@ [[Object' Parameter'] Array] ) -(abstract: .public Declaration Any) -(abstract: .public Inheritance Any) +(primitive: .public Declaration Any) +(primitive: .public Inheritance Any) diff --git a/stdlib/source/library/lux/target/jvm/type/descriptor.lux b/stdlib/source/library/lux/target/jvm/type/descriptor.lux index cfc674edc..a58c9098f 100644 --- a/stdlib/source/library/lux/target/jvm/type/descriptor.lux +++ b/stdlib/source/library/lux/target/jvm/type/descriptor.lux @@ -14,14 +14,14 @@ [number ["n" nat]]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" // "_" [category {"+" Void Value Return Method Primitive Object Class Array Var Parameter Declaration}] ["/[1]" // "_" [encoding ["[1][0]" name {"+" Internal External}]]]]) -(abstract: .public (Descriptor category) +(primitive: .public (Descriptor category) Text (def: .public descriptor diff --git a/stdlib/source/library/lux/target/jvm/type/lux.lux b/stdlib/source/library/lux/target/jvm/type/lux.lux index a1b8328bf..8fa73b5f9 100644 --- a/stdlib/source/library/lux/target/jvm/type/lux.lux +++ b/stdlib/source/library/lux/target/jvm/type/lux.lux @@ -16,7 +16,7 @@ ["[0]" array] ["[0]" dictionary {"+" Dictionary}]]] [type - [abstract "*"] + [primitive "*"] ["[0]" check {"+" Check} ("[1]#[0]" monad)]]]] ["[0]" // [category {"+" Void Value Return Method Primitive Object Class Array Var Parameter}] @@ -30,7 +30,7 @@ ["[1][0]" name]]]]) (template [] - [(abstract: .public ( class) Any)] + [(primitive: .public ( class) Any)] [Lower] [Upper] ) diff --git a/stdlib/source/library/lux/target/jvm/type/reflection.lux b/stdlib/source/library/lux/target/jvm/type/reflection.lux index ae364efa0..7e7ad7a1a 100644 --- a/stdlib/source/library/lux/target/jvm/type/reflection.lux +++ b/stdlib/source/library/lux/target/jvm/type/reflection.lux @@ -7,7 +7,7 @@ ["[0]" text ("[1]#[0]" equivalence) ["%" format {"+" format}]]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" // "_" [category {"+" Void Value Return Method Primitive Object Class Array Var Parameter Declaration}] ["[1][0]" descriptor] @@ -15,7 +15,7 @@ [encoding ["[1][0]" name {"+" External}]]]]) -(abstract: .public (Reflection category) +(primitive: .public (Reflection category) Text (def: .public reflection diff --git a/stdlib/source/library/lux/target/jvm/type/signature.lux b/stdlib/source/library/lux/target/jvm/type/signature.lux index 46a4c1066..e9dffe710 100644 --- a/stdlib/source/library/lux/target/jvm/type/signature.lux +++ b/stdlib/source/library/lux/target/jvm/type/signature.lux @@ -12,7 +12,7 @@ [collection ["[0]" list ("[1]#[0]" functor)]]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" // "_" [category {"+" Void Value Return Method Primitive Object Class Array Var Parameter Declaration Inheritance}] ["[1][0]" descriptor] @@ -20,7 +20,7 @@ [encoding ["[1][0]" name {"+" External}]]]]) -(abstract: .public (Signature category) +(primitive: .public (Signature category) Text (def: .public signature diff --git a/stdlib/source/library/lux/target/lua.lux b/stdlib/source/library/lux/target/lua.lux index 676a0791f..91fe9e4a5 100644 --- a/stdlib/source/library/lux/target/lua.lux +++ b/stdlib/source/library/lux/target/lua.lux @@ -25,7 +25,7 @@ ["i" int] ["f" frac]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) ... Added the carriage return for better Windows compatibility. (def: \n+ @@ -40,7 +40,7 @@ (def: input_separator ", ") -(abstract: .public (Code brand) +(primitive: .public (Code brand) Text (implementation: .public equivalence @@ -65,7 +65,7 @@ (template [ +] [(with_expansions [ (template.symbol [ "'"])] - (abstract: ( brand) Any) + (primitive: ( brand) Any) (`` (type: .public (|> Any (~~ (template.spliced +))))))] [Expression [Code]] @@ -76,7 +76,7 @@ (template [ +] [(with_expansions [ (template.symbol [ "'"])] - (abstract: Any) + (primitive: Any) (`` (type: .public (|> (~~ (template.spliced +))))))] [Literal [Computation' Expression' Code]] diff --git a/stdlib/source/library/lux/target/php.lux b/stdlib/source/library/lux/target/php.lux index ef79be536..5a8d6faf2 100644 --- a/stdlib/source/library/lux/target/php.lux +++ b/stdlib/source/library/lux/target/php.lux @@ -24,7 +24,7 @@ ["n" nat] ["f" frac]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) (def: input_separator ", ") (def: statement_suffix ";") @@ -48,7 +48,7 @@ (-> Text Text) (text.enclosed ["(" ")"])) -(abstract: .public (Code brand) +(primitive: .public (Code brand) Text (implementation: .public equivalence @@ -73,7 +73,7 @@ (template [ +] [(with_expansions [ (template.symbol [ "'"])] - (abstract: ( brand) Any) + (primitive: ( brand) Any) (`` (type: .public (|> Any (~~ (template.spliced +))))))] [Expression [Code]] @@ -84,7 +84,7 @@ (template [ +] [(with_expansions [ (template.symbol [ "'"])] - (abstract: .public Any) + (primitive: .public Any) (`` (type: .public (|> (~~ (template.spliced +))))))] [Literal [Computation' Expression' Code]] diff --git a/stdlib/source/library/lux/target/python.lux b/stdlib/source/library/lux/target/python.lux index 369cbfd92..8ab7a88ec 100644 --- a/stdlib/source/library/lux/target/python.lux +++ b/stdlib/source/library/lux/target/python.lux @@ -25,7 +25,7 @@ ["n" nat] ["f" frac]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) (def: input_separator ", ") @@ -57,7 +57,7 @@ (|>> (format \n+) (text.replaced text.new_line nested_new_line))))) -(abstract: .public (Code brand) +(primitive: .public (Code brand) Text (implementation: .public equivalence @@ -82,7 +82,7 @@ (template [ ] [(with_expansions [ (template.symbol [ "'"])] - (`` (abstract: ( brand) Any)) + (`` (primitive: ( brand) Any)) (`` (type: .public ( brand) ( ( brand)))))] @@ -95,7 +95,7 @@ (template [ ] [(with_expansions [ (template.symbol [ "'"])] - (`` (abstract: Any)) + (`` (primitive: Any)) (`` (type: .public ( ))))] [Literal Computation] @@ -104,7 +104,7 @@ ) (template [ ] - [(abstract: .public Any) + [(primitive: .public Any) (type: .public (Var ))] diff --git a/stdlib/source/library/lux/target/r.lux b/stdlib/source/library/lux/target/r.lux index d7e7b7c90..a6a95bd38 100644 --- a/stdlib/source/library/lux/target/r.lux +++ b/stdlib/source/library/lux/target/r.lux @@ -20,14 +20,14 @@ [number ["f" frac]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) -(abstract: .public (Code kind) +(primitive: .public (Code kind) Text (template [ +] [(with_expansions [ (template.symbol [ "'"])] - (abstract: .public ( kind) Any) + (primitive: .public ( kind) Any) (`` (type: .public (|> Any (~~ (template.spliced +))))))] [Expression [Code]] @@ -35,14 +35,14 @@ (template [ +] [(with_expansions [ (template.symbol [ "'"])] - (abstract: .public ( kind) Any) + (primitive: .public ( kind) Any) (`` (type: .public ( ) (|> (~~ (template.spliced +))))))] [Var [Expression' Code]] ) (template [ ] - [(abstract: .public Any) + [(primitive: .public Any) (type: .public (Var ))] [SVar Single] diff --git a/stdlib/source/library/lux/target/ruby.lux b/stdlib/source/library/lux/target/ruby.lux index cc797609c..972628596 100644 --- a/stdlib/source/library/lux/target/ruby.lux +++ b/stdlib/source/library/lux/target/ruby.lux @@ -24,7 +24,7 @@ ["n" nat] ["f" frac]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) (def: input_separator ", ") (def: statement_suffix ";") @@ -40,7 +40,7 @@ (|>> (format \n+) (text.replaced text.new_line nested_new_line)))) -(abstract: .public (Code brand) +(primitive: .public (Code brand) Text (implementation: .public equivalence @@ -59,7 +59,7 @@ (template [ +] [(with_expansions [ (template.symbol [ "'"])] - (abstract: ( brand) Any) + (primitive: ( brand) Any) (`` (type: .public (|> Any (~~ (template.spliced +))))))] [Expression [Code]] @@ -72,7 +72,7 @@ (template [ +] [(with_expansions [ (template.symbol [ "'"])] - (abstract: Any) + (primitive: Any) (`` (type: .public (|> (~~ (template.spliced +))))))] [Literal [Computation' Expression' Code]] diff --git a/stdlib/source/library/lux/target/scheme.lux b/stdlib/source/library/lux/target/scheme.lux index 826ada9da..d7b97bd0b 100644 --- a/stdlib/source/library/lux/target/scheme.lux +++ b/stdlib/source/library/lux/target/scheme.lux @@ -19,7 +19,7 @@ ["n" nat] ["f" frac]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) ... Added the carriage return for better Windows compatibility. (def: \n+ @@ -31,7 +31,7 @@ (.let [nested_new_line (format text.new_line text.tab)] (text.replaced text.new_line nested_new_line))) -(abstract: .public (Code k) +(primitive: .public (Code k) Text (implementation: .public equivalence @@ -47,14 +47,14 @@ (def: hash (|>> representation (# text.hash hash)))) (template [ +] - [(abstract: .public ( brand) Any) + [(primitive: .public ( brand) Any) (`` (type: .public (|> Any (~~ (template.spliced +)))))] [Expression Expression' [Code]] ) (template [ +] - [(abstract: .public Any) + [(primitive: .public Any) (`` (type: .public (|> (~~ (template.spliced +)))))] [Var Var' [Expression' Code]] diff --git a/stdlib/source/library/lux/time.lux b/stdlib/source/library/lux/time.lux index d395b5795..cf0d64c9e 100644 --- a/stdlib/source/library/lux/time.lux +++ b/stdlib/source/library/lux/time.lux @@ -19,7 +19,7 @@ [number ["n" nat ("[1]#[0]" decimal)]]] [type - [abstract "*"]]]] + [primitive "*"]]]] [/ ["[0]" duration {"+" Duration}]]) @@ -76,7 +76,7 @@ [..seconds second_parser invalid_second ..section_parser] ) -(abstract: .public Time +(primitive: .public Time Nat (def: .public midnight diff --git a/stdlib/source/library/lux/time/date.lux b/stdlib/source/library/lux/time/date.lux index 75091e32e..fc839952e 100644 --- a/stdlib/source/library/lux/time/date.lux +++ b/stdlib/source/library/lux/time/date.lux @@ -23,7 +23,7 @@ ["n" nat ("[1]#[0]" decimal)] ["i" int]]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" // "_" ["[1][0]" year {"+" Year}] ["[1][0]" month {"+" Month}]]) @@ -69,7 +69,7 @@ (def: separator "-") -(abstract: .public Date +(primitive: .public Date (Record [#year Year #month Month diff --git a/stdlib/source/library/lux/time/duration.lux b/stdlib/source/library/lux/time/duration.lux index ec876f942..4ce7774c3 100644 --- a/stdlib/source/library/lux/time/duration.lux +++ b/stdlib/source/library/lux/time/duration.lux @@ -19,11 +19,11 @@ ["i" int] ["[0]" nat ("[1]#[0]" decimal)]]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" // "_" ["[1][0]" year]]) -(abstract: .public Duration +(primitive: .public Duration Int (def: .public of_millis diff --git a/stdlib/source/library/lux/time/instant.lux b/stdlib/source/library/lux/time/instant.lux index cf854a9fc..81ff18897 100644 --- a/stdlib/source/library/lux/time/instant.lux +++ b/stdlib/source/library/lux/time/instant.lux @@ -22,7 +22,7 @@ ["i" int] ["f" frac]]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" // {"+" Time} ["[0]" duration {"+" Duration}] ["[0]" year {"+" Year}] @@ -30,7 +30,7 @@ ["[0]" day {"+" Day}] ["[0]" date {"+" Date}]]) -(abstract: .public Instant +(primitive: .public Instant Int (def: .public of_millis diff --git a/stdlib/source/library/lux/time/year.lux b/stdlib/source/library/lux/time/year.lux index dc149b476..ad60ff921 100644 --- a/stdlib/source/library/lux/time/year.lux +++ b/stdlib/source/library/lux/time/year.lux @@ -18,7 +18,7 @@ ["n" nat ("[1]#[0]" decimal)] ["i" int ("[1]#[0]" decimal)]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) (def: (internal year) (-> Int Int) @@ -35,7 +35,7 @@ (exception: .public there_is_no_year_0) ... https://en.wikipedia.org/wiki/Gregorian_calendar -(abstract: .public Year +(primitive: .public Year Int (def: .public (year value) diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive.lux b/stdlib/source/library/lux/tool/compiler/meta/archive.lux index e2bd7a114..622a52d82 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/archive.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/archive.lux @@ -27,7 +27,7 @@ [number ["n" nat ("[1]#[0]" equivalence)]]] [type - [abstract "*"]]]] + [primitive "*"]]]] [/ ["[0]" artifact] ["[0]" registry {"+" Registry}] @@ -72,7 +72,7 @@ #output Output #registry Registry])) -(abstract: .public Archive +(primitive: .public Archive (Record [#next module.ID #resolver (Dictionary descriptor.Module [module.ID (Maybe (Entry Any))])]) diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/key.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/key.lux index 78b3aa25f..86d8cfe9e 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/archive/key.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/archive/key.lux @@ -2,11 +2,11 @@ [library [lux "*" [type - [abstract "*"]]]] + [primitive "*"]]]] [// [signature {"+" Signature}]]) -(abstract: .public (Key k) +(primitive: .public (Key k) Signature (def: .public signature diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/module/document.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/module/document.lux index 5ca25f617..8c1eae9ca 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/archive/module/document.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/archive/module/document.lux @@ -14,7 +14,7 @@ [format ["[0]" binary {"+" Writer}]]] [type {"+" sharing} - [abstract "*"]]]] + [primitive "*"]]]] [/// ["[0]" signature {"+" Signature} ("[1]#[0]" equivalence)] ["[0]" key {"+" Key}]]) @@ -25,7 +25,7 @@ "Expected" (signature.description expected) "Actual" (signature.description actual))) -(abstract: .public (Document d) +(primitive: .public (Document d) (Record [#signature Signature #content d]) diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux index 6a9420985..5ebd0f2f3 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux @@ -23,13 +23,13 @@ [macro ["^" pattern]] [type - [abstract "*"]]]] + [primitive "*"]]]] ["[0]" // "_" ["[0]" unit] ["[1]" artifact {"+" Artifact ID} ["[2][0]" category {"+" Category}]]]) -(abstract: .public Registry +(primitive: .public Registry (Record [#artifacts (Sequence [Artifact (Set unit.ID)]) #resolver (Dictionary Text [ID (Maybe //category.Definition)])]) diff --git a/stdlib/source/library/lux/type/abstract.lux b/stdlib/source/library/lux/type/abstract.lux deleted file mode 100644 index 3d644dae3..000000000 --- a/stdlib/source/library/lux/type/abstract.lux +++ /dev/null @@ -1,263 +0,0 @@ -(.using - [library - [lux "*" - ["[0]" meta] - [abstract - [monad {"+" Monad do}]] - [control - ["[0]" exception {"+" exception:}] - ["<>" parser ("[1]#[0]" monad) - ["<[0]>" code {"+" Parser}]]] - [data - ["[0]" text ("[1]#[0]" equivalence monoid)] - [collection - ["[0]" list ("[1]#[0]" functor monoid)]]] - [macro - ["^" pattern] - ["[0]" code] - [syntax {"+" syntax:} - ["|[0]|" export]]] - [meta - ["[0]" symbol ("[1]#[0]" codec)]]]] - ["[0]" //]) - -(type: Stack - List) - -(def: peek - (All (_ a) (-> (Stack a) (Maybe a))) - list.head) - -(def: (push value stack) - (All (_ a) (-> a (Stack a) (Stack a))) - {.#Item value stack}) - -(def: pop - (All (_ a) (-> (Stack a) (Maybe (Stack a)))) - list.tail) - -(type: .public Frame - (Record - [#name Text - #type_vars (List Code) - #abstraction Code - #representation Code])) - -(def: frames - (Stack Frame) - {.#End}) - -(template: (!peek ) - [(loop (again [entries ]) - (case entries - {.#Item [head_name head] tail} - (if (text#= head_name) - - (again tail)) - - {.#End} - (undefined)))]) - -(def: (peek_frames_definition reference source) - (-> Text (List [Text Global]) (Stack Frame)) - (!peek source reference - (case head - {.#Definition [exported? frame_type frame_value]} - (as (Stack Frame) frame_value) - - (^.or {.#Type _} - {.#Alias _} - {.#Tag _} - {.#Slot _}) - (undefined)))) - -(def: (peek_frames reference definition_reference source) - (-> Text Text (List [Text Module]) (Stack Frame)) - (!peek source reference - (peek_frames_definition definition_reference (the .#definitions head)))) - -(exception: .public no_active_frames) - -(def: (peek! frame) - (-> (Maybe Text) (Meta Frame)) - (function (_ compiler) - (let [[reference definition_reference] (symbol ..frames) - current_frames (peek_frames reference definition_reference (the .#modules compiler))] - (case (case frame - {.#Some frame} - (list.example (function (_ [actual _]) - (text#= frame actual)) - current_frames) - - {.#None} - (..peek current_frames)) - {.#Some frame} - {.#Right [compiler frame]} - - {.#None} - (exception.except ..no_active_frames []))))) - -(def: .public current - (Meta Frame) - (..peek! {.#None})) - -(def: .public (specific name) - (-> Text (Meta Frame)) - (..peek! {.#Some name})) - -(template: (!push ) - [(loop (again [entries ]) - (case entries - {.#Item [head_name head] tail} - (if (text#= head_name) - {.#Item [head_name ] - tail} - {.#Item [head_name head] - (again tail)}) - - {.#End} - (undefined)))]) - -(def: (push_frame_definition reference frame source) - (-> Text Frame (List [Text Global]) (List [Text Global])) - (!push source reference - (case head - {.#Definition [exported? frames_type frames_value]} - {.#Definition [exported? - frames_type - (..push frame (as (Stack Frame) frames_value))]} - - (^.or {.#Type _} - {.#Alias _} - {.#Tag _} - {.#Slot _}) - (undefined)))) - -(def: (push_frame [module_reference definition_reference] frame source) - (-> Symbol Frame (List [Text Module]) (List [Text Module])) - (!push source module_reference - (revised .#definitions (push_frame_definition definition_reference frame) head))) - -(def: (push! frame) - (-> Frame (Meta Any)) - (function (_ compiler) - {.#Right [(revised .#modules - (..push_frame (symbol ..frames) frame) - compiler) - []]})) - -(def: (pop_frame_definition reference source) - (-> Text (List [Text Global]) (List [Text Global])) - (!push source reference - (case head - {.#Definition [exported? frames_type frames_value]} - {.#Definition [exported? - frames_type - (let [current_frames (as (Stack Frame) frames_value)] - (case (..pop current_frames) - {.#Some current_frames'} - current_frames' - - {.#None} - current_frames))]} - - (^.or {.#Type _} - {.#Alias _} - {.#Tag _} - {.#Slot _}) - (undefined)))) - -(def: (pop_frame [module_reference definition_reference] source) - (-> Symbol (List [Text Module]) (List [Text Module])) - (!push source module_reference - (|> head (revised .#definitions (pop_frame_definition definition_reference))))) - -(syntax: (pop! []) - (function (_ compiler) - {.#Right [(revised .#modules - (..pop_frame (symbol ..frames)) - compiler) - (list)]})) - -(def: cast - (Parser [(Maybe Text) Code]) - (<>.either (<>.and (<>.maybe .local) .any) - (<>.and (<>#in {.#None}) .any))) - -(template [ ] - [(syntax: .public ( [[frame value] ..cast]) - (do meta.monad - [[name type_vars abstraction representation] (peek! frame)] - (in (list (` ((~! //.as) [(~+ type_vars)] (~ ) (~ ) - (~ value)))))))] - - [abstraction representation abstraction] - [representation abstraction representation] - ) - -(def: abstraction_type_name - (-> Symbol Text) - symbol#encoded) - -(def: representation_definition_name - (-> Text Text) - (|>> (all text#composite - (symbol#encoded (symbol ..#Representation)) - " "))) - -(def: declaration - (Parser [Text (List Text)]) - (<>.either (.form (<>.and .local (<>.some .local))) - (<>.and .local (# <>.monad in (list))))) - -(def: abstract - (Parser [Code [Text (List Text)] Code (List Code)]) - (|export|.parser - (all <>.and - ..declaration - .any - (<>.some .any) - ))) - -... TODO: Make sure the generated code always gets optimized away. -... (This applies to uses of "abstraction" and "representation") -(syntax: .public (abstract: [[export_policy [name type_vars] representation_type primitives] - ..abstract]) - (do meta.monad - [current_module meta.current_module_name - .let [type_varsC (list#each code.local type_vars) - abstraction_declaration (` ((~ (code.local name)) (~+ type_varsC))) - representation_declaration (` ((~ (code.local (representation_definition_name name))) - (~+ type_varsC)))] - _ (..push! [name - type_varsC - abstraction_declaration - representation_declaration])] - (in (partial_list (` (type: (~ export_policy) (~ abstraction_declaration) - (Primitive (~ (code.text (abstraction_type_name [current_module name]))) - [(~+ type_varsC)]))) - (` (type: (~ representation_declaration) - (~ representation_type))) - (all list#composite - primitives - (list (` ((~! ..pop!))))))))) - -(type: (Selection a) - (Variant - {#Specific Code a} - {#Current a})) - -(def: (selection parser) - (All (_ a) (-> (Parser a) (Parser (Selection a)))) - (<>.or (<>.and .any parser) - parser)) - -(syntax: .public (transmutation [selection (..selection .any)]) - (case selection - {#Specific specific value} - (in (list (` (.|> (~ value) - (..representation (~ specific)) - (..abstraction (~ specific)))))) - - {#Current value} - (in (list (` (.|> (~ value) ..representation ..abstraction)))))) diff --git a/stdlib/source/library/lux/type/dynamic.lux b/stdlib/source/library/lux/type/dynamic.lux index d4f06d136..d24b16dd4 100644 --- a/stdlib/source/library/lux/type/dynamic.lux +++ b/stdlib/source/library/lux/type/dynamic.lux @@ -13,7 +13,7 @@ [macro {"+" with_symbols} ["[0]" syntax {"+" syntax:}]] ["[0]" type - ["[0]" abstract {"+" abstract:}]]]]) + ["[0]" primitive {"+" primitive:}]]]]) (exception: .public (wrong_type [expected Type actual Type]) @@ -21,16 +21,16 @@ "Expected" (%.type expected) "Actual" (%.type actual))) -(abstract: .public Dynamic +(primitive: .public Dynamic [Type Any] (def: abstraction (-> [Type Any] Dynamic) - (|>> abstract.abstraction)) + (|>> primitive.abstraction)) (def: representation (-> Dynamic [Type Any]) - (|>> abstract.representation)) + (|>> primitive.representation)) (syntax: .public (dynamic [value .any]) (with_symbols [g!value] @@ -49,6 +49,6 @@ (def: .public (format value) (-> Dynamic (Try Text)) - (let [[type value] (abstract.representation value)] + (let [[type value] (primitive.representation value)] (debug.representation type value))) ) diff --git a/stdlib/source/library/lux/type/primitive.lux b/stdlib/source/library/lux/type/primitive.lux new file mode 100644 index 000000000..28dd48137 --- /dev/null +++ b/stdlib/source/library/lux/type/primitive.lux @@ -0,0 +1,263 @@ +(.using + [library + [lux "*" + ["[0]" meta] + [abstract + [monad {"+" Monad do}]] + [control + ["[0]" exception {"+" exception:}] + ["<>" parser ("[1]#[0]" monad) + ["<[0]>" code {"+" Parser}]]] + [data + ["[0]" text ("[1]#[0]" equivalence monoid)] + [collection + ["[0]" list ("[1]#[0]" functor monoid)]]] + [macro + ["^" pattern] + ["[0]" code] + [syntax {"+" syntax:} + ["|[0]|" export]]] + [meta + ["[0]" symbol ("[1]#[0]" codec)]]]] + ["[0]" //]) + +(type: Stack + List) + +(def: peek + (All (_ a) (-> (Stack a) (Maybe a))) + list.head) + +(def: (push value stack) + (All (_ a) (-> a (Stack a) (Stack a))) + {.#Item value stack}) + +(def: pop + (All (_ a) (-> (Stack a) (Maybe (Stack a)))) + list.tail) + +(type: .public Frame + (Record + [#name Text + #type_vars (List Code) + #abstraction Code + #representation Code])) + +(def: frames + (Stack Frame) + {.#End}) + +(template: (!peek ) + [(loop (again [entries ]) + (case entries + {.#Item [head_name head] tail} + (if (text#= head_name) + + (again tail)) + + {.#End} + (undefined)))]) + +(def: (peek_frames_definition reference source) + (-> Text (List [Text Global]) (Stack Frame)) + (!peek source reference + (case head + {.#Definition [exported? frame_type frame_value]} + (as (Stack Frame) frame_value) + + (^.or {.#Type _} + {.#Alias _} + {.#Tag _} + {.#Slot _}) + (undefined)))) + +(def: (peek_frames reference definition_reference source) + (-> Text Text (List [Text Module]) (Stack Frame)) + (!peek source reference + (peek_frames_definition definition_reference (the .#definitions head)))) + +(exception: .public no_active_frames) + +(def: (peek! frame) + (-> (Maybe Text) (Meta Frame)) + (function (_ compiler) + (let [[reference definition_reference] (symbol ..frames) + current_frames (peek_frames reference definition_reference (the .#modules compiler))] + (case (case frame + {.#Some frame} + (list.example (function (_ [actual _]) + (text#= frame actual)) + current_frames) + + {.#None} + (..peek current_frames)) + {.#Some frame} + {.#Right [compiler frame]} + + {.#None} + (exception.except ..no_active_frames []))))) + +(def: .public current + (Meta Frame) + (..peek! {.#None})) + +(def: .public (specific name) + (-> Text (Meta Frame)) + (..peek! {.#Some name})) + +(template: (!push ) + [(loop (again [entries ]) + (case entries + {.#Item [head_name head] tail} + (if (text#= head_name) + {.#Item [head_name ] + tail} + {.#Item [head_name head] + (again tail)}) + + {.#End} + (undefined)))]) + +(def: (push_frame_definition reference frame source) + (-> Text Frame (List [Text Global]) (List [Text Global])) + (!push source reference + (case head + {.#Definition [exported? frames_type frames_value]} + {.#Definition [exported? + frames_type + (..push frame (as (Stack Frame) frames_value))]} + + (^.or {.#Type _} + {.#Alias _} + {.#Tag _} + {.#Slot _}) + (undefined)))) + +(def: (push_frame [module_reference definition_reference] frame source) + (-> Symbol Frame (List [Text Module]) (List [Text Module])) + (!push source module_reference + (revised .#definitions (push_frame_definition definition_reference frame) head))) + +(def: (push! frame) + (-> Frame (Meta Any)) + (function (_ compiler) + {.#Right [(revised .#modules + (..push_frame (symbol ..frames) frame) + compiler) + []]})) + +(def: (pop_frame_definition reference source) + (-> Text (List [Text Global]) (List [Text Global])) + (!push source reference + (case head + {.#Definition [exported? frames_type frames_value]} + {.#Definition [exported? + frames_type + (let [current_frames (as (Stack Frame) frames_value)] + (case (..pop current_frames) + {.#Some current_frames'} + current_frames' + + {.#None} + current_frames))]} + + (^.or {.#Type _} + {.#Alias _} + {.#Tag _} + {.#Slot _}) + (undefined)))) + +(def: (pop_frame [module_reference definition_reference] source) + (-> Symbol (List [Text Module]) (List [Text Module])) + (!push source module_reference + (|> head (revised .#definitions (pop_frame_definition definition_reference))))) + +(syntax: (pop! []) + (function (_ compiler) + {.#Right [(revised .#modules + (..pop_frame (symbol ..frames)) + compiler) + (list)]})) + +(def: cast + (Parser [(Maybe Text) Code]) + (<>.either (<>.and (<>.maybe .local) .any) + (<>.and (<>#in {.#None}) .any))) + +(template [ ] + [(syntax: .public ( [[frame value] ..cast]) + (do meta.monad + [[name type_vars abstraction representation] (peek! frame)] + (in (list (` ((~! //.as) [(~+ type_vars)] (~ ) (~ ) + (~ value)))))))] + + [abstraction representation abstraction] + [representation abstraction representation] + ) + +(def: abstraction_type_name + (-> Symbol Text) + symbol#encoded) + +(def: representation_definition_name + (-> Text Text) + (|>> (all text#composite + (symbol#encoded (symbol ..#Representation)) + " "))) + +(def: declaration + (Parser [Text (List Text)]) + (<>.either (.form (<>.and .local (<>.some .local))) + (<>.and .local (# <>.monad in (list))))) + +(def: abstract + (Parser [Code [Text (List Text)] Code (List Code)]) + (|export|.parser + (all <>.and + ..declaration + .any + (<>.some .any) + ))) + +... TODO: Make sure the generated code always gets optimized away. +... (This applies to uses of "abstraction" and "representation") +(syntax: .public (primitive: [[export_policy [name type_vars] representation_type primitives] + ..abstract]) + (do meta.monad + [current_module meta.current_module_name + .let [type_varsC (list#each code.local type_vars) + abstraction_declaration (` ((~ (code.local name)) (~+ type_varsC))) + representation_declaration (` ((~ (code.local (representation_definition_name name))) + (~+ type_varsC)))] + _ (..push! [name + type_varsC + abstraction_declaration + representation_declaration])] + (in (partial_list (` (type: (~ export_policy) (~ abstraction_declaration) + (Primitive (~ (code.text (abstraction_type_name [current_module name]))) + [(~+ type_varsC)]))) + (` (type: (~ representation_declaration) + (~ representation_type))) + (all list#composite + primitives + (list (` ((~! ..pop!))))))))) + +(type: (Selection a) + (Variant + {#Specific Code a} + {#Current a})) + +(def: (selection parser) + (All (_ a) (-> (Parser a) (Parser (Selection a)))) + (<>.or (<>.and .any parser) + parser)) + +(syntax: .public (transmutation [selection (..selection .any)]) + (case selection + {#Specific specific value} + (in (list (` (.|> (~ value) + (..representation (~ specific)) + (..abstraction (~ specific)))))) + + {#Current value} + (in (list (` (.|> (~ value) ..representation ..abstraction)))))) diff --git a/stdlib/source/library/lux/type/quotient.lux b/stdlib/source/library/lux/type/quotient.lux index 73c4b2a1e..3eb7cb6f3 100644 --- a/stdlib/source/library/lux/type/quotient.lux +++ b/stdlib/source/library/lux/type/quotient.lux @@ -9,9 +9,9 @@ [macro {"+" with_symbols} [syntax {"+" syntax:}]] ["[0]" type - [abstract "*"]]]]) + [primitive "*"]]]]) -(abstract: .public (Class t c %) +(primitive: .public (Class t c %) (-> t c) (def: .public class @@ -20,7 +20,7 @@ (-> (-> t c) (Class t c %)))) (|>> abstraction)) - (abstract: .public (Quotient t c %) + (primitive: .public (Quotient t c %) (Record [#value t #label c]) diff --git a/stdlib/source/library/lux/type/refinement.lux b/stdlib/source/library/lux/type/refinement.lux index 1a4433507..1ae7e761e 100644 --- a/stdlib/source/library/lux/type/refinement.lux +++ b/stdlib/source/library/lux/type/refinement.lux @@ -9,9 +9,9 @@ ["[0]" macro [syntax {"+" syntax:}]] ["[0]" type - [abstract "*"]]]]) + [primitive "*"]]]]) -(abstract: .public (Refined t %) +(primitive: .public (Refined t %) (Record [#value t #predicate (Predicate t)]) diff --git a/stdlib/source/library/lux/type/resource.lux b/stdlib/source/library/lux/type/resource.lux index 4d6526d22..f198e3619 100644 --- a/stdlib/source/library/lux/type/resource.lux +++ b/stdlib/source/library/lux/type/resource.lux @@ -23,7 +23,7 @@ [number ["n" nat]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) (type: .public (Procedure monad input output value) (-> input (monad [output value]))) @@ -66,10 +66,10 @@ [output procedure] (in [keys output])))) -(abstract: .public Ordered Any) -(abstract: .public Commutative Any) +(primitive: .public Ordered Any) +(primitive: .public Commutative Any) -(abstract: .public (Key mode key) +(primitive: .public (Key mode key) Any (template [ ] @@ -81,7 +81,7 @@ [commutative_key Commutative] )) -(abstract: .public (Res key value) +(primitive: .public (Res key value) value (template [ ] diff --git a/stdlib/source/library/lux/type/unit.lux b/stdlib/source/library/lux/type/unit.lux index 4ef2269e3..e822dcded 100644 --- a/stdlib/source/library/lux/type/unit.lux +++ b/stdlib/source/library/lux/type/unit.lux @@ -24,9 +24,9 @@ ["i" int] ["[0]" ratio {"+" Ratio}]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) -(abstract: .public (Qty unit) +(primitive: .public (Qty unit) Int (def: in' diff --git a/stdlib/source/library/lux/world/db/sql.lux b/stdlib/source/library/lux/world/db/sql.lux index 4835e3f24..218d64ccf 100644 --- a/stdlib/source/library/lux/world/db/sql.lux +++ b/stdlib/source/library/lux/world/db/sql.lux @@ -13,7 +13,7 @@ [macro ["[0]" template]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) (def: parenthesize (-> Text Text) @@ -21,7 +21,7 @@ ... Kind (template [] - [(abstract: .public Any)] + [(primitive: .public Any)] [Literal'] [Column'] @@ -62,7 +62,7 @@ (def: .public no_alias Alias "") -(abstract: .public (SQL kind) +(primitive: .public (SQL kind) Text ... SQL diff --git a/stdlib/source/library/lux/world/file/watch.lux b/stdlib/source/library/lux/world/file/watch.lux index 6c1331c4d..d9c070472 100644 --- a/stdlib/source/library/lux/world/file/watch.lux +++ b/stdlib/source/library/lux/world/file/watch.lux @@ -29,10 +29,10 @@ [time ["[0]" instant {"+" Instant} ("[1]#[0]" equivalence)]] [type - [abstract {"+" abstract: representation abstraction}]]]] + [primitive {"+" primitive: representation abstraction}]]]] ["[0]" //]) -(abstract: .public Concern +(primitive: .public Concern (Record [#creation Bit #modification Bit diff --git a/stdlib/source/library/lux/world/net/http/mime.lux b/stdlib/source/library/lux/world/net/http/mime.lux index 12cf28d79..a8578015c 100644 --- a/stdlib/source/library/lux/world/net/http/mime.lux +++ b/stdlib/source/library/lux/world/net/http/mime.lux @@ -6,9 +6,9 @@ ["%" format {"+" format}] ["[0]" encoding {"+" Encoding}]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) -(abstract: .public MIME +(primitive: .public MIME Text (def: .public mime diff --git a/stdlib/source/program/aedifex/artifact/time/date.lux b/stdlib/source/program/aedifex/artifact/time/date.lux index 71f4dbe1c..d3af4c01b 100644 --- a/stdlib/source/program/aedifex/artifact/time/date.lux +++ b/stdlib/source/program/aedifex/artifact/time/date.lux @@ -21,7 +21,7 @@ ["[0]" year] ["[0]" month]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) (def: .public (pad value) (-> Nat Text) @@ -38,7 +38,7 @@ "Maximum" (%.int ..max_year) "Year" (%.int (year.value year)))) -(abstract: .public Date +(primitive: .public Date date.Date (def: .public epoch diff --git a/stdlib/source/program/aedifex/hash.lux b/stdlib/source/program/aedifex/hash.lux index db33a1e6a..bd78f8fe3 100644 --- a/stdlib/source/program/aedifex/hash.lux +++ b/stdlib/source/program/aedifex/hash.lux @@ -21,7 +21,7 @@ ["n" nat] ["[0]" i64]]] [type - [abstract "*"]]]]) + [primitive "*"]]]]) ... TODO: Replace with pure-Lux implementations of these algorithms ... https://en.wikipedia.org/wiki/SHA-1#SHA-1_pseudocode @@ -34,10 +34,10 @@ ("static" getInstance [java/lang/String] java/security/MessageDigest) (digest [[byte]] [byte])) -(abstract: .public SHA-1 Any) -(abstract: .public MD5 Any) +(primitive: .public SHA-1 Any) +(primitive: .public MD5 Any) -(abstract: .public (Hash h) +(primitive: .public (Hash h) Binary (def: .public data diff --git a/stdlib/source/test/lux/type.lux b/stdlib/source/test/lux/type.lux index 1577c6a20..d2e0fed2b 100644 --- a/stdlib/source/test/lux/type.lux +++ b/stdlib/source/test/lux/type.lux @@ -25,7 +25,7 @@ [\\library ["[0]" / ("[1]#[0]" equivalence)]] ["[0]" / "_" - ["[1][0]" abstract] + ["[1][0]" primitive] ["[1][0]" check] ["[1][0]" dynamic] ["[1][0]" implicit] @@ -252,7 +252,7 @@ (text#= (/.format left) (/.format right)))) )) - /abstract.test + /primitive.test /check.test /dynamic.test /implicit.test diff --git a/stdlib/source/test/lux/type/abstract.lux b/stdlib/source/test/lux/type/abstract.lux deleted file mode 100644 index df08a62ae..000000000 --- a/stdlib/source/test/lux/type/abstract.lux +++ /dev/null @@ -1,104 +0,0 @@ -(.using - [library - [lux "*" - ["_" test {"+" Test}] - ["[0]" meta] - [abstract - [monad {"+" do}]] - [control - ["[0]" try] - ["[0]" exception] - [parser - ["<[0]>" code]]] - [data - ["[0]" text ("[1]#[0]" equivalence)]] - ["[0]" macro - [syntax {"+" syntax:}] - ["[0]" code] - ["[0]" template]] - ["[0]" math - ["[0]" random] - [number - ["n" nat]]]]] - [\\library - ["[0]" /]]) - -(template.with_locals [g!Foo g!Bar] - (these (template [ ] - [(syntax: ( []) - (do meta.monad - [frame ] - (in (list (code.text (the /.#name frame))))))] - - [current /.current] - [specific (/.specific (template.text [g!Foo]))] - ) - - (syntax: (with_no_active_frames [macro .any]) - (function (_ compiler) - (let [verdict (case ((macro.expansion macro) compiler) - {try.#Failure error} - (exception.match? /.no_active_frames error) - - {try.#Success _} - false)] - {try.#Success [compiler (list (code.bit verdict))]}))) - - (with_expansions [no_current! (..with_no_active_frames (..current)) - no_specific! (..with_no_active_frames (..specific))] - (/.abstract: (g!Foo a) - Text - - (/.abstract: (g!Bar a) - Nat - - (def: .public test - Test - (<| (_.covering /._) - (_.for [/.abstract:]) - (do random.monad - [expected_foo (random.lower_case 5) - expected_bar random.nat] - (all _.and - (_.cover [/.abstraction] - (and (exec (is (g!Foo Text) - (/.abstraction g!Foo expected_foo)) - true) - (exec (is (g!Bar Text) - (/.abstraction expected_bar)) - true))) - (_.cover [/.representation] - (and (|> expected_foo - (/.abstraction g!Foo) - (is (g!Foo Bit)) - (/.representation g!Foo) - (text#= expected_foo)) - (|> (/.abstraction expected_bar) - (is (g!Bar Bit)) - /.representation - (n.= expected_bar)))) - (_.cover [/.transmutation] - (and (exec (|> expected_foo - (/.abstraction g!Foo) - (is (g!Foo .Macro)) - (/.transmutation g!Foo) - (is (g!Foo .Lux))) - true) - (exec (|> (/.abstraction expected_bar) - (is (g!Bar .Macro)) - /.transmutation - (is (g!Bar .Lux))) - true))) - (_.for [/.Frame] - (all _.and - (_.cover [/.current] - (text#= (template.text [g!Bar]) - (..current))) - (_.cover [/.specific] - (text#= (template.text [g!Foo]) - (..specific))) - (_.cover [/.no_active_frames] - (and no_current! - no_specific!)) - )) - ))))))))) diff --git a/stdlib/source/test/lux/type/primitive.lux b/stdlib/source/test/lux/type/primitive.lux new file mode 100644 index 000000000..5b4a3fe06 --- /dev/null +++ b/stdlib/source/test/lux/type/primitive.lux @@ -0,0 +1,104 @@ +(.using + [library + [lux "*" + ["_" test {"+" Test}] + ["[0]" meta] + [abstract + [monad {"+" do}]] + [control + ["[0]" try] + ["[0]" exception] + [parser + ["<[0]>" code]]] + [data + ["[0]" text ("[1]#[0]" equivalence)]] + ["[0]" macro + [syntax {"+" syntax:}] + ["[0]" code] + ["[0]" template]] + ["[0]" math + ["[0]" random] + [number + ["n" nat]]]]] + [\\library + ["[0]" /]]) + +(template.with_locals [g!Foo g!Bar] + (these (template [ ] + [(syntax: ( []) + (do meta.monad + [frame ] + (in (list (code.text (the /.#name frame))))))] + + [current /.current] + [specific (/.specific (template.text [g!Foo]))] + ) + + (syntax: (with_no_active_frames [macro .any]) + (function (_ compiler) + (let [verdict (case ((macro.expansion macro) compiler) + {try.#Failure error} + (exception.match? /.no_active_frames error) + + {try.#Success _} + false)] + {try.#Success [compiler (list (code.bit verdict))]}))) + + (with_expansions [no_current! (..with_no_active_frames (..current)) + no_specific! (..with_no_active_frames (..specific))] + (/.primitive: (g!Foo a) + Text + + (/.primitive: (g!Bar a) + Nat + + (def: .public test + Test + (<| (_.covering /._) + (_.for [/.primitive:]) + (do random.monad + [expected_foo (random.lower_case 5) + expected_bar random.nat] + (all _.and + (_.cover [/.abstraction] + (and (exec (is (g!Foo Text) + (/.abstraction g!Foo expected_foo)) + true) + (exec (is (g!Bar Text) + (/.abstraction expected_bar)) + true))) + (_.cover [/.representation] + (and (|> expected_foo + (/.abstraction g!Foo) + (is (g!Foo Bit)) + (/.representation g!Foo) + (text#= expected_foo)) + (|> (/.abstraction expected_bar) + (is (g!Bar Bit)) + /.representation + (n.= expected_bar)))) + (_.cover [/.transmutation] + (and (exec (|> expected_foo + (/.abstraction g!Foo) + (is (g!Foo .Macro)) + (/.transmutation g!Foo) + (is (g!Foo .Lux))) + true) + (exec (|> (/.abstraction expected_bar) + (is (g!Bar .Macro)) + /.transmutation + (is (g!Bar .Lux))) + true))) + (_.for [/.Frame] + (all _.and + (_.cover [/.current] + (text#= (template.text [g!Bar]) + (..current))) + (_.cover [/.specific] + (text#= (template.text [g!Foo]) + (..specific))) + (_.cover [/.no_active_frames] + (and no_current! + no_specific!)) + )) + ))))))))) -- cgit v1.2.3