text-1.2.5.0: An efficient packed Unicode text type.
Copyright (c) 2009 2010 Bryan O'Sullivan BSD-style bos@serpentine.com experimental GHC Safe-Inferred Haskell2010

Data.Text.Internal.Lazy.Search

Description

Warning: this is an internal module, and does not have a stable API or name. Functions in this module may not check or enforce preconditions expected by public modules. Use at your own risk!

Fast substring search for lazy Text, based on work by Boyer, Moore, Horspool, Sunday, and Lundh. Adapted from the strict implementation.

Synopsis

# Documentation

Arguments

 :: Text Substring to search for (needle) -> Text Text to search in (haystack) -> [Int64]

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

This function is strict in needle, and lazy (as far as possible) in the chunks of haystack.