-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | IO with Exceptions tracked on the type-level -- -- IO with Exceptions tracked on the type-level. See README.md for -- more details. @package eio @version 0.0.0.0 -- | IO with Exceptions tracked on the type-level module EIO -- | Main type for IO that tracks exceptions on the type-level. -- Simply wraps IO and adds exceptions meta-information. newtype EIO (exceptions :: [Type]) a EIO :: IO a -> EIO (exceptions :: [Type]) a [unEIO] :: EIO (exceptions :: [Type]) a -> IO a -- | Run the the EIO main with exception tracking. -- -- Usually used in the main function like so: -- --
--   import EIO (EIO)
--   import qualified EIO
--   
--   main :: IO ()
--   main = EIO.runEIO safeMain
--   
--   safeMain :: EIO '[] ()
--   safeMain = EIO.do
--       ... your code ...
--   
runEIO :: EIO '[] () -> IO () -- | Throw exception. throw :: forall e a. Exception e => e -> EIO '[e] a -- | Catch exception and remove it from the list of handled exceptions. catch :: forall e a e1 e2. Exception e => EIO e1 a -> (e -> EIO e2 a) -> EIO (Delete e (e1 <> e2)) a -- | Wrap a value into EIO without throwing any exceptions. return :: forall a. a -> EIO '[] a -- | Bind the value inside the first action to the second one and combine -- thrown exceptions. (>>=) :: forall e1 e2 a b. EIO e1 a -> (a -> EIO e2 b) -> EIO (e1 <> e2) b -- | Run two actions sequentially and combine thrown exceptions. (>>) :: forall e1 e2 a b. EIO e1 a -> EIO e2 b -> EIO (e1 <> e2) b instance GHC.Base.Functor (EIO.EIO exceptions)