Module SCL/ModuleRepository

This module is undocumented. This is a list of its definitions.

documentationOfSCLValue :: SCLValue -> <Proc> String
flushDefaultModuleRepository :: <Proc> ()

Discards everything the module repository the calling module was compiled in has compiled, so that every module is compiled again when it is next needed. Meant for testing, not for normal operation.

flushModuleRepository :: ModuleRepository -> <Proc> ()

Discards everything the given module repository has compiled, so that every module is compiled again when it is next needed. Meant for testing, not for normal operation.

invalidateModule :: String -> <Proc> ()

Marks a module as changed. The module, and everything that depends on it, is compiled again the next time it is needed -- which is how an edited .scl file takes effect without restarting the application.

moduleByName :: String -> <Proc> Maybe Module

The compiled form of the named module, from the module repository the calling module was compiled in, or Nothing if the module does not exist or does not compile.

moduleCompilationErrors :: String -> <Proc> [(String, Integer, Integer, String)]

The same errors as moduleCompilationStatus, as (severity, beginOffset, endOffset, message). The offsets are character positions in the module source, -1 for an error the compiler could not place. Empty if the module compiles, or does not exist.

moduleCompilationReport :: [String] -> <Proc> String

One line per module -- OK, FAIL with the errors indented beneath it, or NONE for a module the compiler does not know -- without recompiling anything.

moduleCompilationStatus :: String -> <Proc> Maybe String

Nothing if the module compiles, and otherwise the compiler's own errors, one per line, each prefixed with line:column-line:column when the module's source can be read.

This reads no log and compiles nothing a second time: it reports the verdict the repository is already holding, compiling the module only if nobody has needed it yet.

moduleExists :: String -> <Proc> Boolean

Whether the compiler knows this module at all. A misspelled module name answers False here instead of looking like a module that fails to compile.

possibleModuleSourceText :: String -> <Proc> Maybe String

The source text of the named module, from the source repository of the module repository the calling module was compiled in, or Nothing if there is no such module or its source is not text.

possibleUnsafeSclValueByName :: String -> <Proc> Maybe a

Like unsafeSclValueByName, but gives Nothing instead of failing when the value cannot be resolved for any reason.

recompileModule :: String -> <Proc> Maybe String

Reads a module again from its source and reports the result: Nothing if it compiles, and otherwise its errors. This is the single call to make after editing one .scl file.

recompileModules :: [String] -> <Proc> String

Reads every one of these modules again and reports them all. Invalidating the whole list before compiling any of it matters: where one of them imports another, the importer has to be read again after the module it imports, or it is checked against the version that was just replaced.

sclModuleNames :: <Proc> [String]

The names of the modules provided by the source repository of the module repository the calling module was compiled in. Some source repositories give an empty list even when they do provide modules.

sclValueRef :: String -> <Proc> Maybe SCLValue
unsafeSclValueByName :: String -> <Proc> a

The value with the given full name Module/name, resolved in the module repository the calling module was compiled in.

The result is not type checked: the caller decides what type it is used at, and getting that wrong fails later. Fails if the name is not a valid full value name, or if the module does not exist, does not compile or does not define the value.