aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/world
diff options
context:
space:
mode:
authorEduardo Julian2022-07-06 17:11:35 -0400
committerEduardo Julian2022-07-06 17:11:35 -0400
commitf7880ce83ba82ada2d04a0c587448446e677d458 (patch)
tree0cdd43e40933906bae8c87681095284e4274d3c6 /stdlib/source/documentation/lux/world
parent5270f301eba5237feebc8eca14aee6b7a992a819 (diff)
Moved "lux/time" to "lux/world/time".
Diffstat (limited to 'stdlib/source/documentation/lux/world')
-rw-r--r--stdlib/source/documentation/lux/world/time.lux71
-rw-r--r--stdlib/source/documentation/lux/world/time/date.lux38
-rw-r--r--stdlib/source/documentation/lux/world/time/day.lux30
-rw-r--r--stdlib/source/documentation/lux/world/time/duration.lux47
-rw-r--r--stdlib/source/documentation/lux/world/time/instant.lux56
-rw-r--r--stdlib/source/documentation/lux/world/time/month.lux38
-rw-r--r--stdlib/source/documentation/lux/world/time/year.lux48
7 files changed, 328 insertions, 0 deletions
diff --git a/stdlib/source/documentation/lux/world/time.lux b/stdlib/source/documentation/lux/world/time.lux
new file mode 100644
index 000000000..f327e942a
--- /dev/null
+++ b/stdlib/source/documentation/lux/world/time.lux
@@ -0,0 +1,71 @@
+(.require
+ [library
+ [lux (.except and)
+ ["$" documentation]
+ [data
+ ["[0]" text (.only \n)
+ ["%" \\format (.only format)]]]]]
+ [\\library
+ ["[0]" /]]
+ ["[0]" /
+ ["[1][0]" date]
+ ["[1][0]" day]
+ ["[1][0]" duration]
+ ["[1][0]" instant]
+ ["[1][0]" month]
+ ["[1][0]" year]])
+
+(`` (.def .public documentation
+ (.List $.Module)
+ ($.module /._
+ ""
+ [($.default /.time_exceeds_a_day)
+ ($.default /.invalid_hour)
+ ($.default /.invalid_minute)
+ ($.default /.invalid_second)
+ ($.default /.millis)
+ ($.default /.equivalence)
+ ($.default /.order)
+ ($.default /.enum)
+ ($.default /.parser)
+
+ (,, (with_template [<name> <doc>]
+ [($.documentation <name>
+ <doc>)]
+
+ [/.milli_seconds "Number of milli-seconds in a second."]
+ [/.seconds "Number of seconds in a minute."]
+ [/.minutes "Number of minutes in an hour."]
+ [/.hours "Number of hours in an day."]
+ ))
+
+ ($.documentation /.Time
+ "Time is defined as milliseconds since the start of the day (00:00:00.000).")
+
+ ($.documentation /.midnight
+ "The instant corresponding to the start of the day: 00:00:00.000")
+
+ ($.documentation /.of_millis
+ ""
+ [(of_millis milli_seconds)])
+
+ ($.documentation /.Clock
+ "A clock marking the specific hour, minute, second, and milli-second in a day.")
+
+ ($.documentation /.clock
+ ""
+ [(clock time)])
+
+ ($.documentation /.time
+ ""
+ [(time clock)])
+
+ ($.documentation /.codec
+ (format "Based on ISO 8601."
+ \n "For example: 21:14:51.827"))]
+ [/date.documentation
+ /day.documentation
+ /duration.documentation
+ /instant.documentation
+ /month.documentation
+ /year.documentation])))
diff --git a/stdlib/source/documentation/lux/world/time/date.lux b/stdlib/source/documentation/lux/world/time/date.lux
new file mode 100644
index 000000000..17fd0143b
--- /dev/null
+++ b/stdlib/source/documentation/lux/world/time/date.lux
@@ -0,0 +1,38 @@
+(.require
+ [library
+ [lux (.except and)
+ ["$" documentation]
+ [data
+ ["[0]" text (.only \n)
+ ["%" \\format (.only format)]]]]]
+ [\\library
+ ["[0]" /]])
+
+(.def .public documentation
+ (.List $.Module)
+ ($.module /._
+ ""
+ [($.default /.invalid_day)
+ ($.default /.epoch)
+ ($.default /.year)
+ ($.default /.month)
+ ($.default /.day_of_month)
+ ($.default /.equivalence)
+ ($.default /.order)
+ ($.default /.invalid_month)
+ ($.default /.parser)
+ ($.default /.days)
+ ($.default /.of_days)
+ ($.default /.enum)
+
+ ($.documentation /.Date
+ "A date specified as a year/month/day triplet.")
+
+ ($.documentation /.date
+ "A date, within the allowed limits."
+ [(date year month day_of_month)])
+
+ ($.documentation /.codec
+ (format "Based on ISO 8601."
+ \n "For example: 2017-01-15"))]
+ []))
diff --git a/stdlib/source/documentation/lux/world/time/day.lux b/stdlib/source/documentation/lux/world/time/day.lux
new file mode 100644
index 000000000..e7923dfe0
--- /dev/null
+++ b/stdlib/source/documentation/lux/world/time/day.lux
@@ -0,0 +1,30 @@
+(.require
+ [library
+ [lux (.except and)
+ ["$" documentation]
+ [data
+ ["[0]" text (.only \n)
+ ["%" \\format (.only format)]]]]]
+ [\\library
+ ["[0]" /]])
+
+(.def .public documentation
+ (.List $.Module)
+ ($.module /._
+ ""
+ [($.default /.equivalence)
+ ($.default /.order)
+ ($.default /.enum)
+ ($.default /.not_a_day_of_the_week)
+ ($.default /.codec)
+ ($.default /.number)
+ ($.default /.invalid_day)
+ ($.default /.by_number)
+ ($.default /.hash)
+
+ ($.documentation /.Day
+ "A day of the week.")
+
+ ($.documentation /.week
+ "All the days, ordered by when they come in a week.")]
+ []))
diff --git a/stdlib/source/documentation/lux/world/time/duration.lux b/stdlib/source/documentation/lux/world/time/duration.lux
new file mode 100644
index 000000000..0b9ddaa0b
--- /dev/null
+++ b/stdlib/source/documentation/lux/world/time/duration.lux
@@ -0,0 +1,47 @@
+(.require
+ [library
+ [lux (.except and)
+ ["$" documentation]
+ [data
+ ["[0]" text (.only \n)
+ ["%" \\format (.only format)]]]]]
+ [\\library
+ ["[0]" /]])
+
+(.def .public documentation
+ (.List $.Module)
+ ($.module /._
+ ""
+ [($.default /.of_millis)
+ ($.default /.millis)
+ ($.default /.composite)
+ ($.default /.framed)
+ ($.default /.up)
+ ($.default /.down)
+ ($.default /.inverse)
+ ($.default /.ticks)
+ ($.default /.equivalence)
+ ($.default /.order)
+ ($.default /.positive?)
+ ($.default /.negative?)
+ ($.default /.neutral?)
+ ($.default /.empty)
+ ($.default /.milli_second)
+ ($.default /.second)
+ ($.default /.minute)
+ ($.default /.hour)
+ ($.default /.day)
+ ($.default /.week)
+ ($.default /.normal_year)
+ ($.default /.leap_year)
+ ($.default /.monoid)
+ ($.default /.codec)
+ ($.default /.enum)
+
+ ($.documentation /.Duration
+ "Durations have a resolution of milli-seconds.")
+
+ ($.documentation /.difference
+ ""
+ [(difference from to)])]
+ []))
diff --git a/stdlib/source/documentation/lux/world/time/instant.lux b/stdlib/source/documentation/lux/world/time/instant.lux
new file mode 100644
index 000000000..c5fbe2b01
--- /dev/null
+++ b/stdlib/source/documentation/lux/world/time/instant.lux
@@ -0,0 +1,56 @@
+(.require
+ [library
+ [lux (.except and)
+ ["$" documentation]
+ [data
+ ["[0]" text (.only \n)
+ ["%" \\format (.only format)]]]]]
+ [\\library
+ ["[0]" /]])
+
+(.def .public documentation
+ (.List $.Module)
+ ($.module /._
+ ""
+ [($.default /.of_millis)
+ ($.default /.millis)
+ ($.default /.equivalence)
+ ($.default /.order)
+ ($.default /.enum)
+ ($.default /.date)
+ ($.default /.time)
+ ($.default /.day_of_week)
+
+ ($.documentation /.Instant
+ "Instant is defined as milli-seconds since the epoch.")
+
+ ($.documentation /.span
+ ""
+ [(span from to)])
+
+ ($.documentation /.after
+ ""
+ [(after duration instant)])
+
+ ($.documentation /.relative
+ ""
+ [(relative instant)])
+
+ ($.documentation /.absolute
+ ""
+ [(absolute offset)])
+
+ ($.documentation /.epoch
+ "The instant corresponding to 1970-01-01T00:00:00Z.")
+
+ ($.documentation /.codec
+ (format "Based on ISO 8601."
+ \n "For example: 2017-01-15T21:14:51.827Z"))
+
+ ($.documentation /.now
+ "Yields the current instant, as measured from the operating-system's clock.")
+
+ ($.documentation /.of_date_time
+ ""
+ [(of_date_time date time)])]
+ []))
diff --git a/stdlib/source/documentation/lux/world/time/month.lux b/stdlib/source/documentation/lux/world/time/month.lux
new file mode 100644
index 000000000..9e9d4dc28
--- /dev/null
+++ b/stdlib/source/documentation/lux/world/time/month.lux
@@ -0,0 +1,38 @@
+(.require
+ [library
+ [lux (.except and)
+ ["$" documentation]
+ [data
+ ["[0]" text (.only \n)
+ ["%" \\format (.only format)]]]]]
+ [\\library
+ ["[0]" /]])
+
+(.def .public documentation
+ (.List $.Module)
+ ($.module /._
+ ""
+ [($.default /.equivalence)
+ ($.default /.number)
+ ($.default /.invalid_month)
+ ($.default /.by_number)
+ ($.default /.hash)
+ ($.default /.order)
+ ($.default /.enum)
+ ($.default /.not_a_month_of_the_year)
+ ($.default /.codec)
+
+ ($.documentation /.Month
+ "A month of the year.")
+
+ ($.documentation /.days
+ "The amount of days of a month."
+ [(days month)])
+
+ ($.documentation /.leap_year_days
+ "The amount of days of a month (in a leap year)."
+ [(leap_year_days month)])
+
+ ($.documentation /.year
+ "All the months, ordered by when they come in a year.")]
+ []))
diff --git a/stdlib/source/documentation/lux/world/time/year.lux b/stdlib/source/documentation/lux/world/time/year.lux
new file mode 100644
index 000000000..1ac6a11ca
--- /dev/null
+++ b/stdlib/source/documentation/lux/world/time/year.lux
@@ -0,0 +1,48 @@
+(.require
+ [library
+ [lux (.except and)
+ ["$" documentation]
+ [data
+ ["[0]" text (.only \n)
+ ["%" \\format (.only format)]]]]]
+ [\\library
+ ["[0]" /]])
+
+(.def .public documentation
+ (.List $.Module)
+ ($.module /._
+ ""
+ [($.default /.there_is_no_year_0)
+ ($.default /.value)
+ ($.default /.epoch)
+ ($.default /.leap)
+ ($.default /.century)
+ ($.default /.era)
+ ($.default /.leap?)
+ ($.default /.parser)
+ ($.default /.equivalence)
+ ($.default /.order)
+
+ ($.documentation /.Year
+ (format "A year in the gregorian calendar."
+ \n "Both negative (< 0) and positive (> 0) values are valid, but not 0."
+ \n "This is because the first year of the gregorian calendar was year 1."))
+
+ ($.documentation /.year
+ "A valid year in the gregorian calendar, if possible."
+ [(year value)])
+
+ ($.documentation /.days
+ "The amount of days in a typical year.")
+
+ ($.documentation /.Period
+ "An amount of years.")
+
+ ($.documentation /.leaps
+ "The number of leap years in a period of years."
+ [(leaps year)])
+
+ ($.documentation /.codec
+ (format "Based on ISO 8601."
+ \n "For example: 2017"))]
+ []))