:: [a] -> [a] -> Bool package:Cabal

The isInfixOf function takes two lists and returns True iff the first list is contained, wholly and intact, anywhere within the second.

Examples

>>> isInfixOf "Haskell" "I really like Haskell."
True
>>> isInfixOf "Ial" "I really like Haskell."
False
For the result to be True, the first list must be finite; for the result to be False, the second list must be finite:
>>> [20..50] `isInfixOf` [0..]
True
>>> [0..] `isInfixOf` [20..50]
False
>>> [0..] `isInfixOf` [0..]
* Hangs forever *