dawg-0.8.2: Directed acyclic word graphs

Safe HaskellSafe
LanguageHaskell2010

Data.DAWG.Trans

Description

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

Synopsis

Documentation

class Trans t where Source #

Abstraction over transition maps from alphabet symbols to node identifiers.

Methods

empty :: t Source #

Empty transition map.

lookup :: Sym -> t -> Maybe ID Source #

Lookup sybol in the map.

index :: Sym -> t -> Maybe Int Source #

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 -> t Source #

Insert element to the transition map.

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

Construct transition map from a list.

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

Translate transition map into a list.

Instances
Trans Trans Source # 
Instance details

Defined in Data.DAWG.Trans.Map

Trans Trans Source # 
Instance details

Defined in Data.DAWG.Trans.Vector

Trans t => Trans (Hashed t) Source # 
Instance details

Defined in Data.DAWG.Trans.Hashed

Methods

empty :: Hashed t Source #

lookup :: Sym -> Hashed t -> Maybe ID Source #

index :: Sym -> Hashed t -> Maybe Int Source #

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

insert :: Sym -> ID -> Hashed t -> Hashed t Source #

fromList :: [(Sym, ID)] -> Hashed t Source #

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