Hoogle Search

Within LTS Haskell 24.28 (ghc-9.10.3)

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

  1. unsafeMakeLoadArrayAdjusted :: Index ix => Comp -> Sz ix -> Maybe e -> (forall s . () => Scheduler s () -> (Ix1 -> e -> ST s ()) -> ST s ()) -> Array DL ix e

    massiv Data.Massiv.Array.Unsafe

    Same as unsafeMakeLoadArray, except will ensure that starting index is correctly adjusted. Which means the writing function gets one less argument.

  2. stepStartAdjust :: Int -> Int -> Int

    massiv Data.Massiv.Core.Index

    Helper for adjusting stride of a chunk

  3. catchJust :: Exception e => (e -> Maybe b) -> IO a -> (b -> IO a) -> IO a

    protolude Protolude

    The function catchJust is like catch, but it takes an extra argument which is an exception predicate, a function which selects which type of exceptions we're interested in.

    catchJust (\e -> if isDoesNotExistErrorType (ioeGetErrorType e) then Just () else Nothing)
    (readFile f)
    (\_ -> do hPutStrLn stderr ("No such file: " ++ show f)
    return "")
    
    Any other exceptions which are not matched by the predicate are re-raised, and may be caught by an enclosing catch, catchJust, etc.

  4. handleJust :: Exception e => (e -> Maybe b) -> (b -> IO a) -> IO a -> IO a

    protolude Protolude

    A version of catchJust with the arguments swapped around (see handle).

  5. isJust :: Maybe a -> Bool

    protolude Protolude

    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
    

  6. tryJust :: Exception e => (e -> Maybe b) -> IO a -> IO (Either b a)

    protolude Protolude

    A variant of try that takes an exception predicate to select which exceptions are caught (c.f. catchJust). If the exception does not match the predicate, it is re-thrown.

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

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

  8. unsafeFromJust :: HasCallStack => Maybe a -> a

    protolude Protolude.Unsafe

    No documentation available.

  9. assertJust :: HasCallStack => Maybe a -> IO a

    HTF Test.Framework.HUnitWrapper

    Fail if the given value is a Nothing.

  10. assertJustVerbose :: HasCallStack => String -> Maybe a -> IO a

    HTF Test.Framework.HUnitWrapper

    Fail if the given value is a Nothing, supplying an additional error message.

Page 49 of many | Previous | Next