aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/lux.lux35
-rw-r--r--source/lux/codata/lazy.lux7
-rw-r--r--source/lux/meta/lux.lux6
-rw-r--r--source/program.lux4
4 files changed, 25 insertions, 27 deletions
diff --git a/source/lux.lux b/source/lux.lux
index 7d00cd077..3ede6d75b 100644
--- a/source/lux.lux
+++ b/source/lux.lux
@@ -292,18 +292,10 @@
#Nil))))))))
(_lux_export DefData')
-## (deftype LuxVar
-## (| (#Local Int)
-## (#Global Ident)))
-(_lux_def LuxVar
- (#NamedT ["lux" "LuxVar"]
- (#VariantT (#Cons [## "lux;Local"
- Int
- (#Cons [## "lux;Global"
- Ident
- #Nil])]))))
-(_lux_export LuxVar)
-(_lux_declare-tags [#Local #Global] LuxVar)
+(_lux_def Analysis
+ (#NamedT ["lux" "Analysis"]
+ Void))
+(_lux_export Analysis)
## (deftype (Module Compiler)
## (& #module-aliases (List (, Text Text))
@@ -349,7 +341,7 @@
## (& #source Source
## #cursor Cursor
## #modules (List (, Text (Module Compiler)))
-## #envs (List (Env Text (, LuxVar Type)))
+## #envs (List (Env Text (Meta (, Type Cursor) Analysis)))
## #type-vars (Bindings Int Type)
## #expected Type
## #seed Int
@@ -369,7 +361,9 @@
#Nil))))
(#Cons ## "lux;envs"
(#AppT List (#AppT (#AppT Env Text)
- (#TupleT (#Cons LuxVar (#Cons Type #Nil)))))
+ (#AppT (#AppT Meta
+ (#TupleT (#Cons Type (#Cons Cursor #Nil))))
+ Analysis)))
(#Cons ## "lux;type-vars"
(#AppT (#AppT Bindings Int) Type)
(#Cons ## "lux;expected"
@@ -2711,16 +2705,15 @@
#envs envs #type-vars types #host host
#seed seed #eval? eval? #expected expected
#cursor cursor}
- (some (: (-> (Env Text (, LuxVar Type)) (Maybe Type))
+ (some (: (-> (Env Text (Meta (, Type Cursor) Analysis)) (Maybe Type))
(lambda [env]
(case env
{#name _ #inner-closures _ #locals {#counter _ #mappings locals} #closure {#counter _ #mappings closure}}
- (try-both (some (: (-> (, Text (, LuxVar Type)) (Maybe Type))
- (lambda [binding]
- (let [[bname [_ type]] binding]
- (if (text:= name bname)
- (#Some type)
- #None)))))
+ (try-both (some (: (-> (, Text (Meta (, Type Cursor) Analysis)) (Maybe Type))
+ (lambda [[bname [[type _] _]]]
+ (if (text:= name bname)
+ (#Some type)
+ #None))))
locals
closure))))
envs)))
diff --git a/source/lux/codata/lazy.lux b/source/lux/codata/lazy.lux
index 37fbbac64..c0c79fc1a 100644
--- a/source/lux/codata/lazy.lux
+++ b/source/lux/codata/lazy.lux
@@ -34,9 +34,14 @@
(def #export (call/cc f)
(All [a b c] (Lazy (-> a (Lazy b c)) (Lazy a c)))
(lambda [k]
- (f (lambda [a _] (k a))
+ (f (lambda [a _]
+ (k a))
k)))
+(def #export (run-lazy l k)
+ (All [a z] (-> (Lazy a z) (-> a z) z))
+ (l k))
+
## [Structs]
(defstruct #export Lazy/Functor (Functor Lazy)
(def (map f ma)
diff --git a/source/lux/meta/lux.lux b/source/lux/meta/lux.lux
index b9e07083f..650e67133 100644
--- a/source/lux/meta/lux.lux
+++ b/source/lux/meta/lux.lux
@@ -236,13 +236,13 @@
#;envs envs #;type-vars types #;host host
#;seed seed #;eval? eval? #;expected expected
#;cursor cursor}
- (some (: (-> (Env Text (, LuxVar Type)) (Maybe Type))
+ (some (: (-> (Env Text (Meta (, Type Cursor) Analysis)) (Maybe Type))
(lambda [env]
(case env
{#;name _ #;inner-closures _ #;locals {#;counter _ #;mappings locals} #;closure {#;counter _ #;mappings closure}}
- (try-both (some (: (-> (, Text (, LuxVar Type)) (Maybe Type))
+ (try-both (some (: (-> (, Text (Meta (, Type Cursor) Analysis)) (Maybe Type))
(lambda [binding]
- (let [[bname [_ type]] binding]
+ (let [[bname [[type _] _]] binding]
(if (text:= name bname)
(#;Some type)
#;None)))))
diff --git a/source/program.lux b/source/program.lux
index fa8b3a055..f013655bc 100644
--- a/source/program.lux
+++ b/source/program.lux
@@ -19,7 +19,6 @@
char
(either #as e)
id
- io
list
maybe
(number (int #refer (#only) #open ("i:" Int/Show))
@@ -32,7 +31,8 @@
(lazy #refer (#only))
(function #refer (#only))
(reader #as r)
- (state #refer (#only)))
+ (state #refer (#only))
+ io)
(host jvm
io)
(meta ast