diff options
author | Eduardo Julian | 2021-09-08 03:08:13 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-09-08 03:08:13 -0400 |
commit | 392582885500d8201bbe502943ca4b02c5c77ac0 (patch) | |
tree | 6e7410546048547560c767dba9c303d3f2f9597a /stdlib/source/library/lux/control/io.lux | |
parent | 609cc6c16e75c13d87183c38245136fa038b0496 (diff) |
Normalized the syntax of "abstract:" and "actor:".
Diffstat (limited to 'stdlib/source/library/lux/control/io.lux')
-rw-r--r-- | stdlib/source/library/lux/control/io.lux | 76 |
1 files changed, 37 insertions, 39 deletions
diff --git a/stdlib/source/library/lux/control/io.lux b/stdlib/source/library/lux/control/io.lux index 8ff12b40b..654415bd3 100644 --- a/stdlib/source/library/lux/control/io.lux +++ b/stdlib/source/library/lux/control/io.lux @@ -15,54 +15,52 @@ ["[0]" template]]]]) (abstract: .public (IO a) - {} - (-> Any a) - (def: label - (All (_ _ a) (-> (-> Any a) (IO a))) - (|>> :abstraction)) + [(def: label + (All (_ _ a) (-> (-> Any a) (IO a))) + (|>> :abstraction)) - (template: (!io computation) - [(:abstraction (template.with_locals [g!func g!arg] - (function (g!func g!arg) - computation)))]) + (template: (!io computation) + [(:abstraction (template.with_locals [g!func g!arg] + (function (g!func g!arg) + computation)))]) - (template: (run!' io) - ... creatio ex nihilo - [((:representation io) [])]) + (template: (run!' io) + ... creatio ex nihilo + [((:representation io) [])]) - (syntax: .public (io [computation <code>.any]) - (with_identifiers [g!func g!arg] - (in (list (` ((~! ..label) (function ((~ g!func) (~ g!arg)) - (~ computation)))))))) + (syntax: .public (io [computation <code>.any]) + (with_identifiers [g!func g!arg] + (in (list (` ((~! ..label) (function ((~ g!func) (~ g!arg)) + (~ computation)))))))) - (def: .public run! - (All (_ _ a) (-> (IO a) a)) - (|>> ..run!')) + (def: .public run! + (All (_ _ a) (-> (IO a) a)) + (|>> ..run!')) - (implementation: .public functor - (Functor IO) - - (def: (each f) - (|>> ..run!' f !io))) + (implementation: .public functor + (Functor IO) + + (def: (each f) + (|>> ..run!' f !io))) - (implementation: .public apply - (Apply IO) - - (def: &functor ..functor) + (implementation: .public apply + (Apply IO) + + (def: &functor ..functor) - (def: (on fa ff) - (!io ((..run!' ff) (..run!' fa))))) + (def: (on fa ff) + (!io ((..run!' ff) (..run!' fa))))) - (implementation: .public monad - (Monad IO) - - (def: &functor ..functor) + (implementation: .public monad + (Monad IO) + + (def: &functor ..functor) - (def: in - (|>> !io)) - - (def: conjoint - (|>> ..run!' ..run!' !io))) + (def: in + (|>> !io)) + + (def: conjoint + (|>> ..run!' ..run!' !io)))] ) |