diff options
author | Eduardo Julian | 2021-07-25 03:12:17 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-07-25 03:12:17 -0400 |
commit | 62b3abfcc014ca1c19d62aacdd497f6a250b372c (patch) | |
tree | c23155ecef6018b78b349f0ba6cd238872b24da7 /stdlib/source/library/lux/world/file.lux | |
parent | 0f545b7e57d2564e351d907befd2ce26900c5521 (diff) |
Better syntax for "library/lux.^multi".
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/world/file.lux | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/stdlib/source/library/lux/world/file.lux b/stdlib/source/library/lux/world/file.lux index d59faa1c1..ac2912f16 100644 --- a/stdlib/source/library/lux/world/file.lux +++ b/stdlib/source/library/lux/world/file.lux @@ -229,7 +229,7 @@ (#.Some children) (|> children array.to_list - (monad.filter ! (|>> <method>)) + (monad.only ! (|>> <method>)) (\ ! map (monad.map ! (|>> java/io/File::getAbsolutePath))) (\ ! join)) @@ -248,7 +248,7 @@ (def: last_modified (|>> java/io/File::new (java/io/File::lastModified) - (\ (try.with io.monad) map (|>> duration.from_millis instant.absolute)))) + (\ (try.with io.monad) map (|>> duration.of_millis instant.absolute)))) (def: can_execute? (|>> java/io/File::new @@ -453,7 +453,7 @@ (\ ! map (|>> (<method> []) [sub]) (with_promise write! (Try Stats) (Fs::stat [sub (..value_callback write!)] node_fs))))) - (\ ! map (|>> (list.filter product.right) + (\ ! map (|>> (list.only product.right) (list\map product.left))))))] [directory_files Stats::isFile] @@ -477,7 +477,7 @@ (wrap (|> stats Stats::mtimeMs f.int - duration.from_millis + duration.of_millis instant.absolute)))) (def: (can_execute? path) @@ -598,7 +598,7 @@ (list\map (|>> (format path ..python_separator))) (monad.map ! (function (_ sub) (\ ! map (|>> [sub]) (<method> [sub])))) - (\ ! map (|>> (list.filter product.right) + (\ ! map (|>> (list.only product.right) (list\map product.left))))) (\ ! join))))] @@ -614,7 +614,7 @@ (|>> os/path::getmtime (\ (try.with io.monad) map (|>> f.int (i.* +1,000) - duration.from_millis + duration.of_millis instant.absolute)))) (def: (can_execute? path) @@ -746,14 +746,14 @@ [(def: <name> (let [! (try.with io.monad)] (|>> RubyFile::stat - (\ ! map (`` (|>> (~~ (template.splice <pipeline>))))))))] + (\ ! map (`` (|>> (~~ (template.spliced <pipeline>))))))))] [file_size [RubyStat::size .nat]] [last_modified [(RubyStat::mtime []) (RubyTime::to_f []) (f.* +1,000.0) f.int - duration.from_millis + duration.of_millis instant.absolute]] [can_execute? [(RubyStat::executable? [])]] )) @@ -872,10 +872,10 @@ ## [value (<ffi> [path])] ## (if (bit\= false (:as Bit value)) ## (\ io.monad wrap (exception.throw ..cannot_find_file [path])) - ## (wrap (`` (|> value (~~ (template.splice <pipeline>))))))))] + ## (wrap (`` (|> value (~~ (template.spliced <pipeline>))))))))] ## [size ..filesize [.nat]] - ## [last_modified ..filemtime [(i.* +1,000) duration.from_millis instant.absolute]] + ## [last_modified ..filemtime [(i.* +1,000) duration.of_millis instant.absolute]] ## )) ## (def: (can_execute? _) @@ -915,7 +915,7 @@ ## [children (..scandir [path])] ## (loop [input (|> children ## array.to_list - ## (list.filter (function (_ child) + ## (list.only (function (_ child) ## (not (or (text\= "." child) ## (text\= ".." child)))))) ## output (: (List (<capability> IO)) |