Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Map f
- type Name = StableName
- empty :: Map f
- singleton :: Name a -> f a -> Map f
- null :: Map f -> Bool
- size :: Map f -> Int
- member :: Name a -> Map f -> Bool
- (!) :: Map f -> Name a -> f a
- lookup :: Name a -> Map f -> Maybe (f a)
- insert :: Ref a -> f a -> Map f -> Map f
- delete :: forall f a. Name a -> Map f -> Map f
- adjust :: forall f a b. (f a -> f b) -> Name a -> Map f -> Map f
- filter :: (forall a. f a -> Bool) -> Map f -> Map f
- hmap :: forall f h a. (f a -> h a) -> Map f -> Map h
- union :: Map f -> Map f -> Map f
- difference :: Map f -> Map f -> Map f
- intersection :: Map f -> Map f -> Map f
- data Entry f = forall a. Entry (Name a) (f a)
- toList :: Map f -> [Entry f]
- fromList :: [Entry f] -> Map f
Documentation
A reference indexed map. Useful for associating info with a reference.
Note: this is generally unsound when f
is a GADT!
type Name = StableName Source #
Shorthand for stable names.
lookup :: Name a -> Map f -> Maybe (f a) Source #
Finds the value associated with the name, or Nothing
if the name has no
value associated to it.
insert :: Ref a -> f a -> Map f -> Map f Source #
Associates a reference with the specified value. If the map already contains a mapping for the reference, the old value is replaced.
delete :: forall f a. Name a -> Map f -> Map f Source #
Removes the associated value of a reference, if any is present in the map.
adjust :: forall f a b. (f a -> f b) -> Name a -> Map f -> Map f Source #
Updates the associated value of a reference, if any is present in the map.