> You can get efficiency, the desired data, and deal with infinite strings by 
> using a function that is like 'inits' but which returns the initial strings 
> in reversed order.
> 
>    reversed_inits = scanl (flip (:)) ""
>    find (isPrefixOf (reverse "needle")) (reversed_inits "haystack")

If I may ask for curiosity's sake, how much string data are we
talking about here?  Is it practical to process a serious volume
of data as [Char]?

        Donn Cave, [EMAIL PROTECTED]

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to