re-xyr / cleff

Fast and concise extensible effects
https://hackage.haskell.org/package/cleff
BSD 3-Clause "New" or "Revised" License
105 stars 6 forks source link

Plugin for disambiguating effects #13

Closed arybczak closed 2 years ago

arybczak commented 2 years ago

Hey,

Do you have plans to work on this? I track a similar issue and while someone already ported polysemy-plugin, what I would like is to have a plugin with documentation for cases when effects are disambiguated and where they aren't (and the source code which reflects that).

AFAIK polysemy-plugin falls short in that regard as the source isn't very well documented and the spec is guided by a set of tests. It's better than nothing but my expectations for a type checker plugin are higher :slightly_smiling_face:

In the end, the plugin can be trivially ported between cleff and effectful (or even made configurable to work with both), so everyone benefits. Also, I can help with improving the initial implementation.

re-xyr commented 2 years ago

Thanks for reaching out! I'm open to working on the plugin, and I'll try to look into the implementation in the coming few weeks (that is, if I can understand the code; I've never used GHC API before.)

re-xyr commented 2 years ago

@arybczak I implemented a prototype today in cd08cf5; it seems that the version I came up with is actually significantly shorter than polysemy-plugin (only 250 ~200 loc). Currently it passes all polysemy-plugin tests. I also wrote some notes in the code to describe what is actually going on.

arybczak commented 2 years ago

Oh wow, that's excellent! I tentatively looked at the code and it looks very clear, thanks for the comments! I'll have a closer look in the upcoming days.

re-xyr commented 2 years ago

Closing as solved - cleff-plugin is on Hackage and Stackage now.