diff options
Diffstat (limited to 'stdlib/source/library/lux/world/program.lux')
-rw-r--r-- | stdlib/source/library/lux/world/program.lux | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/stdlib/source/library/lux/world/program.lux b/stdlib/source/library/lux/world/program.lux index 2da3bad68..9bdba0392 100644 --- a/stdlib/source/library/lux/world/program.lux +++ b/stdlib/source/library/lux/world/program.lux @@ -31,9 +31,7 @@ ["[0]" template]] [math [number - ["i" int]]] - [type - abstract]]] + ["i" int]]]]] [// [file {"+" Path}] [shell {"+" Exit}]]))) @@ -44,16 +42,16 @@ (type: .public (Program !) (Interface - (: (-> Any (! (List Text))) - available_variables) - (: (-> Text (! (Try Text))) - variable) - (: Path - home) - (: Path - directory) - (: (-> Exit (! Nothing)) - exit))) + (is (-> Any (! (List Text))) + available_variables) + (is (-> Text (! (Try Text))) + variable) + (is Path + home) + (is Path + directory) + (is (-> Exit (! Nothing)) + exit))) (def: .public (environment monad program) (All (_ !) (-> (Monad !) (Program !) (! Environment))) @@ -317,7 +315,7 @@ ... ..array_keys ... (array.list {.#None}) ... (list#each (function (_ variable) - ... [variable ("php array read" (:as Nat variable) environment)])) + ... [variable ("php array read" (as Nat variable) environment)])) ... (dictionary.of_list text.hash)))) ... @.scheme (do io.monad ... [input (..get-environment-variables [])] @@ -346,8 +344,8 @@ @.js (io.io (if ffi.on_node_js? (case (do maybe.monad [process/env (ffi.global Object [process env])] - (array.read! (:as Nat name) - (:as (Array Text) process/env))) + (array.read! (as Nat name) + (as (Array Text) process/env))) {.#Some value} {try.#Success value} @@ -371,7 +369,7 @@ @.js (if ffi.on_node_js? (|> (node_js.require "os") maybe.trusted - (:as NodeJs_OS) + (as NodeJs_OS) NodeJs_OS::homedir) <default>) @.python (os/path::expanduser "~") @@ -379,7 +377,7 @@ @.ruby (io.io (Dir::home)) ... @.php (do io.monad ... [output (..getenv/1 ["HOME"])] - ... (in (if (bit#= false (:as Bit output)) + ... (in (if (bit#= false (as Bit output)) ... "~" ... output))) @@ -413,7 +411,7 @@ @.ruby (io.io (FileUtils::pwd)) ... @.php (do io.monad ... [output (..getcwd [])] - ... (in (if (bit#= false (:as Bit output)) + ... (in (if (bit#= false (as Bit output)) ... "." ... output))) |