>>> "Hello" `isPrefixOf` "Hello World!" True >>> "Hello" `isPrefixOf` "Wello Horld!" FalseFor 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 *
isPrefixOf (stream t1) (stream t2) = isPrefixOf t1 t2
>>> "Hello" `isPrefixOf` "Hello World!" True
>>> "Hello" `isPrefixOf` "Wello Horld!" False
>>> Stream.isPrefixOf (Stream.fromList "hello") (Stream.fromList "hello" :: SerialT IO Char) True
>>> 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.
>>> 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.