Hoogle Search

Within LTS Haskell 24.20 (ghc-9.10.3)

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

  1. adjustWithKey :: Ord k => (k -> a -> a) -> k -> Map k a -> Map k a

    rio RIO.Map

    Adjust a value at a specific key. When the key is not a member of the map, the original map is returned.

    let f key x = (show key) ++ ":new " ++ x
    adjustWithKey f 5 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "5:new a")]
    adjustWithKey f 7 (fromList [(5,"a"), (3,"b")]) == fromList [(3, "b"), (5, "a")]
    adjustWithKey f 7 empty                         == empty
    

  2. fromJust :: HasCallStack => Maybe a -> a

    rio RIO.Partial

    The fromJust function extracts the element out of a Just and throws an error if its argument is Nothing.

    Examples

    Basic usage:
    >>> fromJust (Just 1)
    1
    
    >>> 2 * (fromJust (Just 10))
    20
    
    >>> 2 * (fromJust Nothing)
    *** Exception: Maybe.fromJust: Nothing
    ...
    
    WARNING: This function is partial. You can use case-matching instead.

  3. isJust :: Maybe a -> Bool

    rio RIO.Prelude

    The isJust function returns True iff its argument is of the form Just _.

    Examples

    Basic usage:
    >>> isJust (Just 3)
    True
    
    >>> isJust (Just ())
    True
    
    >>> isJust Nothing
    False
    
    Only the outer constructor is taken into consideration:
    >>> isJust (Just Nothing)
    True
    

  4. adjust :: (a -> a) -> Int -> Seq a -> Seq a

    rio RIO.Seq

    Update the element at the specified position. If the position is out of range, the original sequence is returned. adjust can lead to poor performance and even memory leaks, because it does not force the new value before installing it in the sequence. adjust' should usually be preferred.

  5. adjust' :: (a -> a) -> Int -> Seq a -> Seq a

    rio RIO.Seq

    Update the element at the specified position. If the position is out of range, the original sequence is returned. The new value is forced before it is installed in the sequence.

    adjust' f i xs =
    case xs !? i of
    Nothing -> xs
    Just x -> let !x' = f x
    in update i x' xs
    

  6. findJustDef :: a -> (a -> Bool) -> [a] -> a

    errors Control.Error

    No documentation available.

  7. fromJustDef :: a -> Maybe a -> a

    errors Control.Error

    An alternative name for fromMaybe, to fit the naming scheme of this package. Generally using fromMaybe directly would be considered better style.

  8. isJust :: Maybe a -> Bool

    errors Control.Error

    The isJust function returns True iff its argument is of the form Just _.

    Examples

    Basic usage:
    >>> isJust (Just 3)
    True
    
    >>> isJust (Just ())
    True
    
    >>> isJust Nothing
    False
    
    Only the outer constructor is taken into consideration:
    >>> isJust (Just Nothing)
    True
    

  9. lookupJustDef :: Eq a => b -> a -> [(a, b)] -> b

    errors Control.Error

    No documentation available.

  10. tryJust :: forall (m :: Type -> Type) e a . Monad m => e -> Maybe a -> ExceptT e m a

    errors Control.Error.Safe

    A fromJust that fails in the ExceptT monad

Page 41 of many | Previous | Next