From 2b909032e7a0bd10cd7db52067d2fb701bfa95e5 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 6 Jul 2021 21:34:21 -0400 Subject: Simplified the API for file-system operations. --- stdlib/source/program/aedifex/command/pom.lux | 33 ++++++++++++--------------- 1 file changed, 14 insertions(+), 19 deletions(-) (limited to 'stdlib/source/program/aedifex/command/pom.lux') 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))) -- cgit v1.2.3