aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/world
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/world')
-rw-r--r--stdlib/source/library/lux/world/console.lux26
-rw-r--r--stdlib/source/library/lux/world/db/jdbc/input.lux4
-rw-r--r--stdlib/source/library/lux/world/db/jdbc/output.lux64
-rw-r--r--stdlib/source/library/lux/world/file.lux170
-rw-r--r--stdlib/source/library/lux/world/file/watch.lux36
-rw-r--r--stdlib/source/library/lux/world/net/http/client.lux14
-rw-r--r--stdlib/source/library/lux/world/net/http/request.lux20
-rw-r--r--stdlib/source/library/lux/world/program.lux46
-rw-r--r--stdlib/source/library/lux/world/shell.lux26
9 files changed, 203 insertions, 203 deletions
diff --git a/stdlib/source/library/lux/world/console.lux b/stdlib/source/library/lux/world/console.lux
index e3d156adf..7c974630f 100644
--- a/stdlib/source/library/lux/world/console.lux
+++ b/stdlib/source/library/lux/world/console.lux
@@ -74,7 +74,7 @@
#.None
(in (exception.except ..cannot_open []))
- (#.Some jvm_console)
+ {#.Some jvm_console}
(let [jvm_input (java/lang/System::in)
jvm_output (java/lang/System::out)]
(<| in
@@ -122,13 +122,13 @@
(do [! io.monad]
[|state| (atom.read! state)]
(case (\ mock <mock> |state|)
- (#try.Success [|state| output])
+ {#try.Success [|state| output]}
(do !
[_ (atom.write! |state| state)]
- (in (#try.Success output)))
+ (in {#try.Success output}))
- (#try.Failure error)
- (in (#try.Failure error)))))]
+ {#try.Failure error}
+ (in {#try.Failure error}))))]
[read on_read]
[read_line on_read_line]
@@ -138,23 +138,23 @@
(do [! io.monad]
[|state| (atom.read! state)]
(case (\ mock on_write input |state|)
- (#try.Success |state|)
+ {#try.Success |state|}
(do !
[_ (atom.write! |state| state)]
- (in (#try.Success [])))
+ (in {#try.Success []}))
- (#try.Failure error)
- (in (#try.Failure error)))))
+ {#try.Failure error}
+ (in {#try.Failure error}))))
(def: (close _)
(do [! io.monad]
[|state| (atom.read! state)]
(case (\ mock on_close |state|)
- (#try.Success |state|)
+ {#try.Success |state|}
(do !
[_ (atom.write! |state| state)]
- (in (#try.Success [])))
+ (in {#try.Success []}))
- (#try.Failure error)
- (in (#try.Failure error)))))
+ {#try.Failure error}
+ (in {#try.Failure error}))))
))))
diff --git a/stdlib/source/library/lux/world/db/jdbc/input.lux b/stdlib/source/library/lux/world/db/jdbc/input.lux
index 1819241b3..aa8a168af 100644
--- a/stdlib/source/library/lux/world/db/jdbc/input.lux
+++ b/stdlib/source/library/lux/world/db/jdbc/input.lux
@@ -64,12 +64,12 @@
(def: .public (fail error)
(All (_ a) (-> Text (Input a)))
(function (_ value [idx context])
- (#try.Failure error)))
+ {#try.Failure error}))
(def: .public empty
(Input Any)
(function (_ value context)
- (#try.Success context)))
+ {#try.Success context}))
(template [<function> <type> <setter>]
[(def: .public <function>
diff --git a/stdlib/source/library/lux/world/db/jdbc/output.lux b/stdlib/source/library/lux/world/db/jdbc/output.lux
index 25b4b0668..3772ff0e1 100644
--- a/stdlib/source/library/lux/world/db/jdbc/output.lux
+++ b/stdlib/source/library/lux/world/db/jdbc/output.lux
@@ -56,11 +56,11 @@
(def: (each f fa)
(function (_ idx+rs)
(case (fa idx+rs)
- (#try.Failure error)
- (#try.Failure error)
+ {#try.Failure error}
+ {#try.Failure error}
- (#try.Success [idx' value])
- (#try.Success [idx' (f value)])))))
+ {#try.Success [idx' value]}
+ {#try.Success [idx' (f value)]}))))
(implementation: .public apply
(Apply Output)
@@ -70,16 +70,16 @@
(def: (apply ff fa)
(function (_ [idx rs])
(case (ff [idx rs])
- (#try.Success [idx' f])
+ {#try.Success [idx' f]}
(case (fa [idx' rs])
- (#try.Success [idx'' a])
- (#try.Success [idx'' (f a)])
+ {#try.Success [idx'' a]}
+ {#try.Success [idx'' (f a)]}
- (#try.Failure msg)
- (#try.Failure msg))
+ {#try.Failure msg}
+ {#try.Failure msg})
- (#try.Failure msg)
- (#try.Failure msg)))))
+ {#try.Failure msg}
+ {#try.Failure msg}))))
(implementation: .public monad
(Monad Output)
@@ -88,21 +88,21 @@
(def: (in a)
(function (_ [idx rs])
- (#.Some [idx a])))
+ {#.Some [idx a]}))
(def: (conjoint mma)
(function (_ [idx rs])
(case (mma [idx rs])
- (#try.Failure error)
- (#try.Failure error)
+ {#try.Failure error}
+ {#try.Failure error}
- (#try.Success [idx' ma])
+ {#try.Success [idx' ma]}
(ma [idx' rs])))))
(def: .public (fail error)
(All (_ a) (-> Text (Output a)))
(function (_ [idx result_set])
- (#try.Failure error)))
+ {#try.Failure error}))
(def: .public (and left right)
(All (_ a b)
@@ -117,11 +117,11 @@
(Output <type>)
(function (_ [idx result_set])
(case (<method_name> [(.int idx)] result_set)
- (#try.Failure error)
- (#try.Failure error)
+ {#try.Failure error}
+ {#try.Failure error}
- (#try.Success value)
- (#try.Success [(++ idx) value]))))]
+ {#try.Success value}
+ {#try.Success [(++ idx) value]})))]
[boolean java/sql/ResultSet::getBoolean Bit]
@@ -142,12 +142,12 @@
(Output Instant)
(function (_ [idx result_set])
(case (<method_name> [(.int idx)] result_set)
- (#try.Failure error)
- (#try.Failure error)
+ {#try.Failure error}
+ {#try.Failure error}
- (#try.Success value)
- (#try.Success [(++ idx)
- (instant.from_millis (java/util/Date::getTime value))]))))]
+ {#try.Success value}
+ {#try.Success [(++ idx)
+ (instant.from_millis (java/util/Date::getTime value))]})))]
[date java/sql/ResultSet::getDate]
[time java/sql/ResultSet::getTime]
@@ -157,24 +157,24 @@
(def: .public (rows output results)
(All (_ a) (-> (Output a) java/sql/ResultSet (IO (Try (List a)))))
(case (java/sql/ResultSet::next results)
- (#try.Success has_next?)
+ {#try.Success has_next?}
(if has_next?
(case (output [1 results])
- (#.Some [_ head])
+ {#.Some [_ head]}
(do io.monad
[?tail (rows output results)]
(case ?tail
- (#try.Success tail)
- (in (#try.Success (#.Item head tail)))
+ {#try.Success tail}
+ (in {#try.Success {#.Item head tail}})
- (#try.Failure error)
+ {#try.Failure error}
(do io.monad
[temp (java/sql/ResultSet::close results)]
(in (do try.monad
[_ temp]
(try.failure error))))))
- (#try.Failure error)
+ {#try.Failure error}
(do io.monad
[temp (java/sql/ResultSet::close results)]
(in (do try.monad
@@ -186,7 +186,7 @@
[_ temp]
(in (list))))))
- (#try.Failure error)
+ {#try.Failure error}
(do io.monad
[temp (java/sql/ResultSet::close results)]
(in (do try.monad
diff --git a/stdlib/source/library/lux/world/file.lux b/stdlib/source/library/lux/world/file.lux
index 66c125a34..82796463c 100644
--- a/stdlib/source/library/lux/world/file.lux
+++ b/stdlib/source/library/lux/world/file.lux
@@ -84,7 +84,7 @@
#.None
#.None
- (#.Some last_separator)
+ {#.Some last_separator}
(do maybe.monad
[[parent temp] (text.split_at last_separator path)
[_ child] (text.split_at (text.size /) temp)]
@@ -230,7 +230,7 @@
(do [! (try.with io.monad)]
[?children (java/io/File::listFiles (java/io/File::new path))]
(case ?children
- (#.Some children)
+ {#.Some children}
(|> children
(array.list #.None)
(monad.only ! (|>> <method>))
@@ -354,8 +354,8 @@
io.run!
write!
(if (ffi.null? error)
- (#try.Success [])
- (#try.Failure (Error::toString [] (:as Error error))))))
+ {#try.Success []}
+ {#try.Failure (Error::toString [] (:as Error error))})))
(def: (value_callback write!)
(All (_ a) (-> (async.Resolver (Try a)) ffi.Function))
@@ -363,8 +363,8 @@
io.run!
write!
(if (ffi.null? error)
- (#try.Success (:expected datum))
- (#try.Failure (Error::toString [] (:as Error error))))))
+ {#try.Success (:expected datum)}
+ {#try.Failure (Error::toString [] (:as Error error))})))
(ffi.import: JsPath
["[1]::[0]"
@@ -383,9 +383,9 @@
(def: (require _)
(-> [] (-> ffi.String Any))
(case [(normal_require []) (global_require []) (process_load [])]
- (^or [(#.Some require) _ _]
- [_ (#.Some require) _]
- [_ _ (#.Some require)])
+ (^or [{#.Some require} _ _]
+ [_ {#.Some require} _]
+ [_ _ {#.Some require}])
require
_
@@ -418,10 +418,10 @@
(Fs::stat [path (..value_callback write!)]
(..node_fs [])))]
(in (case ?stats
- (#try.Success stats)
+ {#try.Success stats}
(<method> [] stats)
- (#try.Failure _)
+ {#try.Failure _}
false))))]
[file? Stats::isFile]
@@ -437,10 +437,10 @@
(..any_callback write!)]
node_fs))]
(case outcome
- (#try.Success _)
+ {#try.Success _}
(in (exception.except ..cannot_make_directory [path]))
- (#try.Failure _)
+ {#try.Failure _}
(with_async write! (Try Any)
(Fs::mkdir [path (..any_callback write!)] node_fs)))))
@@ -487,10 +487,10 @@
(def: (can_execute? path)
(let [node_fs (..node_fs [])]
(\ async.monad each
- (|>> (case> (#try.Success _)
+ (|>> (case> {#try.Success _}
true
- (#try.Failure _)
+ {#try.Failure _}
false)
#try.Success)
(with_async write! (Try Any)
@@ -733,11 +733,11 @@
#.End
(in output)
- (#.Item head tail)
+ {#.Item head tail}
(do !
[verdict (<test> head)]
(recur tail (if verdict
- (#.Item head output)
+ {#.Item head output}
output)))))
_ (RubyDir::close [] self)]
(in output)))]
@@ -928,11 +928,11 @@
... #.End
... (in output)
- ... (#.Item head tail)
+ ... {#.Item head tail}
... (do !
... [verdict (<test> head)]
... (if verdict
- ... (recur tail (#.Item (<constructor> head) output))
+ ... (recur tail {#.Item (<constructor> head) output})
... (recur tail output)))))))]
... [files ..is_file ..file File]
@@ -956,7 +956,7 @@
... [verdict (<test> path)]
... (\ io.monad in
... (if verdict
- ... (#try.Success (<constructor> path))
+ ... {#try.Success (<constructor> path)}
... (exception.except <exception> [path])))))]
... [file ..is_file ..file ..cannot_find_file]
@@ -968,7 +968,7 @@
... [verdict (..touch [path (|> instant.now io.run! instant.relative duration.millis (i./ +1,000))])]
... (\ io.monad in
... (if verdict
- ... (#try.Success (..file path))
+ ... {#try.Success (..file path)}
... (exception.except ..cannot_make_file [path])))))
... (def: (make_directory path)
@@ -976,7 +976,7 @@
... [verdict (..mkdir path)]
... (\ io.monad in
... (if verdict
- ... (#try.Success (..directory path))
+ ... {#try.Success (..directory path)}
... (exception.except ..cannot_make_directory [path])))))
... (def: separator
@@ -1013,17 +1013,17 @@
(loop [directory mock
trail (text.all_split_by separator path)]
(case trail
- (#.Item head tail)
+ {#.Item head tail}
(case (dictionary.value head directory)
#.None
(exception.except ..cannot_find_file [path])
- (#.Some node)
+ {#.Some node}
(case [node tail]
- [(#.Left file) #.End]
- (#try.Success [head file])
+ [{#.Left file} #.End]
+ {#try.Success [head file]}
- [(#.Right sub_directory) (#.Item _)]
+ [{#.Right sub_directory} {#.Item _}]
(recur sub_directory tail)
_
@@ -1037,33 +1037,33 @@
(loop [directory mock
trail (text.all_split_by / path)]
(case trail
- (#.Item head tail)
+ {#.Item head tail}
(case (dictionary.value head directory)
#.None
(case tail
#.End
- (#try.Success (dictionary.has head
- (#.Left [#mock_last_modified now
+ {#try.Success (dictionary.has head
+ {#.Left [#mock_last_modified now
#mock_can_execute false
- #mock_content content])
- directory))
+ #mock_content content]}
+ directory)}
- (#.Item _)
+ {#.Item _}
(exception.except ..cannot_find_file [path]))
- (#.Some node)
+ {#.Some node}
(case [node tail]
- [(#.Left file) #.End]
- (#try.Success (dictionary.has head
- (#.Left (|> file
+ [{#.Left file} #.End]
+ {#try.Success (dictionary.has head
+ {#.Left (|> file
(with@ #mock_last_modified now)
- (with@ #mock_content content)))
- directory))
+ (with@ #mock_content content))}
+ directory)}
- [(#.Right sub_directory) (#.Item _)]
+ [{#.Right sub_directory} {#.Item _}]
(do try.monad
[sub_directory (recur sub_directory tail)]
- (in (dictionary.has head (#.Right sub_directory) directory)))
+ (in (dictionary.has head {#.Right sub_directory} directory)))
_
(exception.except ..cannot_find_file [path])))
@@ -1076,32 +1076,32 @@
(loop [directory mock
trail (text.all_split_by / path)]
(case trail
- (#.Item head tail)
+ {#.Item head tail}
(case (dictionary.value head directory)
#.None
(exception.except ..cannot_delete [path])
- (#.Some node)
+ {#.Some node}
(case tail
#.End
(case node
- (#.Left file)
- (#try.Success (dictionary.lacks head directory))
+ {#.Left file}
+ {#try.Success (dictionary.lacks head directory)}
- (#.Right sub_directory)
+ {#.Right sub_directory}
(if (dictionary.empty? sub_directory)
- (#try.Success (dictionary.lacks head directory))
+ {#try.Success (dictionary.lacks head directory)}
(exception.except ..cannot_delete [path])))
- (#.Item _)
+ {#.Item _}
(case node
- (#.Left file)
+ {#.Left file}
(exception.except ..cannot_delete [path])
- (#.Right sub_directory)
+ {#.Right sub_directory}
(do try.monad
[sub_directory' (recur sub_directory tail)]
- (in (dictionary.has head (#.Right sub_directory') directory))))))
+ (in (dictionary.has head {#.Right sub_directory'} directory))))))
#.End
(exception.except ..cannot_delete [path]))))
@@ -1111,35 +1111,35 @@
(do [! stm.monad]
[|var| (stm.read var)]
(case (transform |var|)
- (#try.Success |var|)
+ {#try.Success |var|}
(do !
[_ (stm.write |var| var)]
- (in (#try.Success [])))
+ (in {#try.Success []}))
- (#try.Failure error)
- (in (#try.Failure error)))))
+ {#try.Failure error}
+ (in {#try.Failure error}))))
(def: (make_mock_directory! / path mock)
(-> Text Path Mock (Try Mock))
(loop [directory mock
trail (text.all_split_by / path)]
(case trail
- (#.Item head tail)
+ {#.Item head tail}
(case (dictionary.value head directory)
#.None
(case tail
#.End
- (#try.Success (dictionary.has head (#.Right ..empty_mock) directory))
+ {#try.Success (dictionary.has head {#.Right ..empty_mock} directory)}
- (#.Item _)
+ {#.Item _}
(exception.except ..cannot_make_directory [path]))
- (#.Some node)
+ {#.Some node}
(case [node tail]
- [(#.Right sub_directory) (#.Item _)]
+ [{#.Right sub_directory} {#.Item _}]
(do try.monad
[sub_directory (recur sub_directory tail)]
- (in (dictionary.has head (#.Right sub_directory) directory)))
+ (in (dictionary.has head {#.Right sub_directory} directory)))
_
(exception.except ..cannot_make_directory [path])))
@@ -1153,24 +1153,24 @@
trail (text.all_split_by / path)]
(case trail
#.End
- (#try.Success directory)
+ {#try.Success directory}
- (#.Item head tail)
+ {#.Item head tail}
(case (dictionary.value head directory)
#.None
(exception.except ..cannot_find_directory [path])
- (#.Some node)
+ {#.Some node}
(case node
- (#.Left _)
+ {#.Left _}
(exception.except ..cannot_find_directory [path])
- (#.Right sub_directory)
+ {#.Right sub_directory}
(case tail
#.End
- (#try.Success sub_directory)
+ {#try.Success sub_directory}
- (#.Item _)
+ {#.Item _}
(recur sub_directory tail)))))))
(def: .public (mock separator)
@@ -1198,13 +1198,13 @@
(do [! stm.monad]
[|store| (stm.read store)]
(case (..make_mock_directory! separator path |store|)
- (#try.Success |store|)
+ {#try.Success |store|}
(do !
[_ (stm.write |store| store)]
- (in (#try.Success [])))
+ (in {#try.Success []}))
- (#try.Failure error)
- (in (#try.Failure error))))))
+ {#try.Failure error}
+ (in {#try.Failure error})))))
(~~ (template [<method> <tag>]
[(def: (<method> path)
@@ -1217,8 +1217,8 @@
dictionary.entries
(list.all (function (_ [node_name node])
(case node
- (<tag> _)
- (#.Some (format path separator node_name))
+ {<tag> _}
+ {#.Some (format path separator node_name)}
_
#.None))))))))))]
@@ -1304,13 +1304,13 @@
[[name file] (..retrieve_mock_file! separator origin |store|)
|store| (..delete_mock_node! separator origin |store|)]
(..update_mock_file! separator destination (value@ #mock_last_modified file) (value@ #mock_content file) |store|))
- (#try.Success |store|)
+ {#try.Success |store|}
(do !
[_ (stm.write |store| store)]
- (in (#try.Success [])))
+ (in {#try.Success []}))
- (#try.Failure error)
- (in (#try.Failure error))))))
+ {#try.Failure error}
+ (in {#try.Failure error})))))
))))
(def: (check_or_make_directory monad fs path)
@@ -1318,7 +1318,7 @@
(do monad
[? (\ fs directory? path)]
(if ?
- (in (#try.Success []))
+ (in {#try.Success []})
(\ fs make_directory path))))
(def: .public (make_directories monad fs path)
@@ -1331,7 +1331,7 @@
#.End
(\ monad in (exception.except ..cannot_make_directory [path]))
- (#.Item head tail)
+ {#.Item head tail}
(case head
"" (\ monad in (exception.except ..cannot_make_directory [path]))
_ (loop [current (if rooted?
@@ -1341,17 +1341,17 @@
(do monad
[? (..check_or_make_directory monad fs current)]
(case ?
- (#try.Success _)
+ {#try.Success _}
(case next
#.End
- (in (#try.Success []))
+ (in {#try.Success []})
- (#.Item head tail)
+ {#.Item head tail}
(recur (format current (\ fs separator) head)
tail))
- (#try.Failure error)
- (in (#try.Failure error)))))))))
+ {#try.Failure error}
+ (in {#try.Failure error}))))))))
(def: .public (make_file monad fs content path)
(All (_ !) (-> (Monad !) (System !) Binary Path (! (Try Any))))
diff --git a/stdlib/source/library/lux/world/file/watch.lux b/stdlib/source/library/lux/world/file/watch.lux
index 3af235af1..46308d6e3 100644
--- a/stdlib/source/library/lux/world/file/watch.lux
+++ b/stdlib/source/library/lux/world/file/watch.lux
@@ -112,7 +112,7 @@
(do [! stm.monad]
[@tracker (stm.read tracker)]
(case (dictionary.value path @tracker)
- (#.Some [old_concern last_modified])
+ {#.Some [old_concern last_modified]}
(do !
[_ (stm.update (dictionary.has path [new_concern last_modified]) tracker)]
(in true))
@@ -196,20 +196,20 @@
(do !
[updated? (stm.commit! (..update_watch! new_concern path tracker))]
(if updated?
- (in (#try.Success []))
+ (in {#try.Success []})
(do (try.with !)
[file_tracker (..file_tracker fs path)]
(do !
[_ (stm.commit! (stm.update (dictionary.has path [new_concern file_tracker]) tracker))]
- (in (#try.Success []))))))
+ (in {#try.Success []})))))
(in (exception.except ..cannot_poll_a_non_existent_directory [path])))))
(def: (concern path)
(stm.commit!
(do stm.monad
[@tracker (stm.read tracker)]
(in (case (dictionary.value path @tracker)
- (#.Some [concern file_tracker])
- (#try.Success concern)
+ {#.Some [concern file_tracker]}
+ {#try.Success concern}
#.None
(exception.except ..not_being_watched [path]))))))
@@ -218,10 +218,10 @@
(do [! stm.monad]
[@tracker (stm.read tracker)]
(case (dictionary.value path @tracker)
- (#.Some [concern file_tracker])
+ {#.Some [concern file_tracker]}
(do !
[_ (stm.update (dictionary.lacks path) tracker)]
- (in (#try.Success concern)))
+ (in {#try.Success concern}))
#.None
(in (exception.except ..not_being_watched [path]))))))
@@ -237,7 +237,7 @@
(list\each product.left)
(dictionary.of_list text.hash))
tracker))]
- (in (#try.Success [])))
+ (in {#try.Success []}))
.let [[creations modifications deletions]
(list\mix (function (_ [_ [creations modifications deletions]]
[all_creations all_modifications all_deletions])
@@ -278,8 +278,8 @@
output #.End]
(if (n.< size idx)
(recur (++ idx)
- (#.Item (java/util/List::get (.int idx) list)
- output))
+ {#.Item (java/util/List::get (.int idx) list)
+ output})
output))))
(import: (java/nio/file/WatchEvent$Kind a))
@@ -375,7 +375,7 @@
(do (try.with io.monad)
[?key (java/nio/file/WatchService::poll watcher)]
(case ?key
- (#.Some key)
+ {#.Some key}
(do [! io.monad]
[valid? (java/nio/file/WatchKey::reset key)]
(if valid?
@@ -386,8 +386,8 @@
java/nio/file/Path::toString
(:as //.Path))]
concern (..default_key_concern key)]
- (recur (#.Item [concern path]
- output)))
+ (recur {#.Item [concern path]
+ output}))
(recur output)))
#.None
@@ -420,12 +420,12 @@
(do [! async.monad]
[@tracker (stm.commit! (stm.read tracker))]
(case (dictionary.value path @tracker)
- (#.Some [concern key])
+ {#.Some [concern key]}
(do !
[_ (async.future
(java/nio/file/WatchKey::cancel key))
_ (stm.commit! (stm.update (dictionary.lacks path) tracker))]
- (in (#try.Success concern)))
+ (in {#try.Success concern}))
#.None
(in (exception.except ..not_being_watched [path]))))))]]
@@ -441,13 +441,13 @@
path)]
(do async.monad
[_ (stm.commit! (stm.update (dictionary.has path [concern key]) tracker))]
- (in (#try.Success []))))))
+ (in {#try.Success []})))))
(def: (concern path)
(do async.monad
[@tracker (stm.commit! (stm.read tracker))]
(case (dictionary.value path @tracker)
- (#.Some [concern key])
- (in (#try.Success concern))
+ {#.Some [concern key]}
+ (in {#try.Success concern})
#.None
(in (exception.except ..not_being_watched [path])))))
diff --git a/stdlib/source/library/lux/world/net/http/client.lux b/stdlib/source/library/lux/world/net/http/client.lux
index c5af6d11f..472c49a52 100644
--- a/stdlib/source/library/lux/world/net/http/client.lux
+++ b/stdlib/source/library/lux/world/net/http/client.lux
@@ -172,7 +172,7 @@
(do [! (try.with io.monad)]
[?name (java/net/URLConnection::getHeaderFieldKey index connection)]
(case ?name
- (#.Some name)
+ {#.Some name}
(do !
[?value (java/net/URLConnection::getHeaderField index connection)]
(recur (++ index)
@@ -194,7 +194,7 @@
(java/net/URLConnection::setRequestProperty name value connection))
(dictionary.entries headers))
_ (case data
- (#.Some data)
+ {#.Some data}
(do !
[_ (java/net/URLConnection::setDoOutput true connection)
stream (java/net/URLConnection::getOutputStream connection)
@@ -224,14 +224,14 @@
(|> (\ client request method url headers data)
async.future
(\ async.monad each
- (|>> (case> (#try.Success [status message])
- (#try.Success [status (revised@ #//.body (: (-> (//.Body IO) (//.Body Async))
+ (|>> (case> {#try.Success [status message]}
+ {#try.Success [status (revised@ #//.body (: (-> (//.Body IO) (//.Body Async))
(function (_ body)
(|>> body async.future)))
- message)])
+ message)]}
- (#try.Failure error)
- (#try.Failure error)))))))
+ {#try.Failure error}
+ {#try.Failure error}))))))
(def: .public headers
(-> (List [Text Text]) //.Headers)
diff --git a/stdlib/source/library/lux/world/net/http/request.lux b/stdlib/source/library/lux/world/net/http/request.lux
index 9ab4b1d32..c6185bc09 100644
--- a/stdlib/source/library/lux/world/net/http/request.lux
+++ b/stdlib/source/library/lux/world/net/http/request.lux
@@ -61,10 +61,10 @@
[raw ?raw
content (\ json.codec decoded raw)]
(json.result content reader))
- (#try.Success input)
+ {#try.Success input}
(server input request)
- (#try.Failure error)
+ {#try.Failure error}
(async.resolved ..failure)))))
(def: .public (text server)
@@ -73,10 +73,10 @@
(do async.monad
[?raw (read_text_body (value@ #//.body message))]
(case ?raw
- (#try.Success content)
+ {#try.Success content}
(server content request)
- (#try.Failure error)
+ {#try.Failure error}
(async.resolved ..failure)))))
(def: .public (query property server)
@@ -91,10 +91,10 @@
input (context.result query property)]
(in [[identification protocol (with@ #//.uri uri resource) message]
input]))
- (#try.Success [request input])
+ {#try.Success [request input]}
(server input request)
- (#try.Failure error)
+ {#try.Failure error}
(async.resolved ..failure)))))
(def: .public (form property server)
@@ -106,10 +106,10 @@
[body ?body
form (//query.parameters body)]
(context.result form property))
- (#try.Success input)
+ {#try.Success input}
(server input request)
- (#try.Failure error)
+ {#try.Failure error}
(async.resolved ..failure)))))
(def: .public (cookies property server)
@@ -121,8 +121,8 @@
(maybe.else "")
//cookie.get)]
(context.result cookies property))
- (#try.Success input)
+ {#try.Success input}
(server input request)
- (#try.Failure error)
+ {#try.Failure error}
(async.resolved ..failure))))
diff --git a/stdlib/source/library/lux/world/program.lux b/stdlib/source/library/lux/world/program.lux
index feb95fff9..eb0fe35cf 100644
--- a/stdlib/source/library/lux/world/program.lux
+++ b/stdlib/source/library/lux/world/program.lux
@@ -62,10 +62,10 @@
(in (|> entries
(list.all (function (_ [name value])
(case value
- (#try.Success value)
- (#.Some [name value])
+ {#try.Success value}
+ {#.Some [name value]}
- (#try.Failure _)
+ {#try.Failure _}
#.None)))
(dictionary.of_list text.hash)))))
@@ -97,8 +97,8 @@
(function.constant (io.io (dictionary.keys environment))))
(def: (variable name)
(io.io (case (dictionary.value name environment)
- (#.Some value)
- (#try.Success value)
+ {#.Some value}
+ {#try.Success value}
#.None
(exception.except ..unknown_environment_variable [name]))))
@@ -137,8 +137,8 @@
(def: (jvm\\consume iterator)
(All (_ a) (-> (java/util/Iterator a) (List a)))
(if (java/util/Iterator::hasNext iterator)
- (#.Item (java/util/Iterator::next iterator)
- (jvm\\consume iterator))
+ {#.Item (java/util/Iterator::next iterator)
+ (jvm\\consume iterator)}
#.End))
)]
(for [@.old (as_is <jvm>)
@@ -155,7 +155,7 @@
(def: (exit_node_js! code)
(-> Exit (IO Nothing))
(case (ffi.constant ..NodeJs_Process [process])
- (#.Some process)
+ {#.Some process}
(NodeJs_Process::exit (i.frac code) process)
#.None
@@ -173,18 +173,18 @@
(-> Exit (IO Nothing))
(case [(ffi.constant ..Browser_Window [window])
(ffi.constant ..Browser_Location [location])]
- [(#.Some window) (#.Some location)]
+ [{#.Some window} {#.Some location}]
(exec
(Browser_Window::close [] window)
(Browser_Location::reload [] location)
(..default_exit! code))
- [(#.Some window) #.None]
+ [{#.Some window} #.None]
(exec
(Browser_Window::close [] window)
(..default_exit! code))
- [#.None (#.Some location)]
+ [#.None {#.Some location}]
(exec
(Browser_Location::reload [] location)
(..default_exit! code))
@@ -213,9 +213,9 @@
(def: (require _)
(-> [] (-> ffi.String Any))
(case [(normal_require []) (global_require []) (process_load [])]
- (^or [(#.Some require) _ _]
- [_ (#.Some require) _]
- [_ _ (#.Some require)])
+ (^or [{#.Some require} _ _]
+ [_ {#.Some require} _]
+ [_ _ {#.Some require}])
require
_
@@ -247,9 +247,9 @@
(do [! io.monad]
[outcome (io/popen [command])]
(case outcome
- (#try.Success outcome)
+ {#try.Success outcome}
(case outcome
- (#.Some file)
+ {#.Some file}
(do !
[?output (LuaFile::read ["*l"] file)
_ (LuaFile::close [] file)]
@@ -258,7 +258,7 @@
#.None
(in default))
- (#try.Failure _)
+ {#try.Failure _}
(in default)))))
@.ruby (as_is (ffi.import: Env "as" RubyEnv
["[1]::[0]"
@@ -314,7 +314,7 @@
@.jvm <jvm>
@.js (io.io (if ffi.on_node_js?
(case (ffi.constant Object [process env])
- (#.Some process/env)
+ {#.Some process/env}
(|> (Object::entries [process/env])
(array.list #.None)
(list\each (|>> (array.read! 0) maybe.trusted)))
@@ -352,8 +352,8 @@
[(do io.monad
[value (<method> name)]
(in (case value
- (#.Some value)
- (#try.Success value)
+ {#.Some value}
+ {#try.Success value}
#.None
(exception.except ..unknown_environment_variable [name]))))]]
@@ -365,8 +365,8 @@
[process/env (ffi.constant Object [process env])]
(array.read! (:as Nat name)
(:as (Array Text) process/env)))
- (#.Some value)
- (#try.Success value)
+ {#.Some value}
+ {#try.Success value}
#.None
(exception.except ..unknown_environment_variable [name]))
@@ -407,7 +407,7 @@
@.jvm <jvm>
@.js (if ffi.on_node_js?
(case (ffi.constant ..NodeJs_Process [process])
- (#.Some process)
+ {#.Some process}
(NodeJs_Process::cwd [] process)
#.None
diff --git a/stdlib/source/library/lux/world/shell.lux b/stdlib/source/library/lux/world/shell.lux
index 5c0fdfbc7..3fd76261b 100644
--- a/stdlib/source/library/lux/world/shell.lux
+++ b/stdlib/source/library/lux/world/shell.lux
@@ -249,7 +249,7 @@
(do !
[output (java/io/BufferedReader::readLine <stream>)]
(case output
- (#.Some output)
+ {#.Some output}
(in output)
#.None
@@ -331,13 +331,13 @@
(do [! io.monad]
[|state| (atom.read! state)]
(case (\ mock <mock> |state|)
- (#try.Success [|state| output])
+ {#try.Success [|state| output]}
(do !
[_ (atom.write! |state| state)]
- (in (#try.Success output)))
+ (in {#try.Success output}))
- (#try.Failure error)
- (in (#try.Failure error)))))]
+ {#try.Failure error}
+ (in {#try.Failure error}))))]
[read on_read]
[error on_error]
@@ -347,24 +347,24 @@
(do [! io.monad]
[|state| (atom.read! state)]
(case (\ mock on_write message |state|)
- (#try.Success |state|)
+ {#try.Success |state|}
(do !
[_ (atom.write! |state| state)]
- (in (#try.Success [])))
+ (in {#try.Success []}))
- (#try.Failure error)
- (in (#try.Failure error)))))
+ {#try.Failure error}
+ (in {#try.Failure error}))))
(def: (destroy _)
(do [! io.monad]
[|state| (atom.read! state)]
(case (\ mock on_destroy |state|)
- (#try.Success |state|)
+ {#try.Success |state|}
(do !
[_ (atom.write! |state| state)]
- (in (#try.Success [])))
+ (in {#try.Success []}))
- (#try.Failure error)
- (in (#try.Failure error)))))))
+ {#try.Failure error}
+ (in {#try.Failure error}))))))
(implementation: .public (mock mock init)
(All (_ s)