chr-data-0.1.0.1: 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 (IntMap v) Key v Source # 
Instance details

Defined in CHR.Data.Lookup.Instances

Methods

lookup :: Key -> IntMap v -> Maybe v Source #

fromList :: [(Key, v)] -> IntMap v Source #

toList :: IntMap v -> [(Key, v)] Source #

null :: IntMap v -> Bool Source #

size :: IntMap v -> Int Source #

alter :: (Maybe v -> Maybe v) -> Key -> IntMap v -> IntMap v Source #

singleton :: Key -> v -> IntMap v Source #

empty :: IntMap v Source #

insertWith :: (v -> v -> v) -> Key -> v -> IntMap v -> IntMap v Source #

insert :: Key -> v -> IntMap v -> IntMap v Source #

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

union :: IntMap v -> IntMap v -> IntMap v Source #

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

unions :: [IntMap v] -> IntMap v Source #

delete :: Key -> IntMap v -> IntMap v Source #

keys :: IntMap v -> [Key] Source #

keysSet :: IntMap v -> Set Key Source #

elems :: IntMap v -> [v] Source #

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

Lookup (VecAlloc e) Int e Source # 
Instance details

Defined in CHR.Data.Lookup.Instances

Methods

lookup :: Int -> VecAlloc e -> Maybe e Source #

fromList :: [(Int, e)] -> VecAlloc e Source #

toList :: VecAlloc e -> [(Int, e)] Source #

null :: VecAlloc e -> Bool Source #

size :: VecAlloc e -> Int Source #

alter :: (Maybe e -> Maybe e) -> Int -> VecAlloc e -> VecAlloc e Source #

singleton :: Int -> e -> VecAlloc e Source #

empty :: VecAlloc e Source #

insertWith :: (e -> e -> e) -> Int -> e -> VecAlloc e -> VecAlloc e Source #

insert :: Int -> e -> VecAlloc e -> VecAlloc e Source #

unionWith :: (e -> e -> e) -> VecAlloc e -> VecAlloc e -> VecAlloc e Source #

union :: VecAlloc e -> VecAlloc e -> VecAlloc e Source #

unionsWith :: (e -> e -> e) -> [VecAlloc e] -> VecAlloc e Source #

unions :: [VecAlloc e] -> VecAlloc e Source #

delete :: Int -> VecAlloc e -> VecAlloc e Source #

keys :: VecAlloc e -> [Int] Source #

keysSet :: VecAlloc e -> Set Int Source #

elems :: VecAlloc e -> [e] Source #

map :: (e -> e) -> VecAlloc e -> VecAlloc e 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 #

Ord k => Lookup (Map k v) k v Source # 
Instance details

Defined in CHR.Data.Lookup.Instances

Methods

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

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

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

null :: Map k v -> Bool Source #

size :: Map k v -> Int Source #

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

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

empty :: Map k v Source #

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

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

unionWith :: (v -> v -> v) -> Map k v -> Map k v -> Map k v Source #

union :: Map k v -> Map k v -> Map k v Source #

unionsWith :: (v -> v -> v) -> [Map k v] -> Map k v Source #

unions :: [Map k v] -> Map k v Source #

delete :: k -> Map k v -> Map k v Source #

keys :: Map k v -> [k] Source #

keysSet :: Map k v -> Set k Source #

elems :: Map k v -> [v] Source #

map :: (v -> v) -> Map k v -> Map k v Source #

(Eq k, Hashable k) => Lookup (HashMap k v) k v Source # 
Instance details

Defined in CHR.Data.Lookup.Instances

Methods

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

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

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

null :: HashMap k v -> Bool Source #

size :: HashMap k v -> Int Source #

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

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

empty :: HashMap k v Source #

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

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

unionWith :: (v -> v -> v) -> HashMap k v -> HashMap k v -> HashMap k v Source #

union :: HashMap k v -> HashMap k v -> HashMap k v Source #

unionsWith :: (v -> v -> v) -> [HashMap k v] -> HashMap k v Source #

unions :: [HashMap k v] -> HashMap k v Source #

delete :: k -> HashMap k v -> HashMap k v Source #

keys :: HashMap k v -> [k] Source #

keysSet :: HashMap k v -> Set k Source #

elems :: HashMap k v -> [v] Source #

map :: (v -> v) -> HashMap k v -> HashMap k v 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 # 
Instance details

Defined in CHR.Data.Lookup.Stacked

Methods

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

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

Defined in CHR.Data.VarMp

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