Community
Modules 50

Data.Text.Internal.Search

experimental

Fast substring search for Text, based on work by Boyer, Moore, Horspool, Sunday, and Lundh.

References:

  • R. S. Boyer, J. S. Moore: A Fast String Searching Algorithm. Communications of the ACM, 20, 10, 762-772 (1977)

  • R. N. Horspool: Practical Fast Searching in Strings. Software - Practice and Experience 10, 501-506 (1980)

  • D. M. Sunday: A Very Fast Substring Search Algorithm. Communications of the ACM, 33, 8, 132-142 (1990)

indices :: Text -> Text -> [Int]

O(n+m) Find the offsets of all non-overlapping indices of needle within haystack.

In (unlikely) bad cases, this algorithm's complexity degrades towards O(n*m).

Text

Substring to search for (needle)

Text

Text to search in (haystack)

Maintainer
bos@serpentine.com
Portability
GHC
Copyright
(c) Bryan O'Sullivan 2009
License
BSD-style
Build record and source files

Community contribution. The service has not verified this documentation. The generator reported 2 diagnostics.

Target: Linux on x86-64. Some inferred types and resolved links are not available.

Generator: aihc-haddock-858b1951-web-1

Metadata snapshot: 0b0724abd14577f7a6c8172d62e3e1c0808feb114d4d379402e17f37e3c7801e

Open the dependency plan · Download the documentation model

Import a package

Enter a package name and an exact version from Hackage. The site contains imported versions only.