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.
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
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")
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
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"
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."
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
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")
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
isPrefixOf :: Eq a => [a] -> NonEmpty a -> Boolbase-compat Data.List.NonEmpty.Compat The isPrefixOf function returns True if the first argument is a prefix of the second.
unsafeFixIO :: (a -> IO a) -> IO abase-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.