>>> "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 shortcuts when the first argument is empty:
>>> isPrefixOf [] undefined True
isPrefixOf (stream t1) (stream t2) = isPrefixOf t1 t2
>>> "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 shortcuts when the first argument is empty:
>>> isPrefixOf [] undefined True
>>> "Hello" `isPrefixOf` "Hello World!" True
>>> "Hello" `isPrefixOf` "Wello Horld!" False
>>> Stream.isPrefixOf (Stream.fromList "hello") (Stream.fromList "hello" :: SerialT IO Char) True
>>> "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 *
>>> Stream.isPrefixOf (Stream.fromList "hello") (Stream.fromList "hello" :: Stream IO Char) True