diff options
Diffstat (limited to 'stdlib/source/library/lux/meta/compiler/meta/cache/module.lux')
-rw-r--r-- | stdlib/source/library/lux/meta/compiler/meta/cache/module.lux | 69 |
1 files changed, 41 insertions, 28 deletions
diff --git a/stdlib/source/library/lux/meta/compiler/meta/cache/module.lux b/stdlib/source/library/lux/meta/compiler/meta/cache/module.lux index 050da13ff..50df408fa 100644 --- a/stdlib/source/library/lux/meta/compiler/meta/cache/module.lux +++ b/stdlib/source/library/lux/meta/compiler/meta/cache/module.lux @@ -25,7 +25,6 @@ ["[0]" file]]]] ["[0]" // (.only) [// - [context (.only Context)] [archive ["[0]" module]]]]) @@ -36,28 +35,34 @@ ["Module ID" (%.nat @module)] ["Error" error]))) -(def .public (path fs context @module) - (All (_ !) (-> (file.System !) Context module.ID file.Path)) - (format (//.path fs context) - (of fs separator) - (%.nat @module))) +(def .public (path fs @module) + (All (_ !) + (-> (file.System !) module.ID + file.Path)) + (let [/ (of fs separator)] + (format //.path + / (%.nat @module)))) -(def .public (enabled? fs context @module) - (All (_ !) (-> (file.System !) Context module.ID (! Bit))) - (of fs directory? (..path fs context @module))) +(def .public (enabled? fs @module) + (All (_ !) + (-> (file.System !) module.ID + (! Bit))) + (of fs directory? (..path fs @module))) -(def .public (enable! ! fs context @module) - (All (_ !) (-> (Monad !) (file.System !) Context module.ID (! (Try Any)))) +(def .public (enable! ! fs @module) + (All (_ !) + (-> (Monad !) (file.System !) module.ID + (! (Try Any)))) (do ! - [.let [path (..path fs context @module)] + [.let [path (..path fs @module)] module_exists? (of fs directory? path)] (if module_exists? (in {try.#Success []}) - (with_expansions [<failure> (exception.except ..cannot_enable [(//.path fs context) + (with_expansions [<failure> (exception.except ..cannot_enable [//.path @module error])] (do ! - [? (//.enable! ! fs context)] + [? (//.enable! ! fs)] (when ? {try.#Failure error} (in <failure>) @@ -76,24 +81,32 @@ file.Path "descriptor") -(def .public (descriptor fs context @module) - (All (_ !) (-> (file.System !) Context module.ID file.Path)) - (format (..path fs context @module) - (of fs separator) - ..file)) +(def .public (descriptor fs @module) + (All (_ !) + (-> (file.System !) module.ID + file.Path)) + (let [/ (of fs separator)] + (format (..path fs @module) + / ..file))) -(def .public (cache! fs context @module content) - (All (_ !) (-> (file.System !) Context module.ID Binary (! (Try Any)))) - (of fs write (..descriptor fs context @module) content)) +(def .public (cache! fs @module content) + (All (_ !) + (-> (file.System !) module.ID Binary + (! (Try Any)))) + (of fs write (..descriptor fs @module) content)) -(def .public (cache fs context @module) - (All (_ !) (-> (file.System !) Context module.ID (! (Try Binary)))) - (of fs read (..descriptor fs context @module))) +(def .public (cache fs @module) + (All (_ !) + (-> (file.System !) module.ID + (! (Try Binary)))) + (of fs read (..descriptor fs @module))) -(def .public (artifacts ! fs context @module) - (All (_ !) (-> (Monad !) (file.System !) Context module.ID (! (Try (Dictionary Text Binary))))) +(def .public (artifacts ! fs @module) + (All (_ !) + (-> (Monad !) (file.System !) module.ID + (! (Try (Dictionary Text Binary))))) (do [! (try.with !)] - [files (of fs directory_files (..path fs context @module)) + [files (of fs directory_files (..path fs @module)) pairs (|> files (list#each (function (_ file) [(file.name fs file) file])) |