From 14e96f5e5dad439383d63e60a52169cc2e7aaa5c Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 20 May 2018 21:04:03 -0400 Subject: - Re-named "Top" to "Any", and "Bottom" to "Nothing". - Removed some modules that should have been deleted before. --- stdlib/source/lux.lux | 92 ++++++++++++------------ stdlib/source/lux/cli.lux | 6 +- stdlib/source/lux/concurrency/actor.lux | 4 +- stdlib/source/lux/concurrency/atom.lux | 2 +- stdlib/source/lux/concurrency/frp.lux | 12 ++-- stdlib/source/lux/concurrency/promise.lux | 6 +- stdlib/source/lux/concurrency/semaphore.lux | 22 +++--- stdlib/source/lux/concurrency/stm.lux | 30 ++++---- stdlib/source/lux/concurrency/task.lux | 4 +- stdlib/source/lux/control/concatenative.lux | 4 +- stdlib/source/lux/control/parser.lux | 4 +- stdlib/source/lux/control/pipe.lux | 2 +- stdlib/source/lux/control/region.lux | 6 +- stdlib/source/lux/control/state.lux | 8 +-- stdlib/source/lux/control/thread.lux | 2 +- stdlib/source/lux/control/writer.lux | 2 +- stdlib/source/lux/data/bit.lux | 4 +- stdlib/source/lux/data/coll/sequence.lux | 2 +- stdlib/source/lux/data/format/json.lux | 14 ++-- stdlib/source/lux/data/format/xml.lux | 4 +- stdlib/source/lux/data/number.lux | 6 +- stdlib/source/lux/data/text/lexer.lux | 4 +- stdlib/source/lux/data/text/regex.lux | 2 +- stdlib/source/lux/host.jvm.lux | 16 ++--- stdlib/source/lux/io.lux | 12 ++-- stdlib/source/lux/lang.lux | 2 +- stdlib/source/lux/lang/analysis/case.lux | 2 +- stdlib/source/lux/lang/analysis/primitive.lux | 2 +- stdlib/source/lux/lang/analysis/structure.lux | 2 +- stdlib/source/lux/lang/analysis/type.lux | 2 +- stdlib/source/lux/lang/init.lux | 6 +- stdlib/source/lux/lang/module.lux | 12 ++-- stdlib/source/lux/lang/syntax.lux | 2 +- stdlib/source/lux/lang/type.lux | 4 +- stdlib/source/lux/lang/type/check.lux | 16 ++--- stdlib/source/lux/macro.lux | 14 ++-- stdlib/source/lux/macro/poly.lux | 14 ++-- stdlib/source/lux/macro/poly/equality.lux | 2 +- stdlib/source/lux/macro/poly/json.lux | 4 +- stdlib/source/lux/macro/syntax.lux | 4 +- stdlib/source/lux/macro/syntax/common/reader.lux | 4 +- stdlib/source/lux/math/constructive.lux | 6 +- stdlib/source/lux/math/random.lux | 6 +- stdlib/source/lux/test.lux | 6 +- stdlib/source/lux/type/abstract.lux | 4 +- stdlib/source/lux/type/resource.lux | 6 +- stdlib/source/lux/world/blob.jvm.lux | 10 +-- stdlib/source/lux/world/console.lux | 4 +- stdlib/source/lux/world/file.lux | 2 +- stdlib/source/lux/world/net/tcp.jvm.lux | 10 +-- stdlib/source/lux/world/net/udp.jvm.lux | 6 +- stdlib/test/test/lux/concurrency/frp.lux | 2 +- stdlib/test/test/lux/concurrency/semaphore.lux | 6 +- stdlib/test/test/lux/control/parser.lux | 2 +- stdlib/test/test/lux/control/region.lux | 2 +- stdlib/test/test/lux/lang/analysis/primitive.lux | 4 +- stdlib/test/test/lux/lang/type.lux | 4 +- stdlib/test/test/lux/lang/type/check.lux | 32 ++++----- stdlib/test/test/lux/type/object/interface.lux | 4 +- stdlib/test/test/lux/type/object/protocol.lux | 24 +++---- stdlib/test/test/lux/world/blob.lux | 2 +- 61 files changed, 252 insertions(+), 252 deletions(-) (limited to 'stdlib') diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux index 795133b33..5fbbf44b5 100644 --- a/stdlib/source/lux.lux +++ b/stdlib/source/lux.lux @@ -9,10 +9,10 @@ [["" +0 +0] (+0 true)]] (+0)))]) -## (type: Top +## (type: Any ## (Ex [a] a)) -("lux def" Top - (+10 ["lux" "Top"] +("lux def" Any + (+10 ["lux" "Any"] (+8 (+0) (+4 +1))) [dummy-cursor (+10 (+1 [[dummy-cursor (+7 ["lux" "type?"])] @@ -25,10 +25,10 @@ It can be used to write functions or data-structures that can take, or return, anything.")]] (+0)))))]) -## (type: Bottom +## (type: Nothing ## (All [a] a)) -("lux def" Bottom - (+10 ["lux" "Bottom"] +("lux def" Nothing + (+10 ["lux" "Nothing"] (+7 (+0) (+4 +1))) [dummy-cursor (+10 (+1 [[dummy-cursor (+7 ["lux" "type?"])] @@ -48,7 +48,7 @@ (+10 ["lux" "List"] (+7 (+0) (+1 ## "lux.Nil" - Top + Any ## "lux.Cons" (+2 (+4 +1) (+9 (+4 +1) (+4 +0)))))) @@ -175,7 +175,7 @@ (+10 ["lux" "Maybe"] (+7 #Nil (+1 ## "lux.None" - Top + Any ## "lux.Some" (+4 +1)))) [dummy-cursor @@ -212,7 +212,7 @@ {Type-List ("lux case" ("lux check type" (+2 Type Type)) {Type-Pair - (+9 Bottom + (+9 Nothing (+7 #Nil (+1 ## "lux.Primitive" (+2 Text Type-List) @@ -468,10 +468,10 @@ (record$ #Nil)) ## (type: Definition -## [Type Code Top]) +## [Type Code Any]) ("lux def" Definition (#Named ["lux" "Definition"] - (#Product Type (#Product Code Top))) + (#Product Type (#Product Code Any))) (record$ (#Cons [(tag$ ["lux" "doc"]) (text$ "Represents all the data associated with a definition: its type, its annotations, and its value.")] default-def-meta-exported))) @@ -565,12 +565,12 @@ (#Named ["lux" "Module-State"] (#Sum ## #Active - Top + Any (#Sum ## #Compiled - Top + Any ## #Cached - Top))) + Any))) (record$ (#Cons [(tag$ ["lux" "tags"]) (tuple$ (#Cons (text$ "Active") (#Cons (text$ "Compiled") (#Cons (text$ "Cached") #Nil))))] default-def-meta-exported))) @@ -652,11 +652,11 @@ ("lux def" Mode (#Named ["lux" "Mode"] (#Sum ## Build - Top + Any (#Sum ## Eval - Top + Any ## REPL - Top))) + Any))) (record$ (#Cons [(tag$ ["lux" "tags"]) (tuple$ (#Cons (text$ "Build") (#Cons (text$ "Eval") @@ -700,8 +700,8 @@ ## #expected (Maybe Type) ## #seed Nat ## #scope-type-vars (List Nat) -## #extensions Bottom -## #host Bottom}) +## #extensions Nothing +## #host Nothing}) ("lux def" Lux (#Named ["lux" "Lux"] (#Product ## "lux.info" @@ -725,9 +725,9 @@ (#Product ## scope-type-vars (#Apply Nat List) (#Product ## extensions - Bottom + Nothing ## "lux.host" - Bottom)))))))))))) + Nothing)))))))))))) (record$ (#Cons [(tag$ ["lux" "tags"]) (tuple$ (#Cons (text$ "info") (#Cons (text$ "source") @@ -1227,7 +1227,7 @@ ## A name can be provided, to specify a recursive type. (All List [a] - (| Top + (| Any [a (List a)]))")] #Nil) (let'' [self-name tokens] ("lux case" tokens @@ -1374,12 +1374,12 @@ (text$ "## Tuple types: (& Text Int Bool) - ## Top. + ## Any. (&)")] #Nil) ("lux case" (list/reverse tokens) {#Nil - (return (list (symbol$ ["lux" "Top"]))) + (return (list (symbol$ ["lux" "Any"]))) (#Cons last prevs) (return (list (list/fold (function'' [left right] (form$ (list (tag$ ["lux" "Product"]) left right))) @@ -1392,12 +1392,12 @@ (text$ "## Variant types: (| Text Int Bool) - ## Bottom. + ## Nothing. (|)")] #Nil) ("lux case" (list/reverse tokens) {#Nil - (return (list (symbol$ ["lux" "Bottom"]))) + (return (list (symbol$ ["lux" "Nothing"]))) (#Cons last prevs) (return (list (list/fold (function'' [left right] (form$ (list (tag$ ["lux" "Sum"]) left right))) @@ -1774,7 +1774,7 @@ (text$ "Logs message to standard output. Useful for debugging.")]) - (-> Text Top) + (-> Text Any) ("lux io log" message)) (def:''' (text/compose x y) @@ -2212,7 +2212,7 @@ (def:''' (high-bits value) (list) - (-> ($' I64 Top) I64) + (-> ($' I64 Any) I64) ("lux i64 logical-right-shift" +32 value)) (def:''' low-mask @@ -2224,7 +2224,7 @@ (def:''' (low-bits value) (list) - (-> ($' I64 Top) I64) + (-> ($' I64 Any) I64) ("lux i64 and" low-mask value)) (def:''' #export (n/< test subject) @@ -2898,7 +2898,7 @@ (#Cons type #Nil) ("lux case" type {[_ (#Tag "" member-name)] - (return [(` .Top) (#Some (list member-name))]) + (return [(` .Any) (#Some (list member-name))]) [_ (#Form (#Cons [_ (#Tag "" member-name)] member-types))] (return [(` (& (~+ member-types))) (#Some (list member-name))]) @@ -2913,7 +2913,7 @@ (function' [case] ("lux case" case {[_ (#Tag "" member-name)] - (return [member-name (` .Top)]) + (return [member-name (` .Any)]) [_ (#Form (#Cons [_ (#Tag "" member-name)] (#Cons member-type #Nil)))] (return [member-name member-type]) @@ -2956,7 +2956,7 @@ {(#Cons [_ (#Symbol "" name)] (#Cons body #Nil)) (let' [body' (replace-syntax (list [name (` (#.Apply (~ (make-bound +1)) (~ (make-bound +0))))]) (update-bounds body))] - (return (list (` (#.Apply .Bottom (#.UnivQ #.Nil (~ body'))))))) + (return (list (` (#.Apply .Nothing (#.UnivQ #.Nil (~ body'))))))) _ (fail "Wrong syntax for Rec")})) @@ -3608,7 +3608,7 @@ (def: #export (error! message) {#.doc "## Causes an error, with the given error message. (error! \"OH NO!\")"} - (-> Text Bottom) + (-> Text Nothing) ("lux io error" message)) (macro: (default tokens state) @@ -4027,9 +4027,9 @@ (if (empty? args) (let [g!param (symbol$ ["" ""]) prime-name (symbol$ ["" name]) - type+ (replace-syntax (list [name (` ((~ prime-name) .Bottom))]) type)] + type+ (replace-syntax (list [name (` ((~ prime-name) .Nothing))]) type)] (#Some (` ((All (~ prime-name) [(~ g!param)] (~ type+)) - .Bottom)))) + .Nothing)))) #None) (case args #Nil @@ -4432,13 +4432,13 @@ #inner _ #locals {#counter _ #mappings locals} #captured {#counter _ #mappings closure}} - (try-both (find (: (-> [Text [Type Top]] (Maybe Type)) + (try-both (find (: (-> [Text [Type Any]] (Maybe Type)) (function (_ [bname [type _]]) (if (text/= name bname) (#Some type) #None)))) - (: (List [Text [Type Top]]) locals) - (: (List [Text [Type Top]]) closure))))) + (: (List [Text [Type Any]]) locals) + (: (List [Text [Type Any]]) closure))))) scopes))) (def: (find-def-type name state) @@ -4461,7 +4461,7 @@ (#Some def-type))))) (def: (find-def-value name state) - (-> Ident (Meta [Type Top])) + (-> Ident (Meta [Type Any])) (let [[v-prefix v-name] name {#info info #source source #current-module _ #modules modules #scopes scopes #type-context types #host host @@ -4824,10 +4824,10 @@ openings+options (parse-openings options) #let [[openings options] openings+options] current-module current-module-name - #let [test-referrals (: (-> Text (List Text) (List Text) (Meta (List Top))) + #let [test-referrals (: (-> Text (List Text) (List Text) (Meta (List Any))) (function (_ module-name all-defs referred-defs) (monad/map Monad - (: (-> Text (Meta Top)) + (: (-> Text (Meta Any)) (function (_ _def) (if (is-member? all-defs _def) (return []) @@ -4849,10 +4849,10 @@ (-> Text Refer (Meta (List Code))) (do Monad [current-module current-module-name - #let [test-referrals (: (-> Text (List Text) (List Text) (Meta (List Top))) + #let [test-referrals (: (-> Text (List Text) (List Text) (Meta (List Any))) (function (_ module-name all-defs referred-defs) (monad/map Monad - (: (-> Text (Meta Top)) + (: (-> Text (Meta Any)) (function (_ _def) (if (is-member? all-defs _def) (return []) @@ -5299,7 +5299,7 @@ (do-template [ ] [(def: #export - (-> (I64 Top) ) + (-> (I64 Any) ) (|>> (:! )))] [i64 I64] @@ -6016,7 +6016,7 @@ )) (def: (parse-end tokens) - (-> (List Code) (Meta Top)) + (-> (List Code) (Meta Any)) (case tokens (^ (list)) (return []) @@ -6297,7 +6297,7 @@ ) (def: to-significand - (-> (I64 Top) Frac) + (-> (I64 Any) Frac) (|>> ("lux i64 logical-right-shift" +11) int-to-frac)) diff --git a/stdlib/source/lux/cli.lux b/stdlib/source/lux/cli.lux index 72a22a267..281dfd9d5 100644 --- a/stdlib/source/lux/cli.lux +++ b/stdlib/source/lux/cli.lux @@ -53,7 +53,7 @@ (def: #export (this reference) {#.doc "Checks that a token is in the inputs."} - (-> Text (CLI Top)) + (-> Text (CLI Any)) (function (_ inputs) (do E.Monad [[remaining raw] (any inputs)] @@ -83,7 +83,7 @@ (def: #export end {#.doc "Ensures there are no more inputs."} - (CLI Top) + (CLI Any) (function (_ inputs) (case inputs #.Nil (#E.Success [inputs []]) @@ -133,7 +133,7 @@ (with-gensyms [g!args g!_ g!output g!message] (wrap (list (` ("lux program" (.function ((~ g!program) (~ g!args)) - (case ((: (~! (..CLI (io.IO .Top))) + (case ((: (~! (..CLI (io.IO .Any))) ((~! do) (~! p.Monad) [(~+ (|> args (list/map (function (_ [binding parser]) diff --git a/stdlib/source/lux/concurrency/actor.lux b/stdlib/source/lux/concurrency/actor.lux index 1e512d642..77543ba78 100644 --- a/stdlib/source/lux/concurrency/actor.lux +++ b/stdlib/source/lux/concurrency/actor.lux @@ -61,7 +61,7 @@ (type: #export (Behavior s) {#.doc "An actor's behavior when messages are received."} {#handle (-> (Message s) s (Actor s) (Task s)) - #end (-> Text s (Promise Top))}) + #end (-> Text s (Promise Any))}) (def: #export (spawn behavior init) {#.doc "Given a behavior and initial state, spawns an actor and returns it."} @@ -124,7 +124,7 @@ (message state self)) (def: (default-end cause state) - (All [s] (-> Text s (Promise Top))) + (All [s] (-> Text s (Promise Any))) (promise/wrap [])) (def: #export default-behavior diff --git a/stdlib/source/lux/concurrency/atom.lux b/stdlib/source/lux/concurrency/atom.lux index c60edd01e..10f7005d3 100644 --- a/stdlib/source/lux/concurrency/atom.lux +++ b/stdlib/source/lux/concurrency/atom.lux @@ -37,5 +37,5 @@ (recur [])))))) (def: #export (write value atom) - (All [a] (-> a (Atom a) (IO Top))) + (All [a] (-> a (Atom a) (IO Any))) (update (function.const value) atom)) diff --git a/stdlib/source/lux/concurrency/frp.lux b/stdlib/source/lux/concurrency/frp.lux index caa1173c2..28d7be094 100644 --- a/stdlib/source/lux/concurrency/frp.lux +++ b/stdlib/source/lux/concurrency/frp.lux @@ -12,14 +12,14 @@ ## [Types] (abstract: #export (Channel a) {#.doc "An asynchronous channel to distribute values."} - (Atom (List (-> a (IO Top)))) + (Atom (List (-> a (IO Any)))) (def: #export (channel _) - (All [a] (-> Top (Channel a))) + (All [a] (-> Any (Channel a))) (@abstraction (atom (list)))) (def: #export (listen listener (^@representation channel)) - (All [a] (-> (-> a (IO Top)) (Channel a) (IO Top))) + (All [a] (-> (-> a (IO Any)) (Channel a) (IO Any))) ## TODO: Simplify when possible. (do io.Monad [_ (atom.update (|>> (#.Cons listener)) channel)] @@ -27,7 +27,7 @@ (def: #export (publish (^@representation channel) value) {#.doc "Publish to a channel."} - (All [a] (-> (Channel a) a (IO Top))) + (All [a] (-> (Channel a) a (IO Any))) (do io.Monad [listeners (atom.read channel)] (monad.map @ (function (_ listener) (listener value)) listeners))) @@ -46,7 +46,7 @@ (def: #export (pipe output input) {#.doc "Copy/pipe the contents of a channel on to another."} - (All [a] (-> (Channel a) (Channel a) (IO Top))) + (All [a] (-> (Channel a) (Channel a) (IO Any))) (listen (publish output) input)) @@ -76,7 +76,7 @@ output))) (def: #export (periodic time) - (-> Nat (Channel Top)) + (-> Nat (Channel Any)) (let [output (channel [])] (exec (io.run (loop [_ []] diff --git a/stdlib/source/lux/concurrency/promise.lux b/stdlib/source/lux/concurrency/promise.lux index 15bad9910..3ccdc22e9 100644 --- a/stdlib/source/lux/concurrency/promise.lux +++ b/stdlib/source/lux/concurrency/promise.lux @@ -15,7 +15,7 @@ (abstract: #export (Promise a) {#.doc "Represents values produced by asynchronous computations (unlike IO, which is synchronous)."} - (Atom [(Maybe a) (List (-> a (IO Top)))]) + (Atom [(Maybe a) (List (-> a (IO Any)))]) (def: #export (promise ?value) (All [a] (-> (Maybe a) (Promise a))) @@ -49,7 +49,7 @@ (resolve value (@abstraction promise))))))) (def: #export (await f (^@representation promise)) - (All [a] (-> (-> a (IO Top)) (Promise a) Top)) + (All [a] (-> (-> a (IO Any)) (Promise a) Any)) (let [(^@ old [_value _observers]) (io.run (atom.read promise))] (case _value (#.Some value) @@ -160,7 +160,7 @@ (def: #export (wait time-millis) {#.doc "Returns a promise that will be resolved after the specified amount of milliseconds."} - (-> Nat (Promise Top)) + (-> Nat (Promise Any)) (delay time-millis [])) (def: #export (time-out time-millis promise) diff --git a/stdlib/source/lux/concurrency/semaphore.lux b/stdlib/source/lux/concurrency/semaphore.lux index c9ac32fcb..23303a236 100644 --- a/stdlib/source/lux/concurrency/semaphore.lux +++ b/stdlib/source/lux/concurrency/semaphore.lux @@ -9,7 +9,7 @@ (type: State {#open-positions Nat - #waiting-list (List (Promise Top))}) + #waiting-list (List (Promise Any))}) (abstract: #export Semaphore {#.doc "A tool for controlling access to resources by multiple concurrent processes."} @@ -22,10 +22,10 @@ #waiting-list (list)}))) (def: #export (wait semaphore) - (Ex [k] (-> Semaphore (Promise Top))) + (Ex [k] (-> Semaphore (Promise Any))) (let [semaphore (@representation semaphore)] (io.run - (loop [signal (: (Promise Top) + (loop [signal (: (Promise Any) (promise.promise #.None))] (do io.Monad [state (atom.read semaphore) @@ -44,13 +44,13 @@ (recur signal))))))) (def: #export (signal semaphore) - (Ex [k] (-> Semaphore (Promise Top))) + (Ex [k] (-> Semaphore (Promise Any))) (let [semaphore (@representation semaphore)] (promise.future (loop [_ []] (do io.Monad [state (atom.read semaphore) - #let [[?signal state'] (: [(Maybe (Promise Top)) State] + #let [[?signal state'] (: [(Maybe (Promise Any)) State] (case (get@ #waiting-list state) #.Nil [#.None (update@ #open-positions inc state)] @@ -76,15 +76,15 @@ Semaphore (def: #export (mutex _) - (-> Top Mutex) + (-> Any Mutex) (@abstraction (semaphore +1))) (def: (acquire mutex) - (-> Mutex (Promise Top)) + (-> Mutex (Promise Any)) (wait (@representation mutex))) (def: (release mutex) - (-> Mutex (Promise Top)) + (-> Mutex (Promise Any)) (signal (@representation mutex))) (def: #export (synchronize mutex procedure) @@ -115,7 +115,7 @@ #end-turnstile (semaphore +0)})) (def: (un-block times turnstile) - (-> Nat Semaphore (Promise Top)) + (-> Nat Semaphore (Promise Any)) (loop [step +0] (if (n/< times step) (do promise.Monad @@ -125,7 +125,7 @@ (do-template [ ] [(def: ( (^@representation barrier)) - (-> Barrier (Promise Top)) + (-> Barrier (Promise Any)) (do promise.Monad [#let [limit (refinement.un-refine (get@ #limit barrier)) goal @@ -140,7 +140,7 @@ ) (def: #export (block barrier) - (-> Barrier (Promise Top)) + (-> Barrier (Promise Any)) (do promise.Monad [_ (start barrier)] (end barrier))) diff --git a/stdlib/source/lux/concurrency/stm.lux b/stdlib/source/lux/concurrency/stm.lux index fb150d842..a7c8b3cf3 100644 --- a/stdlib/source/lux/concurrency/stm.lux +++ b/stdlib/source/lux/concurrency/stm.lux @@ -15,7 +15,7 @@ (abstract: #export (Var a) {#.doc "A mutable cell containing a value, and observers that will be alerted of any change to it."} - (Atom [a (List (-> a (IO Top)))]) + (Atom [a (List (-> a (IO Any)))]) (def: #export (var value) {#.doc "Creates a new STM var, with a default value."} @@ -34,7 +34,7 @@ (:: io.Functor map product.left))) (def: (write! new-value (^@representation var)) - (All [a] (-> a (Var a) (IO Top))) + (All [a] (-> a (Var a) (IO Any))) (do io.Monad [(^@ old [_value _observers]) (atom.read var) succeeded? (atom.compare-and-swap old [new-value _observers] var)] @@ -76,8 +76,8 @@ (All [a] (-> (Var a) Tx (Maybe a))) (|> tx (list.find (function (_ [_var _original _current]) - (is? (:! (Var Top) var) - (:! (Var Top) _var)))) + (is? (:! (Var Any) var) + (:! (Var Any) _var)))) (:: maybe.Monad map (function (_ [_var _original _current]) _current)) (:!!) @@ -102,11 +102,11 @@ #.Nil (#.Cons [_var _original _current] tx') - (if (is? (:! (Var Top) var) - (:! (Var Top) _var)) - (#.Cons {#var (:! (Var Top) _var) - #original (:! Top _original) - #current (:! Top value)} + (if (is? (:! (Var Any) var) + (:! (Var Any) _var)) + (#.Cons {#var (:! (Var Any) _var) + #original (:! Any _original) + #current (:! Any value)} tx') (#.Cons {#var _var #original _original @@ -116,7 +116,7 @@ (def: #export (write value var) {#.doc "Writes value to var."} - (All [a] (-> a (Var a) (STM Top))) + (All [a] (-> a (Var a) (STM Any))) (function (_ tx) (case (find-var-value var tx) (#.Some _) @@ -169,7 +169,7 @@ tx)) (def: (commit-var! [_var _original _current]) - (-> (Ex [a] (Tx-Frame a)) Top) + (-> (Ex [a] (Tx-Frame a)) Any) (if (is? _original _current) [] (io.run (write! _current _var)))) @@ -187,7 +187,7 @@ (atom false)) (def: (issue-commit commit) - (-> Commit (IO Top)) + (-> Commit (IO Any)) (let [entry [commit (promise #.None)]] (loop [|commits| (io.run (atom.read pending-commits))] (case (promise.poll |commits|) @@ -202,7 +202,7 @@ (recur tail))))) (def: (process-commit [stm-proc output]) - (-> [(STM Top) (Promise Top)] Top) + (-> [(STM Any) (Promise Any)] Any) (let [[finished-tx value] (stm-proc fresh-tx)] (io.run (if (can-commit? finished-tx) (exec (list/map commit-var! finished-tx) @@ -210,7 +210,7 @@ (issue-commit [stm-proc output]))))) (def: init-processor! - (IO Top) + (IO Any) (do io.Monad [flag (atom.read commit-processor-flag)] (if flag @@ -220,7 +220,7 @@ (if was-first? (exec (|> (io.run (atom.read pending-commits)) (promise.await (function (recur [head tail]) - (io (exec (process-commit (:! [(STM Top) (Promise Top)] head)) + (io (exec (process-commit (:! [(STM Any) (Promise Any)] head)) (promise.await recur tail)))))) (wrap [])) (wrap []))) diff --git a/stdlib/source/lux/concurrency/task.lux b/stdlib/source/lux/concurrency/task.lux index 8d95842e9..911fdd2d2 100644 --- a/stdlib/source/lux/concurrency/task.lux +++ b/stdlib/source/lux/concurrency/task.lux @@ -70,8 +70,8 @@ ma)))) (syntax: #export (task {type s.any}) - {#.doc (doc "Makes an uninitialized Task (in this example, of Top)." - (task Top))} + {#.doc (doc "Makes an uninitialized Task (in this example, of Any)." + (task Any))} (wrap (list (` (: (..Task (~ type)) (P.promise #.None)))))) diff --git a/stdlib/source/lux/control/concatenative.lux b/stdlib/source/lux/control/concatenative.lux index 1af41bbdb..2b91cac0e 100644 --- a/stdlib/source/lux/control/concatenative.lux +++ b/stdlib/source/lux/control/concatenative.lux @@ -86,10 +86,10 @@ (-> (~ (de-alias inputC)) (~ (de-alias outputC)))))))))))) -(def: begin! Top []) +(def: begin! Any []) (def: end! - (All [a] (-> [Top a] a)) + (All [a] (-> [Any a] a)) (function (_ [_ top]) top)) diff --git a/stdlib/source/lux/control/parser.lux b/stdlib/source/lux/control/parser.lux index 88f2eb20d..14c6c3313 100644 --- a/stdlib/source/lux/control/parser.lux +++ b/stdlib/source/lux/control/parser.lux @@ -59,7 +59,7 @@ ## [Parsers] (def: #export (assert message test) {#.doc "Fails with the given message if the test is false."} - (All [s] (-> Text Bool (Parser s Top))) + (All [s] (-> Text Bool (Parser s Any))) (function (_ input) (if test (#e.Success [input []]) @@ -192,7 +192,7 @@ ))) (def: #export (not p) - (All [s a] (-> (Parser s a) (Parser s Top))) + (All [s a] (-> (Parser s a) (Parser s Any))) (function (_ input) (case (p input) (#e.Error msg) diff --git a/stdlib/source/lux/control/pipe.lux b/stdlib/source/lux/control/pipe.lux index 19d67ce7d..4cbfe3504 100644 --- a/stdlib/source/lux/control/pipe.lux +++ b/stdlib/source/lux/control/pipe.lux @@ -35,7 +35,7 @@ (~ body)))))) (def: _reverse_ - (Syntax Top) + (Syntax Any) (function (_ tokens) (#e.Success [(list.reverse tokens) []]))) diff --git a/stdlib/source/lux/control/region.lux b/stdlib/source/lux/control/region.lux index e26a23ab9..7397d9781 100644 --- a/stdlib/source/lux/control/region.lux +++ b/stdlib/source/lux/control/region.lux @@ -9,7 +9,7 @@ (coll [list "list/" Fold])))) (type: (Cleaner r m) - (-> r (m (Error Top)))) + (-> r (m (Error Any)))) (type: #export (Region r m a) (-> [r (List (Cleaner r m))] @@ -36,7 +36,7 @@ error|output)))) (def: (combine-outcomes clean-up output) - (All [a] (-> (Error Top) (Error a) (Error a))) + (All [a] (-> (Error Any) (Error a) (Error a))) (case clean-up (#e.Success _) output @@ -55,7 +55,7 @@ (wrap (list/fold combine-outcomes output results)))) (def: #export (acquire Monad cleaner value) - (All [m a] (-> (Monad m) (-> a (m (Error Top))) a + (All [m a] (-> (Monad m) (-> a (m (Error Any))) a (All [r] (Region r m a)))) (function (_ [region cleaners]) (:: Monad wrap [(#.Cons (function (_ region) (cleaner value)) diff --git a/stdlib/source/lux/control/state.lux b/stdlib/source/lux/control/state.lux index ab69ed9fe..296147e6b 100644 --- a/stdlib/source/lux/control/state.lux +++ b/stdlib/source/lux/control/state.lux @@ -52,13 +52,13 @@ (def: #export (put new-state) {#.doc "Set the new state."} - (All [s] (-> s (State s Top))) + (All [s] (-> s (State s Any))) (function (_ state) [new-state []])) (def: #export (update change) {#.doc "Compute the new state."} - (All [s] (-> (-> s s) (State s Top))) + (All [s] (-> (-> s s) (State s Any))) (function (_ state) [(change state) []])) @@ -134,7 +134,7 @@ (wrap [state a])))) (def: #export (while condition body) - (All [s] (-> (State s Bool) (State s Top) (State s Top))) + (All [s] (-> (State s Bool) (State s Any) (State s Any))) (do Monad [execute? condition] (if execute? @@ -144,7 +144,7 @@ (wrap [])))) (def: #export (do-while condition body) - (All [s] (-> (State s Bool) (State s Top) (State s Top))) + (All [s] (-> (State s Bool) (State s Any) (State s Any))) (do Monad [_ body] (while condition body))) diff --git a/stdlib/source/lux/control/thread.lux b/stdlib/source/lux/control/thread.lux index e44869043..7d46f3707 100644 --- a/stdlib/source/lux/control/thread.lux +++ b/stdlib/source/lux/control/thread.lux @@ -23,7 +23,7 @@ ("lux box read" box))) (def: #export (write value box) - (All [a] (-> a (All [!] (-> (Box ! a) (Thread ! Top))))) + (All [a] (-> a (All [!] (-> (Box ! a) (Thread ! Any))))) (function (_ !) ("lux box write" value box))) diff --git a/stdlib/source/lux/control/writer.lux b/stdlib/source/lux/control/writer.lux index 7f23e2750..3dcf64cc3 100644 --- a/stdlib/source/lux/control/writer.lux +++ b/stdlib/source/lux/control/writer.lux @@ -44,7 +44,7 @@ (def: #export (log l) {#.doc "Set the log to a particular value."} - (All [l] (-> l (Writer l Top))) + (All [l] (-> l (Writer l Any))) [l []]) (struct: #export (WriterT Monoid Monad) diff --git a/stdlib/source/lux/data/bit.lux b/stdlib/source/lux/data/bit.lux index e89cf0c9d..a0f8e18a7 100644 --- a/stdlib/source/lux/data/bit.lux +++ b/stdlib/source/lux/data/bit.lux @@ -33,7 +33,7 @@ (def: #export (count subject) {#.doc "Count the number of 1s in a bit-map."} - (-> (I64 Top) Nat) + (-> (I64 Any) Nat) (let [count' (n/- (|> subject (right-shift +1) (and +6148914691236517205) i64) (i64 subject))] (|> count' @@ -69,7 +69,7 @@ ) (def: #export (set? idx input) - (-> Nat (I64 Top) Bool) + (-> Nat (I64 Any) Bool) (|> input (:! I64) (..and (flag idx)) (n/= +0) .not)) (do-template [
] diff --git a/stdlib/source/lux/data/coll/sequence.lux b/stdlib/source/lux/data/coll/sequence.lux index f5ade6bed..4e6226dcd 100644 --- a/stdlib/source/lux/data/coll/sequence.lux +++ b/stdlib/source/lux/data/coll/sequence.lux @@ -59,7 +59,7 @@ (bit.and branch-idx-mask)) (def: (new-hierarchy _) - (All [a] (-> Top (Hierarchy a))) + (All [a] (-> Any (Hierarchy a))) (array.new full-node-size)) (def: (tail-off vec-size) diff --git a/stdlib/source/lux/data/format/json.lux b/stdlib/source/lux/data/format/json.lux index 03d4de615..9262c3d70 100644 --- a/stdlib/source/lux/data/format/json.lux +++ b/stdlib/source/lux/data/format/json.lux @@ -24,7 +24,7 @@ (do-template [ ] [(type: #export )] - [Null Top] + [Null Any] [Boolean Bool] [Number Frac] [String Text] @@ -234,7 +234,7 @@ _ (fail ($_ text/compose "JSON value is not " ".")))))] - [null Top #Null "null"] + [null Any #Null "null"] [boolean Bool #Boolean "boolean"] [number Frac #Number "number"] [string Text #String "string"] @@ -255,7 +255,7 @@ (def: #export ( test) {#.doc (code.text ($_ text/compose "Ensures a JSON value is a " "."))} - (-> (Reader Top)) + (-> (Reader Any)) (do p.Monad [head any] (case head @@ -395,7 +395,7 @@ (l.some l.space)) (def: data-sep - (l.Lexer [Text Top Text]) + (l.Lexer [Text Any Text]) ($_ p.seq space~ (l.this ",") space~)) (def: null~ @@ -467,7 +467,7 @@ (wrap chars)))) (def: (kv~ json~) - (-> (-> Top (l.Lexer JSON)) (l.Lexer [String JSON])) + (-> (-> Any (l.Lexer JSON)) (l.Lexer [String JSON])) (do p.Monad [key string~ _ space~ @@ -478,7 +478,7 @@ (do-template [ ] [(def: ( json~) - (-> (-> Top (l.Lexer JSON)) (l.Lexer )) + (-> (-> Any (l.Lexer JSON)) (l.Lexer )) (do p.Monad [_ (l.this ) _ space~ @@ -492,7 +492,7 @@ ) (def: (json~' _) - (-> Top (l.Lexer JSON)) + (-> Any (l.Lexer JSON)) ($_ p.alt null~ boolean~ number~ string~ (array~ json~') (object~ json~'))) (struct: #export _ (Codec Text JSON) diff --git a/stdlib/source/lux/data/format/xml.lux b/stdlib/source/lux/data/format/xml.lux index d1a84d675..a725263af 100644 --- a/stdlib/source/lux/data/format/xml.lux +++ b/stdlib/source/lux/data/format/xml.lux @@ -304,7 +304,7 @@ (#E.Error error))) (def: #export (node tag) - (-> Ident (Reader Top)) + (-> Ident (Reader Any)) (function (_ docs) (case docs #.Nil @@ -338,7 +338,7 @@ (wrap [tail output])))))) (def: #export ignore - (Reader Top) + (Reader Any) (function (_ docs) (case docs #.Nil diff --git a/stdlib/source/lux/data/number.lux b/stdlib/source/lux/data/number.lux index 2aba0da7a..72c6dbb86 100644 --- a/stdlib/source/lux/data/number.lux +++ b/stdlib/source/lux/data/number.lux @@ -731,7 +731,7 @@ (type: Digits (Array Nat)) (def: (make-digits _) - (-> Top Digits) + (-> Any Digits) ("lux array new" bit.width)) (def: (digits-get idx digits) @@ -955,7 +955,7 @@ (do-template [ ] [(def: (|> +1 (bit.left-shift ) dec (bit.left-shift ))) (def: ( input) - (-> (I64 Top) I64) + (-> (I64 Any) I64) (|> input (bit.and ) (bit.logical-right-shift ) i64))] [mantissa mantissa-mask mantissa-size +0] @@ -964,7 +964,7 @@ ) (def: #export (bits-to-frac input) - (-> (I64 Top) Frac) + (-> (I64 Any) Frac) (let [S (sign input) E (exponent input) M (mantissa input)] diff --git a/stdlib/source/lux/data/text/lexer.lux b/stdlib/source/lux/data/text/lexer.lux index d965020e0..84495a6a8 100644 --- a/stdlib/source/lux/data/text/lexer.lux +++ b/stdlib/source/lux/data/text/lexer.lux @@ -63,7 +63,7 @@ (def: #export (this reference) {#.doc "Lex a text if it matches the given sample."} - (-> Text (Lexer Top)) + (-> Text (Lexer Any)) (function (_ [offset tape]) (case (text.index-of' reference offset tape) (#.Some where) @@ -87,7 +87,7 @@ (def: #export end {#.doc "Ensure the lexer's input is empty."} - (Lexer Top) + (Lexer Any) (function (_ (^@ input [offset tape])) (if (n/= offset (text.size tape)) (#e.Success [input []]) diff --git a/stdlib/source/lux/data/text/regex.lux b/stdlib/source/lux/data/text/regex.lux index f644c4669..cf0d69475 100644 --- a/stdlib/source/lux/data/text/regex.lux +++ b/stdlib/source/lux/data/text/regex.lux @@ -309,7 +309,7 @@ )) (def: (unflatten^ lexer) - (-> (l.Lexer Text) (l.Lexer [Text Top])) + (-> (l.Lexer Text) (l.Lexer [Text Any])) (p.seq lexer (:: p.Monad wrap []))) (def: (|||^ left right) diff --git a/stdlib/source/lux/host.jvm.lux b/stdlib/source/lux/host.jvm.lux index 1f920c0b1..5fbeae68d 100644 --- a/stdlib/source/lux/host.jvm.lux +++ b/stdlib/source/lux/host.jvm.lux @@ -246,7 +246,7 @@ ["float" (primitive "java.lang.Float")] ["double" (primitive "java.lang.Double")] ["char" (primitive "java.lang.Character")] - ["void" .Top]) + ["void" .Any]) _ #.None)) @@ -264,7 +264,7 @@ ["long" .Int] ["float" .Frac] ["double" .Frac] - ["void" .Top]) + ["void" .Any]) _ #.None)) @@ -530,7 +530,7 @@ (-> Text Text (Syntax Code)) (do p.Monad [#let [dotted-name (format "::" field-name)] - [_ _ value] (: (Syntax [Top Top Code]) + [_ _ value] (: (Syntax [Any Any Code]) (s.form ($_ p.seq (s.this (' :=)) (s.this (code.symbol ["" dotted-name])) s.any)))] (wrap (`' ((~ (code.text (format "jvm putfield" ":" class-name ":" field-name))) _jvm_this (~ value)))))) @@ -657,7 +657,7 @@ (s.this (' >)))) (def: (assert-no-periods name) - (-> Text (Syntax Top)) + (-> Text (Syntax Any)) (p.assert "Names in class declarations cannot contain periods." (not (text.contains? "." name)))) @@ -1809,8 +1809,8 @@ (` ((~ setter-name) (~ g!value))) (` ((~ setter-name) (~ g!value) (~ g!obj)))) setter-type (if import-field-static? - (` (All [(~+ tvar-asts)] (-> (~ typeC) (IO Top)))) - (` (All [(~+ tvar-asts)] (-> (~ typeC) (~ classC) (IO Top))))) + (` (All [(~+ tvar-asts)] (-> (~ typeC) (IO Any)))) + (` (All [(~+ tvar-asts)] (-> (~ typeC) (~ classC) (IO Any))))) setter-value (with-mode-field-set import-field-mode import-field-type g!value) setter-value (if import-field-maybe? (` (!!! (~ setter-value))) @@ -1840,7 +1840,7 @@ ("jvm invokevirtual:java.lang.Class:isInterface:" class)) (def: (load-class class-name) - (-> Text (Either Text (primitive "java.lang.Class" [Top]))) + (-> Text (Either Text (primitive "java.lang.Class" [Any]))) (try ("jvm invokestatic:java.lang.Class:forName:java.lang.String" class-name))) (def: (class-kind [class-name _]) @@ -1942,7 +1942,7 @@ (def: (type->class-name type) (-> Type (Meta Text)) - (if (type/= Top type) + (if (type/= Any type) (:: Monad wrap "java.lang.Object") (case type (#.Primitive name params) diff --git a/stdlib/source/lux/io.lux b/stdlib/source/lux/io.lux index d35584fd1..21d70de61 100644 --- a/stdlib/source/lux/io.lux +++ b/stdlib/source/lux/io.lux @@ -9,7 +9,7 @@ (type: #export (IO a) {#.doc "A type that represents synchronous, effectful computations that may interact with the outside world."} - (-> Bottom a)) + (-> Nothing a)) (macro: #export (io tokens state) {#.doc (doc "Delays the evaluation of an expression, by wrapping it in an IO 'thunk'." @@ -27,13 +27,13 @@ (struct: #export _ (Functor IO) (def: (map f ma) - (io (f (ma (:! Bottom [])))))) + (io (f (ma (:! Nothing [])))))) (struct: #export _ (Apply IO) (def: functor Functor) (def: (apply ff fa) - (io ((ff (:! Bottom [])) (fa (:! Bottom [])))))) + (io ((ff (:! Nothing [])) (fa (:! Nothing [])))))) (struct: #export _ (Monad IO) (def: functor Functor) @@ -42,15 +42,15 @@ (io x)) (def: (join mma) - (io ((mma (:! Bottom [])) (:! Bottom []))))) + (io ((mma (:! Nothing [])) (:! Nothing []))))) (def: #export (run action) {#.doc "A way to execute IO computations and perform their side-effects."} (All [a] (-> (IO a) a)) - (action (:! Bottom []))) + (action (:! Nothing []))) (def: #export (exit code) - (-> Int (IO Bottom)) + (-> Int (IO Nothing)) (io ("lux io exit" code))) ## Process diff --git a/stdlib/source/lux/lang.lux b/stdlib/source/lux/lang.lux index 9f164b719..4c467c7fb 100644 --- a/stdlib/source/lux/lang.lux +++ b/stdlib/source/lux/lang.lux @@ -10,7 +10,7 @@ (macro ["s" syntax #+ syntax:]))) (type: #export Eval - (-> Type Code (Meta Top))) + (-> Type Code (Meta Any))) (def: #export (fail message) (All [a] (-> Text (Meta a))) diff --git a/stdlib/source/lux/lang/analysis/case.lux b/stdlib/source/lux/lang/analysis/case.lux index 3140a9d7e..744d3cf24 100644 --- a/stdlib/source/lux/lang/analysis/case.lux +++ b/stdlib/source/lux/lang/analysis/case.lux @@ -168,7 +168,7 @@ [Deg (#.Deg pattern-value) (#analysisL.Deg pattern-value)] [Frac (#.Frac pattern-value) (#analysisL.Frac pattern-value)] [Text (#.Text pattern-value) (#analysisL.Text pattern-value)] - [Top (#.Tuple #.Nil) #analysisL.Unit]) + [Any (#.Tuple #.Nil) #analysisL.Unit]) (^ [cursor (#.Tuple (list singleton))]) (analyse-pattern #.None inputT singleton next) diff --git a/stdlib/source/lux/lang/analysis/primitive.lux b/stdlib/source/lux/lang/analysis/primitive.lux index f154932e6..74596fba2 100644 --- a/stdlib/source/lux/lang/analysis/primitive.lux +++ b/stdlib/source/lux/lang/analysis/primitive.lux @@ -24,5 +24,5 @@ (def: #export unit (Meta Analysis) (do macro.Monad - [_ (typeA.infer Top)] + [_ (typeA.infer Any)] (wrap (#//.Primitive #//.Unit)))) diff --git a/stdlib/source/lux/lang/analysis/structure.lux b/stdlib/source/lux/lang/analysis/structure.lux index 8e3611e67..4e91baad7 100644 --- a/stdlib/source/lux/lang/analysis/structure.lux +++ b/stdlib/source/lux/lang/analysis/structure.lux @@ -299,7 +299,7 @@ (case record ## empty-record = empty-tuple = unit = [] #.Nil - (:: macro.Monad wrap [(list) Top]) + (:: macro.Monad wrap [(list) Any]) (#.Cons [head-k head-v] _) (do macro.Monad diff --git a/stdlib/source/lux/lang/analysis/type.lux b/stdlib/source/lux/lang/analysis/type.lux index 6d06d5cff..a7f9b3b29 100644 --- a/stdlib/source/lux/lang/analysis/type.lux +++ b/stdlib/source/lux/lang/analysis/type.lux @@ -42,7 +42,7 @@ output)))) (def: #export (infer actualT) - (-> Type (Meta Top)) + (-> Type (Meta Any)) (do macro.Monad [expectedT macro.expected-type] (with-env diff --git a/stdlib/source/lux/lang/init.lux b/stdlib/source/lux/lang/init.lux index a1ef4ffb8..80e6d4740 100644 --- a/stdlib/source/lux/lang/init.lux +++ b/stdlib/source/lux/lang/init.lux @@ -35,7 +35,7 @@ #.mode #.Build}) (def: #export (compiler host) - (-> Top Lux) + (-> Any Lux) {#.info ..info #.source dummy-source #.cursor .dummy-cursor @@ -46,11 +46,11 @@ #.expected #.None #.seed +0 #.scope-type-vars (list) - #.extensions (:! Bottom + #.extensions (:! Nothing [] ## {#extensionL.analysis analysisE.defaults ## #extensionL.synthesis synthesisE.defaults ## #extensionL.translation translationE.defaults ## #extensionL.statement statementE.defaults} ) - #.host (:! Bottom host)}) + #.host (:! Nothing host)}) diff --git a/stdlib/source/lux/lang/module.lux b/stdlib/source/lux/lang/module.lux index d5efb1d7e..161fd073a 100644 --- a/stdlib/source/lux/lang/module.lux +++ b/stdlib/source/lux/lang/module.lux @@ -56,7 +56,7 @@ #.module-state #.Active}) (def: #export (set-annotations annotations) - (-> Code (Meta Top)) + (-> Code (Meta Any)) (do macro.Monad [self-name macro.current-module-name self macro.current-module] @@ -72,7 +72,7 @@ (//.throw cannot-set-module-annotations-more-than-once [self-name old annotations])))) (def: #export (import module) - (-> Text (Meta Top)) + (-> Text (Meta Any)) (do macro.Monad [self-name macro.current-module-name] (function (_ compiler) @@ -82,7 +82,7 @@ []])))) (def: #export (alias alias module) - (-> Text Text (Meta Top)) + (-> Text Text (Meta Any)) (do macro.Monad [self-name macro.current-module-name] (function (_ compiler) @@ -141,7 +141,7 @@ (do-template [ ] [(def: #export ( module-name) - (-> Text (Meta Top)) + (-> Text (Meta Any)) (function (_ compiler) (case (|> compiler (get@ #.modules) (plist.get module-name)) (#.Some module) @@ -194,7 +194,7 @@ ) (def: (ensure-undeclared-tags module-name tags) - (-> Text (List Tag) (Meta Top)) + (-> Text (List Tag) (Meta Any)) (do macro.Monad [bindings (..tags module-name) _ (monad.map @ @@ -209,7 +209,7 @@ (wrap []))) (def: #export (declare-tags tags exported? type) - (-> (List Tag) Bool Type (Meta Top)) + (-> (List Tag) Bool Type (Meta Any)) (do macro.Monad [self-name macro.current-module-name [type-module type-name] (case type diff --git a/stdlib/source/lux/lang/syntax.lux b/stdlib/source/lux/lang/syntax.lux index bc1543cac..8029b5975 100644 --- a/stdlib/source/lux/lang/syntax.lux +++ b/stdlib/source/lux/lang/syntax.lux @@ -81,7 +81,7 @@ ## This is just a helper parser to find text which doesn't run into ## any special character sequences for multi-line comments. (def: comment-bound^ - (l.Lexer Top) + (l.Lexer Any) ($_ p.either (l.this new-line) (l.this ")#") diff --git a/stdlib/source/lux/lang/type.lux b/stdlib/source/lux/lang/type.lux index 1bfea13d6..36e6a74a8 100644 --- a/stdlib/source/lux/lang/type.lux +++ b/stdlib/source/lux/lang/type.lux @@ -274,8 +274,8 @@ (#.Cons type types') ( type ( types'))))] - [variant Bottom #.Sum] - [tuple Top #.Product] + [variant Nothing #.Sum] + [tuple Any #.Product] ) (def: #export (function inputs output) diff --git a/stdlib/source/lux/lang/type/check.lux b/stdlib/source/lux/lang/type/check.lux index 4537ae38d..61001d8be 100644 --- a/stdlib/source/lux/lang/type/check.lux +++ b/stdlib/source/lux/lang/type/check.lux @@ -203,7 +203,7 @@ (ex.throw unknown-type-var id)))) (def: #export (write type id) - (-> Type Var (Check Top)) + (-> Type Var (Check Any)) (function (_ context) (case (|> context (get@ #.var-bindings) (var::get id)) (#.Some (#.Some bound)) @@ -217,7 +217,7 @@ (ex.throw unknown-type-var id)))) (def: (update type id) - (-> Type Var (Check Top)) + (-> Type Var (Check Any)) (function (_ context) (case (|> context (get@ #.var-bindings) (var::get id)) (#.Some _) @@ -243,7 +243,7 @@ (get@ #.var-bindings context)]))) (def: (set-bindings value) - (-> (List [Var (Maybe Type)]) (Check Top)) + (-> (List [Var (Maybe Type)]) (Check Any)) (function (_ context) (#e.Success [(set@ #.var-bindings value context) []]))) @@ -319,7 +319,7 @@ (#e.Error message))) (def: #export (assert message test) - (-> Text Bool (Check Top)) + (-> Text Bool (Check Any)) (function (_ context) (if test (#e.Success [context []]) @@ -365,13 +365,13 @@ (else (maybe.default (#.Var id) ?bound))))) (def: (link-2 left right) - (-> Var Var (Check Top)) + (-> Var Var (Check Any)) (do Monad [_ (write (#.Var right) left)] (write (#.Var left) right))) (def: (link-3 interpose to from) - (-> Var Var Var (Check Top)) + (-> Var Var Var (Check Any)) (do Monad [_ (update (#.Var interpose) from)] (update (#.Var to) interpose))) @@ -449,7 +449,7 @@ (check' etype atype assumptions)))))) (def: (with-error-stack on-error check) - (All [a] (-> (-> Top Text) (Check a) (Check a))) + (All [a] (-> (-> Any Text) (Check a) (Check a))) (function (_ context) (case (check context) (#e.Error error) @@ -625,7 +625,7 @@ (def: #export (check expected actual) {#.doc "Type-check to ensure that the 'expected' type subsumes the 'actual' type."} - (-> Type Type (Check Top)) + (-> Type Type (Check Any)) (do Monad [assumptions (check' expected actual (list))] (wrap []))) diff --git a/stdlib/source/lux/macro.lux b/stdlib/source/lux/macro.lux index 8131db902..890ed5273 100644 --- a/stdlib/source/lux/macro.lux +++ b/stdlib/source/lux/macro.lux @@ -97,7 +97,7 @@ (def: #export (assert message test) {#.doc "Fails with the given message if the test is false."} - (-> Text Bool (Meta Top)) + (-> Text Bool (Meta Any)) (function (_ compiler) (if test (#e.Success [compiler []]) @@ -464,19 +464,19 @@ {#.doc "Looks-up the type of a local variable somewhere in the environment."} (-> Text (Meta Type)) (function (_ compiler) - (let [test (: (-> [Text [Type Top]] Bool) + (let [test (: (-> [Text [Type Any]] Bool) (|>> product.left (text/= name)))] (case (do maybe.Monad [scope (list.find (function (_ env) - (or (list.any? test (: (List [Text [Type Top]]) + (or (list.any? test (: (List [Text [Type Any]]) (get@ [#.locals #.mappings] env))) - (list.any? test (: (List [Text [Type Top]]) + (list.any? test (: (List [Text [Type Any]]) (get@ [#.captured #.mappings] env))))) (get@ #.scopes compiler)) [_ [type _]] (try-both (list.find test) - (: (List [Text [Type Top]]) + (: (List [Text [Type Any]]) (get@ [#.locals #.mappings] scope)) - (: (List [Text [Type Top]]) + (: (List [Text [Type Any]]) (get@ [#.captured #.mappings] scope)))] (wrap type)) (#.Some var-type) @@ -535,7 +535,7 @@ (find-def-type name)))) (def: #export (find-type-def name) - {#.doc "Finds the value of a type definition (such as Int, Top or Lux)."} + {#.doc "Finds the value of a type definition (such as Int, Any or Lux)."} (-> Ident (Meta Type)) (do Monad [[def-type def-data def-value] (find-def name)] diff --git a/stdlib/source/lux/macro/poly.lux b/stdlib/source/lux/macro/poly.lux index 63590953b..4c0363df0 100644 --- a/stdlib/source/lux/macro/poly.lux +++ b/stdlib/source/lux/macro/poly.lux @@ -165,7 +165,7 @@ list.reverse))))] (recur (inc current-arg) (|> env' - (dict.put partialI [.Bottom partialC]) + (dict.put partialI [.Nothing partialC]) (dict.put partial-varI [(#.Bound partial-varI) partial-varL])) (#.Cons partial-varL all-varsL)))) [all-varsL env']))]] @@ -196,7 +196,7 @@ (do-template [ ] [(def: #export ( expected) - (-> Type (Poly Top)) + (-> Type (Poly Any)) (do p.Monad [actual any] (if ( expected actual) @@ -235,7 +235,7 @@ (p.fail ($_ text/compose "Not a bound type: " (type.to-text headT)))))) (def: #export (var id) - (-> Nat (Poly Top)) + (-> Nat (Poly Any)) (do p.Monad [env ..env headT any] @@ -280,10 +280,10 @@ (do p.Monad [headT any] (case (type.un-name headT) - (#.Apply (#.Named ["lux" "Bottom"] _) (#.UnivQ _ headT')) + (#.Apply (#.Named ["lux" "Nothing"] _) (#.UnivQ _ headT')) (do @ [[recT _ output] (|> poly - (with-extension .Bottom) + (with-extension .Nothing) (with-extension headT) (local (list headT')))] (wrap [recT output])) @@ -297,7 +297,7 @@ [env ..env headT any] (case (type.un-name headT) - (^multi (#.Apply (#.Named ["lux" "Bottom"] _) (#.Bound funcT-idx)) + (^multi (#.Apply (#.Named ["lux" "Nothing"] _) (#.Bound funcT-idx)) (n/= +0 (adjusted-idx env funcT-idx)) [(dict.get +0 env) (#.Some [self-type self-call])]) (wrap self-call) @@ -404,7 +404,7 @@ (|> (dict.get idx env) maybe.assume product.left (to-code env)) (` (.$ (~ (code.nat (dec idx))))))) - (#.Apply (#.Named ["lux" "Bottom"] _) (#.Bound idx)) + (#.Apply (#.Named ["lux" "Nothing"] _) (#.Bound idx)) (let [idx (adjusted-idx env idx)] (if (n/= +0 idx) (|> (dict.get idx env) maybe.assume product.left (to-code env)) diff --git a/stdlib/source/lux/macro/poly/equality.lux b/stdlib/source/lux/macro/poly/equality.lux index 4cf8b2de0..8df347bba 100644 --- a/stdlib/source/lux/macro/poly/equality.lux +++ b/stdlib/source/lux/macro/poly/equality.lux @@ -45,7 +45,7 @@ (wrap (` (: (~ (@Eq inputT)) ))))] - [(poly.this Top) (function ((~ g!_) (~ g!_) (~ g!_)) true)] + [(poly.this Any) (function ((~ g!_) (~ g!_) (~ g!_)) true)] [(poly.like Bool) bool.Eq] [(poly.like Nat) number.Eq] [(poly.like Int) number.Eq] diff --git a/stdlib/source/lux/macro/poly/json.lux b/stdlib/source/lux/macro/poly/json.lux index 1bf0cba96..ba20f7627 100644 --- a/stdlib/source/lux/macro/poly/json.lux +++ b/stdlib/source/lux/macro/poly/json.lux @@ -87,7 +87,7 @@ (wrap (` (: (~ (@JSON//encode inputT)) ))))] - [(poly.this Top) (function ((~ g!_) (~ (code.symbol ["" "0"]))) #//.Null)] + [(poly.this Any) (function ((~ g!_) (~ (code.symbol ["" "0"]))) #//.Null)] [(poly.like Bool) (|>> #//.Boolean)] [(poly.like Nat) (:: (~! ..Codec) (~' encode))] [(poly.like Int) (:: (~! ..Codec) (~' encode))] @@ -203,7 +203,7 @@ (wrap (` (: (~ (@JSON//decode inputT)) ))))] - [(poly.this Top) //.null] + [(poly.this Any) //.null] [(poly.like Bool) //.boolean] [(poly.like Nat) (p.codec (~! ..Codec) //.any)] [(poly.like Int) (p.codec (~! ..Codec) //.any)] diff --git a/stdlib/source/lux/macro/syntax.lux b/stdlib/source/lux/macro/syntax.lux index d7621eba4..0268cae29 100644 --- a/stdlib/source/lux/macro/syntax.lux +++ b/stdlib/source/lux/macro/syntax.lux @@ -80,7 +80,7 @@ (def: #export (this ast) {#.doc "Ensures the given Code is the next input."} - (-> Code (Syntax Top)) + (-> Code (Syntax Any)) (function (_ tokens) (case tokens (#.Cons [token tokens']) @@ -143,7 +143,7 @@ (def: #export end! {#.doc "Ensures there are no more inputs."} - (Syntax Top) + (Syntax Any) (function (_ tokens) (case tokens #.Nil (#e.Success [tokens []]) diff --git a/stdlib/source/lux/macro/syntax/common/reader.lux b/stdlib/source/lux/macro/syntax/common/reader.lux index 49ef3851d..c84cc5624 100644 --- a/stdlib/source/lux/macro/syntax/common/reader.lux +++ b/stdlib/source/lux/macro/syntax/common/reader.lux @@ -50,7 +50,7 @@ (s.tuple (p.seq s.text s.text))) (def: (_definition-anns^ _) - (-> Top (Syntax //.Annotations)) + (-> Any (Syntax //.Annotations)) (p.alt (s.this (' #.Nil)) (s.form (do p.Monad [_ (s.this (' #.Cons)) @@ -60,7 +60,7 @@ )) (def: (flat-list^ _) - (-> Top (Syntax (List Code))) + (-> Any (Syntax (List Code))) (p.either (do p.Monad [_ (s.this (' #.Nil))] (wrap (list))) diff --git a/stdlib/source/lux/math/constructive.lux b/stdlib/source/lux/math/constructive.lux index 25fd6a29f..8d375fad7 100644 --- a/stdlib/source/lux/math/constructive.lux +++ b/stdlib/source/lux/math/constructive.lux @@ -120,7 +120,7 @@ {} - .Top)))) + .Any)))) (#.Some meaning) (wrap (.list (.` (.type: (~+ (scw.export export?)) @@ -185,7 +185,7 @@ (~ meaning))))))) (.type: #export (not p) - (-> p .Bottom)) + (-> p .Nothing)) (.type: #export (Test p) (#True p) @@ -194,6 +194,6 @@ (exception: #export absurd) (.def: #export absurdity - (.All [p] (-> p .Bottom)) + (.All [p] (-> p .Nothing)) (.function (_ proof) (.error! (ex.construct absurd [])))) diff --git a/stdlib/source/lux/math/random.lux b/stdlib/source/lux/math/random.lux index cdb65971c..55c504585 100644 --- a/stdlib/source/lux/math/random.lux +++ b/stdlib/source/lux/math/random.lux @@ -24,7 +24,7 @@ (type: #export #rec PRNG {#.doc "An abstract way to represent any PRNG."} - (-> Top [PRNG I64])) + (-> Any [PRNG I64])) (type: #export (Random a) {#.doc "A producer of random values based on a PRNG."} @@ -248,7 +248,7 @@ {#.doc "An implementation of the PCG32 algorithm. For more information, please see: http://www.pcg-random.org/"} - (-> [(I64 Top) (I64 Top)] PRNG) + (-> [(I64 Any) (I64 Any)] PRNG) (function (_ _) [(|> seed .nat (n/* pcg-32-magic-mult) ("lux i64 +" inc) [inc] pcg-32) (let [rot (|> seed .i64 (bit.logical-right-shift +59))] @@ -263,7 +263,7 @@ {#.doc "An implementation of the Xoroshiro128+ algorithm. For more information, please see: http://xoroshiro.di.unimi.it/"} - (-> [(I64 Top) (I64 Top)] PRNG) + (-> [(I64 Any) (I64 Any)] PRNG) (function (_ _) [(let [s01 (bit.xor s0 s1)] (xoroshiro-128+ [(|> s0 diff --git a/stdlib/source/lux/test.lux b/stdlib/source/lux/test.lux index c78424559..33ac37423 100644 --- a/stdlib/source/lux/test.lux +++ b/stdlib/source/lux/test.lux @@ -22,7 +22,7 @@ (type: #export Seed {#.doc "The seed value used for random testing (if that feature is used)."} - (I64 Top)) + (I64 Any)) (type: #export Test (r.Random (Promise [Counters Text]))) @@ -91,7 +91,7 @@ [prng result]))) (def: (times-failure seed documentation) - (-> (I64 Top) Text Text) + (-> (I64 Any) Text Text) (format "Failed with this seed: " (%n (.nat seed)) "\n" documentation)) @@ -227,7 +227,7 @@ list.reverse (monad.map @ exported-tests) (:: @ map list/join)))] - (wrap (list (` (: (~! (IO Top)) + (wrap (list (` (: (~! (IO Any)) ((~! io) (exec ((~! do) (~! promise.Monad) [(~' #let) [(~ g!total-successes) +0 (~ g!total-failures) +0] diff --git a/stdlib/source/lux/type/abstract.lux b/stdlib/source/lux/type/abstract.lux index be53d4d9d..2caaf62bb 100644 --- a/stdlib/source/lux/type/abstract.lux +++ b/stdlib/source/lux/type/abstract.lux @@ -58,7 +58,7 @@ (let [[module kind] (ident-for #..Representation)]))) (def: (install-casts' this-module-name name type-vars) - (-> Text Text (List Text) (Meta Top)) + (-> Text Text (List Text) (Meta Any)) (do macro.Monad [this-module (macro.find-module this-module-name) #let [type-varsC (list/map code.local-symbol type-vars) @@ -96,7 +96,7 @@ []])))) (def: (un-install-casts' this-module-name) - (-> Text (Meta Top)) + (-> Text (Meta Any)) (do macro.Monad [this-module (macro.find-module this-module-name) #let [this-module (|> this-module diff --git a/stdlib/source/lux/type/resource.lux b/stdlib/source/lux/type/resource.lux index c25db4aab..2c7062c1a 100644 --- a/stdlib/source/lux/type/resource.lux +++ b/stdlib/source/lux/type/resource.lux @@ -137,7 +137,7 @@ (wrap (list& head tail)))))))) (def: (no-op Monad) - (All [m] (-> (Monad m) (Linear m Top))) + (All [m] (-> (Monad m) (Linear m Any))) (function (_ context) (:: Monad wrap [context []]))) (do-template [ ] @@ -166,7 +166,7 @@ (Procedure (~! ) [(~+ g!inputsT+) (~ g!context)] [(~+ g!outputsT+) (~ g!context)] - .Top)) + .Any)) (function ((~ g!_) [(~+ g!inputs) (~ g!context)]) (:: (~! ) (~' wrap) [[(~+ g!outputs) (~ g!context)] []]))))))))))] @@ -191,7 +191,7 @@ (Procedure (~! ) [ (~ g!context)] [ (~ g!context)] - .Top)) + .Any)) (function ((~ g!_) [ (~ g!context)]) (:: (~! ) (~' wrap) [[ (~ g!context)] []])))))))))] diff --git a/stdlib/source/lux/world/blob.jvm.lux b/stdlib/source/lux/world/blob.jvm.lux index 88b1913e9..df9fcf8d2 100644 --- a/stdlib/source/lux/world/blob.jvm.lux +++ b/stdlib/source/lux/world/blob.jvm.lux @@ -30,7 +30,7 @@ (|>> host.byte-to-long (:! I64) (bit.and byte-mask))) (def: byte - (-> (I64 Top) (primitive "java.lang.Byte")) + (-> (I64 Any) (primitive "java.lang.Byte")) (|>> .int host.long-to-byte)) (def: #export (create size) @@ -76,7 +76,7 @@ (ex.throw index-out-of-bounds (%n idx)))) (def: #export (write-8 idx value blob) - (-> Nat (I64 Top) Blob (e.Error Blob)) + (-> Nat (I64 Any) Blob (e.Error Blob)) (if (n/< (host.array-length blob) idx) (exec (|> blob (host.array-write idx (..byte value))) @@ -84,7 +84,7 @@ (ex.throw index-out-of-bounds (%n idx)))) (def: #export (write-16 idx value blob) - (-> Nat (I64 Top) Blob (e.Error Blob)) + (-> Nat (I64 Any) Blob (e.Error Blob)) (if (n/< (host.array-length blob) (n/+ +1 idx)) (exec (|> blob (host.array-write idx (..byte (bit.logical-right-shift +8 value))) @@ -93,7 +93,7 @@ (ex.throw index-out-of-bounds (%n idx)))) (def: #export (write-32 idx value blob) - (-> Nat (I64 Top) Blob (e.Error Blob)) + (-> Nat (I64 Any) Blob (e.Error Blob)) (if (n/< (host.array-length blob) (n/+ +3 idx)) (exec (|> blob (host.array-write idx (..byte (bit.logical-right-shift +24 value))) @@ -104,7 +104,7 @@ (ex.throw index-out-of-bounds (%n idx)))) (def: #export (write-64 idx value blob) - (-> Nat (I64 Top) Blob (e.Error Blob)) + (-> Nat (I64 Any) Blob (e.Error Blob)) (if (n/< (host.array-length blob) (n/+ +7 idx)) (exec (|> blob (host.array-write idx (..byte (bit.logical-right-shift +56 value))) diff --git a/stdlib/source/lux/world/console.lux b/stdlib/source/lux/world/console.lux index 7e5d72790..7bd7cfaca 100644 --- a/stdlib/source/lux/world/console.lux +++ b/stdlib/source/lux/world/console.lux @@ -12,8 +12,8 @@ (interface: #export Console (read-char [] (Task Text)) (read-line [] (Task Text)) - (write [Text] (Task Top)) - (close [] (Task Top))) + (write [Text] (Task Any)) + (close [] (Task Any))) (for {"JVM" (as-is (host.import java/io/InputStream diff --git a/stdlib/source/lux/world/file.lux b/stdlib/source/lux/world/file.lux index 92fdd1501..78640ad58 100644 --- a/stdlib/source/lux/world/file.lux +++ b/stdlib/source/lux/world/file.lux @@ -53,7 +53,7 @@ (do-template [ ] [(def: #export ( data file) - (-> Blob File (Process Top)) + (-> Blob File (Process Any)) (do io.Monad [stream (FileOutputStream::new [(java/io/File::new file) ]) _ (OutputStream::write [data] stream) diff --git a/stdlib/source/lux/world/net/tcp.jvm.lux b/stdlib/source/lux/world/net/tcp.jvm.lux index a0cfbc4b6..fddd6a94e 100644 --- a/stdlib/source/lux/world/net/tcp.jvm.lux +++ b/stdlib/source/lux/world/net/tcp.jvm.lux @@ -50,7 +50,7 @@ (wrap (.nat bytes-read))))) (def: #export (write data offset length self) - (-> Blob Nat Nat TCP (Task Top)) + (-> Blob Nat Nat TCP (Task Any)) (let [out (get@ #out (@representation self))] (promise.future (do io.Monad @@ -59,7 +59,7 @@ (Flushable::flush [] out))))) (def: #export (close self) - (-> TCP (Task Top)) + (-> TCP (Task Any)) (let [(^open) (@representation self)] (promise.future (do io.Monad @@ -85,19 +85,19 @@ (tcp-client socket)))) (def: #export (server port) - (-> //.Port (Task [(Promise Top) + (-> //.Port (Task [(Promise Any) (frp.Channel TCP)])) (promise.future (do (e.ErrorT io.Monad) [server (ServerSocket::new [(.int port)]) - #let [signal (: (Promise Top) + #let [signal (: (Promise Any) (promise #.None)) _ (promise.await (function (_ _) (AutoCloseable::close [] server)) signal) output (: (frp.Channel TCP) (frp.channel [])) - _ (: (Promise Top) + _ (: (Promise Any) (promise.future (loop [_ []] (do io.Monad diff --git a/stdlib/source/lux/world/net/udp.jvm.lux b/stdlib/source/lux/world/net/udp.jvm.lux index da4f8f05d..5818020e6 100644 --- a/stdlib/source/lux/world/net/udp.jvm.lux +++ b/stdlib/source/lux/world/net/udp.jvm.lux @@ -72,7 +72,7 @@ (.nat (DatagramPacket::getPort [] packet))]))))) (def: #export (write address port data offset length self) - (-> //.Address //.Port Blob Nat Nat UDP (T.Task Top)) + (-> //.Address //.Port Blob Nat Nat UDP (T.Task Any)) (P.future (do (e.ErrorT io.Monad) [address (resolve address) @@ -81,13 +81,13 @@ socket)))) (def: #export (close self) - (-> UDP (T.Task Top)) + (-> UDP (T.Task Any)) (let [(^open) (@representation self)] (P.future (AutoCloseable::close [] socket)))) (def: #export (client _) - (-> Top (T.Task UDP)) + (-> Any (T.Task UDP)) (P.future (do (e.ErrorT io.Monad) [socket (DatagramSocket::new|client [])] diff --git a/stdlib/test/test/lux/concurrency/frp.lux b/stdlib/test/test/lux/concurrency/frp.lux index 527fafb36..6de1634ec 100644 --- a/stdlib/test/test/lux/concurrency/frp.lux +++ b/stdlib/test/test/lux/concurrency/frp.lux @@ -11,7 +11,7 @@ lux/test) (def: (write! values channel) - (All [a] (-> (List a) (Channel a) (IO Top))) + (All [a] (-> (List a) (Channel a) (IO Any))) (do io.Monad [_ (monad.map @ (frp.publish channel) values)] (wrap []))) diff --git a/stdlib/test/test/lux/concurrency/semaphore.lux b/stdlib/test/test/lux/concurrency/semaphore.lux index af025dbb5..b360426c5 100644 --- a/stdlib/test/test/lux/concurrency/semaphore.lux +++ b/stdlib/test/test/lux/concurrency/semaphore.lux @@ -13,7 +13,7 @@ lux/test) (def: (wait-many-times times semaphore) - (-> Nat /.Semaphore (Promise Top)) + (-> Nat /.Semaphore (Promise Any)) (loop [steps times] (if (n/> +0 steps) (do promise.Monad @@ -44,7 +44,7 @@ true))))) (let [semaphore (/.semaphore open-positions)] (wrap (do promise.Monad - [_ (: (Promise Top) + [_ (: (Promise Any) (loop [steps (n/* +2 open-positions)] (if (n/> +0 steps) (do @ @@ -110,7 +110,7 @@ )))) (def: (waiter resource barrier id) - (-> (Atom Text) /.Barrier Nat (Promise Top)) + (-> (Atom Text) /.Barrier Nat (Promise Any)) (do promise.Monad [_ (/.block barrier) #let [_ (io.run (atom.update (|>> (format (%n id))) resource))]] diff --git a/stdlib/test/test/lux/control/parser.lux b/stdlib/test/test/lux/control/parser.lux index bc26444ce..fd1f67724 100644 --- a/stdlib/test/test/lux/control/parser.lux +++ b/stdlib/test/test/lux/control/parser.lux @@ -25,7 +25,7 @@ _ false)) (def: (enforced? parser input) - (All [s] (-> (&.Parser s Top) s Bool)) + (All [s] (-> (&.Parser s Any) s Bool)) (case (&.run input parser) (#E.Success [_ []]) true diff --git a/stdlib/test/test/lux/control/region.lux b/stdlib/test/test/lux/control/region.lux index a266218f9..48b2b1b7f 100644 --- a/stdlib/test/test/lux/control/region.lux +++ b/stdlib/test/test/lux/control/region.lux @@ -73,7 +73,7 @@ count-clean-up (function (_ value) (do @ [_ (thread.update inc clean-up-counter)] - (wrap (: (Error Top) (ex.throw oops [])))))] + (wrap (: (Error Any) (ex.throw oops [])))))] outcome (/.run @ (do (/.Monad @) [_ (monad.map @ (/.acquire @@ count-clean-up) diff --git a/stdlib/test/test/lux/lang/analysis/primitive.lux b/stdlib/test/test/lux/lang/analysis/primitive.lux index 8e4ca6dde..6e2a8aae9 100644 --- a/stdlib/test/test/lux/lang/analysis/primitive.lux +++ b/stdlib/test/test/lux/lang/analysis/primitive.lux @@ -29,7 +29,7 @@ (~~ (do-template [ ] [(r.seq (r/wrap ) (r/map ))] - [Top code.tuple (r.list +0 ..unit)] + [Any code.tuple (r.list +0 ..unit)] [Bool code.bool r.bool] [Nat code.nat r.nat] [Int code.int r.int] @@ -58,7 +58,7 @@ (context: "Primitives" ($_ seq (test "Can analyse unit." - (|> (infer-primitive Top (..analyse (' []))) + (|> (infer-primitive Any (..analyse (' []))) (case> (^ (#e.Success (#analysis.Primitive (#analysis.Unit output)))) (is? [] output) diff --git a/stdlib/test/test/lux/lang/type.lux b/stdlib/test/test/lux/lang/type.lux index be888d321..22cd568ee 100644 --- a/stdlib/test/test/lux/lang/type.lux +++ b/stdlib/test/test/lux/lang/type.lux @@ -102,8 +102,8 @@ (and (L/= (list) members) (L/= (list ) flat)))))] - ["variant" &.variant &.flatten-variant Bottom] - ["tuple" &.tuple &.flatten-tuple Top] + ["variant" &.variant &.flatten-variant Nothing] + ["tuple" &.tuple &.flatten-tuple Any] )] ($_ seq diff --git a/stdlib/test/test/lux/lang/type/check.lux b/stdlib/test/test/lux/lang/type/check.lux index b384ad2ef..57285c91c 100644 --- a/stdlib/test/test/lux/lang/type/check.lux +++ b/stdlib/test/test/lux/lang/type/check.lux @@ -74,23 +74,23 @@ false)) ## [Tests] -(context: "Top and Bottom." +(context: "Any and Nothing." (<| (times +100) (do @ [sample (|> gen-type (r.filter valid-type?))] ($_ seq - (test "Top is the super-type of everything." - (@.checks? Top sample)) + (test "Any is the super-type of everything." + (@.checks? Any sample)) - (test "Bottom is the sub-type of everything." - (@.checks? sample Bottom)) + (test "Nothing is the sub-type of everything." + (@.checks? sample Nothing)) )))) (context: "Simple type-checking." ($_ seq - (test "Top and Bottom match themselves." - (and (@.checks? Bottom Bottom) - (@.checks? Top Top))) + (test "Any and Nothing match themselves." + (and (@.checks? Nothing Nothing) + (@.checks? Any Any))) (test "Existential types only match with themselves." (and (type-checks? (do @.Monad @@ -116,10 +116,10 @@ (#.Named ["module" "name"] exT)))))) (test "Functions are covariant on inputs and contravariant on outputs." - (and (@.checks? (#.Function Bottom Top) - (#.Function Top Bottom)) - (not (@.checks? (#.Function Top Bottom) - (#.Function Bottom Top))))) + (and (@.checks? (#.Function Nothing Any) + (#.Function Any Nothing)) + (not (@.checks? (#.Function Any Nothing) + (#.Function Nothing Any))))) )) (context: "Type application." @@ -164,10 +164,10 @@ (test "Can bind unbound type-vars by type-checking against them." (and (type-checks? (do @.Monad [[id var] @.var] - (@.check var .Top))) + (@.check var .Any))) (type-checks? (do @.Monad [[id var] @.var] - (@.check .Top var))))) + (@.check .Any var))))) (test "Cannot rebind already bound type-vars." (not (type-checks? (do @.Monad @@ -178,13 +178,13 @@ (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 Top)] + _ (@.check var Any)] (@.check var .Bool)))) (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 Bottom)] + _ (@.check var Nothing)] (@.check .Bool var)))) )) diff --git a/stdlib/test/test/lux/type/object/interface.lux b/stdlib/test/test/lux/type/object/interface.lux index f74d32e2a..7e2bddcdb 100644 --- a/stdlib/test/test/lux/type/object/interface.lux +++ b/stdlib/test/test/lux/type/object/interface.lux @@ -23,7 +23,7 @@ (class: NatRC Resettable-Counter #super NatC - Top + Any (def: reset (set@Counter +0))) @@ -48,7 +48,7 @@ (class: (ListI a) (Iterable a) #super (ListC a) - Top + Any (def: enumerate get@Collection)) diff --git a/stdlib/test/test/lux/type/object/protocol.lux b/stdlib/test/test/lux/type/object/protocol.lux index fcb53d3b1..58e4f6fcd 100644 --- a/stdlib/test/test/lux/type/object/protocol.lux +++ b/stdlib/test/test/lux/type/object/protocol.lux @@ -3,10 +3,10 @@ (lux (data text/format) (type (object protocol)))) -(type: Counter (Object (Method Top Nat))) +(type: Counter (Object (Method Any Nat))) (def: (count [tick return] state) - (Class Nat (Method Top Nat)) + (Class Nat (Method Any Nat)) (let [state' (inc state)] [(return state') state'])) @@ -48,20 +48,20 @@ (read [] a)) (def: (readM [tick return] state) - (All [s] (Class s (Method Top s))) + (All [s] (Class s (Method Any s))) [(return state) state]) (protocol: (Add n) - (+ n Top) - (- n Top)) + (+ n Any) + (- n Any)) (protocol: (Mul n) - (* n Top) - (/ n Top)) + (* n Any) + (/ n Any)) (do-template [ ] [(def: ( [diff return] state) - (Class Nat (Method Nat Top)) + (Class Nat (Method Nat Any)) [(return []) ( diff state)])] [+M n/+] @@ -108,11 +108,11 @@ (numberO (+0 (read [])))) (def: _test3 - [Top NatO] + [Any NatO] (numberO (+1 (+0 (+ +123))))) (def: _test4 - [Top NatO] + [Any NatO] (numberO (+1 (+1 (* +123))))) ## TODO: Fix when new-luxc is the official compiler. @@ -121,9 +121,9 @@ ## (numberO (^read (read [])))) ## (def: _test3 -## [Top NatO] +## [Any NatO] ## (numberO (^add (+ +123)))) ## (def: _test4 -## [Top NatO] +## [Any NatO] ## (numberO (^mul (* +123)))) diff --git a/stdlib/test/test/lux/world/blob.lux b/stdlib/test/test/lux/world/blob.lux index e1c77552b..a74fb20e0 100644 --- a/stdlib/test/test/lux/world/blob.lux +++ b/stdlib/test/test/lux/world/blob.lux @@ -33,7 +33,7 @@ (:: r.Monad wrap output))))) (def: (bits-io bytes read write value) - (-> Nat (-> Nat /.Blob (e.Error Nat)) (-> Nat Nat /.Blob (e.Error Top)) Nat Bool) + (-> Nat (-> Nat /.Blob (e.Error Nat)) (-> Nat Nat /.Blob (e.Error Any)) Nat Bool) (let [blob (/.create +8) bits (n/* +8 bytes) capped-value (|> +1 (bit.left-shift bits) dec (bit.and value))] -- cgit v1.2.3