Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- class Scoped c where
- type DefaultScpsLkup k v = ScpsLkup (Map k (ScopedItem v)) Scopes
- defaultScpsLkup :: DefaultScpsLkup k v
Documentation
Functionality on top of Lookup
for awareness of a scope
new :: c -> (ScpId, c) Source #
pop :: c -> (ScpId, c) Source #
switch :: ScpId -> c -> (ScpId, c) 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 #
defaultScpsLkup :: DefaultScpsLkup k v Source #