isSuffixOf -package:mono-traversable
The
isSuffixOf function takes two lists and returns
True
iff the first list is a suffix of the second.
Examples
>>> "ld!" `isSuffixOf` "Hello World!"
True
>>> "World" `isSuffixOf` "Hello World!"
False
The second list must be finite; however the first list may be
infinite:
>>> [0..] `isSuffixOf` [0..99]
False
>>> [0..99] `isSuffixOf` [0..]
* Hangs forever *
O(n) The
isSuffixOf function takes two ByteStrings and
returns
True iff the first is a suffix of the second.
The following holds:
isSuffixOf x y == reverse x `isPrefixOf` reverse y
However, the real implementation uses memcmp to compare the end of the
string only, with no reverse required..
O(n) The
isSuffixOf function takes two ByteStrings and
returns
True iff the first is a suffix of the second.
The following holds:
isSuffixOf x y == reverse x `isPrefixOf` reverse y
O(n) The
isSuffixOf function takes two ShortByteStrings
and returns
True iff the first is a suffix of the second.
The following holds:
isSuffixOf x y == reverse x `isPrefixOf` reverse y
O(n) The
isSuffixOf function takes two
Texts and
returns
True if and only if the first is a suffix of the
second.
O(n) The
isSuffixOf function takes two ByteStrings and
returns
True iff the first is a suffix of the second.
The following holds:
isSuffixOf x y == reverse x `isPrefixOf` reverse y
However, the real implemenation uses memcmp to compare the end of the
string only, with no reverse required..
The
isSuffixOf function takes two lists and returns
True
iff the first list is a suffix of the second. The second list must be
finite.
>>> "ld!" `isSuffixOf` "Hello World!"
True
>>> "World" `isSuffixOf` "Hello World!"
False
O(n) The
isSuffixOf function takes two
Texts and
returns
True iff the first is a suffix of the second.
Tests whether the first
ShortText is a suffix of
the second
ShortText
>>> isSuffixOf "ef" "abcdef"
True
>>> isPrefixOf "df" "abcdef"
False
isSuffixOf "" t == True
isSuffixOf t t == True
Is the first argument a suffix of the second argument?
True when the first list is at the beginning of the second.
Returns
True if the first stream is a suffix of the second. A
stream is considered a suffix of itself.
>>> Stream.isSuffixOf (Stream.fromList "hello") (Stream.fromList "hello" :: SerialT IO Char)
True
Space:
O(n), buffers entire input stream and the suffix.
Pre-release
Suboptimal - Help wanted.
The
isSuffixOf function takes two lists and returns
True
iff the first list is a suffix of the second.
>>> "ld!" `isSuffixOf` "Hello World!"
True
>>> "World" `isSuffixOf` "Hello World!"
False
The second list must be finite; however the first list may be
infinite:
>>> [0..] `isSuffixOf` [0..99]
False
>>> [0..99] `isSuffixOf` [0..]
* Hangs forever *
O(n) The
isSuffixOf function takes two
Vectors
and returns
True iff the first is a suffix of the second.
The following holds:
isSuffixOf x y == reverse x `isPrefixOf` reverse y
O(n) The
isSuffixOf function takes two OsStrings and
returns
True iff the first is a suffix of the second.
The following holds:
isSuffixOf x y == reverse x `isPrefixOf` reverse y
O(n) The
isSuffixOf function takes two OsStrings and
returns
True iff the first is a suffix of the second.
The following holds:
isSuffixOf x y == reverse x `isPrefixOf` reverse y
O(n) The
isSuffixOf function takes two OsStrings and
returns
True iff the first is a suffix of the second.
The following holds:
isSuffixOf x y == reverse x `isPrefixOf` reverse y
Returns
True if the first stream is a suffix of the second. A
stream is considered a suffix of itself.
>>> Stream.isSuffixOf (Stream.fromList "hello") (Stream.fromList "hello" :: Stream IO Char)
True
Space:
O(n), buffers entire input stream and the suffix.
Pre-release
Suboptimal - Help wanted.
Check whether the first string is a suffix of the second string.
Takes two collections and returns True iff the first collection is a
suffix of the second.
Takes two collections and returns True iff the first collection is a
suffix of the second.