Plugin - Polysemy

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Eric Wolf

Hi there, is it still worthwhile to use polysemy-plugin?

TheMatten

Why it shouldn't be anymore?

Torsten Schmits

maybe because of the panics with 8.10

TheMatten

Ah, I see - I'll try to take a look at it

Georgi Lyubenov // googleson78

you should take a look at my pr! I probably messed something up

Georgi Lyubenov // googleson78

https://github.com/polysemy-research/polysemy/pull/337

Fixes #336 Ct (and friends) now comes from Constraints There was an ifdef'd part that uses a function "bool" which isn't imported when the ifdef triggers
TheMatten

That shouldn't be it (like please, please GHC, you wouldn't do this to us :sweat_smile: )

Torsten Schmits

but it's already merged

Georgi Lyubenov // googleson78

yup, and there are problems with 8.10 :sweat_smile:

Georgi Lyubenov // googleson78

that pr was so that it actually compiled in the first place

TheMatten

I mean, it shouldn't be the reason

TheMatten

You know what's interesting? Part of plugin concerned with types works in typechecker solely, but error is related to information created during core transformation that removes unused function arguments...

TheMatten

We need to try it without additional core passes added by the other part of plugin

TheMatten

(They come from GHC, so maybe it's actually their problem? :big_smile: )

Georgi Lyubenov // googleson78

btw I have a project (private, so I can't share, large, so I can't minimise) in which I often get "stuck type family bogus proof etcetc" errors

Georgi Lyubenov // googleson78

e.g. I just made a let binding in a do block, of which the body was just a single hole, and I got the same thing

Georgi Lyubenov // googleson78

same also regarding the "large so I can't minimise"? :sweat_smile:

Torsten Schmits

but like 99% in ghcide but not ghci

Georgi Lyubenov // googleson78

well.. my errors are also in hls, I haven't actually tried it in ghci..

TheMatten

Yeah, that's a separate problem - I think that error comes from plugin (have to check), so maybe we do some incorrect assumptions about the input

Torsten Schmits

no I thought that was just unavoidable. I think there is a github issue on the topic

Georgi Lyubenov // googleson78

https://github.com/polysemy-research/polysemy/issues/363

Edit: I soon found out I had a type error, but I'm guessing this bug might still be useful to know about. I was playing around with a more granular approach to #353 and all of a sudden I got: ....
Torsten Schmits

for me it often happens if I have a wrong number of arguments for an effect ctor

Georgi Lyubenov // googleson78

I guess this is a pretty small example

Georgi Lyubenov // googleson78

but it's also some interaction with how ghcide runs the compiler I guess..

TheMatten

Okay, so I've disabled core passes... and problem solved :joy:
@Sandy Maguire seems like we missed it because they were written to only run on 8.10

Torsten Schmits

lol awesome!!! :rocket:

TheMatten

(Problem solved = zoo compiles - we may need to try it in other projects)

TheMatten

But it seems like it's really some problem in GHC after all?

TheMatten

@Georgi Lyubenov // googleson78 @Love Waern (King of the Homeless) does it make sense to remove these? We weren't using them until now, and as we already know we can't get past module boundaries just by making GHC optimize more heavily

TheMatten

Just your past GHC plugins haunting you :stuck_out_tongue_wink:

TheMatten

To add some context, disabling extraPhases in https://github.com/polysemy-research/polysemy/blob/6b660eaadca54a34aba2963707175233e5a7da7f/polysemy-plugin/src/Polysemy/Plugin.hs#L97 solves https://github.com/polysemy-research/polysemy-zoo/issues/65

:gemini: higher-order, no-boilerplate monads. Contribute to polysemy-research/polysemy development by creating an account on GitHub.
Currently, the zoo won't compile with ghc 8.10.1 because of an upper bound on ghc-prim. It might be as simple as raising the bound. However, when I tried to check via an "allow-newer"...
Georgi Lyubenov // googleson78

I think it's fair to remove/disable them until someone has the time to invest in "going faster"

Georgi Lyubenov // googleson78

especially since it's not actually a regression

TheMatten

https://github.com/polysemy-research/polysemy/pull/382

Fixes polysemy-research/polysemy-zoo#65 by removing optimization phases, which weren't really used up until now and don't solve the original problem anyway. Additionally I've fixed warn...