dawg-0.8.1: Directed acyclic word graphs

Safe HaskellSafe-Inferred

Data.DAWG.Trans

Description

The module provides an abstraction over transition maps from alphabet symbols to node identifiers.

Synopsis

Documentation

class Trans t whereSource

Abstraction over transition maps from alphabet symbols to node identifiers.

Methods

empty :: tSource

Empty transition map.

lookup :: Sym -> t -> Maybe IDSource

Lookup sybol in the map.

index :: Sym -> t -> Maybe IntSource

Find index of the symbol.

byIndex :: Int -> t -> Maybe (Sym, ID)Source

Select a (symbol, ID) pair by index of its position in the map.

insert :: Sym -> ID -> t -> tSource

Insert element to the transition map.

fromList :: [(Sym, ID)] -> tSource

Construct transition map from a list.

toList :: t -> [(Sym, ID)]Source

Translate transition map into a list.

Instances

Trans Trans 
Trans Trans 
Trans t => Trans (Hashed t)