dawg-0.7.1: Directed acyclic word graphs

Safe HaskellNone



A vector representation of Map.



data VMap a Source

A strictly ascending vector of distinct elements with respect to fst values.


(Eq a, Unbox a) => Eq (VMap a) 
(Eq (VMap a), Ord a, Unbox a) => Ord (VMap a) 
(Show a, Unbox a) => Show (VMap a) 
(Binary a, Unbox a) => Binary (VMap a) 

empty :: Unbox a => VMap aSource

Empty map.

lookup :: Unbox a => Int -> VMap a -> Maybe aSource

Lookup the symbol in the map.

insert :: Unbox a => Int -> a -> VMap a -> VMap aSource

Insert the symbol/value pair into the map.

findLastLE :: Unbox a => (a -> Ordering) -> VMap a -> Maybe (Int, a)Source

Given a vector sorted with respect to some underlying comparison function, find last element which is not GT with respect to the comparison function.

fromList :: Unbox a => [(Int, a)] -> VMap aSource

Smart VMap constructor which ensures that the underlying vector is strictly ascending with respect to fst values.

toList :: Unbox a => VMap a -> [(Int, a)]Source

Convert the VMap to a list of ascending symbol/value pairs.