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.

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

  2. 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")
    

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

  4. 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"
    

  5. 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."
    

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

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

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

  9. isPrefixOf :: Eq a => [a] -> NonEmpty a -> Bool

    base-compat Data.List.NonEmpty.Compat

    The isPrefixOf function returns True if the first argument is a prefix of the second.

  10. unsafeFixIO :: (a -> IO a) -> IO a

    base-compat System.IO.Unsafe.Compat

    A slightly faster version of fixIO that may not be safe to use with multiple threads. The unsafety arises when used like this:

    unsafeFixIO $ \r -> do
    forkIO (print r)
    return (...)
    
    In this case, the child thread will receive a NonTermination exception instead of waiting for the value of r to be computed.

Page 55 of many | Previous | Next