tip-lib-0.2.2: tons of inductive problems - support library and tools

Safe HaskellNone
LanguageHaskell2010

Tip.Scope

Contents

Description

A monad for keeping track of variable scope.

Synopsis

Documentation

scope :: (PrettyVar a, Ord a) => Theory a -> Scope a Source

The scope of a theory

data Scope a Source

Constructors

Scope 

Fields

inner :: Set a
 
types :: Map a (TypeInfo a)
 
locals :: Map a (Type a)
 
globals :: Map a (GlobalInfo a)
 

Instances

Show a => Show (Scope a) Source 
Monad m => MonadState (Scope a) (ScopeT a m) Source 

Querying the scope

data TypeInfo a Source

Constructors

TyVarInfo 
DatatypeInfo (Datatype a) 
SortInfo (Sort a) 

Instances

Eq a => Eq (TypeInfo a) Source 
Show a => Show (TypeInfo a) Source 

isType :: Ord a => a -> Scope a -> Bool Source

isTyVar :: Ord a => a -> Scope a -> Bool Source

isSort :: Ord a => a -> Scope a -> Bool Source

isLocal :: Ord a => a -> Scope a -> Bool Source

isGlobal :: Ord a => a -> Scope a -> Bool Source

lookupType :: Ord a => a -> Scope a -> Maybe (TypeInfo a) Source

lookupLocal :: Ord a => a -> Scope a -> Maybe (Type a) Source

whichDatatype :: Ord a => a -> Scope a -> Datatype a Source

whichLocal :: Ord a => a -> Scope a -> Type a Source

whichGlobal :: Ord a => a -> Scope a -> GlobalInfo a Source

whichFunction :: Ord a => a -> Scope a -> PolyType a Source

whichProjector :: Ord a => a -> Scope a -> (Datatype a, Constructor a, Int, Type a) Source

The scope monad

newtype ScopeT a m b Source

Constructors

ScopeT 

Fields

unScopeT :: StateT (Scope a) (ErrorT Doc m) b
 

runScopeT :: Monad m => ScopeT a m b -> m (Either Doc b) Source

checkScopeT :: Monad m => ScopeT a m b -> m b Source

inContext :: Pretty a => a -> ScopeM b c -> ScopeM b c Source

local :: Monad m => ScopeT a m b -> ScopeT a m b Source

Adding things to the scope in the scope monad

newScope :: Monad m => ScopeT a m b -> ScopeT a m b Source

newName :: (PrettyVar a, Ord a, Monad m) => a -> ScopeT a m () Source

newTyVar :: (Monad m, Ord a, PrettyVar a) => a -> ScopeT a m () Source

newSort :: (Monad m, Ord a, PrettyVar a) => Sort a -> ScopeT a m () Source

newDatatype :: (Monad m, Ord a, PrettyVar a) => Datatype a -> ScopeT a m () Source

newFunction :: (Monad m, Ord a, PrettyVar a) => Signature a -> ScopeT a m () Source

newLocal :: (Monad m, Ord a, PrettyVar a) => Local a -> ScopeT a m () Source

withTheory :: (Monad m, Ord a, PrettyVar a) => Theory a -> ScopeT a m b -> ScopeT a m b Source

Add everything in a theory