yutotakano / discord-haskell-voice

A Haskell library to add voice support to discord-haskell.
https://hackage.haskell.org/package/discord-haskell-voice
MIT License
9 stars 3 forks source link

Remove ExceptT from the monad stack #18

Open yutotakano opened 1 year ago

yutotakano commented 1 year ago

Its use is very very limited in the library (maybe even none in the 2.4.0 branch), and we can do with a removal of ExceptT, relying on MonadCatch/MonadThrow in the base monad for ReaderT (DiscordHandler).

Since the type is an opaque newtype, we can do this change easily. We'll have several new return types for functions (maybe make it so you can use trying from Lens?) but 2.4.0 is a breaking change anyway so I think it's fine. If necessary I might consider pushing it forwards to 3.0.0.

The amazonka library was the inspiration, they use a newtype based only on ReaderT, although they also have a mtl-typeclass MonadAWS. I don't think we need the latter but unsure.