egison-2.0.3: An Interpreter for the Programming Language Egison

Safe HaskellSafe-Inferred
LanguageHaskell98

Language.Egison.Variables

Synopsis

Documentation

printEnv Source

Arguments

:: Env

Environment

-> IO String

Contents of the env as a string

Show the contents of an environment

copyEnv Source

Arguments

:: Env

Source environment

-> IO Env

A copy of the source environment

Create a copy of an environment

extendEnv Source

Arguments

:: Env

Environment

-> [(Var, ObjectRef)]

Extensions to the environment

-> IO Env

Extended environment

Extend given environment by binding a series of values to a new environment.

extendLetRec Source

Arguments

:: Env

Environment

-> [(String, EgisonExpr)]

Extensions to the environment

-> IO Env

Extended environment

Extend given environment by binding a series of values to a new environment for letrec.

findEnv Source

Arguments

:: Env

Environment to begin the search; parent env's will be searched as well.

-> Var

Variable

-> IO (Maybe Env)

Environment, or Nothing if there was no match.

Recursively search environments to find one that contains the given variable.

isBound Source

Arguments

:: Env

Environment

-> Var

Variable

-> IO Bool

True if the variable is bound

Determine if a variable is bound

isRecBound Source

Arguments

:: Env

Environment

-> Var

Variable

-> IO Bool

True if the variable is bound

Determine if a variable is bound or a parent of the given environment.

getVar Source

Arguments

:: Env

Environment

-> Var

Variable

-> IOThrowsError ObjectRef

Contents of the variable

Retrieve the value of a variable defined

defineVar Source

Arguments

:: Env

Environment

-> Var

Variable

-> ObjectRef

Value

-> IOThrowsError ()

Result

Bind a variable