Copyright | (c) 2021 Kowainik |
---|---|
License | MPL-2.0 |
Maintainer | Kowainik <xrom.xkov@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
EIO
Description
IO with Exceptions tracked on the type-level
Synopsis
- newtype EIO (exceptions :: [Type]) a = EIO {}
- runEIO :: EIO '[] () -> IO ()
- throw :: forall e a. Exception e => e -> EIO '[e] a
- catch :: forall e a e1 e2. Exception e => EIO e1 a -> (e -> EIO e2 a) -> EIO (Delete e (e1 <> e2)) a
- return :: forall a. a -> EIO '[] a
- (>>=) :: forall e1 e2 a b. EIO e1 a -> (a -> EIO e2 b) -> EIO (e1 <> e2) b
- (>>) :: forall e1 e2 a b. EIO e1 a -> EIO e2 b -> EIO (e1 <> e2) b
Main type
Basic API
catch :: forall e a e1 e2. Exception e => EIO e1 a -> (e -> EIO e2 a) -> EIO (Delete e (e1 <> e2)) a Source #
Catch exception and remove it from the list of handled exceptions.
Since: 0.0.0.0
QualifieDo interface
return :: forall a. a -> EIO '[] a Source #
Wrap a value into EIO
without throwing any exceptions.
Since: 0.0.0.0