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.

  1. 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"           == Nothing
    

  2. isInfixOf :: Text -> Text -> Bool

    rio 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).

  3. isPrefixOf :: Text -> Text -> Bool

    rio 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.

  4. isSuffixOf :: Text -> Text -> Bool

    rio 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.

  5. stripPrefix :: Text -> Text -> Maybe Text

    rio 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 _                                 = -1
    

  6. stripSuffix :: Text -> Text -> Maybe Text

    rio 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
    

  7. data Mixin

    shakespeare Text.Cassius

    No documentation available.

  8. data PixelSize

    shakespeare Text.Cassius

    No documentation available.

  9. PixelSize :: Rational -> PixelSize

    shakespeare Text.Cassius

    No documentation available.

  10. cassiusMixin :: QuasiQuoter

    shakespeare Text.Cassius

    Create a mixin with Cassius syntax. Since 2.0.3

Page 135 of many | Previous | Next