kmp-dfa-0.1.0.1: KMP algorithm implementation, based on Deterministic Finite State Automata

Safe HaskellNone
LanguageHaskell2010

Algorithms.DFA.KMP

Description

Perform KMP matching

Synopsis

Documentation

unsafeFrom :: NonEmpty (a, Index) -> NonEmpty (Interface a) Source #

given a kmp table produce an interface errors: indexes pointing outside the length, first index not 0

table :: Eq a => NonEmpty a -> NonEmpty Index Source #

A list of lpws. This is the KMP table with indexes row shifted right by one

match Source #

Arguments

:: Eq a 
=> NonEmpty a

pattern

-> [a]

pattern

-> Bool 

use kmp to check any (isPrefixOf pattern) $ tails stream | use kmp to check any (isPrefixOf pattern) $ tails stream

(==!) Source #

Arguments

:: Eq a 
=> [a]

pattern

-> [a]

pattern

-> Bool 

error on empty patterns