glambda-1.0: A simply typed lambda calculus interpreter, written with GADTs

Copyright(C) 2015 Richard Eisenberg
LicenseBSD-style (see LICENSE)
MaintainerRichard Eisenberg (eir@cis.upenn.edu)
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Language.Glambda.Globals

Description

Manages the global variables in Glambda

Synopsis

Documentation

data Globals Source

The global variable environment maps variables to type-checked expressions

emptyGlobals :: Globals Source

An empty global variable environment

extend :: String -> STy ty -> Exp [] ty -> Globals -> Globals Source

Extend a Globals with a new binding

lookupGlobal :: MonadError Doc m => Globals -> String -> (forall ty. STy ty -> Exp [] ty -> m r) -> m r Source

Lookup a global variable. Fails with throwError if the variable is not bound.