aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Julian2015-09-29 07:40:29 -0400
committerEduardo Julian2015-09-29 07:40:29 -0400
commit57ed0ef20db8f6ae926c1f7580f5bfa26928612b (patch)
tree7566f4004b8507de816eb6c50dd9fe8068721c4b
parent8760f9bc9399cdc0d862f4d841bf920818d4c7bb (diff)
- Returned to old format of type-environments where odds are arguments & evens are quantifiers.
Diffstat (limited to '')
-rw-r--r--source/lux.lux86
-rw-r--r--src/lux/analyser/case.clj2
-rw-r--r--src/lux/analyser/host.clj2
-rw-r--r--src/lux/type.clj24
4 files changed, 57 insertions, 57 deletions
diff --git a/source/lux.lux b/source/lux.lux
index dddf5c80d..ddb3384cc 100644
--- a/source/lux.lux
+++ b/source/lux.lux
@@ -49,8 +49,8 @@
(1 (1 ## "lux;Nil"
(2 (0))
(1 ## "lux;Cons"
- (2 (1 (4 0)
- (1 (9 (4 1) (4 0))
+ (2 (1 (4 1)
+ (1 (9 (4 0) (4 1))
(0))))
(0)))))))
(_lux_export List)
@@ -65,7 +65,7 @@
(1 (1 ## "lux;None"
(2 (0))
(1 ## "lux;Some"
- (4 0)
+ (4 1)
(0)))))))
(_lux_export Maybe)
(_lux_declare-tags [#None #Some] Maybe)
@@ -85,7 +85,7 @@
## ))
(_lux_def Type
(10 ["lux" "Type"]
- (_lux_case (9 (4 1) (4 0))
+ (_lux_case (9 (4 0) (4 1))
Type
(_lux_case (9 List Type)
TypeList
@@ -128,8 +128,8 @@
Int
(#Cons ## "lux;mappings"
(#AppT List
- (#TupleT (#Cons (#BoundT 2)
- (#Cons (#BoundT 0)
+ (#TupleT (#Cons (#BoundT 3)
+ (#Cons (#BoundT 1)
#Nil))))
#Nil)))))))
(_lux_export Bindings)
@@ -149,11 +149,11 @@
(#Cons ## "lux;inner-closures"
Int
(#Cons ## "lux;locals"
- (#AppT (#AppT Bindings (#BoundT 2))
- (#BoundT 0))
+ (#AppT (#AppT Bindings (#BoundT 3))
+ (#BoundT 1))
(#Cons ## "lux;closure"
- (#AppT (#AppT Bindings (#BoundT 2))
- (#BoundT 0))
+ (#AppT (#AppT Bindings (#BoundT 3))
+ (#BoundT 1))
#Nil)))))))))
(_lux_export Env)
(_lux_declare-tags [#name #inner-closures #locals #closure] Env)
@@ -175,8 +175,8 @@
(#NamedT ["lux" "Meta"]
(#UnivQ #Nil
(#UnivQ #Nil
- (#TupleT (#Cons (#BoundT 2)
- (#Cons (#BoundT 0)
+ (#TupleT (#Cons (#BoundT 3)
+ (#Cons (#BoundT 1)
#Nil)))))))
(_lux_export Meta)
(_lux_declare-tags [#meta #datum] Meta)
@@ -194,9 +194,9 @@
## (#RecordS (List (, (w (AST' w)) (w (AST' w)))))))
(_lux_def AST'
(#NamedT ["lux" "AST'"]
- (_lux_case (#AppT (#BoundT 0)
- (#AppT (#BoundT 1)
- (#BoundT 0)))
+ (_lux_case (#AppT (#BoundT 1)
+ (#AppT (#BoundT 0)
+ (#BoundT 1)))
AST
(_lux_case (#AppT [List AST])
ASTList
@@ -246,9 +246,9 @@
(#UnivQ #Nil
(#UnivQ #Nil
(#VariantT (#Cons ## "lux;Left"
- (#BoundT 2)
+ (#BoundT 3)
(#Cons ## "lux;Right"
- (#BoundT 0)
+ (#BoundT 1)
#Nil)))))))
(_lux_export Either)
(_lux_declare-tags [#Left #Right] Either)
@@ -258,10 +258,10 @@
(_lux_def StateE
(#UnivQ #Nil
(#UnivQ #Nil
- (#LambdaT (#BoundT 2)
+ (#LambdaT (#BoundT 3)
(#AppT (#AppT Either Text)
- (#TupleT (#Cons (#BoundT 2)
- (#Cons (#BoundT 0)
+ (#TupleT (#Cons (#BoundT 3)
+ (#Cons (#BoundT 1)
#Nil))))))))
## (deftype Source
@@ -286,7 +286,7 @@
(#Cons ## "lux;TypeD"
Type
(#Cons ## "lux;MacroD"
- (#BoundT 0)
+ (#BoundT 1)
(#Cons ## "lux;AliasD"
Ident
#Nil))))))))
@@ -312,7 +312,7 @@
(#Cons ## "lux;defs"
(#AppT List (#TupleT (#Cons Text
(#Cons (#TupleT (#Cons Bool (#Cons (#AppT DefData' (#LambdaT ASTList
- (#AppT (#AppT StateE (#BoundT 0))
+ (#AppT (#AppT StateE (#BoundT 1))
ASTList)))
#Nil)))
#Nil))))
@@ -357,7 +357,7 @@
Cursor
(#Cons ## "lux;modules"
(#AppT List (#TupleT (#Cons Text
- (#Cons (#AppT Module (#AppT (#BoundT 1) (#BoundT 0)))
+ (#Cons (#AppT Module (#AppT (#BoundT 0) (#BoundT 1)))
#Nil))))
(#Cons ## "lux;envs"
(#AppT List (#AppT (#AppT Env Text)
@@ -418,11 +418,11 @@
## ...)
(_lux_def return
(_lux_: (#UnivQ #Nil
- (#LambdaT (#BoundT 0)
+ (#LambdaT (#BoundT 1)
(#LambdaT Compiler
(#AppT (#AppT Either Text)
(#TupleT (#Cons Compiler
- (#Cons (#BoundT 0)
+ (#Cons (#BoundT 1)
#Nil)))))))
(_lux_lambda _ val
(_lux_lambda _ state
@@ -439,7 +439,7 @@
(#LambdaT Compiler
(#AppT (#AppT Either Text)
(#TupleT (#Cons Compiler
- (#Cons (#BoundT 0)
+ (#Cons (#BoundT 1)
#Nil)))))))
(_lux_lambda _ msg
(_lux_lambda _ state
@@ -655,9 +655,9 @@
(def'' (map f xs)
(#UnivQ #Nil
(#UnivQ #Nil
- (#LambdaT (#LambdaT (#BoundT 2) (#BoundT 0))
- (#LambdaT ($' List (#BoundT 2))
- ($' List (#BoundT 0))))))
+ (#LambdaT (#LambdaT (#BoundT 3) (#BoundT 1))
+ (#LambdaT ($' List (#BoundT 3))
+ ($' List (#BoundT 1))))))
(_lux_case xs
#Nil
#Nil
@@ -770,8 +770,8 @@
(def'' (parse-univq-args args next)
## (All [a] (-> (List AST) (-> (List Text) (Lux a)) (Lux a)))
(#UnivQ #Nil (#LambdaT ($' List AST)
- (#LambdaT (#LambdaT ($' List Text) (#AppT (#AppT StateE Compiler) (#BoundT 0)))
- (#AppT (#AppT StateE Compiler) (#BoundT 0)))))
+ (#LambdaT (#LambdaT ($' List Text) (#AppT (#AppT StateE Compiler) (#BoundT 1)))
+ (#AppT (#AppT StateE Compiler) (#BoundT 1)))))
(_lux_case args
#Nil
(next #Nil)
@@ -788,12 +788,12 @@
(def'' (foldL f init xs)
## (All [a b] (-> (-> a b a) a (List b) a))
- (#UnivQ #Nil (#UnivQ #Nil (#LambdaT (#LambdaT (#BoundT 2)
- (#LambdaT (#BoundT 0)
- (#BoundT 2)))
- (#LambdaT (#BoundT 2)
- (#LambdaT ($' List (#BoundT 0))
- (#BoundT 2))))))
+ (#UnivQ #Nil (#UnivQ #Nil (#LambdaT (#LambdaT (#BoundT 3)
+ (#LambdaT (#BoundT 1)
+ (#BoundT 3)))
+ (#LambdaT (#BoundT 3)
+ (#LambdaT ($' List (#BoundT 1))
+ (#BoundT 3))))))
(_lux_case xs
#Nil
init
@@ -816,9 +816,9 @@
(lambda'' [body' name']
(form$ (#Cons (tag$ ["lux" "UnivQ"])
(#Cons (tag$ ["lux" "Nil"])
- (#Cons (replace-syntax (#Cons [name' (make-bound 0)] #Nil)
+ (#Cons (replace-syntax (#Cons [name' (make-bound 1)] #Nil)
(update-bounds body')) #Nil))))))
- (replace-syntax (#Cons [self-name (make-bound -1)] #Nil)
+ (replace-syntax (#Cons [self-name (make-bound -2)] #Nil)
body)
names)
(return (#Cons body' #Nil)))))
@@ -842,9 +842,9 @@
(lambda'' [body' name']
(form$ (#Cons (tag$ ["lux" "ExQ"])
(#Cons (tag$ ["lux" "Nil"])
- (#Cons (replace-syntax (#Cons [name' (make-bound 0)] #Nil)
+ (#Cons (replace-syntax (#Cons [name' (make-bound 1)] #Nil)
(update-bounds body')) #Nil))))))
- (replace-syntax (#Cons [self-name (make-bound -1)] #Nil)
+ (replace-syntax (#Cons [self-name (make-bound -2)] #Nil)
body)
names)
(return (#Cons body' #Nil)))))
@@ -1776,7 +1776,7 @@
(defmacro' #export (Rec tokens)
(_lux_case tokens
(#Cons [_ (#SymbolS "" name)] (#Cons body #Nil))
- (let' [body' (replace-syntax (@list [name (` (#AppT (~ (make-bound 1)) (~ (make-bound 0))))]) body)]
+ (let' [body' (replace-syntax (@list [name (` (#AppT (~ (make-bound 0)) (~ (make-bound 1))))]) body)]
(return (@list (` (#AppT (#UnivQ #Nil (~ body')) Void)))))
_
@@ -2277,7 +2277,7 @@
(-> Type Type (Maybe Type))
(case type-fn
(#UnivQ env body)
- (#Some (beta-reduce (@list& param type-fn env) body))
+ (#Some (beta-reduce (@list& type-fn param env) body))
(#AppT F A)
(do Maybe/Monad
diff --git a/src/lux/analyser/case.clj b/src/lux/analyser/case.clj
index 9640cf88a..ca4e0edeb 100644
--- a/src/lux/analyser/case.clj
+++ b/src/lux/analyser/case.clj
@@ -67,7 +67,7 @@
(&type/with-var
(fn [$var]
(|do [=type (&type/apply-type type $var)]
- (adjust-type* (&/Cons$ (&/T _aenv 0 $var) (&/|map update-up-frame up)) =type))))
+ (adjust-type* (&/Cons$ (&/T _aenv 1 $var) (&/|map update-up-frame up)) =type))))
(&/$TupleT ?members)
(|do [(&/$TupleT ?members*) (&/fold% (fn [_abody ena]
diff --git a/src/lux/analyser/host.clj b/src/lux/analyser/host.clj
index 33553985b..7e1f92d19 100644
--- a/src/lux/analyser/host.clj
+++ b/src/lux/analyser/host.clj
@@ -126,7 +126,7 @@
(|do [:let [[idx types] idx+types]
[idx* real-type] (clean-gtype-var idx gtype-var)]
(return (&/T idx* (&/Cons$ real-type types)))))
- (&/T 0 (&/|list))
+ (&/T 1 (&/|list))
gtype-vars)]
(return clean-types)))
diff --git a/src/lux/type.clj b/src/lux/type.clj
index fb9c63783..6ae542b68 100644
--- a/src/lux/type.clj
+++ b/src/lux/type.clj
@@ -57,7 +57,7 @@
(def IO
(Named$ (&/T "lux/data" "IO")
(Univ$ empty-env
- (Lambda$ Unit (Bound$ 0)))))
+ (Lambda$ Unit (Bound$ 1)))))
(def List
(Named$ (&/T "lux" "List")
@@ -66,9 +66,9 @@
;; lux;Nil
Unit
;; lux;Cons
- (Tuple$ (&/|list (Bound$ 0)
- (App$ (Bound$ 1)
- (Bound$ 0))))
+ (Tuple$ (&/|list (Bound$ 1)
+ (App$ (Bound$ 0)
+ (Bound$ 1))))
)))))
(def Maybe
@@ -78,12 +78,12 @@
;; lux;None
Unit
;; lux;Some
- (Bound$ 0)
+ (Bound$ 1)
)))))
(def Type
(Named$ (&/T "lux" "Type")
- (let [Type (App$ (Bound$ 1) (Bound$ 0))
+ (let [Type (App$ (Bound$ 0) (Bound$ 1))
TypeList (App$ List Type)
TypePair (Tuple$ (&/|list Type Type))]
(App$ (Univ$ empty-env
@@ -440,8 +440,8 @@
(|case type-fn
(&/$UnivQ local-env local-def)
(return (beta-reduce (->> local-env
- (&/Cons$ type-fn)
- (&/Cons$ param))
+ (&/Cons$ param)
+ (&/Cons$ type-fn))
local-def))
(&/$AppT F A)
@@ -593,16 +593,16 @@
(with-var
(fn [$arg]
(|let [expected* (beta-reduce (->> e!env
- (&/Cons$ expected)
- (&/Cons$ $arg))
+ (&/Cons$ $arg)
+ (&/Cons$ expected))
e!def)]
(check* class-loader fixpoints invariant?? expected* actual))))
[_ (&/$ExQ a!env a!def)]
(|do [$arg existential]
(|let [actual* (beta-reduce (->> a!env
- (&/Cons$ expected)
- (&/Cons$ $arg))
+ (&/Cons$ $arg)
+ (&/Cons$ expected))
a!def)]
(check* class-loader fixpoints invariant?? expected actual*)))