From 4744552df1f1285d600a13ed0a3cf8be2f336030 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 7 May 2017 12:17:27 -0400 Subject: - Removed "T" suffix from Type's tags. --- stdlib/source/lux.lux | 746 +++++++++++++++++++++++++------------------------- 1 file changed, 373 insertions(+), 373 deletions(-) (limited to 'stdlib/source/lux.lux') diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux index 344925b1f..f530f9ca5 100644 --- a/stdlib/source/lux.lux +++ b/stdlib/source/lux.lux @@ -121,19 +121,19 @@ #Nil)))))) ## (type: #rec Type -## (#HostT Text (List Type)) -## #VoidT -## #UnitT -## (#SumT Type Type) -## (#ProdT Type Type) -## (#FunctionT Type Type) -## (#BoundT Nat) -## (#VarT Nat) -## (#ExT Nat) +## (#Host Text (List Type)) +## #Void +## #Unit +## (#Sum Type Type) +## (#Product Type Type) +## (#Function Type Type) +## (#Bound Nat) +## (#Var Nat) +## (#Ex Nat) ## (#UnivQ (List Type) Type) ## (#ExQ (List Type) Type) -## (#AppT Type Type) -## (#NamedT Ident Type) +## (#App Type Type) +## (#Named Ident Type) ## ) (_lux_def Type (+12 ["lux" "Type"] @@ -144,48 +144,48 @@ (_lux_case (+4 Type Type) TypePair (+11 (+9 #Nil - (+3 ## "lux;HostT" + (+3 ## "lux;Host" (+4 Text TypeList) - (+3 ## "lux;VoidT" + (+3 ## "lux;Void" (+2) - (+3 ## "lux;UnitT" + (+3 ## "lux;Unit" (+2) - (+3 ## "lux;SumT" + (+3 ## "lux;Sum" TypePair - (+3 ## "lux;ProdT" + (+3 ## "lux;Product" TypePair - (+3 ## "lux;FunctionT" + (+3 ## "lux;Function" TypePair - (+3 ## "lux;BoundT" + (+3 ## "lux;Bound" Nat - (+3 ## "lux;VarT" + (+3 ## "lux;Var" Nat - (+3 ## "lux;ExT" + (+3 ## "lux;Ex" Nat (+3 ## "lux;UnivQ" (+4 TypeList Type) (+3 ## "lux;ExQ" (+4 TypeList Type) - (+3 ## "lux;AppT" + (+3 ## "lux;App" TypePair - ## "lux;NamedT" + ## "lux;Named" (+4 Ident Type)))))))))))))) Void))))) (#Cons [["lux" "type?"] (+0 true)] (#Cons [["lux" "export?"] (+0 true)] - (#Cons [["lux" "tags"] (+8 (#Cons (+6 "HostT") - (#Cons (+6 "VoidT") - (#Cons (+6 "UnitT") - (#Cons (+6 "SumT") - (#Cons (+6 "ProdT") - (#Cons (+6 "FunctionT") - (#Cons (+6 "BoundT") - (#Cons (+6 "VarT") - (#Cons (+6 "ExT") + (#Cons [["lux" "tags"] (+8 (#Cons (+6 "Host") + (#Cons (+6 "Void") + (#Cons (+6 "Unit") + (#Cons (+6 "Sum") + (#Cons (+6 "Product") + (#Cons (+6 "Function") + (#Cons (+6 "Bound") + (#Cons (+6 "Var") + (#Cons (+6 "Ex") (#Cons (+6 "UnivQ") (#Cons (+6 "ExQ") - (#Cons (+6 "AppT") - (#Cons (+6 "NamedT") + (#Cons (+6 "App") + (#Cons (+6 "Named") #Nil))))))))))))))] (#Cons [["lux" "doc"] (+6 "This type represents the data-structures that are used to specify types themselves.")] (#Cons [["lux" "type-rec?"] (+0 true)] @@ -194,8 +194,8 @@ ## (type: Top ## (Ex [a] a)) (_lux_def Top - (#NamedT ["lux" "Top"] - (#ExQ #Nil (#BoundT +1))) + (#Named ["lux" "Top"] + (#ExQ #Nil (#Bound +1))) (#Cons [["lux" "type?"] (+0 true)] (#Cons [["lux" "export?"] (+0 true)] (#Cons [["lux" "doc"] (+6 "The type of things whose type does not matter. @@ -206,8 +206,8 @@ ## (type: Bottom ## (All [a] a)) (_lux_def Bottom - (#NamedT ["lux" "Bottom"] - (#UnivQ #Nil (#BoundT +1))) + (#Named ["lux" "Bottom"] + (#UnivQ #Nil (#Bound +1))) (#Cons [["lux" "type?"] (+0 true)] (#Cons [["lux" "export?"] (+0 true)] (#Cons [["lux" "doc"] (+6 "The type of things whose type is unknown or undefined. @@ -227,33 +227,33 @@ ## (#ListA (List Ann-Value)) ## (#DictA (List [Text Ann-Value]))) (_lux_def Ann-Value - (#NamedT ["lux" "Ann-Value"] - (_lux_case (#AppT (#BoundT +0) (#BoundT +1)) - Ann-Value - (#AppT (#UnivQ #Nil - (#SumT ## #BoolA - Bool - (#SumT ## #NatA - Nat - (#SumT ## #IntA - Int - (#SumT ## #DegA - Deg - (#SumT ## #RealA - Real - (#SumT ## #CharA - Char - (#SumT ## #TextA - Text - (#SumT ## #IdentA - Ident - (#SumT ## #ListA - (#AppT List Ann-Value) - ## #DictA - (#AppT List (#ProdT Text Ann-Value))))))))))) - ) - Void) - )) + (#Named ["lux" "Ann-Value"] + (_lux_case (#App (#Bound +0) (#Bound +1)) + Ann-Value + (#App (#UnivQ #Nil + (#Sum ## #BoolA + Bool + (#Sum ## #NatA + Nat + (#Sum ## #IntA + Int + (#Sum ## #DegA + Deg + (#Sum ## #RealA + Real + (#Sum ## #CharA + Char + (#Sum ## #TextA + Text + (#Sum ## #IdentA + Ident + (#Sum ## #ListA + (#App List Ann-Value) + ## #DictA + (#App List (#Product Text Ann-Value))))))))))) + ) + Void) + )) (#Cons [["lux" "type?"] (+0 true)] (#Cons [["lux" "export?"] (+0 true)] (#Cons [["lux" "tags"] (+8 (#Cons (+6 "BoolA") @@ -274,8 +274,8 @@ ## (type: Anns ## (List [Ident Ann-Value])) (_lux_def Anns - (#NamedT ["lux" "Anns"] - (#AppT List (#ProdT Ident Ann-Value))) + (#Named ["lux" "Anns"] + (#App List (#Product Ident Ann-Value))) (#Cons [["lux" "type?"] (#BoolA true)] (#Cons [["lux" "export?"] (#BoolA true)] (#Cons [["lux" "doc"] (#TextA "A set of annotations associated with a definition.")] @@ -297,8 +297,8 @@ ## (type: Def ## [Type Anns Void]) (_lux_def Def - (#NamedT ["lux" "Def"] - (#ProdT Type (#ProdT Anns Void))) + (#Named ["lux" "Def"] + (#Product Type (#Product Anns Void))) (#Cons [["lux" "doc"] (#TextA "Represents all the data associated with a definition: its type, its annotations, and its value.")] default-def-meta-exported)) @@ -306,15 +306,15 @@ ## {#counter Nat ## #mappings (List [k v])}) (_lux_def Bindings - (#NamedT ["lux" "Bindings"] - (#UnivQ #Nil - (#UnivQ #Nil - (#ProdT ## "lux;counter" - Nat - ## "lux;mappings" - (#AppT List - (#ProdT (#BoundT +3) - (#BoundT +1))))))) + (#Named ["lux" "Bindings"] + (#UnivQ #Nil + (#UnivQ #Nil + (#Product ## "lux;counter" + Nat + ## "lux;mappings" + (#App List + (#Product (#Bound +3) + (#Bound +1))))))) (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "counter") (#Cons (#TextA "mappings") #Nil)))] @@ -326,8 +326,8 @@ ## #line Nat ## #column Nat}) (_lux_def Cursor - (#NamedT ["lux" "Cursor"] - (#ProdT Text (#ProdT Nat Nat))) + (#Named ["lux" "Cursor"] + (#Product Text (#Product Nat Nat))) (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "module") (#Cons (#TextA "line") (#Cons (#TextA "column") @@ -339,11 +339,11 @@ ## {#meta m ## #datum v}) (_lux_def Meta - (#NamedT ["lux" "Meta"] - (#UnivQ #Nil - (#UnivQ #Nil - (#ProdT (#BoundT +3) - (#BoundT +1))))) + (#Named ["lux" "Meta"] + (#UnivQ #Nil + (#UnivQ #Nil + (#Product (#Bound +3) + (#Bound +1))))) (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "meta") (#Cons (#TextA "datum") #Nil)))] @@ -355,11 +355,11 @@ ## (#Local Nat) ## (#Captured Nat)) (_lux_def Ref - (#NamedT ["lux" "Ref"] - (#SumT ## Local - Nat - ## Captured - Nat)) + (#Named ["lux" "Ref"] + (#Sum ## Local + Nat + ## Captured + Nat)) (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "Local") (#Cons (#TextA "Captured") #Nil)))] @@ -371,15 +371,15 @@ ## #locals (Bindings Text [Type Nat]) ## #captured (Bindings Text [Type Ref])}) (_lux_def Scope - (#NamedT ["lux" "Scope"] - (#ProdT ## name - (#AppT List Text) - (#ProdT ## inner - Nat - (#ProdT ## locals - (#AppT (#AppT Bindings Text) (#ProdT Type Nat)) - ## captured - (#AppT (#AppT Bindings Text) (#ProdT Type Ref)))))) + (#Named ["lux" "Scope"] + (#Product ## name + (#App List Text) + (#Product ## inner + Nat + (#Product ## locals + (#App (#App Bindings Text) (#Product Type Nat)) + ## captured + (#App (#App Bindings Text) (#Product Type Ref)))))) (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "name") (#Cons (#TextA "inner") (#Cons (#TextA "locals") @@ -401,40 +401,40 @@ ## (#Tuple (List (w (AST' w)))) ## (#Record (List [(w (AST' w)) (w (AST' w))]))) (_lux_def AST' - (#NamedT ["lux" "AST'"] - (_lux_case (#AppT (#BoundT +1) - (#AppT (#BoundT +0) - (#BoundT +1))) - AST - (_lux_case (#AppT [List AST]) - AST-List - (#UnivQ #Nil - (#SumT ## "lux;Bool" - Bool - (#SumT ## "lux;Nat" - Nat - (#SumT ## "lux;Int" - Int - (#SumT ## "lux;Deg" - Deg - (#SumT ## "lux;Real" - Real - (#SumT ## "lux;Char" - Char - (#SumT ## "lux;Text" - Text - (#SumT ## "lux;Symbol" + (#Named ["lux" "AST'"] + (_lux_case (#App (#Bound +1) + (#App (#Bound +0) + (#Bound +1))) + AST + (_lux_case (#App [List AST]) + AST-List + (#UnivQ #Nil + (#Sum ## "lux;Bool" + Bool + (#Sum ## "lux;Nat" + Nat + (#Sum ## "lux;Int" + Int + (#Sum ## "lux;Deg" + Deg + (#Sum ## "lux;Real" + Real + (#Sum ## "lux;Char" + Char + (#Sum ## "lux;Text" + Text + (#Sum ## "lux;Symbol" + Ident + (#Sum ## "lux;Tag" Ident - (#SumT ## "lux;Tag" - Ident - (#SumT ## "lux;Form" + (#Sum ## "lux;Form" + AST-List + (#Sum ## "lux;Tuple" AST-List - (#SumT ## "lux;Tuple" - AST-List - ## "lux;Record" - (#AppT List (#ProdT AST AST)) - ))))))))))) - )))) + ## "lux;Record" + (#App List (#Product AST AST)) + ))))))))))) + )))) (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "Bool") (#Cons (#TextA "Nat") (#Cons (#TextA "Int") @@ -454,28 +454,28 @@ ## (type: AST ## (Meta Cursor (AST' (Meta Cursor)))) (_lux_def AST - (#NamedT ["lux" "AST"] - (_lux_case (#AppT Meta Cursor) - w - (#AppT w (#AppT AST' w)))) + (#Named ["lux" "AST"] + (_lux_case (#App Meta Cursor) + w + (#App w (#App AST' w)))) (#Cons [["lux" "doc"] (#TextA "The type of AST nodes for Lux syntax.")] default-def-meta-exported)) (_lux_def AST-List - (#AppT List AST) + (#App List AST) default-def-meta-unexported) ## (type: (Either l r) ## (#Left l) ## (#Right r)) (_lux_def Either - (#NamedT ["lux" "Either"] - (#UnivQ #Nil - (#UnivQ #Nil - (#SumT ## "lux;Left" - (#BoundT +3) - ## "lux;Right" - (#BoundT +1))))) + (#Named ["lux" "Either"] + (#UnivQ #Nil + (#UnivQ #Nil + (#Sum ## "lux;Left" + (#Bound +3) + ## "lux;Right" + (#Bound +1))))) (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "Left") (#Cons (#TextA "Right") #Nil)))] @@ -486,8 +486,8 @@ ## (type: Source ## [Cursor Text]) (_lux_def Source - (#NamedT ["lux" "Source"] - (#ProdT Cursor Text)) + (#Named ["lux" "Source"] + (#Product Cursor Text)) default-def-meta-exported) ## (type: Module-State @@ -495,15 +495,15 @@ ## #Compiled ## #Cached) (_lux_def Module-State - (#NamedT ["lux" "Module-State"] - (#SumT - ## #Active + (#Named ["lux" "Module-State"] + (#Sum + ## #Active + Unit + (#Sum + ## #Compiled Unit - (#SumT - ## #Compiled - Unit - ## #Cached - Unit))) + ## #Cached + Unit))) (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "Active") (#Cons (#TextA "Compiled") (#Cons (#TextA "Cached") @@ -520,33 +520,33 @@ ## #module-anns Anns ## #module-state Module-State}) (_lux_def Module - (#NamedT ["lux" "Module"] - (#ProdT ## "lux;module-hash" - Nat - (#ProdT ## "lux;module-aliases" - (#AppT List (#ProdT Text Text)) - (#ProdT ## "lux;defs" - (#AppT List (#ProdT Text + (#Named ["lux" "Module"] + (#Product ## "lux;module-hash" + Nat + (#Product ## "lux;module-aliases" + (#App List (#Product Text Text)) + (#Product ## "lux;defs" + (#App List (#Product Text Def)) - (#ProdT ## "lux;imports" - (#AppT List Text) - (#ProdT ## "lux;tags" - (#AppT List - (#ProdT Text - (#ProdT Nat - (#ProdT (#AppT List Ident) - (#ProdT Bool - Type))))) - (#ProdT ## "lux;types" - (#AppT List - (#ProdT Text - (#ProdT (#AppT List Ident) - (#ProdT Bool - Type)))) - (#ProdT ## "lux;module-anns" - Anns - Module-State)) - )))))) + (#Product ## "lux;imports" + (#App List Text) + (#Product ## "lux;tags" + (#App List + (#Product Text + (#Product Nat + (#Product (#App List Ident) + (#Product Bool + Type))))) + (#Product ## "lux;types" + (#App List + (#Product Text + (#Product (#App List Ident) + (#Product Bool + Type)))) + (#Product ## "lux;module-anns" + Anns + Module-State)) + )))))) (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "module-hash") (#Cons (#TextA "module-aliases") (#Cons (#TextA "defs") @@ -564,15 +564,15 @@ ## #var-counter Nat ## #var-bindings (List [Nat (Maybe Type)])}) (_lux_def Type-Context - (#NamedT ["lux" "Type-Context"] - (#ProdT ## ex-counter + (#Named ["lux" "Type-Context"] + (#Product ## ex-counter + Nat + (#Product ## var-counter Nat - (#ProdT ## var-counter - Nat - ## var-bindings - (#AppT List - (#ProdT Nat - (#AppT Maybe Type)))))) + ## var-bindings + (#App List + (#Product Nat + (#App Maybe Type)))))) (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "ex-counter") (#Cons (#TextA "var-counter") (#Cons (#TextA "var-bindings") @@ -584,13 +584,13 @@ ## #Eval ## #REPL) (_lux_def Compiler-Mode - (#NamedT ["lux" "Compiler-Mode"] - (#SumT ## Build - #UnitT - (#SumT ## Eval - #UnitT - ## REPL - #UnitT))) + (#Named ["lux" "Compiler-Mode"] + (#Sum ## Build + #Unit + (#Sum ## Eval + #Unit + ## REPL + #Unit))) (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "Build") (#Cons (#TextA "Eval") (#Cons (#TextA "REPL") @@ -602,11 +602,11 @@ ## {#compiler-version Text ## #compiler-mode Compiler-Mode}) (_lux_def Compiler-Info - (#NamedT ["lux" "Compiler-Info"] - (#ProdT ## "lux;compiler-version" - Text - ## "lux;compiler-mode" - Compiler-Mode)) + (#Named ["lux" "Compiler-Info"] + (#Product ## "lux;compiler-version" + Text + ## "lux;compiler-mode" + Compiler-Mode)) (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "compiler-version") (#Cons (#TextA "compiler-mode") #Nil)))] @@ -625,28 +625,28 @@ ## #scope-type-vars (List Nat) ## #host Void}) (_lux_def Compiler - (#NamedT ["lux" "Compiler"] - (#ProdT ## "lux;info" - Compiler-Info - (#ProdT ## "lux;source" - Source - (#ProdT ## "lux;cursor" - Cursor - (#ProdT ## "lux;modules" - (#AppT List (#ProdT Text + (#Named ["lux" "Compiler"] + (#Product ## "lux;info" + Compiler-Info + (#Product ## "lux;source" + Source + (#Product ## "lux;cursor" + Cursor + (#Product ## "lux;modules" + (#App List (#Product Text Module)) - (#ProdT ## "lux;scopes" - (#AppT List Scope) - (#ProdT ## "lux;type-context" - Type-Context - (#ProdT ## "lux;expected" - (#AppT Maybe Type) - (#ProdT ## "lux;seed" - Nat - (#ProdT ## scope-type-vars - (#AppT List Nat) - ## "lux;host" - Void)))))))))) + (#Product ## "lux;scopes" + (#App List Scope) + (#Product ## "lux;type-context" + Type-Context + (#Product ## "lux;expected" + (#App Maybe Type) + (#Product ## "lux;seed" + Nat + (#Product ## scope-type-vars + (#App List Nat) + ## "lux;host" + Void)))))))))) (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "info") (#Cons (#TextA "source") (#Cons (#TextA "cursor") @@ -668,11 +668,11 @@ ## (type: (Lux a) ## (-> Compiler (Either Text [Compiler a]))) (_lux_def Lux - (#NamedT ["lux" "Lux"] - (#UnivQ #Nil - (#FunctionT Compiler - (#AppT (#AppT Either Text) - (#ProdT Compiler (#BoundT +1)))))) + (#Named ["lux" "Lux"] + (#UnivQ #Nil + (#Function Compiler + (#App (#App Either Text) + (#Product Compiler (#Bound +1)))))) (#Cons [["lux" "doc"] (#TextA "Computations that can have access to the state of the compiler. These computations may fail, or modify the state of the compiler.")] @@ -682,8 +682,8 @@ ## (type: Macro ## (-> (List AST) (Lux (List AST)))) (_lux_def Macro - (#NamedT ["lux" "Macro"] - (#FunctionT AST-List (#AppT Lux AST-List))) + (#Named ["lux" "Macro"] + (#Function AST-List (#App Lux AST-List))) (#Cons [["lux" "doc"] (#TextA "Functions that run at compile-time and allow you to transform and extend the language in powerful ways.")] default-def-meta-exported)) @@ -693,20 +693,20 @@ #Nil) (_lux_def _meta - (_lux_: (#FunctionT (#AppT AST' - (#AppT Meta Cursor)) - AST) + (_lux_: (#Function (#App AST' + (#App Meta Cursor)) + AST) (_lux_function _ data [_cursor data])) #Nil) (_lux_def return (_lux_: (#UnivQ #Nil - (#FunctionT (#BoundT +1) - (#FunctionT Compiler - (#AppT (#AppT Either Text) - (#ProdT Compiler - (#BoundT +1)))))) + (#Function (#Bound +1) + (#Function Compiler + (#App (#App Either Text) + (#Product Compiler + (#Bound +1)))))) (_lux_function _ val (_lux_function _ state (#Right state val)))) @@ -714,73 +714,73 @@ (_lux_def fail (_lux_: (#UnivQ #Nil - (#FunctionT Text - (#FunctionT Compiler - (#AppT (#AppT Either Text) - (#ProdT Compiler - (#BoundT +1)))))) + (#Function Text + (#Function Compiler + (#App (#App Either Text) + (#Product Compiler + (#Bound +1)))))) (_lux_function _ msg (_lux_function _ state (#Left msg)))) #Nil) (_lux_def bool$ - (_lux_: (#FunctionT Bool AST) + (_lux_: (#Function Bool AST) (_lux_function _ value (_meta (#Bool value)))) #Nil) (_lux_def nat$ - (_lux_: (#FunctionT Nat AST) + (_lux_: (#Function Nat AST) (_lux_function _ value (_meta (#Nat value)))) #Nil) (_lux_def int$ - (_lux_: (#FunctionT Int AST) + (_lux_: (#Function Int AST) (_lux_function _ value (_meta (#Int value)))) #Nil) (_lux_def deg$ - (_lux_: (#FunctionT Deg AST) + (_lux_: (#Function Deg AST) (_lux_function _ value (_meta (#Deg value)))) #Nil) (_lux_def real$ - (_lux_: (#FunctionT Real AST) + (_lux_: (#Function Real AST) (_lux_function _ value (_meta (#Real value)))) #Nil) (_lux_def char$ - (_lux_: (#FunctionT Char AST) + (_lux_: (#Function Char AST) (_lux_function _ value (_meta (#Char value)))) #Nil) (_lux_def text$ - (_lux_: (#FunctionT Text AST) + (_lux_: (#Function Text AST) (_lux_function _ text (_meta (#Text text)))) #Nil) (_lux_def symbol$ - (_lux_: (#FunctionT Ident AST) + (_lux_: (#Function Ident AST) (_lux_function _ ident (_meta (#Symbol ident)))) #Nil) (_lux_def tag$ - (_lux_: (#FunctionT Ident AST) + (_lux_: (#Function Ident AST) (_lux_function _ ident (_meta (#Tag ident)))) #Nil) (_lux_def form$ - (_lux_: (#FunctionT (#AppT List AST) AST) + (_lux_: (#Function (#App List AST) AST) (_lux_function _ tokens (_meta (#Form tokens)))) #Nil) (_lux_def tuple$ - (_lux_: (#FunctionT (#AppT List AST) AST) + (_lux_: (#Function (#App List AST) AST) (_lux_function _ tokens (_meta (#Tuple tokens)))) #Nil) (_lux_def record$ - (_lux_: (#FunctionT (#AppT List (#ProdT AST AST)) AST) + (_lux_: (#Function (#App List (#Product AST AST)) AST) (_lux_function _ tokens (_meta (#Record tokens)))) #Nil) @@ -869,7 +869,7 @@ #Nil) (_lux_def with-export-meta - (_lux_: (#FunctionT AST AST) + (_lux_: (#Function AST AST) (function'' [tail] (form$ (#Cons (tag$ ["lux" "Cons"]) (#Cons export?-meta @@ -877,7 +877,7 @@ #Nil) (_lux_def with-hidden-meta - (_lux_: (#FunctionT AST AST) + (_lux_: (#Function AST AST) (function'' [tail] (form$ (#Cons (tag$ ["lux" "Cons"]) (#Cons hidden?-meta @@ -885,7 +885,7 @@ #Nil) (_lux_def with-macro-meta - (_lux_: (#FunctionT AST AST) + (_lux_: (#Function AST AST) (function'' [tail] (form$ (#Cons (tag$ ["lux" "Cons"]) (#Cons macro?-meta @@ -1003,7 +1003,7 @@ (#Cons x (#Cons y xs)) (return (#Cons (form$ (#Cons (symbol$ ["lux" "$'"]) - (#Cons (form$ (#Cons (tag$ ["lux" "AppT"]) + (#Cons (form$ (#Cons (tag$ ["lux" "App"]) (#Cons x (#Cons y #Nil)))) xs))) #Nil)) @@ -1015,9 +1015,9 @@ #Nil (#UnivQ #Nil (#UnivQ #Nil - (#FunctionT (#FunctionT (#BoundT +3) (#BoundT +1)) - (#FunctionT ($' List (#BoundT +3)) - ($' List (#BoundT +1)))))) + (#Function (#Function (#Bound +3) (#Bound +1)) + (#Function ($' List (#Bound +3)) + ($' List (#Bound +1)))))) (_lux_case xs #Nil #Nil @@ -1028,11 +1028,11 @@ (def:'' RepEnv #Nil Type - ($' List (#ProdT Text AST))) + ($' List (#Product Text AST))) (def:'' (make-env xs ys) #Nil - (#FunctionT ($' List Text) (#FunctionT ($' List AST) RepEnv)) + (#Function ($' List Text) (#Function ($' List AST) RepEnv)) (_lux_case [xs ys] [(#Cons x xs') (#Cons y ys')] (#Cons [x y] (make-env xs' ys')) @@ -1042,12 +1042,12 @@ (def:'' (Text/= x y) #Nil - (#FunctionT Text (#FunctionT Text Bool)) + (#Function Text (#Function Text Bool)) (_lux_proc ["text" "="] [x y])) (def:'' (get-rep key env) #Nil - (#FunctionT Text (#FunctionT RepEnv ($' Maybe AST))) + (#Function Text (#Function RepEnv ($' Maybe AST))) (_lux_case env #Nil #None @@ -1062,7 +1062,7 @@ (def:'' (replace-syntax reps syntax) #Nil - (#FunctionT RepEnv (#FunctionT AST AST)) + (#Function RepEnv (#Function AST AST)) (_lux_case syntax [_ (#Symbol "" name)] (_lux_case (get-rep name reps) @@ -1079,7 +1079,7 @@ [meta (#Tuple (map (replace-syntax reps) members))] [meta (#Record slots)] - [meta (#Record (map (_lux_: (#FunctionT (#ProdT AST AST) (#ProdT AST AST)) + [meta (#Record (map (_lux_: (#Function (#Product AST AST) (#Product AST AST)) (function'' [slot] (_lux_case slot [k v] @@ -1092,20 +1092,20 @@ (def:'' (update-bounds ast) #Nil - (#FunctionT AST AST) + (#Function AST AST) (_lux_case ast [_ (#Tuple members)] (tuple$ (map update-bounds members)) [_ (#Record pairs)] - (record$ (map (_lux_: (#FunctionT (#ProdT AST AST) (#ProdT AST AST)) + (record$ (map (_lux_: (#Function (#Product AST AST) (#Product AST AST)) (function'' [pair] (let'' [name val] pair [name (update-bounds val)]))) pairs)) - [_ (#Form (#Cons [_ (#Tag "lux" "BoundT")] (#Cons [_ (#Nat idx)] #Nil)))] - (form$ (#Cons (tag$ ["lux" "BoundT"]) (#Cons (nat$ (_lux_proc ["nat" "+"] [+2 idx])) #Nil))) + [_ (#Form (#Cons [_ (#Tag "lux" "Bound")] (#Cons [_ (#Nat idx)] #Nil)))] + (form$ (#Cons (tag$ ["lux" "Bound"]) (#Cons (nat$ (_lux_proc ["nat" "+"] [+2 idx])) #Nil))) [_ (#Form members)] (form$ (map update-bounds members)) @@ -1116,10 +1116,10 @@ (def:'' (parse-quantified-args args next) #Nil ## (-> (List AST) (-> (List Text) (Lux (List AST))) (Lux (List AST))) - (#FunctionT ($' List AST) - (#FunctionT (#FunctionT ($' List Text) (#AppT Lux ($' List AST))) - (#AppT Lux ($' List AST)) - )) + (#Function ($' List AST) + (#Function (#Function ($' List Text) (#App Lux ($' List AST))) + (#App Lux ($' List AST)) + )) (_lux_case args #Nil (next #Nil) @@ -1133,18 +1133,18 @@ (def:'' (make-bound idx) #Nil - (#FunctionT Nat AST) - (form$ (#Cons (tag$ ["lux" "BoundT"]) (#Cons (nat$ idx) #Nil)))) + (#Function Nat AST) + (form$ (#Cons (tag$ ["lux" "Bound"]) (#Cons (nat$ idx) #Nil)))) (def:'' (fold f init xs) #Nil ## (All [a b] (-> (-> b a a) a (List b) a)) - (#UnivQ #Nil (#UnivQ #Nil (#FunctionT (#FunctionT (#BoundT +1) - (#FunctionT (#BoundT +3) - (#BoundT +3))) - (#FunctionT (#BoundT +3) - (#FunctionT ($' List (#BoundT +1)) - (#BoundT +3)))))) + (#UnivQ #Nil (#UnivQ #Nil (#Function (#Function (#Bound +1) + (#Function (#Bound +3) + (#Bound +3))) + (#Function (#Bound +3) + (#Function ($' List (#Bound +1)) + (#Bound +3)))))) (_lux_case xs #Nil init @@ -1155,7 +1155,7 @@ (def:'' (length list) #Nil (#UnivQ #Nil - (#FunctionT ($' List (#BoundT +1)) Int)) + (#Function ($' List (#Bound +1)) Int)) (fold (function'' [_ acc] (_lux_proc ["int" "+"] [1 acc])) 0 list)) (macro:' #export (All tokens) @@ -1178,7 +1178,7 @@ (#Cons [_ (#Tuple args)] (#Cons body #Nil)) (parse-quantified-args args (function'' [names] - (let'' body' (fold (_lux_: (#FunctionT Text (#FunctionT AST AST)) + (let'' body' (fold (_lux_: (#Function Text (#Function AST AST)) (function'' [name' body'] (form$ (#Cons (tag$ ["lux" "UnivQ"]) (#Cons (tag$ ["lux" "Nil"]) @@ -1229,7 +1229,7 @@ (#Cons [_ (#Tuple args)] (#Cons body #Nil)) (parse-quantified-args args (function'' [names] - (let'' body' (fold (_lux_: (#FunctionT Text (#FunctionT AST AST)) + (let'' body' (fold (_lux_: (#Function Text (#Function AST AST)) (function'' [name' body'] (form$ (#Cons (tag$ ["lux" "ExQ"]) (#Cons (tag$ ["lux" "Nil"]) @@ -1260,7 +1260,7 @@ (def:'' (reverse list) #Nil - (All [a] (#FunctionT ($' List a) ($' List a))) + (All [a] (#Function ($' List a) ($' List a))) (fold (function'' [head tail] (#Cons head tail)) #Nil list)) @@ -1273,8 +1273,8 @@ #;Nil) (_lux_case (reverse tokens) (#Cons output inputs) - (return (#Cons (fold (_lux_: (#FunctionT AST (#FunctionT AST AST)) - (function'' [i o] (form$ (#Cons (tag$ ["lux" "FunctionT"]) (#Cons i (#Cons o #Nil)))))) + (return (#Cons (fold (_lux_: (#Function AST (#Function AST AST)) + (function'' [i o] (form$ (#Cons (tag$ ["lux" "Function"]) (#Cons i (#Cons o #Nil)))))) output inputs) #Nil)) @@ -1319,10 +1319,10 @@ #;Nil) (_lux_case (reverse tokens) #Nil - (return (list (tag$ ["lux" "UnitT"]))) + (return (list (tag$ ["lux" "Unit"]))) (#Cons last prevs) - (return (list (fold (function'' [left right] (form$ (list (tag$ ["lux" "ProdT"]) left right))) + (return (list (fold (function'' [left right] (form$ (list (tag$ ["lux" "Product"]) left right))) last prevs))) )) @@ -1336,10 +1336,10 @@ #;Nil) (_lux_case (reverse tokens) #Nil - (return (list (tag$ ["lux" "VoidT"]))) + (return (list (tag$ ["lux" "Void"]))) (#Cons last prevs) - (return (list (fold (function'' [left right] (form$ (list (tag$ ["lux" "SumT"]) left right))) + (return (list (fold (function'' [left right] (form$ (list (tag$ ["lux" "Sum"]) left right))) last prevs))) )) @@ -1553,12 +1553,12 @@ (list& [["lux" "tags"] (#ListA (list (#TextA "wrap") (#TextA "bind")))] default-def-meta-unexported) Type - (#NamedT ["lux" "Monad"] - (All [m] - (& (All [a] (-> a ($' m a))) - (All [a b] (-> (-> a ($' m b)) - ($' m a) - ($' m b))))))) + (#Named ["lux" "Monad"] + (All [m] + (& (All [a] (-> a ($' m a))) + (All [a b] (-> (-> a ($' m b)) + ($' m a) + ($' m b))))))) (def:''' Monad #Nil @@ -1762,7 +1762,7 @@ (do Monad [=elem (untemplate elem)] (wrap (form$ (list (symbol$ ["" "_lux_:"]) - (form$ (list (tag$ ["lux" "AppT"]) (tuple$ (list (symbol$ ["lux" "List"]) (symbol$ ["lux" "AST"]))))) + (form$ (list (tag$ ["lux" "App"]) (tuple$ (list (symbol$ ["lux" "List"]) (symbol$ ["lux" "AST"]))))) (form$ (list (tag$ ["lux" "Cons"]) (tuple$ (list =elem (tag$ ["lux" "Nil"])))))))))))) elems))] (wrap (wrap-meta (form$ (list tag @@ -1868,10 +1868,10 @@ (host java.util.List [java.lang.Long])")]) (_lux_case tokens (#Cons [_ (#Symbol "" class-name)] #Nil) - (return (list (form$ (list (tag$ ["lux" "HostT"]) (text$ class-name) (tag$ ["lux" "Nil"]))))) + (return (list (form$ (list (tag$ ["lux" "Host"]) (text$ class-name) (tag$ ["lux" "Nil"]))))) (#Cons [_ (#Symbol "" class-name)] (#Cons [_ (#Tuple params)] #Nil)) - (return (list (form$ (list (tag$ ["lux" "HostT"]) (text$ class-name) (untemplate-list params))))) + (return (list (form$ (list (tag$ ["lux" "Host"]) (text$ class-name) (untemplate-list params))))) _ (fail "Wrong syntax for host"))) @@ -2494,7 +2494,7 @@ [_ (#Form (#Cons type-fn args))] (fold (_lux_: (-> AST AST AST) - (function' [arg type-fn] (` (#;AppT (~ type-fn) (~ arg))))) + (function' [arg type-fn] (` (#;App (~ type-fn) (~ arg))))) (walk-type type-fn) (map walk-type args)) @@ -2576,7 +2576,7 @@ (#Cons type #Nil) (_lux_case type [_ (#Tag "" member-name)] - (return [(` #;UnitT) (#;Some (list member-name))]) + (return [(` #;Unit) (#;Some (list member-name))]) [_ (#Form (#Cons [_ (#Tag "" member-name)] member-types))] (return [(` (& (~@ member-types))) (#;Some (list member-name))]) @@ -2631,9 +2631,9 @@ [Int (List Self)])")]) (_lux_case tokens (#Cons [_ (#Symbol "" name)] (#Cons body #Nil)) - (let' [body' (replace-syntax (list [name (` (#AppT (~ (make-bound +0)) (~ (make-bound +1))))]) + (let' [body' (replace-syntax (list [name (` (#App (~ (make-bound +0)) (~ (make-bound +1))))]) (update-bounds body))] - (return (list (` (#AppT (#UnivQ #Nil (~ body')) Void))))) + (return (list (` (#App (#UnivQ #Nil (~ body')) Void))))) _ (fail "Wrong syntax for Rec"))) @@ -3375,14 +3375,14 @@ (def: (beta-reduce env type) (-> (List Type) Type Type) (case type - (#SumT left right) - (#SumT (beta-reduce env left) (beta-reduce env right)) + (#Sum left right) + (#Sum (beta-reduce env left) (beta-reduce env right)) - (#ProdT left right) - (#ProdT (beta-reduce env left) (beta-reduce env right)) + (#Product left right) + (#Product (beta-reduce env left) (beta-reduce env right)) - (#AppT ?type-fn ?type-arg) - (#AppT (beta-reduce env ?type-fn) (beta-reduce env ?type-arg)) + (#App ?type-fn ?type-arg) + (#App (beta-reduce env ?type-fn) (beta-reduce env ?type-arg)) (#UnivQ ?local-env ?local-def) (case ?local-env @@ -3400,10 +3400,10 @@ _ type) - (#FunctionT ?input ?output) - (#FunctionT (beta-reduce env ?input) (beta-reduce env ?output)) + (#Function ?input ?output) + (#Function (beta-reduce env ?input) (beta-reduce env ?output)) - (#BoundT idx) + (#Bound idx) (case (nth (_lux_proc ["nat" "to-int"] [idx]) env) (#Some bound) bound @@ -3411,7 +3411,7 @@ _ type) - (#NamedT name type) + (#Named name type) (beta-reduce env type) _ @@ -3427,12 +3427,12 @@ (#ExQ env body) (#Some (beta-reduce (list& type-fn param env) body)) - (#AppT F A) + (#App F A) (do Monad [type-fn* (apply-type F A)] (apply-type type-fn* param)) - (#NamedT name type) + (#Named name type) (apply-type type param) _ @@ -3448,19 +3448,19 @@ _ (list type)))] - [flatten-variant #;SumT] - [flatten-tuple #;ProdT] - [flatten-lambda #;FunctionT] - [flatten-app #;AppT] + [flatten-variant #;Sum] + [flatten-tuple #;Product] + [flatten-lambda #;Function] + [flatten-app #;App] ) (def: (resolve-struct-type type) (-> Type (Maybe (List Type))) (case type - (#ProdT _) + (#Product _) (#Some (flatten-tuple type)) - (#AppT fun arg) + (#App fun arg) (do Monad [output (apply-type fun arg)] (resolve-struct-type output)) @@ -3471,10 +3471,10 @@ (#ExQ _ body) (resolve-struct-type body) - (#NamedT name type) + (#Named name type) (resolve-struct-type type) - (#SumT _) + (#Sum _) #None _ @@ -3515,7 +3515,7 @@ (def: (resolve-type-tags type) (-> Type (Lux (Maybe [(List Ident) (List Type)]))) (case type - (#AppT fun arg) + (#App fun arg) (resolve-type-tags fun) (#UnivQ env body) @@ -3524,12 +3524,12 @@ (#ExQ env body) (resolve-type-tags body) - (#NamedT [module name] _) + (#Named [module name] _) (do Monad [=module (find-module module) #let [{#module-hash _ #module-aliases _ #defs bindings #imports _ #tags tags #types types #module-anns _ #module-state _} =module]] (case (get name types) - (#Some [tags exported? (#NamedT _ _type)]) + (#Some [tags exported? (#Named _ _type)]) (case (resolve-struct-type _type) (#Some members) (return (#Some [tags members])) @@ -3771,9 +3771,9 @@ type-meta meta)) Type - (#;NamedT [(~ (text$ module-name)) - (~ (text$ name))] - (type (~ type''))))))) + (#;Named [(~ (text$ module-name)) + (~ (text$ name))] + (type (~ type''))))))) #None (fail "Wrong syntax for type:")))) @@ -4226,7 +4226,7 @@ (def: (Type/show type) (-> Type Text) (case type - (#HostT name params) + (#Host name params) (case params #;Nil name @@ -4234,28 +4234,28 @@ _ ($_ Text/append "(" name " " (|> params (map Type/show) (interpose " ") reverse (fold Text/append "")) ")")) - #VoidT + #Void "Void" - #UnitT + #Unit "Unit" - (#SumT _) + (#Sum _) ($_ Text/append "(| " (|> (flatten-variant type) (map Type/show) (interpose " ") reverse (fold Text/append "")) ")") - (#ProdT _) + (#Product _) ($_ Text/append "[" (|> (flatten-tuple type) (map Type/show) (interpose " ") reverse (fold Text/append "")) "]") - (#FunctionT _) + (#Function _) ($_ Text/append "(-> " (|> (flatten-lambda type) (map Type/show) (interpose " ") reverse (fold Text/append "")) ")") - (#BoundT id) + (#Bound id) (Nat/encode id) - (#VarT id) + (#Var id) ($_ Text/append "⌈v:" (Nat/encode id) "⌋") - (#ExT id) + (#Ex id) ($_ Text/append "⟨e:" (Nat/encode id) "⟩") (#UnivQ env body) @@ -4264,10 +4264,10 @@ (#ExQ env body) ($_ Text/append "(Ex " (Type/show body) ")") - (#AppT _) + (#App _) ($_ Text/append "(" (|> (flatten-app type) (map Type/show) (interpose " ") reverse (fold Text/append "")) ")") - (#NamedT [prefix name] _) + (#Named [prefix name] _) ($_ Text/append prefix ";" name) )) @@ -4845,19 +4845,19 @@ (def: (beta-reduce env type) (-> (List Type) Type Type) (case type - (#;HostT name params) - (#;HostT name (List/map (beta-reduce env) params)) + (#;Host name params) + (#;Host name (List/map (beta-reduce env) params)) (^template [] ( left right) ( (beta-reduce env left) (beta-reduce env right))) - ([#;SumT] [#;ProdT]) + ([#;Sum] [#;Product]) (^template [] ( left right) ( (beta-reduce env left) (beta-reduce env right))) - ([#;FunctionT] - [#;AppT]) + ([#;Function] + [#;App]) (^template [] ( old-env def) @@ -4870,7 +4870,7 @@ ([#;UnivQ] [#;ExQ]) - (#;BoundT idx) + (#;Bound idx) (default type (list;nth idx env)) _ @@ -5116,31 +5116,31 @@ (def: (type-to-ast type) (-> Type AST) (case type - (#HostT name params) - (` (#HostT (~ (text$ name)) (~ (untemplate-list (map type-to-ast params))))) + (#Host name params) + (` (#Host (~ (text$ name)) (~ (untemplate-list (map type-to-ast params))))) - #VoidT - (` #VoidT) + #Void + (` #Void) - #UnitT - (` #UnitT) + #Unit + (` #Unit) (^template [] ( left right) (` ( (~ (type-to-ast left)) (~ (type-to-ast right))))) - ([#SumT] [#ProdT]) + ([#Sum] [#Product]) - (#FunctionT in out) - (` (#FunctionT (~ (type-to-ast in)) (~ (type-to-ast out)))) + (#Function in out) + (` (#Function (~ (type-to-ast in)) (~ (type-to-ast out)))) - (#BoundT idx) - (` (#BoundT (~ (nat$ idx)))) + (#Bound idx) + (` (#Bound (~ (nat$ idx)))) - (#VarT id) - (` (#VarT (~ (nat$ id)))) + (#Var id) + (` (#Var (~ (nat$ id)))) - (#ExT id) - (` (#ExT (~ (nat$ id)))) + (#Ex id) + (` (#Ex (~ (nat$ id)))) (#UnivQ env type) (let [env' (untemplate-list (map type-to-ast env))] @@ -5150,11 +5150,11 @@ (let [env' (untemplate-list (map type-to-ast env))] (` (#ExQ (~ env') (~ (type-to-ast type))))) - (#AppT fun arg) - (` (#AppT (~ (type-to-ast fun)) (~ (type-to-ast arg)))) + (#App fun arg) + (` (#App (~ (type-to-ast fun)) (~ (type-to-ast arg)))) - (#NamedT [module name] type) - (` (#NamedT [(~ (text$ module)) (~ (text$ name))] (~ (type-to-ast type)))) + (#Named [module name] type) + (` (#Named [(~ (text$ module)) (~ (text$ name))] (~ (type-to-ast type)))) )) (macro: #export (loop tokens) @@ -5324,7 +5324,7 @@ (-> Type Type) (case type (^template [] - (#NamedT ["lux" ] _) + (#Named ["lux" ] _) type) (["Bool"] ["Nat"] @@ -5334,7 +5334,7 @@ ["Char"] ["Text"]) - (#NamedT _ type') + (#Named _ type') type' _ @@ -5347,7 +5347,7 @@ #let [[type value] type+value]] (case (flatten-alias type) (^template [ ] - (#NamedT ["lux" ] _) + (#Named ["lux" ] _) (wrap ( (:! value)))) (["Bool" Bool bool$] ["Nat" Nat nat$] @@ -5419,7 +5419,7 @@ _ (fail "Wrong syntax for ^~"))) -(type: MultiLevelCase +(type: Multi-Level-Case [AST (List [AST AST])]) (def: (case-level^ level) @@ -5433,7 +5433,7 @@ )) (def: (multi-level-case^ levels) - (-> (List AST) (Lux MultiLevelCase)) + (-> (List AST) (Lux Multi-Level-Case)) (case levels #;Nil (fail "Multi-level patterns cannot be empty.") @@ -5444,7 +5444,7 @@ (wrap [init extras'])))) (def: (multi-level-case$ g!_ [[init-pattern levels] body]) - (-> AST [MultiLevelCase AST] (List AST)) + (-> AST [Multi-Level-Case AST] (List AST)) (let [inner-pattern-body (fold (function [[calculation pattern] success] (` (case (~ calculation) (~ pattern) @@ -5482,7 +5482,7 @@ expected get-expected-type g!temp (gensym "temp")] (let [output (list g!temp - (` (;_lux_case (;_lux_: (#;AppT Maybe (~ (type-to-ast expected))) + (` (;_lux_case (;_lux_: (#;App Maybe (~ (type-to-ast expected))) (case (~ g!temp) (~@ (multi-level-case$ g!temp [mlc body])) @@ -5561,7 +5561,7 @@ [stvs get-scope-type-vars] (case (list-at idx (reverse stvs)) (#;Some var-id) - (wrap (list (` (#ExT (~ (nat$ var-id)))))) + (wrap (list (` (#Ex (~ (nat$ var-id)))))) #;None (fail (Text/append "Indexed-type does not exist: " (Nat/encode idx))))) -- cgit v1.2.3