disco-0.1.6: Functional programming language for teaching discrete math.
Copyrightdisco team and contributors
LicenseBSD-3-Clause
Maintainerbyorgey@gmail.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Disco.Interactive.Commands

Description

Defining and dispatching all commands/functionality available at the REPL prompt.

Synopsis

Documentation

dispatch :: Members DiscoEffects r => REPLCommands -> SomeREPLExpr -> Sem r () Source #

Given a list of REPL commands and something typed at the REPL, pick the first command with a matching type-level tag and run its associated action.

discoCommands :: REPLCommands Source #

The list of all commands that can be used at the REPL. Resolution of REPL commands searches this list in order, which means ambiguous command prefixes (e.g. :t for :type) are resolved to the first matching command.

loadFile :: Members '[Output (Message ann), Embed IO] r => FilePath -> Sem r (Maybe String) Source #

Try loading the contents of a file from the filesystem, emitting an error if it's not found.

parseLine :: REPLCommands -> ExtSet -> String -> Either String SomeREPLExpr Source #

Given a list of available REPL commands and the currently enabled extensions, parse a string entered at the REPL prompt, returning either a parse error message or a parsed REPL expression.