cryptol-2.4.0: Cryptol: The Language of Cryptography

Copyright(c) 2013-2016 Galois, Inc.
LicenseBSD3
Maintainercryptol@galois.com
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Cryptol.REPL.Monad

Contents

Description

 

Synopsis

REPL Monad

newtype REPL a Source #

REPL_ context with InputT handling.

Constructors

REPL 

Fields

Instances

Monad REPL Source # 

Methods

(>>=) :: REPL a -> (a -> REPL b) -> REPL b #

(>>) :: REPL a -> REPL b -> REPL b #

return :: a -> REPL a #

fail :: String -> REPL a #

Functor REPL Source # 

Methods

fmap :: (a -> b) -> REPL a -> REPL b #

(<$) :: a -> REPL b -> REPL a #

Applicative REPL Source # 

Methods

pure :: a -> REPL a #

(<*>) :: REPL (a -> b) -> REPL a -> REPL b #

(*>) :: REPL a -> REPL b -> REPL b #

(<*) :: REPL a -> REPL b -> REPL a #

MonadIO REPL Source # 

Methods

liftIO :: IO a -> REPL a #

FreshM REPL Source # 

Methods

liftSupply :: (Supply -> (a, Supply)) -> REPL a Source #

MonadBase IO REPL Source # 

Methods

liftBase :: IO α -> REPL α #

MonadBaseControl IO REPL Source # 

Associated Types

type StM (REPL :: * -> *) a :: * #

Methods

liftBaseWith :: (RunInBase REPL IO -> IO a) -> REPL a #

restoreM :: StM REPL a -> REPL a #

type StM REPL a Source # 
type StM REPL a = a

runREPL :: Bool -> REPL a -> IO a Source #

Run a REPL action with a fresh environment.

io :: IO a -> REPL a Source #

raise :: REPLException -> REPL a Source #

Raise an exception.

catch :: REPL a -> (REPLException -> REPL a) -> REPL a Source #

rPutStrLn :: String -> REPL () Source #

Use the configured output action to print a string with a trailing newline

rPutStr :: String -> REPL () Source #

Use the configured output action to print a string

rPrint :: Show a => a -> REPL () Source #

Use the configured output action to print something using its Show instance

Errors

Environment

uniqify :: Name -> REPL Name Source #

Given an existing qualified name, prefix it with a relatively-unique string. We make it unique by prefixing with a character # that is not lexically valid in a module name.

freshName :: Ident -> REPL Name Source #

Generate a fresh name using the given index. The name will reside within the "interactive" namespace.

whenDebug :: REPL () -> REPL () Source #

getExprNames :: REPL [String] Source #

Get visible variable names.

getTypeNames :: REPL [String] Source #

Get visible type signature names.

getPropertyNames :: REPL ([Name], NameDisp) Source #

Return a list of property names, sorted by position in the file.

data LoadedModule Source #

Constructors

LoadedModule 

Fields

setLoadedMod :: LoadedModule -> REPL () Source #

Set the name of the currently focused file, edited by :e and loaded via :r.

getPrompt :: REPL String Source #

Construct the prompt for the current environment.

asBatch :: REPL () -> REPL () Source #

Run a computation in batch mode, restoring the previous isBatch flag afterwards

getLetEnabled :: REPL Bool Source #

Are let-bindings enabled in this REPL?

updateREPLTitle :: REPL () Source #

Update the title

setUpdateREPLTitle :: REPL () -> REPL () Source #

Set the function that will be called when updating the title

Config Options

setUser :: String -> String -> REPL () Source #

Set a user option.

getUser :: String -> REPL EnvVal Source #

Get a user option, when it's known to exist. Fail with panic when it doesn't.

tryGetUser :: String -> REPL (Maybe EnvVal) Source #

Get a user option, using Maybe for failure.

userOptions :: OptionMap Source #

Configurable Output

getPutStr :: REPL (String -> IO ()) Source #

Get the REPL's string-printer

setPutStr :: (String -> IO ()) -> REPL () Source #

Set the REPL's string-printer

Smoke Test

data Smoke Source #

Constructors

Z3NotFound 

Instances

Eq Smoke Source # 

Methods

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

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

Show Smoke Source # 

Methods

showsPrec :: Int -> Smoke -> ShowS #

show :: Smoke -> String #

showList :: [Smoke] -> ShowS #

PP Smoke Source # 

Methods

ppPrec :: Int -> Smoke -> Doc Source #