aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorEduardo Julian2015-08-30 20:07:37 -0400
committerEduardo Julian2015-08-30 20:07:37 -0400
commita0533814cbc3b4b59850f97e9e72abc8bb83ff57 (patch)
tree5253a297c7b28c5881ba3845881115772e981cf1 /source
parent817d244adff361104ae0aa6ce53efe6c2bc07552 (diff)
- Added call/cc to lux/codata/lazy.
- Added some minor compiler optimizations.
Diffstat (limited to '')
-rw-r--r--source/lux/codata/lazy.lux6
-rw-r--r--source/lux/data/io.lux4
2 files changed, 8 insertions, 2 deletions
diff --git a/source/lux/codata/lazy.lux b/source/lux/codata/lazy.lux
index 1529c0dae..fb0c0bcb3 100644
--- a/source/lux/codata/lazy.lux
+++ b/source/lux/codata/lazy.lux
@@ -32,6 +32,12 @@
(-> (Lazy a) a))
(thunk id))
+(def #export (call/cc f)
+ (All [a b c] (Lazy (-> a (Lazy b c)) (Lazy a c)))
+ (lambda [k]
+ (f (lambda [a _] (k a))
+ k)))
+
## [Structs]
(defstruct #export Lazy/Functor (Functor Lazy)
(def (map f ma)
diff --git a/source/lux/data/io.lux b/source/lux/data/io.lux
index 2d2a2bc35..1ca68f518 100644
--- a/source/lux/data/io.lux
+++ b/source/lux/data/io.lux
@@ -42,10 +42,10 @@
## [Functions]
(def #export (print x)
(-> Text (IO (,)))
- (io (_jvm_invokevirtual "java.io.PrintStream" "print" ["java.lang.Object"]
+ (io (_jvm_invokevirtual "java.io.PrintStream" "print" ["java.lang.String"]
(_jvm_getstatic "java.lang.System" "out") [x])))
(def #export (println x)
(-> Text (IO (,)))
- (io (_jvm_invokevirtual "java.io.PrintStream" "println" ["java.lang.Object"]
+ (io (_jvm_invokevirtual "java.io.PrintStream" "println" ["java.lang.String"]
(_jvm_getstatic "java.lang.System" "out") [x])))