@@ -18,6 +18,7 @@
19module Effectful.Error
19module Effectful.Error
21 , runError
22 , runError
22 , throwError
23 , throwError
23 , catchError
24 , catchError
@@ -28,6 +29,7 @@ module Effectful.Error
30import Control.Exception
31import Control.Exception
31import Data.Typeable
33import Data.Typeable
32import Data.Unique
34import Data.Unique
33import GHC.Stack
35import GHC.Stack
@@ -44,6 +46,11 @@ import Effectful.Internal.Monad
44data Error e :: Effect where
46data Error e :: Effect where
45 Error :: Unique -> Error e m r
47 Error :: Unique -> Error e m r
49+-- | Helper for multiple 'Error' effects.
50+type family Errors (errs :: [Type]) (es :: [Effect]) :: Constraint where
52+ Errors (err : errs) es = (Error err :> es, Errors errs es)
47-- | TODO: write about possibility of an error escaping the scope of 'runError'
54-- | TODO: write about possibility of an error escaping the scope of 'runError'
48-- when misused with 'AsyncE'.
55-- when misused with 'AsyncE'.