suffixarray-0.0.2: Suffix arrays

Stabilityexperimental
MaintainerDanil de Kok <me@danieldk.eu>

Data.SuffixArray

Description

Construction of suffix arrays (arrays ordered by suffix). Given an array d elements, the suffix array is a sorted array of the sub-arrays in d. For instance, the suffix array of banana apple pear apple is:

  • apple
  • apple pear apple
  • banana apple pear apple
  • pear apple

Synopsis

Documentation

data SuffixArray a Source

Constructors

SuffixArray (Vector a) (Vector Int) 

Instances

Show a => Show (SuffixArray a) 

fromList :: Ord a => [a] -> SuffixArray aSource

fromList constructs a suffix array from a list of elements.

suffixArray :: Ord a => Vector a -> SuffixArray aSource

suffixArray is a specialization of suffixArrayBy that uses the default compare function.

suffixArrayBy :: Ord a => (Vector a -> Vector a -> Ordering) -> Vector a -> SuffixArray aSource

suffixArrayBy constructs a suffix array. The sorting order is determined by the supplied compare function.

toList :: SuffixArray a -> [[a]]Source

toList constructs a list from a suffix array.