egison-2.3.8: An Interpreter for the Programming Language Egison

Safe HaskellSafe-Infered

Language.Egison.Variables

Synopsis

Documentation

printEnvSource

Arguments

:: Env

Environment

-> IO String

Contents of the env as a string

Show the contents of an environment

copyEnvSource

Arguments

:: Env

Source environment

-> IO Env

A copy of the source environment

Create a copy of an environment

extendEnvSource

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.

extendLetRecSource

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.

findEnvSource

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.

isBoundSource

Arguments

:: Env

Environment

-> Var

Variable

-> IO Bool

True if the variable is bound

Determine if a variable is bound

isRecBoundSource

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.

getVarSource

Arguments

:: Env

Environment

-> Var

Variable

-> IOThrowsError ObjectRef

Contents of the variable

Retrieve the value of a variable defined

defineVarSource

Arguments

:: Env

Environment

-> Var

Variable

-> ObjectRef

Value

-> IOThrowsError ()

Result

Bind a variable