From ae56acf791c2ed9bd5865f85fffa00b025d310fe Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 13 Jan 2021 17:42:20 -0400 Subject: Removed the (ultimately redundant) on_stop function for actors. --- stdlib/source/program/aedifex/artifact/build.lux | 43 ----------------- .../program/aedifex/artifact/snapshot/build.lux | 43 +++++++++++++++++ .../program/aedifex/artifact/snapshot/stamp.lux | 55 ++++++++++++++++++++++ .../program/aedifex/artifact/snapshot/time.lux | 45 ++++++++++++++++++ .../source/program/aedifex/artifact/time_stamp.lux | 35 -------------- 5 files changed, 143 insertions(+), 78 deletions(-) delete mode 100644 stdlib/source/program/aedifex/artifact/build.lux create mode 100644 stdlib/source/program/aedifex/artifact/snapshot/build.lux create mode 100644 stdlib/source/program/aedifex/artifact/snapshot/stamp.lux create mode 100644 stdlib/source/program/aedifex/artifact/snapshot/time.lux delete mode 100644 stdlib/source/program/aedifex/artifact/time_stamp.lux (limited to 'stdlib/source/program/aedifex/artifact') diff --git a/stdlib/source/program/aedifex/artifact/build.lux b/stdlib/source/program/aedifex/artifact/build.lux deleted file mode 100644 index d9a8b729e..000000000 --- a/stdlib/source/program/aedifex/artifact/build.lux +++ /dev/null @@ -1,43 +0,0 @@ -(.module: - [lux #* - [abstract - [equivalence (#+ Equivalence)] - [monad (#+ do)]] - [control - ["<>" parser - ["<.>" xml (#+ Parser)] - ["<.>" text]]] - [data - [text - ["%" format]] - [format - ["." xml (#+ XML)]]] - [math - [number - ["." nat]]]]) - -(type: #export Build - Nat) - -(def: #export equivalence - (Equivalence Build) - nat.equivalence) - -(def: tag - xml.Tag - ["" "buildNumber"]) - -(def: #export format - (-> Build XML) - (|>> %.nat - #xml.Text - list - (#xml.Node ..tag xml.attributes))) - -(def: #export parser - (Parser Build) - (do <>.monad - [_ (.node ..tag)] - (.embed (<>.codec nat.decimal - (.many .decimal)) - (.children .text)))) diff --git a/stdlib/source/program/aedifex/artifact/snapshot/build.lux b/stdlib/source/program/aedifex/artifact/snapshot/build.lux new file mode 100644 index 000000000..d9a8b729e --- /dev/null +++ b/stdlib/source/program/aedifex/artifact/snapshot/build.lux @@ -0,0 +1,43 @@ +(.module: + [lux #* + [abstract + [equivalence (#+ Equivalence)] + [monad (#+ do)]] + [control + ["<>" parser + ["<.>" xml (#+ Parser)] + ["<.>" text]]] + [data + [text + ["%" format]] + [format + ["." xml (#+ XML)]]] + [math + [number + ["." nat]]]]) + +(type: #export Build + Nat) + +(def: #export equivalence + (Equivalence Build) + nat.equivalence) + +(def: tag + xml.Tag + ["" "buildNumber"]) + +(def: #export format + (-> Build XML) + (|>> %.nat + #xml.Text + list + (#xml.Node ..tag xml.attributes))) + +(def: #export parser + (Parser Build) + (do <>.monad + [_ (.node ..tag)] + (.embed (<>.codec nat.decimal + (.many .decimal)) + (.children .text)))) diff --git a/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux b/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux new file mode 100644 index 000000000..c1efcc8ee --- /dev/null +++ b/stdlib/source/program/aedifex/artifact/snapshot/stamp.lux @@ -0,0 +1,55 @@ +(.module: + [lux #* + [abstract + [equivalence (#+ Equivalence)]] + [data + ["." product] + [format + [xml (#+ XML)]]]] + ["." // #_ + ["#." time (#+ Time)] + ["#." build (#+ Build)]]) + +(type: #export Stamp + {#time Time + #build Build}) + +(def: #export equivalence + (Equivalence Stamp) + ($_ product.equivalence + //time.equivalence + //build.equivalence + )) + +(def: time_format + (-> Time XML) + (|>> //time.format + #xml.Text + list + (#xml.Node ..tag xml.attributes))) + +(def: #export (format (^slots [#time #build])) + (-> Stamp (List XML)) + (list (..time_format time) + (//build.format build))) + +(def: + xml.Tag + ["" "timestamp"]) + +## (exception: #export (mismatch {expected Instant} {actual Instant}) +## (exception.report +## ["Expected" (%.instant expected)] +## ["Actual" (%.instant actual)])) + +(def: time_parser + (Parser Time) + (do <>.monad + [_ (.node )] + (.embed //time.parser + (.children .text)))) + +(def: #export parser + (Parser Stamp) + (<>.and (.somewhere ..time_parser) + (.somewhere //build.parser))) diff --git a/stdlib/source/program/aedifex/artifact/snapshot/time.lux b/stdlib/source/program/aedifex/artifact/snapshot/time.lux new file mode 100644 index 000000000..ea9bf3047 --- /dev/null +++ b/stdlib/source/program/aedifex/artifact/snapshot/time.lux @@ -0,0 +1,45 @@ +(.module: + [lux #* + [abstract + [equivalence (#+ Equivalence)] + [monad (#+ do)]] + [control + ["." exception (#+ exception:)] + ["<>" parser + ["<.>" text] + ["<.>" xml (#+ Parser)]]] + [data + [text + ["%" format]] + [format + ["." xml (#+ XML)]]] + [time + ["." instant (#+ Instant)]]] + ["." /// #_ + [time + ["#." date] + ["#." time]]]) + +(type: #export Time + Instant) + +(def: #export equivalence + (Equivalence Time) + instant.equivalence) + +(def: separator + ".") + +(def: #export (format value) + (%.Format Time) + (%.format (///date.format (instant.date value)) + ..separator + (///time.format (instant.time value)))) + +(def: #export parser + (.Parser Time) + (do <>.monad + [date ///date.parser + _ (.this ..separator) + time ///time.parser] + (wrap (instant.from_date_time date time)))) diff --git a/stdlib/source/program/aedifex/artifact/time_stamp.lux b/stdlib/source/program/aedifex/artifact/time_stamp.lux deleted file mode 100644 index 0eab45a14..000000000 --- a/stdlib/source/program/aedifex/artifact/time_stamp.lux +++ /dev/null @@ -1,35 +0,0 @@ -(.module: - [lux #* - [abstract - [monad (#+ do)]] - [control - ["<>" parser - ["<.>" text (#+ Parser)]]] - [data - [text - ["%" format]]] - [time - ["." instant (#+ Instant)]]] - ["." / #_ - ["#." date] - ["#." time]]) - -(type: #export Time_Stamp - Instant) - -(def: #export separator - ".") - -(def: #export (format value) - (%.Format Time_Stamp) - (%.format (/date.format (instant.date value)) - ..separator - (/time.format (instant.time value)))) - -(def: #export parser - (Parser Time_Stamp) - (do <>.monad - [date /date.parser - _ (.this ..separator) - time /time.parser] - (wrap (instant.from_date_time date time)))) -- cgit v1.2.3