aboutsummaryrefslogtreecommitdiff
path: root/licentia/source/program/licentia.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-07-12 00:03:36 -0400
committerEduardo Julian2021-07-12 00:03:36 -0400
commit86df87512966e8038d70624ab654262ce14a915c (patch)
treee96d6709c04e7f3fc77f9d9912b86ef34e9c7ef7 /licentia/source/program/licentia.lux
parentabe24425ced15fd784ef6c62d6f186af72b491db (diff)
Better syntax for parallel-hierarchy imports.
Diffstat (limited to 'licentia/source/program/licentia.lux')
-rw-r--r--licentia/source/program/licentia.lux16
1 files changed, 7 insertions, 9 deletions
diff --git a/licentia/source/program/licentia.lux b/licentia/source/program/licentia.lux
index f1a1503b4..44babb828 100644
--- a/licentia/source/program/licentia.lux
+++ b/licentia/source/program/licentia.lux
@@ -36,7 +36,7 @@
[format
["." json]]]
[world
- ["." file (#+ Path File)]]]
+ ["." file]]]
["." / #_
["#." input]
["#." output]])
@@ -49,10 +49,11 @@
["#::."
(trim [] java/lang/String)])
-(def: default_output_file "LICENSE")
+(def: default_output_file
+ "LICENSE.txt")
(def: (success_message output)
- (-> Path Text)
+ (-> file.Path Text)
(format "Your license has been made!" text.new_line
"Check the file " output "."))
@@ -62,8 +63,7 @@
(do io.monad
[?done (: (IO (Try Any))
(do (try.with io.monad)
- [file (!.use (\ file.default file) [input])
- blob (!.use (\ file content) [])
+ [blob (\ file.default read input)
document (io\wrap (do {! try.monad}
[raw_json (\ utf8.codec decode blob)
json (|> raw_json
@@ -71,10 +71,8 @@
(\ json.codec decode))]
(|> json
(<json>.run /input.license)
- (\ ! map /output.license))))
- output_file (: (IO (Try (File IO)))
- (file.get_file io.monad file.default output))]
- (!.use (\ output_file over_write) (\ utf8.codec encode document))))]
+ (\ ! map /output.license))))]
+ (\ file.default write (\ utf8.codec encode document) output)))]
(wrap (debug.log! (case ?done
(#try.Success _)
(success_message output)