diff options
author | Eduardo Julian | 2015-09-15 00:31:35 -0400 |
---|---|---|
committer | Eduardo Julian | 2015-09-15 00:31:35 -0400 |
commit | 5dafb9ad900f990a14e280db2e00fb668a6606b9 (patch) | |
tree | 8d6db9f4af7e3f05cf25b53a51b7f29ed1cbeb15 /source | |
parent | d2a4aac2226b5cca59be236d3228fe5e5b17b8de (diff) |
- Compiler now takes into consideration exceptions that can be thrown by constructors.
- Changed the order of parameters in UnivQ & ExQ (even params are now arguments & odd params are now the UnivQ/ExQ types).
Diffstat (limited to 'source')
-rw-r--r-- | source/lux.lux | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/source/lux.lux b/source/lux.lux index ee01c8bdf..4571529a0 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 1) - (1 (9 (4 0) (4 1)) + (2 (1 (4 0) + (1 (9 (4 1) (4 0)) (0)))) (0))))))) (_lux_export List) @@ -65,7 +65,7 @@ (1 (1 ## "lux;None" (2 (0)) (1 ## "lux;Some" - (4 1) + (4 0) (0))))))) (_lux_export Maybe) (_lux_declare-tags [#None #Some] Maybe) @@ -84,7 +84,7 @@ ## )) (_lux_def Type (10 ["lux" "Type"] - (_lux_case (9 (4 0) (4 1)) + (_lux_case (9 (4 1) (4 0)) Type (_lux_case (9 List Type) TypeList @@ -127,8 +127,8 @@ Int (#Cons ## "lux;mappings" (#AppT List - (#TupleT (#Cons (#BoundT 3) - (#Cons (#BoundT 1) + (#TupleT (#Cons (#BoundT 2) + (#Cons (#BoundT 0) #Nil)))) #Nil))))))) (_lux_export Bindings) @@ -148,11 +148,11 @@ (#Cons ## "lux;inner-closures" Int (#Cons ## "lux;locals" - (#AppT (#AppT Bindings (#BoundT 3)) - (#BoundT 1)) + (#AppT (#AppT Bindings (#BoundT 2)) + (#BoundT 0)) (#Cons ## "lux;closure" - (#AppT (#AppT Bindings (#BoundT 3)) - (#BoundT 1)) + (#AppT (#AppT Bindings (#BoundT 2)) + (#BoundT 0)) #Nil))))))))) (_lux_export Env) (_lux_declare-tags [#name #inner-closures #locals #closure] Env) @@ -174,8 +174,8 @@ (#NamedT ["lux" "Meta"] (#UnivQ #Nil (#UnivQ #Nil - (#TupleT (#Cons (#BoundT 3) - (#Cons (#BoundT 1) + (#TupleT (#Cons (#BoundT 2) + (#Cons (#BoundT 0) #Nil))))))) (_lux_export Meta) (_lux_declare-tags [#meta #datum] Meta) @@ -193,9 +193,9 @@ ## (#RecordS (List (, (w (AST' w)) (w (AST' w))))))) (_lux_def AST' (#NamedT ["lux" "AST'"] - (_lux_case (#AppT (#BoundT 1) - (#AppT (#BoundT 0) - (#BoundT 1))) + (_lux_case (#AppT (#BoundT 0) + (#AppT (#BoundT 1) + (#BoundT 0))) AST (_lux_case (#AppT [List AST]) ASTList @@ -245,9 +245,9 @@ (#UnivQ #Nil (#UnivQ #Nil (#VariantT (#Cons ## "lux;Left" - (#BoundT 3) + (#BoundT 2) (#Cons ## "lux;Right" - (#BoundT 1) + (#BoundT 0) #Nil))))))) (_lux_export Either) (_lux_declare-tags [#Left #Right] Either) @@ -257,10 +257,10 @@ (_lux_def StateE (#UnivQ #Nil (#UnivQ #Nil - (#LambdaT (#BoundT 3) + (#LambdaT (#BoundT 2) (#AppT (#AppT Either Text) - (#TupleT (#Cons (#BoundT 3) - (#Cons (#BoundT 1) + (#TupleT (#Cons (#BoundT 2) + (#Cons (#BoundT 0) #Nil)))))))) ## (deftype Source @@ -303,7 +303,7 @@ (#Cons ## "lux;TypeD" Type (#Cons ## "lux;MacroD" - (#BoundT 1) + (#BoundT 0) (#Cons ## "lux;AliasD" Ident #Nil)))))))) @@ -337,7 +337,7 @@ (#Cons ## "lux;defs" (#AppT List (#TupleT (#Cons Text (#Cons (#TupleT (#Cons Bool (#Cons (#AppT DefData' (#LambdaT ASTList - (#AppT (#AppT StateE (#BoundT 1)) + (#AppT (#AppT StateE (#BoundT 0)) ASTList))) #Nil))) #Nil)))) @@ -382,7 +382,7 @@ Cursor (#Cons ## "lux;modules" (#AppT List (#TupleT (#Cons Text - (#Cons (#AppT Module (#AppT (#BoundT 0) (#BoundT 1))) + (#Cons (#AppT Module (#AppT (#BoundT 1) (#BoundT 0))) #Nil)))) (#Cons ## "lux;envs" (#AppT List (#AppT (#AppT Env Text) @@ -441,11 +441,11 @@ ## ...) (_lux_def return (_lux_: (#UnivQ #Nil - (#LambdaT (#BoundT 1) + (#LambdaT (#BoundT 0) (#LambdaT Compiler (#AppT (#AppT Either Text) (#TupleT (#Cons Compiler - (#Cons (#BoundT 1) + (#Cons (#BoundT 0) #Nil))))))) (_lux_lambda _ val (_lux_lambda _ state @@ -462,7 +462,7 @@ (#LambdaT Compiler (#AppT (#AppT Either Text) (#TupleT (#Cons Compiler - (#Cons (#BoundT 1) + (#Cons (#BoundT 0) #Nil))))))) (_lux_lambda _ msg (_lux_lambda _ state @@ -678,9 +678,9 @@ (def'' (map f xs) (#UnivQ #Nil (#UnivQ #Nil - (#LambdaT (#LambdaT (#BoundT 3) (#BoundT 1)) - (#LambdaT ($' List (#BoundT 3)) - ($' List (#BoundT 1)))))) + (#LambdaT (#LambdaT (#BoundT 2) (#BoundT 0)) + (#LambdaT ($' List (#BoundT 2)) + ($' List (#BoundT 0)))))) (_lux_case xs #Nil #Nil @@ -793,8 +793,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 1))) - (#AppT (#AppT StateE Compiler) (#BoundT 1))))) + (#LambdaT (#LambdaT ($' List Text) (#AppT (#AppT StateE Compiler) (#BoundT 0))) + (#AppT (#AppT StateE Compiler) (#BoundT 0))))) (_lux_case args #Nil (next #Nil) @@ -811,12 +811,12 @@ (def'' (foldL f init xs) ## (All [a b] (-> (-> a b a) a (List b) a)) - (#UnivQ #Nil (#UnivQ #Nil (#LambdaT (#LambdaT (#BoundT 3) - (#LambdaT (#BoundT 1) - (#BoundT 3))) - (#LambdaT (#BoundT 3) - (#LambdaT ($' List (#BoundT 1)) - (#BoundT 3)))))) + (#UnivQ #Nil (#UnivQ #Nil (#LambdaT (#LambdaT (#BoundT 2) + (#LambdaT (#BoundT 0) + (#BoundT 2))) + (#LambdaT (#BoundT 2) + (#LambdaT ($' List (#BoundT 0)) + (#BoundT 2)))))) (_lux_case xs #Nil init @@ -839,9 +839,9 @@ (lambda'' [body' name'] (form$ (#Cons (tag$ ["lux" "UnivQ"]) (#Cons (tag$ ["lux" "Nil"]) - (#Cons (replace-syntax (#Cons [name' (make-bound 1)] #Nil) + (#Cons (replace-syntax (#Cons [name' (make-bound 0)] #Nil) (update-bounds body')) #Nil)))))) - (replace-syntax (#Cons [self-name (make-bound -2)] #Nil) + (replace-syntax (#Cons [self-name (make-bound -1)] #Nil) body) names) (return (#Cons body' #Nil))))) @@ -865,9 +865,9 @@ (lambda'' [body' name'] (form$ (#Cons (tag$ ["lux" "ExQ"]) (#Cons (tag$ ["lux" "Nil"]) - (#Cons (replace-syntax (#Cons [name' (make-bound 1)] #Nil) + (#Cons (replace-syntax (#Cons [name' (make-bound 0)] #Nil) (update-bounds body')) #Nil)))))) - (replace-syntax (#Cons [self-name (make-bound -2)] #Nil) + (replace-syntax (#Cons [self-name (make-bound -1)] #Nil) body) names) (return (#Cons body' #Nil))))) @@ -1799,7 +1799,7 @@ (defmacro' #export (Rec tokens) (_lux_case tokens (#Cons [_ (#SymbolS "" name)] (#Cons body #Nil)) - (let' [body' (replace-syntax (@list [name (` (#AppT (~ (make-bound 0)) (~ (make-bound 1))))]) body)] + (let' [body' (replace-syntax (@list [name (` (#AppT (~ (make-bound 1)) (~ (make-bound 0))))]) body)] (return (@list (` (#AppT (#UnivQ #Nil (~ body')) Void))))) _ @@ -2300,7 +2300,7 @@ (-> Type Type (Maybe Type)) (case type-fn (#UnivQ env body) - (#Some (beta-reduce (@list& type-fn param env) body)) + (#Some (beta-reduce (@list& param type-fn env) body)) (#AppT F A) (do Maybe/Monad |