aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/program')
-rw-r--r--stdlib/source/program/compositor.lux6
-rw-r--r--stdlib/source/program/compositor/import.lux74
2 files changed, 3 insertions, 77 deletions
diff --git a/stdlib/source/program/compositor.lux b/stdlib/source/program/compositor.lux
index 55da4161b..4e0599859 100644
--- a/stdlib/source/program/compositor.lux
+++ b/stdlib/source/program/compositor.lux
@@ -42,6 +42,7 @@
[meta
[packager {"+" Packager}]
["[0]" cli {"+" Service}]
+ ["[0]" import]
["[0]" export]
[archive {"+" Archive}
["[0]" unit]
@@ -52,8 +53,7 @@
... ["[0]" interpreter]
]]]
["[0]" / "_"
- ["[1][0]" static {"+" Static}]
- ["[1][0]" import]])
+ ["[1][0]" static {"+" Static}]])
(def: (or_crash! failure_description action)
(All (_ a)
@@ -153,7 +153,7 @@
..timed
(do (try.with async.monad)
[.let [[compilation_host_dependencies compilation_libraries compilation_compilers compilation_sources compilation_target compilation_module] compilation]
- import (/import.import (value@ platform.#&file_system platform) compilation_libraries)
+ import (import.import (value@ platform.#&file_system platform) compilation_libraries)
[state archive phase_wrapper] (:sharing [<parameters>]
(Platform <parameters>)
platform
diff --git a/stdlib/source/program/compositor/import.lux b/stdlib/source/program/compositor/import.lux
deleted file mode 100644
index 7f21f20ec..000000000
--- a/stdlib/source/program/compositor/import.lux
+++ /dev/null
@@ -1,74 +0,0 @@
-(.using
- [library
- [lux {"-" Module}
- [abstract
- ["[0]" monad {"+" Monad do}]]
- [control
- ["[0]" try {"+" Try}]
- ["[0]" exception {"+" exception:}]
- [concurrency
- ["[0]" async {"+" Async} ("[1]#[0]" monad)]]
- ["<>" parser
- ["<[0]>" binary]]]
- [data
- [binary {"+" Binary}]
- ["[0]" text
- ["%" format {"+" format}]]
- [collection
- ["[0]" dictionary {"+" Dictionary}]
- ["[0]" sequence]]
- [format
- ["[0]" tar]]]
- [tool
- [compiler
- [meta
- [cli {"+" Library Module}]]]]
- [world
- ["[0]" file]]]])
-
-(def: Action
- (type (All (_ a) (Async (Try a)))))
-
-(exception: .public useless_tar_entry)
-
-(exception: .public (duplicate [library Library
- module Module])
- (exception.report
- ["Module" (%.text module)]
- ["Library" (%.text library)]))
-
-(type: .public Import
- (Dictionary file.Path Binary))
-
-(def: (import_library system library import)
- (-> (file.System Async) Library Import (Action Import))
- (let [! async.monad]
- (|> library
- (# system read)
- (# ! each (let [! try.monad]
- (|>> (# ! each (<binary>.result tar.parser))
- (# ! conjoint)
- (# ! each (|>> sequence.list
- (monad.mix ! (function (_ entry import)
- (case entry
- {tar.#Normal [path instant mode ownership content]}
- (let [path (tar.from_path path)]
- (case (dictionary.has' path (tar.data content) import)
- {try.#Failure error}
- (exception.except ..duplicate [library path])
-
- import'
- import'))
-
- _
- (exception.except ..useless_tar_entry [])))
- import)))
- (# ! conjoint)))))))
-
-(def: .public (import system libraries)
- (-> (file.System Async) (List Library) (Action Import))
- (monad.mix (: (Monad Action)
- (try.with async.monad))
- (..import_library system)
- (dictionary.empty text.hash)
- libraries))