haskell / lsp

Haskell library for the Microsoft Language Server Protocol
364 stars 90 forks source link

Add `Semigroup`/`Monoid` instances for `LspT` #408

Closed Gabriella439 closed 2 years ago

michaelpj commented 2 years ago

A short justification would be nice :)

Do people generally like these instances? I agree they're certainly lawful, but I worry about getting worse error messages because you can now <> a monadic thing when you maybe didn't mean to.

Gabriella439 commented 2 years ago

I wrote up a post to explain why I typically add these instances: https://www.haskellforall.com/2022/03/applicatives-should-usually-implement.html

michaelpj commented 2 years ago

Thanks, that was a lot more explanation than I was expecting :) LGTM

michaelpj commented 2 years ago

Needs some language pragmas too, alas.

michaelpj commented 2 years ago

Thanks!

Gabriella439 commented 2 years ago

You're welcome!