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.

  1. intersectWithKeyMaybe :: OrdF k => (forall (tp :: v) . () => k tp -> a tp -> b tp -> Maybe (c tp)) -> MapF k a -> MapF k b -> MapF k c

    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.

  2. mapMaybeWithKey :: (forall (tp :: v) . () => k tp -> f tp -> Maybe (g tp)) -> MapF k f -> MapF k g

    parameterized-utils Data.Parameterized.Map

    Map keys and elements and collect Just results.

  3. fromMaybeS :: a -> MaybeS a -> a

    parameterized-utils Data.Parameterized.Utils.BinTree

    No documentation available.

  4. elemAtMaybe :: forall (n :: Natural) a . Int -> Vector n a -> Maybe a

    parameterized-utils Data.Parameterized.Vector

    Get the element at the given index. O(1)

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

  6. getUserRuleMaybe :: (ShakeValue key, Typeable a) => key -> (a -> Maybe String) -> (a -> Maybe b) -> Action (Maybe (Int, b))

    shake Development.Shake.Rule

    A version of getUserRuleList that fails if there is more than one result Requires a key for better error messages.

  7. cmdMaybe :: String -> [String] -> IO (Maybe String)

    simple-cmd SimpleCmd

    cmdMaybe c args runs a command, maybe returning output if it succeeds

  8. checkResultMaybe :: String -> (CInt -> a) -> (CInt -> Maybe a) -> CInt -> IO a

    alsa-core Sound.ALSA.Exception

    No documentation available.

  9. catMaybes :: [Maybe a] -> [a]

    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]
    

  10. fromMaybe :: a -> Maybe a -> a

    basic-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
    

Page 187 of many | Previous | Next