From cd71a864ad5be13ed6ec6d046e0a2cb1087bdf94 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 10 Sep 2021 01:21:23 -0400 Subject: Migrated variants to the new syntax. --- .../source/program/aedifex/metadata/artifact.lux | 28 +++++++++++----------- .../source/program/aedifex/metadata/snapshot.lux | 22 ++++++++--------- 2 files changed, 25 insertions(+), 25 deletions(-) (limited to 'stdlib/source/program/aedifex/metadata') diff --git a/stdlib/source/program/aedifex/metadata/artifact.lux b/stdlib/source/program/aedifex/metadata/artifact.lux index 571d9bff1..b56c66104 100644 --- a/stdlib/source/program/aedifex/metadata/artifact.lux +++ b/stdlib/source/program/aedifex/metadata/artifact.lux @@ -84,7 +84,7 @@ (template [
]
   [(def: 
      (->  XML)
-     (|>> 
 #xml.Text list (#xml.Node  xml.attributes)))]
+     (|>> 
 {#xml.Text} list {#xml.Node  xml.attributes}))]
 
   [group_format Group .. (|>)]
   [name_format Name .. (|>)]
@@ -94,18 +94,18 @@
 
 (def: versions_format
   (-> (List Version) XML)
-  (|>> (list\each ..version_format) (#xml.Node .. xml.attributes)))
+  (|>> (list\each ..version_format) {#xml.Node .. xml.attributes}))
 
 (def: .public (format value)
   (-> Metadata XML)
-  (#xml.Node ..
-             xml.attributes
-             (list (..group_format (value@ #group value))
-                   (..name_format (value@ #name value))
-                   (#xml.Node ..
-                              xml.attributes
-                              (list (..versions_format (value@ #versions value))
-                                    (..last_updated_format (value@ #last_updated value)))))))
+  {#xml.Node ..
+   xml.attributes
+   (list (..group_format (value@ #group value))
+         (..name_format (value@ #name value))
+         {#xml.Node ..
+          xml.attributes
+          (list (..versions_format (value@ #versions value))
+                (..last_updated_format (value@ #last_updated value)))})})
 
 (def: (text tag)
   (-> xml.Tag (Parser Text))
@@ -178,20 +178,20 @@
   (do async.monad
     [project (\ repository download (..uri artifact))]
     (case project
-      (#try.Success project)
+      {#try.Success project}
       (in (|> project
               (do> try.monad
                    [(\ utf8.codec decoded)]
                    [(\ xml.codec decoded)]
                    [list (.result ..parser)])))
       
-      (#try.Failure error)
-      (in (#try.Success
+      {#try.Failure error}
+      (in {#try.Success
            (let [(^slots [#///artifact.group #///artifact.name]) artifact]
              [#group group
               #name name
               #versions (list)
-              #last_updated ..epoch]))))))
+              #last_updated ..epoch])}))))
 
 (def: .public (write repository artifact metadata)
   (-> (Repository Async) Artifact Metadata (Async (Try Any)))
diff --git a/stdlib/source/program/aedifex/metadata/snapshot.lux b/stdlib/source/program/aedifex/metadata/snapshot.lux
index 53f5faee0..58792b042 100644
--- a/stdlib/source/program/aedifex/metadata/snapshot.lux
+++ b/stdlib/source/program/aedifex/metadata/snapshot.lux
@@ -62,7 +62,7 @@
 (template [   
]
   [(def: 
      (->  XML)
-     (|>> 
 #xml.Text list (#xml.Node  xml.attributes)))]
+     (|>> 
 #xml.Text list {#xml.Node  xml.attributes}))]
 
   [group_format Group .. (|>)]
   [name_format Name .. (|>)]
@@ -72,12 +72,12 @@
 (def: .public (format (^slots [#artifact #versioning]))
   (-> Metadata XML)
   (let [(^slots [#///artifact.group #///artifact.name #///artifact.version]) artifact]
-    (#xml.Node ..
-               xml.attributes
-               (list (..group_format group)
-                     (..name_format name)
-                     (..version_format version)
-                     (///artifact/versioning.format versioning)))))
+    {#xml.Node ..
+     xml.attributes
+     (list (..group_format group)
+           (..name_format name)
+           (..version_format version)
+           (///artifact/versioning.format versioning))}))
 
 (def: (text tag)
   (-> xml.Tag (Parser Text))
@@ -128,17 +128,17 @@
   (do async.monad
     [project (\ repository download (..uri artifact))]
     (case project
-      (#try.Success project)
+      {#try.Success project}
       (in (|> project
               (do> try.monad
                    [(\ utf8.codec decoded)]
                    [(\ xml.codec decoded)]
                    [list (.result ..parser)])))
       
-      (#try.Failure error)
-      (in (#try.Success
+      {#try.Failure error}
+      (in {#try.Success
            [#artifact artifact
-            #versioning ///artifact/versioning.init])))))
+            #versioning ///artifact/versioning.init]}))))
 
 (def: .public (write repository artifact metadata)
   (-> (Repository Async) Artifact Metadata (Async (Try Any)))
-- 
cgit v1.2.3