Sys structure
July 15, 2026 ยท View on GitHub
The Sys structure provides functions for interacting with the Morel
execution environment, such as reading properties and managing the
environment.
Synopsis
val clearEnv : unit -> unit val colorSchemes : unit -> {comment: string, constant: string, error: string, identifier: string, keyword: string, name: string, numeric: string, string: string, symbol: string, typeVar: string} list val deduceColorScheme : unit -> string val env : unit -> (string * string) list val file : {} val parseTree : string -> string val plan : unit -> string val planEx : string -> string val set : string * 'a -> unit val show : string -> string option val showAll : unit -> (string * string option) list val unset : string -> unit
clearEnv
clearEnv () restores the environment to the initial environment.
colorSchemes
colorSchemes () returns the built-in syntax-highlighting color schemes. Each scheme is a
record whose name field is the scheme name and whose remaining fields
give the style of each token category.
deduceColorScheme
deduceColorScheme () returns the name of the color scheme in effect for syntax highlighting:
the colorScheme property if it names a built-in scheme, otherwise the
scheme deduced from the terminal's background.
env
env () prints the environment.
file
file is a view of the file system as a record. The fields of the record
depend on the files and directories under the configured directory.
parseTree
parseTree s parses s as a top-level Morel statement and returns a parenthesized
S-expression-style dump of the resulting abstract syntax tree. Useful for
testing parser behavior (e.g. operator precedence and attribute attachment)
from .smli scripts. Raises Error if the string does not parse.
plan
plan () prints the plan of the most recently executed expression.
planEx
planEx phase re-plans the most recently executed expression and returns the Core
representation at the specified phase. The phase argument can be "0" (initial),
"-1" (final), or a specific pass number.
set
set (property, value) sets the value of property to value. (See Properties below.)
show
show property returns the current the value of property, as a
string, or NONE if unset.
showAll
showAll () returns a list of all properties and their current value
as a string, or NONE if unset.
unset
unset property clears the current the value of property.