chr-data-0.1.0.0: Datatypes required for chr library

Safe HaskellSafe
LanguageHaskell2010

CHR.Data.Lookup.Types

Synopsis

Documentation

class Lookup c k v | c -> k, c -> v where Source #

Class interface uses same names as Data.Map. Instances must define: lookup, findMin, findMax, fromList, toList, null, alter. Union is left-biased in that left operand values overwrite right operand values, but all other contextinfo (if any andor relevant, like scope) is inherited from the right one.

Minimal complete definition

lookup, fromList, toList, size, alter

Methods

lookup :: k -> c -> Maybe v Source #

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

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

null :: c -> Bool Source #

size :: c -> Int Source #

alter :: (Maybe v -> Maybe v) -> k -> c -> c Source #

singleton :: k -> v -> c Source #

empty :: c Source #

insertWith :: (v -> v -> v) -> k -> v -> c -> c Source #

insert :: k -> v -> c -> c Source #

unionWith :: (v -> v -> v) -> c -> c -> c Source #

union :: c -> c -> c Source #

unionsWith :: (v -> v -> v) -> [c] -> c Source #

unions :: [c] -> c Source #

delete :: k -> c -> c Source #

keys :: c -> [k] Source #

keysSet :: Ord k => c -> Set k Source #

elems :: c -> [v] Source #

map :: (v -> v) -> c -> c Source #

Instances

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

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 #

class LookupApply l1 l2 where Source #

Minimal complete definition

apply

Methods

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

Instances

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

Methods

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

Ord k => LookupApply (VarMp' k v) (VarMp' k v) Source # 

Methods

apply :: VarMp' k v -> VarMp' k v -> VarMp' k v Source #

alterDefault :: Lookup c k v => (Maybe v -> Maybe v) -> k -> c -> c Source #

Default for alter when lookup, insert (or inserWith), and delete are defined