More specific module names for varying exception flavors
parsonsmatt opened this issue · 0 comments
parsonsmatt commented
The design of this module for import/export is unfortunate. We define a term new
, which is clearly meant to be imported qualified, but then we also have functions catch
throw
etc that are meant to be imported unqualified and act as drop-in replacements for other exception modules.
Worse, we have Control.Exception.Annotated
which wraps Control.Exception.Safe
, but then we have Control.Exception.Annotated.UnliftIO
which wraps UnliftIO.Exception
. If we're going to have module name suffixes that indicate the exception behavior you're getting, then we should follow that convention more carefully.
Probably we should do something like:
module Data.AnnotatedException where ...
data AnnotatedException e
makeAnnotatedHandlers :: Handler a -> [Handler a]
module Control.Exception.Annotated where
import Control.Exception
module Control.Exception.Annotated.Safe where
import Control.Exception.Safe
module Control.Exception.Annotated.UnliftIO where
import UnliftIO.Exception