neovimhaskell / nvim-hs

Neovim API for Haskell plugins as well as the plugin provider
Other
267 stars 18 forks source link

Question: Why was the `MonadCatch` instance removed? #64

Closed Hogeyama closed 6 years ago

Hogeyama commented 6 years ago

Hi, thank you for awesome package! In this line of this commit, MonadCatch and MonadMask instances of Neovim are removed. What is the purpose of this?

saep commented 6 years ago

I'm glad that someone likes and uses this package! :-)

After reading some blog posts about the difficulty of exception handling and alike, I thought it would be a good idea to simplify things and use a library that does the heavy lifting. The obvious candidate for me was the unliftio package. The package description explains the rationales and tradeoffs of the approach and I encourage you to read it if you're interested in the details.

If you have problems with a piece of code you wrote, I'm happy to help you out.

As there have been no new features compared to the previous version (0.2.5), there is no rush to change your code to use the new version. The exception handling has been improved though, which I find a bit funny considering the nature of this ticket. :-)

Hogeyama commented 6 years ago

Oh, so I should just import UnliftIO.Exception instead of Control.Exception(.Safe). The unliftio package seems interesting. I'll read it. Thank you!