diff options
Diffstat (limited to 'stdlib/source/library/lux/world/file.lux')
-rw-r--r-- | stdlib/source/library/lux/world/file.lux | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/stdlib/source/library/lux/world/file.lux b/stdlib/source/library/lux/world/file.lux index 2d09acf8a..62c4404e8 100644 --- a/stdlib/source/library/lux/world/file.lux +++ b/stdlib/source/library/lux/world/file.lux @@ -35,10 +35,10 @@ ["." instant (#+ Instant)] ["." duration]]]]) -(type: #export Path +(type: .public Path Text) -(`` (interface: #export (System !) +(`` (interface: .public (System !) (: Text separator) @@ -89,20 +89,20 @@ [_ child] (text.split (text.size /) temp)] (in [parent child]))))) -(def: #export (parent fs path) +(def: .public (parent fs path) (All [!] (-> (System !) Path (Maybe Path))) (|> path (..un_rooted fs) (maybe\map product.left))) -(def: #export (name fs path) +(def: .public (name fs path) (All [!] (-> (System !) Path Text)) (|> path (..un_rooted fs) (maybe\map product.right) (maybe.else path))) -(def: #export (async fs) +(def: .public (async fs) (-> (System IO) (System Async)) (`` (implementation (def: separator @@ -136,12 +136,12 @@ [move])) ))) -(def: #export (rooted fs parent child) +(def: .public (rooted fs parent child) (All [!] (-> (System !) Path Text Path)) (format parent (\ fs separator) child)) (template [<name>] - [(exception: #export (<name> {file Path}) + [(exception: .public (<name> {file Path}) (exception.report ["Path" file]))] @@ -155,7 +155,7 @@ [cannot_read_all_data] ) -(with_expansions [<for_jvm> (as_is (exception: #export (cannot_modify_file {instant Instant} {file Path}) +(with_expansions [<for_jvm> (as_is (exception: .public (cannot_modify_file {instant Instant} {file Path}) (exception.report ["Instant" (%.instant instant)] ["Path" file])) @@ -202,7 +202,7 @@ ["#::." (new [java/io/File] #io #try)]) - (`` (implementation: #export default + (`` (implementation: .public default (System IO) (def: separator @@ -324,12 +324,12 @@ (toString [] ffi.String)]) (template: (with_async <write> <type> <body>) - (template.with_locals [<read>] - (let [[<read> <write>] (: [(Async <type>) (async.Resolver <type>)] - (async.async []))] - (exec - <body> - <read>)))) + [(template.with_locals [<read>] + (let [[<read> <write>] (: [(Async <type>) (async.Resolver <type>)] + (async.async []))] + (exec + <body> + <read>)))]) (ffi.import: Fs ["#::." @@ -403,7 +403,7 @@ (JsPath::sep (..node_path [])) "/")) - (`` (implementation: #export default + (`` (implementation: .public default (System Async) (def: separator @@ -573,7 +573,7 @@ (def: python_separator (os/path::sep)) - (`` (implementation: #export default + (`` (implementation: .public default (System IO) (def: separator @@ -699,7 +699,7 @@ Text (..RubyFile::SEPARATOR)) - (`` (implementation: #export default + (`` (implementation: .public default (System IO) (def: separator @@ -836,7 +836,7 @@ ## (def: default_separator (..DIRECTORY_SEPARATOR)) ## (template [<name>] - ## [(exception: #export (<name> {file Path}) + ## [(exception: .public (<name> {file Path}) ## (exception.report ## ["Path" file]))] @@ -945,7 +945,7 @@ ## (in [])))) ## )) - ## (`` (implementation: #export default + ## (`` (implementation: .public default ## (System IO) ## (~~ (template [<name> <test> <constructor> <exception>] @@ -984,7 +984,7 @@ } (as_is))) -(def: #export (exists? monad fs path) +(def: .public (exists? monad fs path) (All [!] (-> (Monad !) (System !) Path (! Bit))) (do monad [verdict (\ fs file? path)] @@ -1169,7 +1169,7 @@ (#.Item _) (recur sub_directory tail))))))) -(def: #export (mock separator) +(def: .public (mock separator) (-> Text (System Async)) (let [store (stm.var ..empty_mock)] (`` (implementation @@ -1317,7 +1317,7 @@ (in (#try.Success [])) (\ fs make_directory path)))) -(def: #export (make_directories monad fs path) +(def: .public (make_directories monad fs path) (All [!] (-> (Monad !) (System !) Path (! (Try Any)))) (let [rooted? (text.starts_with? (\ fs separator) path) segments (text.split_all_with (\ fs separator) path)] @@ -1349,7 +1349,7 @@ (#try.Failure error) (in (#try.Failure error))))))))) -(def: #export (make_file monad fs content path) +(def: .public (make_file monad fs content path) (All [!] (-> (Monad !) (System !) Binary Path (! (Try Any)))) (do monad [? (\ fs file? path)] |