Safe Haskell | None |
---|---|
Language | Haskell2010 |
Algorithms.DFA.KMP
Description
Perform KMP matching
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
use kmp to check any (isPrefixOf pattern) $ tails stream | use kmp to check any (isPrefixOf pattern) $ tails stream