diff options
author | Eduardo Julian | 2018-08-04 10:05:26 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-08-04 10:05:26 -0400 |
commit | 221cf3ea1bd48a8c678d3447558ea94631114ebc (patch) | |
tree | d5b7315718f9ec75576f5026783db5a5c752a6a3 /stdlib/source/lux/world/file.lux | |
parent | c1f900baea30dbca55489c6afaf80dcfcda8813b (diff) |
Made some adjustments to fit stdlib's compiler infrastructure to new-luxc.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/world/file.lux | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/stdlib/source/lux/world/file.lux b/stdlib/source/lux/world/file.lux index 912c448e9..76f03a835 100644 --- a/stdlib/source/lux/world/file.lux +++ b/stdlib/source/lux/world/file.lux @@ -2,8 +2,7 @@ [lux #* [control ["." monad (#+ Monad do)] - ["ex" exception (#+ Exception exception:)] - pipe] + ["ex" exception (#+ Exception exception:)]] [data ["." error (#+ Error)] [text @@ -105,20 +104,19 @@ (`` (for {(~~ (static host.jvm)) (as-is (import: #long java/io/File (new [String]) - (exists [] #io #try boolean) - (mkdirs [] #io #try boolean) - (delete [] #io #try boolean) + (~~ (do-template [<name>] + [(<name> [] #io #try boolean)] + + [exists] [mkdirs] [delete] + [isFile] [isDirectory] + [canRead] [canWrite] [canExecute])) + (length [] #io #try long) (listFiles [] #io #try #? (Array java/io/File)) (getAbsolutePath [] #io #try String) (renameTo [java/io/File] #io #try boolean) - (isFile [] #io #try boolean) - (isDirectory [] #io #try boolean) (lastModified [] #io #try long) (setLastModified [long] #io #try boolean) - (canRead [] #io #try boolean) - (canWrite [] #io #try boolean) - (canExecute [] #io #try boolean) (#static separator String)) (import: java/lang/AutoCloseable @@ -245,8 +243,8 @@ (def: #export (exists? System<m> file) (All [m] (-> (System m) File (m Bit))) - (|> file - (do> (:: System<m> &monad) - [(:: System<m> file?)] - [(if> [(wrap #1)] - [(:: System<m> directory? file)])]))) + (do (:: System<m> &monad) + [??? (:: System<m> file? file)] + (if ??? + (wrap #1) + (:: System<m> directory? file)))) |