bogus proof for stuck type family - Polysemy

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

Sridhar Ratnakumar

I broke polysemy,

<no location info>: error:
    bogus proof for stuck type family
CallStack (from HasCallStack):
  error, called at src/Polysemy/Plugin/Fundep.hs:178:9 in polysemy-plugin-0.2.5.0-BT55LwSy8F0v20rojK9yr:Polysemy.Plugin.Fundep
Sridhar Ratnakumar

Refactoring some code, using dependent-sum set of libraries

Sridhar Ratnakumar

All I did was this change: https://gist.github.com/srid/2dc18afadea2cb09e8fedf202c6aba2e

GitHub Gist: instantly share code, notes, and snippets.
TheMatten

What happens when you change declaration of Tracking back to annotated one?

Sridhar Ratnakumar

It is arising right when compiling an unrelated module (not shown in the diff)

Sridhar Ratnakumar

(And that module only uses the effects polysemy TH generated, and doesn't define any effects itself)

Sridhar Ratnakumar

I wish I could share it, but it is a mix of private stuff (I literally have Haskell types for moods, feelings, private narratives).

TheMatten

Try passing corelint flag to polysemy-plugin

Sridhar Ratnakumar

as a cabal flag? i'm starting from scratch, recreating that diff piecemeal ...

Sridhar Ratnakumar

Figured out where it is coming from. I had to comment out the actual DSL use, to make compilation succeed.

Sridhar Ratnakumar

This triggers the error:

didSet (Squat :/) `mapM_` [10, 10]

And fix (to get rid of the error) is:

(didSet . (Squat :/)) `mapM_` [10, 10]
Sridhar Ratnakumar

Looks like I've identified a bug in polysemy-plugin?

Sridhar Ratnakumar

The corresponding Effect constructor is DidSet :: DSum Move Identity -> MyEffect m ()

Sridhar Ratnakumar

And Squat :/ n is just alias for Squat :=> Identity n (of type DSum Move Identity)

TheMatten

I guess that's one more reason for plugin rewrite - but honestly, eff is getting closer with required primops being submitted as GHC proposal and I wonder how much of polysemy's internals will stay relevant once it comes out...

TheMatten

Though, eff will have the same problems that we solve with it, so maybe we want to decouple it (at least fundep part)

Sandy Maguire

try turning off custom error messages and i think it will work just fine