(.module: [lux #* [abstract [monad (#+ do)]] [control ["." try (#+ Try)] [security ["!" capability]] [concurrency ["." promise (#+ Promise) ("#\." monad)]]] [data ["." text ["%" format (#+ format)] ["." encoding]] [format ["." xml]]] [world ["." file (#+ Path File)] ["." console (#+ Console)]]] ["." // #_ ["#." clean] ["/#" // #_ [command (#+ Command)] ["#." action (#+ Action)] ["#." pom]]]) (def: #export (do! console fs profile) (-> (Console Promise) (file.System Promise) (Command Path)) (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) (\ encoding.utf8 encode) (!.use (\ file over-write))) _ (console.write-line //clean.success console)] (wrap ///pom.file)))