diff options
Diffstat (limited to 'stdlib/source/library/lux/time/duration.lux')
-rw-r--r-- | stdlib/source/library/lux/time/duration.lux | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/stdlib/source/library/lux/time/duration.lux b/stdlib/source/library/lux/time/duration.lux index ff9ad24d3..07f104b97 100644 --- a/stdlib/source/library/lux/time/duration.lux +++ b/stdlib/source/library/lux/time/duration.lux @@ -23,21 +23,21 @@ ["." // #_ ["#." year]]) -(abstract: #export Duration - Int - +(abstract: .public Duration {#.doc "Durations have a resolution of milli-seconds."} - (def: #export of_millis + Int + + (def: .public of_millis (-> Int Duration) (|>> :abstraction)) - (def: #export millis + (def: .public millis (-> Duration Int) (|>> :representation)) (template [<op> <name>] - [(def: #export (<name> param subject) + [(def: .public (<name> param subject) (-> Duration Duration Duration) (:abstraction (<op> (:representation param) (:representation subject))))] @@ -46,7 +46,7 @@ ) (template [<op> <name>] - [(def: #export (<name> scalar) + [(def: .public (<name> scalar) (-> Nat Duration Duration) (|>> :representation (<op> (.int scalar)) :abstraction))] @@ -54,21 +54,21 @@ [i./ down] ) - (def: #export inverse + (def: .public inverse (-> Duration Duration) (|>> :representation (i.* -1) :abstraction)) - (def: #export (query param subject) + (def: .public (query param subject) (-> Duration Duration Int) (i./ (:representation param) (:representation subject))) - (implementation: #export equivalence + (implementation: .public equivalence (Equivalence Duration) (def: (= param subject) (i.= (:representation param) (:representation subject)))) - (implementation: #export order + (implementation: .public order (Order Duration) (def: &equivalence ..equivalence) @@ -76,7 +76,7 @@ (i.< (:representation param) (:representation subject)))) (template [<op> <name>] - [(def: #export <name> + [(def: .public <name> (-> Duration Bit) (|>> :representation (<op> +0)))] @@ -86,14 +86,14 @@ ) ) -(def: #export empty +(def: .public empty (..of_millis +0)) -(def: #export milli_second +(def: .public milli_second (..of_millis +1)) (template [<name> <scale> <base>] - [(def: #export <name> + [(def: .public <name> (..up <scale> <base>))] [second 1,000 milli_second] @@ -105,10 +105,10 @@ [normal_year //year.days day] ) -(def: #export leap_year +(def: .public leap_year (..merged ..day ..normal_year)) -(implementation: #export monoid +(implementation: .public monoid (Monoid Duration) (def: identity ..empty) @@ -183,17 +183,17 @@ (#.Left _) (..inverse span) (#.Right _) span))))) -(implementation: #export codec +(implementation: .public codec (Codec Text Duration) (def: encode ..encode) (def: decode (<text>.run ..parser))) -(def: #export (difference from to) +(def: .public (difference from to) (-> Duration Duration Duration) (|> from ..inverse (..merged to))) -(implementation: #export enum +(implementation: .public enum (Enum Duration) (def: &order ..order) |