chr-data-0.1.0.1: Datatypes required for chr library

Safe HaskellNone
LanguageHaskell2010

CHR.Data.Lookup

Synopsis

Documentation

class Scoped c Source #

Functionality on top of Lookup for awareness of a scope

Minimal complete definition

empty

class Stacked stk Source #

Functionality on top of Lookup for awareness of a scope. Minimal definition lifts, 'unlifts,', 'top'/'topM', 'pop'/'popM', 'push'/'pushM'

Minimal complete definition

lifts, unlifts

Instances
Stacked (Stacks lkup) Source # 
Instance details

Defined in CHR.Data.Lookup.Stacked

Methods

lifts :: StackedElt (Stacks lkup) -> Stacks lkup Source #

unlifts :: Stacks lkup -> [StackedElt (Stacks lkup)] Source #

top :: Stacks lkup -> StackedElt (Stacks lkup) Source #

pop :: Stacks lkup -> (StackedElt (Stacks lkup), Stacks lkup) Source #

push :: StackedElt (Stacks lkup) -> Stacks lkup -> Stacks lkup Source #

topM :: MonadState (Stacks lkup) m => m (StackedElt (Stacks lkup)) Source #

popM :: MonadState (Stacks lkup) m => m (StackedElt (Stacks lkup)) Source #

pushM :: MonadState (Stacks lkup) m => StackedElt (Stacks lkup) -> m () Source #

tops :: Stacks lkup -> Stacks lkup Source #

pops :: Stacks lkup -> (Stacks lkup, Stacks lkup) Source #

pushs :: Stacks lkup -> Stacks lkup -> Stacks lkup Source #

topsM :: MonadState (Stacks lkup) m => m (Stacks lkup) Source #

popsM :: MonadState (Stacks lkup) m => m (Stacks lkup) Source #

pushsM :: MonadState (Stacks lkup) m => Stacks lkup -> m () Source #

lookupResolveVar :: Lookup m (VarLookupKey m) (VarLookupVal m) => (VarLookupVal m -> Maybe (VarLookupKey m)) -> VarLookupKey m -> m -> Maybe (VarLookupVal m) Source #

Fully resolve lookup

lookupResolveVal :: Lookup m (VarLookupKey m) (VarLookupVal m) => (VarLookupVal m -> Maybe (VarLookupKey m)) -> VarLookupVal m -> m -> Maybe (VarLookupVal m) Source #

Fully resolve lookup

lookupResolveAndContinueM :: (Monad m, Lookup s (VarLookupKey s) (VarLookupVal s)) => (VarLookupVal s -> Maybe (VarLookupKey s)) -> m s -> m a -> (VarLookupVal s -> m a) -> VarLookupKey s -> m a Source #

Monadically lookup a variable, resolve it, continue with either a fail or success monad continuation

inverse :: (Lookup l1 k1 v1, Lookup l2 k2 v2) => (k1 -> v1 -> (k2, v2)) -> l1 -> l2 Source #

Inverse of a lookup