diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/io.lux | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/stdlib/source/lux/io.lux b/stdlib/source/lux/io.lux index d3e08169e..8eaeaae63 100644 --- a/stdlib/source/lux/io.lux +++ b/stdlib/source/lux/io.lux @@ -1,4 +1,4 @@ -(;module: {#;doc "A method for abstracting I/O and effectful computations to make it safe while writing pure functional code."} +(.module: {#.doc "A method for abstracting I/O and effectful computations to make it safe while writing pure functional code."} lux (lux (control [functor #+ Functor] [applicative #+ Applicative] @@ -7,22 +7,22 @@ (coll [list])))) (type: #export (IO a) - {#;doc "A type that represents synchronous, effectful computations that may interact with the outside world."} + {#.doc "A type that represents synchronous, effectful computations that may interact with the outside world."} (-> Void a)) (macro: #export (io tokens state) - {#;doc (doc "Delays the evaluation of an expression, by wrapping it in an IO 'thunk'." + {#.doc (doc "Delays the evaluation of an expression, by wrapping it in an IO 'thunk'." "Great for wrapping effectful computations (which will not be performed until the IO is \"run\")." (io (exec (log! msg) "Some value...")))} (case tokens (^ (list value)) - (let [blank (: Code [["" +0 +0] (#;Symbol ["" ""])])] - (#;Right [state (list (` ("lux function" (~ blank) (~ blank) (~ value))))])) + (let [blank (: Code [["" +0 +0] (#.Symbol ["" ""])])] + (#.Right [state (list (` ("lux function" (~ blank) (~ blank) (~ value))))])) _ - (#;Left "Wrong syntax for io"))) + (#.Left "Wrong syntax for io"))) (struct: #export _ (Functor IO) (def: (map f ma) @@ -44,7 +44,7 @@ (io ((mma (:! Void [])) (:! Void []))))) (def: #export (run action) - {#;doc "A way to execute IO computations and perform their side-effects."} + {#.doc "A way to execute IO computations and perform their side-effects."} (All [a] (-> (IO a) a)) (action (:! Void []))) @@ -54,28 +54,28 @@ (struct: #export _ (Functor Process) (def: (map f ma) - (io (:: e;Functor<Error> map f (run ma))))) + (io (:: e.Functor<Error> map f (run ma))))) (struct: #export _ (Applicative Process) (def: functor Functor<Process>) (def: (wrap x) - (io (:: e;Applicative<Error> wrap x))) + (io (:: e.Applicative<Error> wrap x))) (def: (apply ff fa) - (io (:: e;Applicative<Error> apply (run ff) (run fa))))) + (io (:: e.Applicative<Error> apply (run ff) (run fa))))) (struct: #export _ (Monad Process) (def: applicative Applicative<Process>) (def: (join mma) (case (run mma) - (#e;Success ma) + (#e.Success ma) ma - (#e;Error error) - (io (#e;Error error))))) + (#e.Error error) + (io (#e.Error error))))) (def: #export (fail error) (All [a] (-> Text (Process a))) - (io (#e;Error error))) + (io (#e.Error error))) |