isPrefixOf

The isPrefixOf function takes two lists and returns True iff the first list is a prefix of the second.
>>> "Hello" `isPrefixOf` "Hello World!"
True

>>> "Hello" `isPrefixOf` "Wello Horld!"
False
For the result to be True, the first list must be finite; False, however, results from any mismatch:
>>> [0..] `isPrefixOf` [1..]
False

>>> [0..] `isPrefixOf` [0..99]
False

>>> [0..99] `isPrefixOf` [0..]
True

>>> [0..] `isPrefixOf` [0..]
* Hangs forever *
The isPrefixOf function returns True if the first argument is a prefix of the second.
O(n) The isPrefixOf function takes two ByteStrings and returns True if the first is a prefix of the second.
O(n) The isPrefixOf function takes two ByteStrings and returns True iff the first is a prefix of the second.
O(n) The isPrefixOf function takes two ShortByteStrings and returns True
O(n) The isPrefixOf function takes two Texts and returns True if and only if the first is a prefix of the second.
O(n) The isPrefixOf function takes two Streams and returns True if and only if the first is a prefix of the second. Properties
isPrefixOf (stream t1) (stream t2) = isPrefixOf t1 t2
The isPrefixOf function takes two lists and returns True iff the first list is a prefix of the second.
>>> "Hello" `isPrefixOf` "Hello World!"
True
>>> "Hello" `isPrefixOf` "Wello Horld!"
False
O(n) The isPrefixOf function takes two Texts and returns True iff the first is a prefix of the second. Subject to fusion.
isPrefixOf takes two sequences and returns True if the first sequence is a prefix of the second.
Tests whether the first ShortText is a prefix of the second ShortText
>>> isPrefixOf "ab" "abcdef"
True
>>> isPrefixOf "ac" "abcdef"
False
isPrefixOf "" t == True
isPrefixOf t t == True
True when the first list is at the beginning of the second.
Returns True if the first stream is the same as or a prefix of the second. A stream is a prefix of itself.
>>> Stream.isPrefixOf (Stream.fromList "hello") (Stream.fromList "hello" :: SerialT IO Char)
True
Is the first argument a prefix of the second argument?
O(n) The isPrefixOf function takes two Vector and returns True iff the first is a prefix of the second.
The isPrefix function returns True if the first argument is a prefix of the second.
Check whether the first string is a prefix of the second string.
Takes two collections and returns True iff the first collection is a prefix of the second.
Takes two collections and returns True iff the first collection is a prefix of the second.
isPrefixOf pre l. Is pre a prefix of l?
>>> prove $ \(l1 :: SList Integer) l2 -> l1 `isPrefixOf` (l1 ++ l2)
Q.E.D.

>>> prove $ \(l1 :: SList Integer) l2 -> l1 `isPrefixOf` l2 .=> subList l2 0 (length l1) .== l1
Q.E.D.
isPrefixOf pre s. Is pre a prefix of s?
>>> prove $ \s1 s2 -> s1 `isPrefixOf` (s1 ++ s2)
Q.E.D.

>>> prove $ \s1 s2 -> s1 `isPrefixOf` s2 .=> subStr s2 0 (length s1) .== s1
Q.E.D.