Skip to content

The `solveWanteds` error message is pretty awful.

If I use UndecidableSuperClasses to make something like

class (Prop (Not p, Not (Not p) ~ p) => Prop p where
  type Not p = (c :: Type) | c -> p

then pretty much whenever I get a type error and Prop is in scope the first error I see will be a screen full of

src/Linear/Logic/Yoneda.hs:1:1: error:
    solveWanteds: too many iterations (limit = 4)
      Unsolved: WC {wc_impl =
                      Implic {
                        TcLevel = 2
                        Skolems =
                        No-eqs = True
                        Status = Solved {Dead givens = []}
                        Given =
                        Wanted = WC {}
                        Binds = EvBindsVar<a1ISp>
                        the instance declaration }
                      Implic {
                        TcLevel = 2
                        Skolems =
                        No-eqs = True
                        Status = Solved {Dead givens = []}
                        Given =
                        Wanted = WC {}
                        Binds = EvBindsVar<a1ISt>
                        the instance declaration }
                      Implic {
                        TcLevel = 2
                        Skolems =
   ...

My actual error is effectively always the next thing. However, because it's buried past this mess, I can't see it with ghcid.

This turns my workflow from one of keeping ghcid running in the background to a painful series of starts and stops and separate compiler runs.

I would love some way to push this error down the list, suppress seeing it, or to make it shorter and only show this excruciating level of detail when asked, or even to just unformat it so I can see what is coming next.

(Worse, the type that it couldn't find isn't usually even on the first screen of that error message on its own!)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information