Open chshersh opened 3 years ago
Does it make sense to use this package https://github.com/isovector/type-sets/ ?
It's probably possible. But I'm afraid that the ergonomics will suffer. As far as I can tell from the library, the type-level set of exceptions needs to be constructed like this:
type Exceptions1 = Insert MyErr1 (Insert MyErr2 'Empty))
foo :: EIO Exceptions1 ()
While I was thinking more in the following design space:
foo :: EIO '[ MyErr1, MyErr2 ] ()
where the source plugin automatically creates sets for lists in the EIO
type. So it will look more readable 🙂
Currently we just append lists. This can probably not be optimal for longer lists of exceptions. We need to do something more efficient. Probably even use some GHC source plugin for type-level sets.
Using type-level sets has the following advantages: