aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/program')
-rw-r--r--stdlib/source/program/aedifex/artifact/build.lux43
1 files changed, 43 insertions, 0 deletions
diff --git a/stdlib/source/program/aedifex/artifact/build.lux b/stdlib/source/program/aedifex/artifact/build.lux
new file mode 100644
index 000000000..d9a8b729e
--- /dev/null
+++ b/stdlib/source/program/aedifex/artifact/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
+ [_ (<xml>.node ..tag)]
+ (<text>.embed (<>.codec nat.decimal
+ (<text>.many <text>.decimal))
+ (<xml>.children <xml>.text))))