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.
isSuffixOf :: Text -> Text -> Booltext Data.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 Texttext Data.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 _ = -1
stripSuffix :: Text -> Text -> Maybe Texttext Data.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
-
text Data.Text.Lazy.Builder.RealFloat Standard decimal notation.
-
containers Data.IntMap.Internal No documentation available.
-
containers Data.IntSet.Internal No documentation available.
-
containers Data.IntSet.Internal No documentation available.
-
containers Data.IntSet.Internal No documentation available.
-
QuickCheck Test.QuickCheck Fixed x: as x, but will not be shrunk.
-
QuickCheck Test.QuickCheck No documentation available.