cryptol-2.4.0: Cryptol: The Language of Cryptography

Copyright | (c) 2013-2016 Galois Inc.
License | BSD3
Maintainer | cryptol@galois.com
Stability | provisional
Portability | portable
Safe Haskell | Safe
Language | Haskell98

Cryptol.Eval.Env

Description

Synopsis

- type ReadEnv = EvalEnv
- data EvalEnv = EvalEnv {
  - envVars :: Map Name Value
  - envTypes :: Map TVar (Either Nat' TValue)
  }
- emptyEnv :: EvalEnv
- bindVar :: Name -> Value -> EvalEnv -> EvalEnv
- lookupVar :: Name -> EvalEnv -> Maybe Value
- bindType :: TVar -> Either Nat' TValue -> EvalEnv -> EvalEnv
- lookupType :: TVar -> EvalEnv -> Maybe (Either Nat' TValue)

# Documentation

type ReadEnv = EvalEnv Source #

data EvalEnv Source #

Constructors

EvalEnv |

Fields

- envVars :: Map Name Value
- envTypes :: Map TVar (Either Nat' TValue)

Instances

Generic EvalEnv Source # |
Associated Types type Rep EvalEnv :: * -> * # Methods from :: EvalEnv -> Rep EvalEnv x # to :: Rep EvalEnv x -> EvalEnv #
Monoid EvalEnv Source # |
Methods mempty :: EvalEnv # mappend :: EvalEnv -> EvalEnv -> EvalEnv # mconcat :: [EvalEnv] -> EvalEnv #
NFData EvalEnv Source # |
Methods rnf :: EvalEnv -> () #
PP (WithBase EvalEnv) Source # |
Methods ppPrec :: Int -> WithBase EvalEnv -> Doc Source #
type Rep EvalEnv Source # |
type Rep EvalEnv = D1 (MetaData "EvalEnv" "Cryptol.Eval.Env" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) (C1 (MetaCons "EvalEnv" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "envVars") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map Name Value))) (S1 (MetaSel (Just Symbol "envTypes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map TVar (Either Nat' TValue))))))

emptyEnv :: EvalEnv Source #

bindVar :: Name -> Value -> EvalEnv -> EvalEnv Source #

Bind a variable in the evaluation environment.

lookupVar :: Name -> EvalEnv -> Maybe Value Source #

Lookup a variable in the environment.

bindType :: TVar -> Either Nat' TValue -> EvalEnv -> EvalEnv Source #

Bind a type variable of kind # or *.

lookupType :: TVar -> EvalEnv -> Maybe (Either Nat' TValue) Source #

Lookup a type variable.