chr-data-0.1.0.1: Datatypes required for chr library

Safe HaskellNone
LanguageHaskell2010

CHR.Data.Lookup.Stacked

Description

Lookups combined into stack of lookups, allowing combined lookup coupled with updates on top of stack only

Synopsis

Documentation

class Stacked stk where 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

Methods

lifts :: StackedElt stk -> stk Source #

unlifts :: stk -> [StackedElt stk] Source #

top :: stk -> StackedElt stk Source #

pop :: stk -> (StackedElt stk, stk) Source #

push :: StackedElt stk -> stk -> stk Source #

topM :: MonadState stk m => m (StackedElt stk) Source #

popM :: MonadState stk m => m (StackedElt stk) Source #

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

tops :: stk -> stk Source #

pops :: stk -> (stk, stk) Source #

pushs Source #

Arguments

:: stk 
-> stk 
-> stk

push, but only top of first arg

topsM :: MonadState stk m => m stk Source #

popsM :: MonadState stk m => m stk Source #

pushsM :: MonadState stk m => stk -> m () Source #

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 #

type family StackedElt stk :: * Source #

Instances
type StackedElt (Stacks e) Source # 
Instance details

Defined in CHR.Data.Lookup.Stacked

type StackedElt (Stacks e) = e
type StackedElt (StackedVarLookup s) Source # 
Instance details

Defined in CHR.Data.VarLookup

newtype Stacks l Source #

Stacked Lookup derived from a base one, to allow a use of multiple lookups but update on top only

Constructors

Stacks 

Fields

Instances
Functor Stacks Source # 
Instance details

Defined in CHR.Data.Lookup.Stacked

Methods

fmap :: (a -> b) -> Stacks a -> Stacks b #

(<$) :: a -> Stacks b -> Stacks a #

Applicative Stacks Source # 
Instance details

Defined in CHR.Data.Lookup.Stacked

Methods

pure :: a -> Stacks a #

(<*>) :: Stacks (a -> b) -> Stacks a -> Stacks b #

liftA2 :: (a -> b -> c) -> Stacks a -> Stacks b -> Stacks c #

(*>) :: Stacks a -> Stacks b -> Stacks b #

(<*) :: Stacks a -> Stacks b -> Stacks a #

LookupApply l1 l2 => LookupApply l1 (Stacks l2) Source # 
Instance details

Defined in CHR.Data.Lookup.Stacked

Methods

apply :: l1 -> Stacks l2 -> Stacks l2 Source #

Show (Stacks s) Source # 
Instance details

Defined in CHR.Data.Lookup.Stacked

Methods

showsPrec :: Int -> Stacks s -> ShowS #

show :: Stacks s -> String #

showList :: [Stacks s] -> ShowS #

PP s => PP (Stacks s) Source # 
Instance details

Defined in CHR.Data.Lookup.Stacked

Methods

pp :: Stacks s -> PP_Doc #

ppList :: [Stacks s] -> PP_Doc #

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 #

Lookup lkup k v => Lookup (Stacks lkup) k v Source # 
Instance details

Defined in CHR.Data.Lookup.Stacked

Methods

lookup :: k -> Stacks lkup -> Maybe v Source #

fromList :: [(k, v)] -> Stacks lkup Source #

toList :: Stacks lkup -> [(k, v)] Source #

null :: Stacks lkup -> Bool Source #

size :: Stacks lkup -> Int Source #

alter :: (Maybe v -> Maybe v) -> k -> Stacks lkup -> Stacks lkup Source #

singleton :: k -> v -> Stacks lkup Source #

empty :: Stacks lkup Source #

insertWith :: (v -> v -> v) -> k -> v -> Stacks lkup -> Stacks lkup Source #

insert :: k -> v -> Stacks lkup -> Stacks lkup Source #

unionWith :: (v -> v -> v) -> Stacks lkup -> Stacks lkup -> Stacks lkup Source #

union :: Stacks lkup -> Stacks lkup -> Stacks lkup Source #

unionsWith :: (v -> v -> v) -> [Stacks lkup] -> Stacks lkup Source #

unions :: [Stacks lkup] -> Stacks lkup Source #

delete :: k -> Stacks lkup -> Stacks lkup Source #

keys :: Stacks lkup -> [k] Source #

keysSet :: Stacks lkup -> Set k Source #

elems :: Stacks lkup -> [v] Source #

map :: (v -> v) -> Stacks lkup -> Stacks lkup Source #

type StackedElt (Stacks e) Source # 
Instance details

Defined in CHR.Data.Lookup.Stacked

type StackedElt (Stacks e) = e
type StackedElt (StackedVarLookup s) Source # 
Instance details

Defined in CHR.Data.VarLookup

type VarLookupVal (StackedVarLookup s) Source # 
Instance details

Defined in CHR.Data.VarLookup

type VarLookupKey (StackedVarLookup s) Source # 
Instance details

Defined in CHR.Data.VarLookup