chr-data-0.1.0.1: Datatypes required for chr library

Safe HaskellNone
LanguageHaskell2010

CHR.Data.Lookup.Scoped

Description

Scoped Lookup allowing items to have a scope associated. A scope identifies a position in a tree representing nesting. The Lookup has its own scope, i.e. maintains contextual state about 'where it is' in terms of nesting, thus allowing to query whether an item can see the current scope.

Synopsis

Documentation

class Scoped c where Source #

Functionality on top of Lookup for awareness of a scope

Minimal complete definition

empty

Methods

empty :: c Source #

new :: c -> (ScpId, c) Source #

pop :: c -> (ScpId, c) Source #

switch :: ScpId -> c -> (ScpId, c) Source #

scope :: c -> ScpId Source #

curIsVisibleFrom :: ScpId -> c -> Bool Source #

Something at current scope is visible from given scope, i.e. given scope is inside current scope

newM :: MonadState c m => m ScpId Source #

popM :: MonadState c m => m ScpId Source #

switchM :: MonadState c m => ScpId -> m ScpId Source #

scopeM :: MonadState c m => m ScpId Source #

curIsVisibleFromM :: MonadState c m => ScpId -> m Bool Source #

type DefaultScpsLkup k v = ScpsLkup (Map k (ScopedItem v)) Scopes Source #