Hoogle Search
Within LTS Haskell 24.58 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
commonPrefixes :: Text -> Text -> Maybe (Text, Text, Text)rio RIO.Text.Lazy 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" == NothingisInfixOf :: Text -> Text -> Boolrio RIO.Text.Lazy O(n+m) The isInfixOf function takes two Texts and returns True if and only if the first is contained, wholly and intact, anywhere within the second. This function is strict in its first argument, and lazy in its second. In (unlikely) bad cases, this function's time complexity degrades towards O(n*m).
isPrefixOf :: Text -> Text -> Boolrio RIO.Text.Lazy O(n) The isPrefixOf function takes two Texts and returns True if and only if the first is a prefix of the second.
isSuffixOf :: Text -> Text -> Boolrio RIO.Text.Lazy O(n) The isSuffixOf function takes two Texts and returns True if and only if the first is a suffix of the second.
stripPrefix :: Text -> Text -> Maybe Textrio RIO.Text.Lazy O(n) Return the suffix of the second string if its prefix matches the entire first string. Examples:
stripPrefix "foo" "foobar" == Just "bar" stripPrefix "" "baz" == Just "baz" stripPrefix "foo" "quux" == Nothing
This is particularly useful with the ViewPatterns extension to GHC, as follows:{-# LANGUAGE ViewPatterns #-} import Data.Text.Lazy as T fnordLength :: Text -> Int fnordLength (stripPrefix "fnord" -> Just suf) = T.length suf fnordLength _ = -1stripSuffix :: Text -> Text -> Maybe Textrio RIO.Text.Lazy O(n) Return the prefix of the second string if its suffix matches the entire first string. Examples:
stripSuffix "bar" "foobar" == Just "foo" stripSuffix "" "baz" == Just "baz" stripSuffix "foo" "quux" == Nothing
This is particularly useful with the ViewPatterns extension to GHC, as follows:{-# LANGUAGE ViewPatterns #-} import Data.Text.Lazy as T quuxLength :: Text -> Int quuxLength (stripSuffix "quux" -> Just pre) = T.length pre quuxLength _ = -1-
shakespeare Text.Cassius No documentation available.
-
shakespeare Text.Cassius No documentation available.
PixelSize :: Rational -> PixelSizeshakespeare Text.Cassius No documentation available.
-
shakespeare Text.Cassius Create a mixin with Cassius syntax. Since 2.0.3