hackage-security-0.6.0.0: Hackage security library

Safe HaskellNone
LanguageHaskell2010

Hackage.Security.Util.Checked

Contents

Description

Checked exceptions

Synopsis

Documentation

class Throws e Source #

Checked exceptions

unthrow :: forall a e proxy. proxy e -> (Throws e => a) -> a Source #

Base exceptions

throwChecked :: (Exception e, Throws e) => e -> IO a Source #

Throw a checked exception

catchChecked :: forall a e. Exception e => (Throws e => IO a) -> (e -> IO a) -> IO a Source #

Catch a checked exception

handleChecked :: Exception e => (e -> IO a) -> (Throws e => IO a) -> IO a Source #

catchChecked with the arguments reversed

tryChecked :: Exception e => (Throws e => IO a) -> IO (Either e a) Source #

Like try, but for checked exceptions

checkIO :: Throws IOException => IO a -> IO a Source #

Rethrow IO exceptions as checked exceptions

throwUnchecked :: Exception e => e -> IO a Source #

Throw an unchecked exception

This is just an alias for throw, but makes it evident that this is a very intentional use of an unchecked exception.

internalError :: String -> IO a Source #

Variation on throwUnchecked for internal errors