fgl-5.5.0.1: Martin Erwig's Functional Graph Library

Safe HaskellSafe-Inferred

Data.Graph.Inductive.Internal.FiniteMap

Contents

Description

Simple Finite Maps. This implementation provides several useful methods that Data.FiniteMap does not.

Synopsis

Type

data FiniteMap a b Source

Constructors

Empty 
Node Int (FiniteMap a b) (a, b) (FiniteMap a b) 

Instances

Functor (FiniteMap a) 
(Eq a, Eq b) => Eq (FiniteMap a b) 
(Show a, Show b, Ord a) => Show (FiniteMap a b) 

Operations

addToFM :: Ord a => FiniteMap a b -> a -> b -> FiniteMap a bSource

delFromFM :: Ord a => FiniteMap a b -> a -> FiniteMap a bSource

updFM :: Ord a => FiniteMap a b -> a -> (b -> b) -> FiniteMap a bSource

applies function to stored entry

accumFM :: Ord a => FiniteMap a b -> a -> (b -> b -> b) -> b -> FiniteMap a bSource

defines or aggregates entries

splitFM :: Ord a => FiniteMap a b -> a -> Maybe (FiniteMap a b, (a, b))Source

combines delFrom and lookup

sizeFM :: Ord a => FiniteMap a b -> IntSource

lookupFM :: Ord a => FiniteMap a b -> a -> Maybe bSource

elemFM :: Ord a => FiniteMap a b -> a -> BoolSource

rangeFM :: Ord a => FiniteMap a b -> a -> a -> [b]Source

applies lookup to an interval

minFM :: Ord a => FiniteMap a b -> Maybe (a, b)Source

maxFM :: Ord a => FiniteMap a b -> Maybe (a, b)Source

predFM :: Ord a => FiniteMap a b -> a -> Maybe (a, b)Source

succFM :: Ord a => FiniteMap a b -> a -> Maybe (a, b)Source

splitMinFM :: Ord a => FiniteMap a b -> Maybe (FiniteMap a b, (a, b))Source

combines splitFM and minFM

fmToList :: Ord a => FiniteMap a b -> [(a, b)]Source