search package:io-streams

Given a ByteString to look for (the "needle") and an InputStream, produces a new InputStream which yields data of type MatchInfo. Example:
ghci> fromList ["food", "oof", "oodles", "ok"] >>=
search "foo" >>= toList
[Match "foo",NoMatch "d",NoMatch "oo",Match "foo",NoMatch "dlesok"]
Uses the Boyer-Moore-Horspool algorithm (http://en.wikipedia.org/wiki/Boyer%E2%80%93Moore%E2%80%93Horspool_algorithm).