From e814f667aed509a70bd386dcd54628929134def4 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 26 Aug 2021 02:34:05 -0400 Subject: "Interface" instead of "interface:", and "Rec" can be used in type definition. --- stdlib/source/documentation/lux.lux | 32 ++++++++++++++++------ .../documentation/lux/control/security/policy.lux | 11 ++++---- .../documentation/lux/data/collection/array.lux | 2 +- .../documentation/lux/data/collection/list.lux | 2 +- stdlib/source/documentation/lux/ffi.lux | 2 +- .../documentation/lux/macro/syntax/definition.lux | 3 +- stdlib/source/documentation/lux/math.lux | 2 ++ .../source/documentation/lux/math/number/frac.lux | 2 +- .../source/documentation/lux/meta/annotation.lux | 1 - stdlib/source/documentation/lux/type/poly.lux | 9 +++--- stdlib/source/documentation/lux/type/unit.lux | 28 +++++++++++-------- 11 files changed, 59 insertions(+), 35 deletions(-) (limited to 'stdlib/source/documentation') diff --git a/stdlib/source/documentation/lux.lux b/stdlib/source/documentation/lux.lux index a046d1fdc..b1d7ae466 100644 --- a/stdlib/source/documentation/lux.lux +++ b/stdlib/source/documentation/lux.lux @@ -322,7 +322,22 @@ ["A name has to be given to the whole type, to use it within its body." (Rec Int_List (Or Any - [Int Int_List]))]) + [Int Int_List]))] + ["Can also be used with type: and labelled-type definitions." + (type: Type + (Rec @ + (Variant + (#Primitive Text (List @)) + (#Sum @ @) + (#Product @ @) + (#Function @ @) + (#Parameter Nat) + (#Var Nat) + (#Ex Nat) + (#UnivQ (List @) @) + (#ExQ (List @) @) + (#Apply @ @) + (#Named Name @))))]) (documentation: /.exec "Sequential execution of expressions (great for side-effects)." @@ -491,13 +506,14 @@ #End (#Item a (List a)))]) -(documentation: /.interface: +(documentation: /.Interface "Interface definition." - [(interface: .public (Order a) - (: (Equivalence a) - &equivalence) - (: (-> a a Bit) - <))]) + [(type: .public (Order a) + (Interface + (: (Equivalence a) + &equivalence) + (: (-> a a Bit) + <)))]) (.template [] [(documentation: @@ -962,7 +978,7 @@ ..Variant ..Record ..type: - ..interface: + ..Interface ..i64 ..nat ..int diff --git a/stdlib/source/documentation/lux/control/security/policy.lux b/stdlib/source/documentation/lux/control/security/policy.lux index 9d9cb655d..8f7b100b7 100644 --- a/stdlib/source/documentation/lux/control/security/policy.lux +++ b/stdlib/source/documentation/lux/control/security/policy.lux @@ -37,11 +37,12 @@ [(type: Password (Private Text)) - (interface: (Policy %) - (: (-> Text (Password %)) - password) - (: (-> (Password %) Text) - unsafe)) + (type: (Policy %) + (Interface + (: (-> Text (Password %)) + password) + (: (-> (Password %) Text) + unsafe))) (def: (policy _) (Ex [%] (-> Any (Policy %))) diff --git a/stdlib/source/documentation/lux/data/collection/array.lux b/stdlib/source/documentation/lux/data/collection/array.lux index ce1d461c5..504d646cc 100644 --- a/stdlib/source/documentation/lux/data/collection/array.lux +++ b/stdlib/source/documentation/lux/data/collection/array.lux @@ -1,6 +1,6 @@ (.module: [library - [lux (#- example list) + [lux (#- list) ["$" documentation (#+ documentation:)] [control ["<>" parser diff --git a/stdlib/source/documentation/lux/data/collection/list.lux b/stdlib/source/documentation/lux/data/collection/list.lux index 87cf01da1..f5dda38bc 100644 --- a/stdlib/source/documentation/lux/data/collection/list.lux +++ b/stdlib/source/documentation/lux/data/collection/list.lux @@ -1,6 +1,6 @@ (.module: [library - [lux (#- example) + [lux #* ["$" documentation (#+ documentation:)] [control ["<>" parser diff --git a/stdlib/source/documentation/lux/ffi.lux b/stdlib/source/documentation/lux/ffi.lux index 89829884b..a781e10ff 100644 --- a/stdlib/source/documentation/lux/ffi.lux +++ b/stdlib/source/documentation/lux/ffi.lux @@ -1,6 +1,6 @@ (.module: [library - [lux (#- int char interface: type :as) + [lux (#- int char type :as) ["$" documentation (#+ documentation:)] [data ["." text (#+ \n) diff --git a/stdlib/source/documentation/lux/macro/syntax/definition.lux b/stdlib/source/documentation/lux/macro/syntax/definition.lux index 21befadc2..3a97fc37d 100644 --- a/stdlib/source/documentation/lux/macro/syntax/definition.lux +++ b/stdlib/source/documentation/lux/macro/syntax/definition.lux @@ -29,5 +29,6 @@ ..parser ..typed ($.default /.equivalence) - ($.default /.lacks_type)] + ($.default /.lacks_type) + ($.default /.format)] [])) diff --git a/stdlib/source/documentation/lux/math.lux b/stdlib/source/documentation/lux/math.lux index 57b56dec2..a8249a394 100644 --- a/stdlib/source/documentation/lux/math.lux +++ b/stdlib/source/documentation/lux/math.lux @@ -64,7 +64,9 @@ ($.default /.factorial) ($.default /.hypotenuse) ($.default /.sinh) + ($.default /.csch) ($.default /.cosh) + ($.default /.sech) ($.default /.tanh) ($.default /.coth) ($.default /.asinh) diff --git a/stdlib/source/documentation/lux/math/number/frac.lux b/stdlib/source/documentation/lux/math/number/frac.lux index a161327fa..e78852864 100644 --- a/stdlib/source/documentation/lux/math/number/frac.lux +++ b/stdlib/source/documentation/lux/math/number/frac.lux @@ -113,7 +113,7 @@ ($.default /.smallest) ($.default /.biggest) ($.default /.addition) - ($.default /.addition) + ($.default /.multiplication) ($.default /.minimum) ($.default /.maximum) ($.default /.number?) diff --git a/stdlib/source/documentation/lux/meta/annotation.lux b/stdlib/source/documentation/lux/meta/annotation.lux index ba739e129..c46961d3a 100644 --- a/stdlib/source/documentation/lux/meta/annotation.lux +++ b/stdlib/source/documentation/lux/meta/annotation.lux @@ -49,7 +49,6 @@ ($.default /.documentation) ($.default /.flagged?) ($.default /.implementation?) - ($.default /.recursive_type?) ($.default /.function_arguments) ($.default /.type_arguments)] [])) diff --git a/stdlib/source/documentation/lux/type/poly.lux b/stdlib/source/documentation/lux/type/poly.lux index 47ea08837..bbdbfd0d0 100644 --- a/stdlib/source/documentation/lux/type/poly.lux +++ b/stdlib/source/documentation/lux/type/poly.lux @@ -25,10 +25,11 @@ (#Text Text) (#Frac Frac))) - (type: #rec Recursive - (.Variant - (#Number Frac) - (#Addition Frac Recursive))) + (type: Recursive + (Rec Recursive + (.Variant + (#Number Frac) + (#Addition Frac Recursive)))) (type: Record (.Record diff --git a/stdlib/source/documentation/lux/type/unit.lux b/stdlib/source/documentation/lux/type/unit.lux index b33a797c6..08cd1a6d4 100644 --- a/stdlib/source/documentation/lux/type/unit.lux +++ b/stdlib/source/documentation/lux/type/unit.lux @@ -57,7 +57,7 @@ [(`` (documentation: (let [numerator (value@ [#/.ratio #ratio.numerator] ) denominator (value@ [#/.ratio #ratio.denominator] )] - (format "'" (~~ (template.text [])) "' scale from " (%.nat numerator) " to " (%.nat denominator) "."))))] + (format "The '" (~~ (template.text [])) "' scale, from " (%.nat numerator) " to " (%.nat denominator) "."))))] [/.Kilo /.kilo] [/.Mega /.mega] @@ -68,14 +68,14 @@ [/.Nano /.nano] ) -(template [] - [(`` (documentation: - (format "'" (~~ (template.text [])) "' unit of meaurement.")))] +(template [] + [(`` (documentation: + (format "The '" (~~ (template.text [])) "' unit of meaurement.")))] - [/.Gram] - [/.Meter] - [/.Litre] - [/.Second] + [/.gram] + [/.meter] + [/.litre] + [/.second] ) (.def: .public documentation @@ -99,10 +99,14 @@ ..milli ..micro ..nano - ..Gram - ..Meter - ..Litre - ..Second + ..gram + ..meter + ..litre + ..second + ($.default /.Gram) + ($.default /.Meter) + ($.default /.Litre) + ($.default /.Second) ($.default /.pure) ($.default /.number) ($.default /.equivalence) -- cgit v1.2.3