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.
catchJust :: Exception e => (e -> Maybe b) -> IO a -> (b -> IO a) -> IO aghc GHC.Utils.Exception No documentation available.
handleJust :: Exception e => (e -> Maybe b) -> (b -> IO a) -> IO a -> IO aghc GHC.Utils.Exception No documentation available.
tryJust :: Exception e => (e -> Maybe b) -> IO a -> IO (Either b a)ghc GHC.Utils.Exception No documentation available.
onJust :: b -> Maybe a -> (a -> b) -> bghc GHC.Utils.Misc onJust x m f applies f to the value inside the Just or returns the default.
catchJust :: (MonadBaseControl IO m, Exception e) => (e -> Maybe b) -> m a -> (b -> m a) -> m alifted-base Control.Exception.Lifted Generalized version of catchJust. Note, when the given computation throws an exception any monadic side effects in m will be discarded.
handleJust :: (MonadBaseControl IO m, Exception e) => (e -> Maybe b) -> (b -> m a) -> m a -> m alifted-base Control.Exception.Lifted Generalized version of handleJust. Note, when the given computation throws an exception any monadic side effects in m will be discarded.
tryJust :: (MonadBaseControl IO m, Exception e) => (e -> Maybe b) -> m a -> m (Either b a)lifted-base Control.Exception.Lifted Generalized version of tryJust. Note, when the given computation throws an exception any monadic side effects in m will be discarded.
catchGErrorJust :: GErrorClass err => err -> IO a -> (GErrorMessage -> IO a) -> IO ahaskell-gi-base Data.GI.Base.GError This will catch just a specific GError exception. If you need to catch a range of related errors, catchGErrorJustDomain is probably more appropriate. Example:
do image <- catchGErrorJust PixbufErrorCorruptImage loadImage (\errorMessage -> do log errorMessage return mssingImagePlaceholder)
catchGErrorJustDomain :: GErrorClass err => IO a -> (err -> GErrorMessage -> IO a) -> IO ahaskell-gi-base Data.GI.Base.GError Catch all GErrors from a particular error domain. The handler function should just deal with one error enumeration type. If you need to catch errors from more than one error domain, use this function twice with an appropriate handler functions for each.
catchGErrorJustDomain loadImage (\err message -> case err of PixbufErrorCorruptImage -> ... PixbufErrorInsufficientMemory -> ... PixbufErrorUnknownType -> ... _ -> ...)
handleGErrorJust :: GErrorClass err => err -> (GErrorMessage -> IO a) -> IO a -> IO ahaskell-gi-base Data.GI.Base.GError A verson of handleGErrorJust with the arguments swapped around.