dawg-0.6.0: Directed acyclic word graphs

Safe HaskellNone

Data.DAWG.VMap

Description

A vector representation of Map.

Synopsis

Documentation

data VMap Source

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

Instances

empty :: VMapSource

Empty map.

lookup :: Int -> VMap -> Maybe IntSource

Lookup the character in the map.

insert :: Int -> Int -> VMap -> VMapSource

Insert the character/value pair into the map. TODO: Optimize! Use the invariant, that VMap is kept in an ascending vector.

fromList :: [(Int, Int)] -> VMapSource

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

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

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