aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/command/pom.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-07-06 21:34:21 -0400
committerEduardo Julian2021-07-06 21:34:21 -0400
commit2b909032e7a0bd10cd7db52067d2fb701bfa95e5 (patch)
tree0e2aaef228f80f3336715327f7f34065c309de22 /stdlib/source/program/aedifex/command/pom.lux
parent5cf4efa861075f8276f43a2516f5beacaf610b44 (diff)
Simplified the API for file-system operations.
Diffstat (limited to 'stdlib/source/program/aedifex/command/pom.lux')
-rw-r--r--stdlib/source/program/aedifex/command/pom.lux33
1 files changed, 14 insertions, 19 deletions
diff --git a/stdlib/source/program/aedifex/command/pom.lux b/stdlib/source/program/aedifex/command/pom.lux
index b8a728904..00427ee39 100644
--- a/stdlib/source/program/aedifex/command/pom.lux
+++ b/stdlib/source/program/aedifex/command/pom.lux
@@ -3,38 +3,33 @@
[abstract
[monad (#+ do)]]
[control
- ["." try (#+ Try)]
+ ["." try ("#\." functor)]
[concurrency
["." promise (#+ Promise) ("#\." monad)]]]
[data
- ["." text
+ [text
["%" format (#+ format)]
[encoding
["." utf8]]]
[format
["." xml]]]
[world
- ["." file (#+ Path File)]
+ ["." file]
["." console (#+ Console)]]]
- ["." // #_
- ["#." clean]
- ["/#" // #_
- [command (#+ Command)]
- ["#." action (#+ Action)]
- ["#." pom]]])
+ ["." /// #_
+ [command (#+ Command)]
+ ["#." action]
+ ["#." pom]])
(def: #export success
(format "Successfully created POM file: " ///pom.file))
(def: #export (do! console fs profile)
- (-> (Console Promise) (file.System Promise) (Command Path))
+ (-> (Console Promise) (file.System Promise) (Command Any))
(do ///action.monad
- [pom (promise\wrap (///pom.write profile))
- file (: (Promise (Try (File Promise)))
- (file.get_file promise.monad fs ///pom.file))
- outcome (|> pom
- (\ xml.codec encode)
- (\ utf8.codec encode)
- (\ file over_write))
- _ (console.write_line ..success console)]
- (wrap ///pom.file)))
+ [content (|> (///pom.write profile)
+ (try\map (|>> (\ xml.codec encode)
+ (\ utf8.codec encode)))
+ promise\wrap)
+ _ (\ fs write content ///pom.file)]
+ (console.write_line ..success console)))