From 03f7f28bcfcd814091537a32dd5c11a388da273b Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 4 Dec 2018 20:29:08 -0400 Subject: Some refactoring and small fixes. --- stdlib/source/lux/cli.lux | 7 ++++--- stdlib/source/lux/concurrency/atom.lux | 5 +++-- stdlib/source/lux/concurrency/process.lux | 5 +++-- stdlib/source/lux/concurrency/stm.lux | 5 ++++- stdlib/source/lux/control/thread.lux | 5 +++-- stdlib/source/lux/data/collection/array.lux | 5 +++-- stdlib/source/lux/data/text.lux | 5 +++-- 7 files changed, 23 insertions(+), 14 deletions(-) (limited to 'stdlib/source') diff --git a/stdlib/source/lux/cli.lux b/stdlib/source/lux/cli.lux index 043519111..0ac9ff0bd 100644 --- a/stdlib/source/lux/cli.lux +++ b/stdlib/source/lux/cli.lux @@ -12,8 +12,9 @@ [macro (#+ with-gensyms) ["." code] ["s" syntax (#+ syntax: Syntax)]] - [compiler - ["." host]] + [platform + [compiler + ["." host]]] ["." io] [concurrency ["." process]]]) @@ -28,7 +29,7 @@ (All [a] (-> (List Text) (CLI a) (E.Error a))) (case (p.run inputs parser) (#E.Success [remaining output]) - (case remaining + (case remaining #.Nil (#E.Success output) diff --git a/stdlib/source/lux/concurrency/atom.lux b/stdlib/source/lux/concurrency/atom.lux index 2df357124..b1692b6e3 100644 --- a/stdlib/source/lux/concurrency/atom.lux +++ b/stdlib/source/lux/concurrency/atom.lux @@ -6,8 +6,9 @@ ["." io (#- run)] [type abstract] - [compiler - ["." host]] + [platform + [compiler + ["." host]]] [host (#+ import:)]]) (`` (for {(~~ (static host.jvm)) diff --git a/stdlib/source/lux/concurrency/process.lux b/stdlib/source/lux/concurrency/process.lux index e63aba14d..c2b519fb4 100644 --- a/stdlib/source/lux/concurrency/process.lux +++ b/stdlib/source/lux/concurrency/process.lux @@ -6,8 +6,9 @@ [data [collection ["." list]]] - [compiler - ["." host]] + [platform + [compiler + ["." host]]] ["." io (#+ IO io)] [host (#+ import: object)]] [// diff --git a/stdlib/source/lux/concurrency/stm.lux b/stdlib/source/lux/concurrency/stm.lux index 3c6691acc..648d86d95 100644 --- a/stdlib/source/lux/concurrency/stm.lux +++ b/stdlib/source/lux/concurrency/stm.lux @@ -17,10 +17,13 @@ [type abstract]]) +(type: #export (Observer a) + (-> a (IO Any))) + (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 Any)))]) + (Atom [a (List (Observer a))]) (def: #export (var value) {#.doc "Creates a new STM var, with a default value."} diff --git a/stdlib/source/lux/control/thread.lux b/stdlib/source/lux/control/thread.lux index f81877a2a..9aad8aca0 100644 --- a/stdlib/source/lux/control/thread.lux +++ b/stdlib/source/lux/control/thread.lux @@ -9,8 +9,9 @@ ["." array (#+ Array)]]] [type (#+ :share) abstract] - [compiler - ["." host]] + [platform + [compiler + ["." host]]] [io (#+ IO)]]) (type: #export (Thread ! a) diff --git a/stdlib/source/lux/data/collection/array.lux b/stdlib/source/lux/data/collection/array.lux index 339e4e7ca..c38ae1371 100644 --- a/stdlib/source/lux/data/collection/array.lux +++ b/stdlib/source/lux/data/collection/array.lux @@ -11,8 +11,9 @@ ["." maybe] [collection ["." list ("list/." Fold)]]] - [compiler - ["." host]]]) + [platform + [compiler + ["." host]]]]) (def: #export array-type-name "#Array") diff --git a/stdlib/source/lux/data/text.lux b/stdlib/source/lux/data/text.lux index 2cd6f7980..6c427f151 100644 --- a/stdlib/source/lux/data/text.lux +++ b/stdlib/source/lux/data/text.lux @@ -13,8 +13,9 @@ ["." i64]] [collection ["." list ("list/." Fold)]]] - [compiler - ["." host]]]) + [platform + [compiler + ["." host]]]]) (type: #export Char Nat) -- cgit v1.2.3