Hoogle Search
Within LTS Haskell 24.6 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
isPrefixOf :: ShortByteString -> ShortByteString -> Boolbytestring Data.ByteString.Short O(n) The isPrefixOf function takes two ShortByteStrings and returns True iff the first is a prefix of the second.
isSuffixOf :: ShortByteString -> ShortByteString -> Boolbytestring Data.ByteString.Short 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
stripPrefix :: ShortByteString -> ShortByteString -> Maybe ShortByteStringbytestring Data.ByteString.Short O(n) The stripPrefix function takes two ShortByteStrings and returns Just the remainder of the second iff the first is its prefix, and otherwise Nothing.
stripSuffix :: ShortByteString -> ShortByteString -> Maybe ShortByteStringbytestring Data.ByteString.Short O(n) The stripSuffix function takes two ShortByteStrings and returns Just the remainder of the second iff the first is its suffix, and otherwise Nothing.
isInfixOf :: ShortByteString -> ShortByteString -> Boolbytestring Data.ByteString.Short.Internal Check whether one string is a substring of another.
isPrefixOf :: ShortByteString -> ShortByteString -> Boolbytestring Data.ByteString.Short.Internal O(n) The isPrefixOf function takes two ShortByteStrings and returns True iff the first is a prefix of the second.
isSuffixOf :: ShortByteString -> ShortByteString -> Boolbytestring Data.ByteString.Short.Internal 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
stripPrefix :: ShortByteString -> ShortByteString -> Maybe ShortByteStringbytestring Data.ByteString.Short.Internal O(n) The stripPrefix function takes two ShortByteStrings and returns Just the remainder of the second iff the first is its prefix, and otherwise Nothing.
stripSuffix :: ShortByteString -> ShortByteString -> Maybe ShortByteStringbytestring Data.ByteString.Short.Internal O(n) The stripSuffix function takes two ShortByteStrings and returns Just the remainder of the second iff the first is its suffix, and otherwise Nothing.
commonPrefixes :: Text -> Text -> Maybe (Text, Text, Text)text Data.Text O(n) Find the longest non-empty common prefix of two strings and return it, along with the suffixes of each string at which they no longer match. If the strings do not have a common prefix or either one is empty, this function returns Nothing. Examples:
>>> commonPrefixes "foobar" "fooquux" Just ("foo","bar","quux")
>>> commonPrefixes "veeble" "fetzer" Nothing
>>> commonPrefixes "" "baz" Nothing