Hoogle Search

Within LTS Haskell 24.38 (ghc-9.10.3)

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

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

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

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

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

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

    errors Control.Error

    No documentation available.

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

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

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

    errors Control.Error

    No documentation available.

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

  10. isJustT :: Monad m => MaybeT m a -> m Bool

    errors Control.Error.Util

    Analogous to isJust, but for MaybeT

Page 41 of many | Previous | Next