diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux.lux | 182 | ||||
-rw-r--r-- | stdlib/test/test/lux/type.lux | 2 | ||||
-rw-r--r-- | stdlib/test/test/lux/type/check.lux | 4 |
3 files changed, 94 insertions, 94 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux index e8bd4d3ea..c93e834db 100644 --- a/stdlib/source/lux.lux +++ b/stdlib/source/lux.lux @@ -298,11 +298,11 @@ [dummy-cursor (+0 true)]] #Nil)))))]) -## (type: (Meta m v) +## (type: (Ann m v) ## {#meta m ## #datum v}) -(_lux_def Meta - (#Named ["lux" "Meta"] +(_lux_def Ann + (#Named ["lux" "Ann"] (#UnivQ #Nil (#UnivQ #Nil (#Product (#Bound +3) @@ -313,7 +313,7 @@ (#Cons [dummy-cursor (+5 "datum")] #Nil)))]] (#Cons [[dummy-cursor (+7 ["lux" "doc"])] - [dummy-cursor (+5 "The type of things that can have meta-data of arbitrary types.")]] + [dummy-cursor (+5 "The type of things that can be annotated with meta-data of arbitrary types.")]] (#Cons [[dummy-cursor (+7 ["lux" "type-args"])] [dummy-cursor (+9 (#Cons [dummy-cursor (+5 "m")] (#Cons [dummy-cursor (+5 "v")] #;Nil)))]] (#Cons [[dummy-cursor (+7 ["lux" "type?"])] @@ -390,10 +390,10 @@ #Nil)))))]) ## (type: Code -## (Meta Cursor (Code' (Meta Cursor)))) +## (Ann Cursor (Code' (Ann Cursor)))) (_lux_def Code (#Named ["lux" "Code"] - (_lux_case (#Apply Cursor Meta) + (_lux_case (#Apply Cursor Ann) w (#Apply (#Apply w Code') w))) [dummy-cursor @@ -405,8 +405,8 @@ [dummy-cursor (#Bool true)]] #Nil))))]) -(_lux_def _meta - (_lux_: (#Function (#Apply (#Apply Cursor Meta) +(_lux_def _ann + (_lux_: (#Function (#Apply (#Apply Cursor Ann) Code') Code) (_lux_function _ data @@ -415,57 +415,57 @@ (_lux_def bool$ (_lux_: (#Function Bool Code) - (_lux_function _ value (_meta (#Bool value)))) + (_lux_function _ value (_ann (#Bool value)))) [dummy-cursor (#Record #Nil)]) (_lux_def nat$ (_lux_: (#Function Nat Code) - (_lux_function _ value (_meta (#Nat value)))) + (_lux_function _ value (_ann (#Nat value)))) [dummy-cursor (#Record #Nil)]) (_lux_def int$ (_lux_: (#Function Int Code) - (_lux_function _ value (_meta (#Int value)))) + (_lux_function _ value (_ann (#Int value)))) [dummy-cursor (#Record #Nil)]) (_lux_def deg$ (_lux_: (#Function Deg Code) - (_lux_function _ value (_meta (#Deg value)))) + (_lux_function _ value (_ann (#Deg value)))) [dummy-cursor (#Record #Nil)]) (_lux_def frac$ (_lux_: (#Function Frac Code) - (_lux_function _ value (_meta (#Frac value)))) + (_lux_function _ value (_ann (#Frac value)))) [dummy-cursor (#Record #Nil)]) (_lux_def text$ (_lux_: (#Function Text Code) - (_lux_function _ text (_meta (#Text text)))) + (_lux_function _ text (_ann (#Text text)))) [dummy-cursor (#Record #Nil)]) (_lux_def symbol$ (_lux_: (#Function Ident Code) - (_lux_function _ ident (_meta (#Symbol ident)))) + (_lux_function _ ident (_ann (#Symbol ident)))) [dummy-cursor (#Record #Nil)]) (_lux_def tag$ (_lux_: (#Function Ident Code) - (_lux_function _ ident (_meta (#Tag ident)))) + (_lux_function _ ident (_ann (#Tag ident)))) [dummy-cursor (#Record #Nil)]) (_lux_def form$ (_lux_: (#Function (#Apply Code List) Code) - (_lux_function _ tokens (_meta (#Form tokens)))) + (_lux_function _ tokens (_ann (#Form tokens)))) [dummy-cursor (#Record #Nil)]) (_lux_def tuple$ (_lux_: (#Function (#Apply Code List) Code) - (_lux_function _ tokens (_meta (#Tuple tokens)))) + (_lux_function _ tokens (_ann (#Tuple tokens)))) [dummy-cursor (#Record #Nil)]) (_lux_def record$ (_lux_: (#Function (#Apply (#Product Code Code) List) Code) - (_lux_function _ tokens (_meta (#Record tokens)))) + (_lux_function _ tokens (_ann (#Record tokens)))) [dummy-cursor (#Record #Nil)]) (_lux_def default-def-meta-exported @@ -834,33 +834,33 @@ (_lux_function _ tokens (_lux_case tokens (#Cons [_ (#Tuple (#Cons arg args'))] (#Cons body #Nil)) - (return (#Cons (_meta (#Form (#Cons (_meta (#Symbol "" "_lux_function")) - (#Cons (_meta (#Symbol "" "")) - (#Cons arg - (#Cons (_lux_case args' - #Nil - body - - _ - (_meta (#Form (#Cons (_meta (#Symbol "lux" "function''")) - (#Cons (_meta (#Tuple args')) - (#Cons body #Nil)))))) - #Nil)))))) + (return (#Cons (_ann (#Form (#Cons (_ann (#Symbol "" "_lux_function")) + (#Cons (_ann (#Symbol "" "")) + (#Cons arg + (#Cons (_lux_case args' + #Nil + body + + _ + (_ann (#Form (#Cons (_ann (#Symbol "lux" "function''")) + (#Cons (_ann (#Tuple args')) + (#Cons body #Nil)))))) + #Nil)))))) #Nil)) (#Cons [_ (#Symbol "" self)] (#Cons [_ (#Tuple (#Cons arg args'))] (#Cons body #Nil))) - (return (#Cons (_meta (#Form (#Cons (_meta (#Symbol "" "_lux_function")) - (#Cons (_meta (#Symbol "" self)) - (#Cons arg - (#Cons (_lux_case args' - #Nil - body - - _ - (_meta (#Form (#Cons (_meta (#Symbol "lux" "function''")) - (#Cons (_meta (#Tuple args')) - (#Cons body #Nil)))))) - #Nil)))))) + (return (#Cons (_ann (#Form (#Cons (_ann (#Symbol "" "_lux_function")) + (#Cons (_ann (#Symbol "" self)) + (#Cons arg + (#Cons (_lux_case args' + #Nil + body + + _ + (_ann (#Form (#Cons (_ann (#Symbol "lux" "function''")) + (#Cons (_ann (#Tuple args')) + (#Cons body #Nil)))))) + #Nil)))))) #Nil)) _ @@ -935,62 +935,62 @@ (#Cons [[_ (#Tag ["" "export"])] (#Cons [[_ (#Form (#Cons [name args]))] (#Cons [meta (#Cons [type (#Cons [body #Nil])])])])]) - (return (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "_lux_def"])) - (#Cons [name - (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "_lux_:"])) - (#Cons [type - (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["lux" "function''"])) - (#Cons [name - (#Cons [(_meta (#Tuple args)) - (#Cons [body #Nil])])])]))) - #Nil])])]))) - (#Cons (form$ (#Cons (symbol$ ["lux" "record$"]) - (#Cons (with-export-meta meta) - #Nil))) - #Nil)])])]))) + (return (#Cons [(_ann (#Form (#Cons [(_ann (#Symbol ["" "_lux_def"])) + (#Cons [name + (#Cons [(_ann (#Form (#Cons [(_ann (#Symbol ["" "_lux_:"])) + (#Cons [type + (#Cons [(_ann (#Form (#Cons [(_ann (#Symbol ["lux" "function''"])) + (#Cons [name + (#Cons [(_ann (#Tuple args)) + (#Cons [body #Nil])])])]))) + #Nil])])]))) + (#Cons (form$ (#Cons (symbol$ ["lux" "record$"]) + (#Cons (with-export-meta meta) + #Nil))) + #Nil)])])]))) #Nil])) (#Cons [[_ (#Tag ["" "export"])] (#Cons [name (#Cons [meta (#Cons [type (#Cons [body #Nil])])])])]) - (return (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "_lux_def"])) - (#Cons [name - (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "_lux_:"])) - (#Cons [type - (#Cons [body - #Nil])])]))) - (#Cons (form$ (#Cons (symbol$ ["lux" "record$"]) - (#Cons (with-export-meta meta) - #Nil))) - #Nil)])])]))) + (return (#Cons [(_ann (#Form (#Cons [(_ann (#Symbol ["" "_lux_def"])) + (#Cons [name + (#Cons [(_ann (#Form (#Cons [(_ann (#Symbol ["" "_lux_:"])) + (#Cons [type + (#Cons [body + #Nil])])]))) + (#Cons (form$ (#Cons (symbol$ ["lux" "record$"]) + (#Cons (with-export-meta meta) + #Nil))) + #Nil)])])]))) #Nil])) (#Cons [[_ (#Form (#Cons [name args]))] (#Cons [meta (#Cons [type (#Cons [body #Nil])])])]) - (return (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "_lux_def"])) - (#Cons [name - (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "_lux_:"])) - (#Cons [type - (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["lux" "function''"])) - (#Cons [name - (#Cons [(_meta (#Tuple args)) - (#Cons [body #Nil])])])]))) - #Nil])])]))) - (#Cons (form$ (#Cons (symbol$ ["lux" "record$"]) - (#Cons meta - #Nil))) - #Nil)])])]))) + (return (#Cons [(_ann (#Form (#Cons [(_ann (#Symbol ["" "_lux_def"])) + (#Cons [name + (#Cons [(_ann (#Form (#Cons [(_ann (#Symbol ["" "_lux_:"])) + (#Cons [type + (#Cons [(_ann (#Form (#Cons [(_ann (#Symbol ["lux" "function''"])) + (#Cons [name + (#Cons [(_ann (#Tuple args)) + (#Cons [body #Nil])])])]))) + #Nil])])]))) + (#Cons (form$ (#Cons (symbol$ ["lux" "record$"]) + (#Cons meta + #Nil))) + #Nil)])])]))) #Nil])) (#Cons [name (#Cons [meta (#Cons [type (#Cons [body #Nil])])])]) - (return (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "_lux_def"])) - (#Cons [name - (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "_lux_:"])) - (#Cons [type - (#Cons [body - #Nil])])]))) - (#Cons (form$ (#Cons (symbol$ ["lux" "record$"]) - (#Cons meta - #Nil))) - #Nil)])])]))) + (return (#Cons [(_ann (#Form (#Cons [(_ann (#Symbol ["" "_lux_def"])) + (#Cons [name + (#Cons [(_ann (#Form (#Cons [(_ann (#Symbol ["" "_lux_:"])) + (#Cons [type + (#Cons [body + #Nil])])]))) + (#Cons (form$ (#Cons (symbol$ ["lux" "record$"]) + (#Cons meta + #Nil))) + #Nil)])])]))) #Nil])) _ @@ -1540,10 +1540,10 @@ (-> ($' List Code) Code) (_lux_case tokens #Nil - (_meta (#Tag ["lux" "Nil"])) + (_ann (#Tag ["lux" "Nil"])) (#Cons [token tokens']) - (_meta (#Form (list (_meta (#Tag ["lux" "Cons"])) token (untemplate-list tokens')))))) + (_ann (#Form (list (_ann (#Tag ["lux" "Cons"])) token (untemplate-list tokens')))))) (def:''' (list/compose xs ys) #;Nil diff --git a/stdlib/test/test/lux/type.lux b/stdlib/test/test/lux/type.lux index 617921e33..3953fcb5b 100644 --- a/stdlib/test/test/lux/type.lux +++ b/stdlib/test/test/lux/type.lux @@ -53,7 +53,7 @@ (test "Can apply quantified types (universal and existential quantification)." (and (maybe;default false (do maybe;Monad<Maybe> - [partial (&;apply (list Bool) Meta) + [partial (&;apply (list Bool) Ann) full (&;apply (list Int) partial)] (wrap (:: &;Eq<Type> = full (#;Product Bool Int))))) (|> (&;apply (list Bool) Text) diff --git a/stdlib/test/test/lux/type/check.lux b/stdlib/test/test/lux/type/check.lux index 938bb44b1..67000157d 100644 --- a/stdlib/test/test/lux/type/check.lux +++ b/stdlib/test/test/lux/type/check.lux @@ -123,10 +123,10 @@ [meta gen-type data gen-type] (test "Can type-check type application." - (and (@;checks? (#;Apply data (#;Apply meta Meta)) + (and (@;checks? (|> Ann (#;Apply meta) (#;Apply data)) (type;tuple (list meta data))) (@;checks? (type;tuple (list meta data)) - (#;Apply data (#;Apply meta Meta)))))) + (|> Ann (#;Apply meta) (#;Apply data)))))) (context: "Host types" [nameL gen-name |