diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/time/month.lux | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/stdlib/source/library/lux/time/month.lux b/stdlib/source/library/lux/time/month.lux index 985e8f1cb..1916819c2 100644 --- a/stdlib/source/library/lux/time/month.lux +++ b/stdlib/source/library/lux/time/month.lux @@ -1,22 +1,23 @@ (.using - [library - [lux "*" - [abstract - [equivalence {"+" Equivalence}] - [hash {"+" Hash}] - [order {"+" Order}] - [enum {"+" Enum}] - [codec {"+" Codec}]] - [control - ["[0]" try {"+" Try}] - ["[0]" exception {"+" exception:}]] - [data - ["[0]" text ("[1]#[0]" monoid)]] - [macro - ["[0]" template]] - [math - [number - ["n" nat]]]]]) + [library + [lux "*" + [abstract + [equivalence {"+" Equivalence}] + [hash {"+" Hash}] + [order {"+" Order}] + [enum {"+" Enum}] + [codec {"+" Codec}]] + [control + ["[0]" try {"+" Try}] + ["[0]" exception {"+" exception:}]] + [data + ["[0]" text ("[1]#[0]" monoid)]] + [macro + ["^" pattern] + ["[0]" template]] + [math + [number + ["n" nat]]]]]) (type: .public Month (Variant @@ -38,7 +39,7 @@ (def: (= reference sample) (case [reference sample] - (^template [<tag>] + (^.template [<tag>] [[{<tag>} {<tag>}] true]) ([#January] @@ -72,7 +73,7 @@ (def: .public (number month) (-> Month Nat) (case month - (^template [<number> <month>] + (^.template [<number> <month>] [{<month>} <number>]) (<pairs>))) @@ -88,7 +89,7 @@ (def: .public (by_number number) (-> Nat (Try Month)) (case number - (^template [<number> <month>] + (^.template [<number> <month>] [<number> {try.#Success {<month>}}]) (<pairs>) @@ -103,7 +104,7 @@ (def: &equivalence ..equivalence) (def: (hash month) (case month - (^template [<prime> <month>] + (^.template [<prime> <month>] [{<month>} <prime>]) ([02 #January] @@ -166,7 +167,7 @@ (def: .public (days month) (-> Month Nat) (case month - (^template [<days> <month>] + (^.template [<days> <month>] [{<month>} <days>]) ([31 #January] @@ -215,7 +216,7 @@ (def: (encoded value) (case value - (^template [<tag>] + (^.template [<tag>] [{<tag>} (text.replaced "#" "" (template.text [<tag>]))]) ([..#January] @@ -232,8 +233,8 @@ [..#December]))) (def: (decoded value) (case (text#composite "#" value) - (^template [<tag>] - [(^ (template.text [<tag>])) + (^.template [<tag>] + [(pattern (template.text [<tag>])) {try.#Success {<tag>}}]) ([..#January] [..#February] |