aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/world/console.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/world/console.lux20
1 files changed, 15 insertions, 5 deletions
diff --git a/stdlib/source/lux/world/console.lux b/stdlib/source/lux/world/console.lux
index 99d290479..209063dfd 100644
--- a/stdlib/source/lux/world/console.lux
+++ b/stdlib/source/lux/world/console.lux
@@ -4,7 +4,8 @@
[monad (#+ do)]
["ex" exception (#+ exception:)]
[security
- ["." taint (#+ Dirty taint)]]]
+ ["." taint (#+ Dirty taint)]
+ [capability (#+ Capability)]]]
[data
["." error (#+ Error)]
["." text
@@ -25,14 +26,23 @@
[cannot-close]
)
+(type: #export (Can-Read ! o)
+ (Capability [] (! (Error (Dirty o)))))
+
+(type: #export (Can-Write ! i)
+ (Capability i (! (Error Any))))
+
+(type: #export (Can-Close !)
+ (Capability [] (! (Error Any))))
+
(signature: #export (Console !)
- (: (-> Any (! (Error (Dirty Nat))))
+ (: (Can-Read ! Nat)
read)
- (: (-> Any (! (Error (Dirty Text))))
+ (: (Can-Read ! Text)
read-line)
- (: (-> Text (! (Error Any)))
+ (: (Can-Write ! Text)
write)
- (: (-> Any (! (Error Any)))
+ (: (Can-Close !)
close))
(def: #export (async console)