cryptol-3.0.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-Inferred
Language | Haskell2010

Cryptol.Eval.Env

Description

Synopsis

- data GenEvalEnv sym = EvalEnv {
  - envVars :: !(IntMap (Either (Prim sym) (SEval sym (GenValue sym))))
  - envTypes :: !TypeEnv
  }
- ppEnv :: Backend sym => sym -> PPOpts -> GenEvalEnv sym -> SEval sym Doc
- emptyEnv :: GenEvalEnv sym
- bindVar :: Backend sym => sym -> Name -> SEval sym (GenValue sym) -> GenEvalEnv sym -> SEval sym (GenEvalEnv sym)
- bindVarDirect :: Backend sym => Name -> Prim sym -> GenEvalEnv sym -> GenEvalEnv sym
- lookupVar :: Name -> GenEvalEnv sym -> Maybe (Either (Prim sym) (SEval sym (GenValue sym)))
- bindType :: TVar -> Either Nat' TValue -> GenEvalEnv sym -> GenEvalEnv sym
- lookupType :: TVar -> GenEvalEnv sym -> Maybe (Either Nat' TValue)

# Documentation

data GenEvalEnv sym Source #

Constructors

EvalEnv |

Fields

- envVars :: !(IntMap (Either (Prim sym) (SEval sym (GenValue sym))))
- envTypes :: !TypeEnv

#### Instances

Instances details

Monoid (GenEvalEnv sym) Source # |
Instance details Defined in Cryptol.Eval.Env Methods mempty :: GenEvalEnv sym Source # mappend :: GenEvalEnv sym -> GenEvalEnv sym -> GenEvalEnv sym Source # mconcat :: [GenEvalEnv sym] -> GenEvalEnv sym Source #
Semigroup (GenEvalEnv sym) Source # |
Instance details Defined in Cryptol.Eval.Env Methods (<>) :: GenEvalEnv sym -> GenEvalEnv sym -> GenEvalEnv sym Source # sconcat :: NonEmpty (GenEvalEnv sym) -> GenEvalEnv sym Source # stimes :: Integral b => b -> GenEvalEnv sym -> GenEvalEnv sym Source #
Generic (GenEvalEnv sym) Source # |
Instance details Defined in Cryptol.Eval.Env Associated Types type Rep (GenEvalEnv sym) :: Type -> Type Source # Methods from :: GenEvalEnv sym -> Rep (GenEvalEnv sym) x Source # to :: Rep (GenEvalEnv sym) x -> GenEvalEnv sym Source #
type Rep (GenEvalEnv sym) Source # |

Instance details

Defined in Cryptol.Eval.Env

type Rep (GenEvalEnv sym) = D1 ('MetaData "GenEvalEnv" "Cryptol.Eval.Env" "cryptol-3.0.0-DBVDUAjB1JeD0WzkHH4ckn" 'False) (C1 ('MetaCons "EvalEnv" 'PrefixI 'True) (S1 ('MetaSel ('Just "envVars") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (IntMap (Either (Prim sym) (SEval sym (GenValue sym))))) :*: S1 ('MetaSel ('Just "envTypes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TypeEnv)))

ppEnv :: Backend sym => sym -> PPOpts -> GenEvalEnv sym -> SEval sym Doc Source #

emptyEnv :: GenEvalEnv sym Source #

Evaluation environment with no bindings

bindVar :: Backend sym => sym -> Name -> SEval sym (GenValue sym) -> GenEvalEnv sym -> SEval sym (GenEvalEnv sym) Source #

Bind a variable in the evaluation environment.

bindVarDirect :: Backend sym => Name -> Prim sym -> GenEvalEnv sym -> GenEvalEnv sym Source #

Bind a variable to a value in the evaluation environment, without creating a thunk.

lookupVar :: Name -> GenEvalEnv sym -> Maybe (Either (Prim sym) (SEval sym (GenValue sym))) Source #

Lookup a variable in the environment.

bindType :: TVar -> Either Nat' TValue -> GenEvalEnv sym -> GenEvalEnv sym Source #

Bind a type variable of kind *.

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

Lookup a type variable.