Hoogle Search
Within LTS Haskell 24.65 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
parameterized-utils Data.Parameterized.Map Applies a function to the pairwise common elements of two maps. Formally, we have that intersectWithKeyMaybe f x y contains a binding from a key k to a value v if and only if x and y bind k to x_k and y_k and f x_k y_k = Just v.
mapMaybeWithKey :: (forall (tp :: v) . () => k tp -> f tp -> Maybe (g tp)) -> MapF k f -> MapF k gparameterized-utils Data.Parameterized.Map Map keys and elements and collect Just results.
fromMaybeS :: a -> MaybeS a -> aparameterized-utils Data.Parameterized.Utils.BinTree No documentation available.
elemAtMaybe :: forall (n :: Natural) a . Int -> Vector n a -> Maybe aparameterized-utils Data.Parameterized.Vector Get the element at the given index. O(1)
insertAtMaybe :: forall a (n :: Natural) . Int -> a -> Vector n a -> Maybe (Vector n a)parameterized-utils Data.Parameterized.Vector Insert an element at the given index. Return Nothing if the element is outside the vector bounds. O(n).
-
shake Development.Shake.Rule A version of getUserRuleList that fails if there is more than one result Requires a key for better error messages.
cmdMaybe :: String -> [String] -> IO (Maybe String)simple-cmd SimpleCmd cmdMaybe c args runs a command, maybe returning output if it succeeds
checkResultMaybe :: String -> (CInt -> a) -> (CInt -> Maybe a) -> CInt -> IO aalsa-core Sound.ALSA.Exception No documentation available.
-
basic-prelude CorePrelude The catMaybes function takes a list of Maybes and returns a list of all the Just values.
Examples
Basic usage:>>> catMaybes [Just 1, Nothing, Just 3] [1,3]
When constructing a list of Maybe values, catMaybes can be used to return all of the "success" results (if the list is the result of a map, then mapMaybe would be more appropriate):>>> import GHC.Internal.Text.Read ( readMaybe ) >>> [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ] [Just 1,Nothing,Just 3] >>> catMaybes $ [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ] [1,3]
fromMaybe :: a -> Maybe a -> abasic-prelude CorePrelude The fromMaybe function takes a default value and a Maybe value. If the Maybe is Nothing, it returns the default value; otherwise, it returns the value contained in the Maybe.
Examples
Basic usage:>>> fromMaybe "" (Just "Hello, World!") "Hello, World!"
>>> fromMaybe "" Nothing ""
Read an integer from a string using readMaybe. If we fail to parse an integer, we want to return 0 by default:>>> import GHC.Internal.Text.Read ( readMaybe ) >>> fromMaybe 0 (readMaybe "5") 5 >>> fromMaybe 0 (readMaybe "") 0