cryptol-3.3.0: Cryptol: The Language of Cryptography
Copyright(c) 2013-2016 Galois Inc.
LicenseBSD3
Maintainercryptol@galois.com
Stabilityprovisional
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cryptol.REPL.Command

Contents

Description

 
Synopsis

Commands

data Command Source #

Commands.

Constructors

Command (Int -> Maybe FilePath -> REPL CommandResult)

Successfully parsed command

Ambiguous String [String]

Ambiguous command, list of conflicting commands

Unknown String

The unknown command

data CommandResult Source #

Constructors

CommandResult 

Fields

Instances

Instances details
Show CommandResult Source # 
Instance details

Defined in Cryptol.REPL.Command

parseCommand :: (String -> [CommandDescr]) -> String -> Maybe Command Source #

Parse a line as a command.

splitCommand :: String -> Maybe (Int, String, String) Source #

Split at the first word boundary.

findCommand :: String -> [CommandDescr] Source #

Lookup a string in the command list.

findCommandExact :: String -> [CommandDescr] Source #

Lookup a string in the command list, returning an exact match even if it's the prefix of another command.

findNbCommand :: Bool -> String -> [CommandDescr] Source #

Lookup a string in the notebook-safe command list.

qcCmd :: QCMode -> String -> (Int, Int) -> Maybe FilePath -> REPL CommandResult Source #

Randomly test a property, or exhaustively check it if the number of values in the type under test is smaller than the tests environment variable, or we specify exhaustive testing.

data QCMode Source #

Constructors

QCRandom 
QCExhaust 

Instances

Instances details
Show QCMode Source # 
Instance details

Defined in Cryptol.REPL.Command

Eq QCMode Source # 
Instance details

Defined in Cryptol.REPL.Command

Methods

(==) :: QCMode -> QCMode -> Bool #

(/=) :: QCMode -> QCMode -> Bool #

checkDocStrings :: LoadedModule -> REPL [DocstringResult] Source #

Check all of the docstrings in the given module.

The outer list elements correspond to the code blocks from the docstrings in file order. Each inner list corresponds to the REPL commands inside each of the docstrings.

data DocstringResult Source #

The result of running a docstring as attached to a definition

Constructors

DocstringResult 

Fields

sanitize :: String -> String Source #

Strip leading space.

replParse :: (String -> Either ParseError a) -> String -> REPL a Source #

Lift a parsing action into the REPL monad.

loadProjectREPL :: LoadProjectMode -> Config -> REPL CommandResult Source #

Load a project. Note that this does not update the Cryptol environment, it only updates the project cache.