Hoogle Search

Within LTS Haskell 24.4 (ghc-9.10.2)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. dropPrefix :: Eq a => [a] -> [a] -> [a]

    extra Data.List.Extra

    Drops the given prefix from a list. It returns the original sequence if the sequence doesn't start with the given prefix.

    dropPrefix "Mr. " "Mr. Men" == "Men"
    dropPrefix "Mr. " "Dr. Men" == "Dr. Men"
    

  2. dropSuffix :: Eq a => [a] -> [a] -> [a]

    extra Data.List.Extra

    Drops the given suffix from a list. It returns the original sequence if the sequence doesn't end with the given suffix.

    dropSuffix "!" "Hello World!"  == "Hello World"
    dropSuffix "!" "Hello World!!" == "Hello World!"
    dropSuffix "!" "Hello World."  == "Hello World."
    

  3. stripInfix :: Eq a => [a] -> [a] -> Maybe ([a], [a])

    extra Data.List.Extra

    Return the the string before and after the search string, or Nothing if the search string is not present. Examples:

    stripInfix "::" "a::b::c" == Just ("a", "b::c")
    stripInfix "/" "foobar"   == Nothing
    

  4. stripInfixEnd :: Eq a => [a] -> [a] -> Maybe ([a], [a])

    extra Data.List.Extra

    Similar to stripInfix, but searches from the end of the string.

    stripInfixEnd "::" "a::b::c" == Just ("a::b", "c")
    

  5. stripSuffix :: Eq a => [a] -> [a] -> Maybe [a]

    extra Data.List.Extra

    Return the prefix of the second list if its suffix matches the entire first list. Examples:

    stripSuffix "bar" "foobar" == Just "foo"
    stripSuffix ""    "baz"    == Just "baz"
    stripSuffix "foo" "quux"   == Nothing
    

  6. dropPrefix :: Eq a => [a] -> [a] -> [a]

    extra Extra

    Drops the given prefix from a list. It returns the original sequence if the sequence doesn't start with the given prefix.

    dropPrefix "Mr. " "Mr. Men" == "Men"
    dropPrefix "Mr. " "Dr. Men" == "Dr. Men"
    

  7. dropSuffix :: Eq a => [a] -> [a] -> [a]

    extra Extra

    Drops the given suffix from a list. It returns the original sequence if the sequence doesn't end with the given suffix.

    dropSuffix "!" "Hello World!"  == "Hello World"
    dropSuffix "!" "Hello World!!" == "Hello World!"
    dropSuffix "!" "Hello World."  == "Hello World."
    

  8. stripInfix :: Eq a => [a] -> [a] -> Maybe ([a], [a])

    extra Extra

    Return the the string before and after the search string, or Nothing if the search string is not present. Examples:

    stripInfix "::" "a::b::c" == Just ("a", "b::c")
    stripInfix "/" "foobar"   == Nothing
    

  9. stripInfixEnd :: Eq a => [a] -> [a] -> Maybe ([a], [a])

    extra Extra

    Similar to stripInfix, but searches from the end of the string.

    stripInfixEnd "::" "a::b::c" == Just ("a::b", "c")
    

  10. stripSuffix :: Eq a => [a] -> [a] -> Maybe [a]

    extra Extra

    Return the prefix of the second list if its suffix matches the entire first list. Examples:

    stripSuffix "bar" "foobar" == Just "foo"
    stripSuffix ""    "baz"    == Just "baz"
    stripSuffix "foo" "quux"   == Nothing
    

Page 55 of many | Previous | Next