scopedSort and kind variable left-biasing

Richard Eisenberg rae at cs.brynmawr.edu
Thu Feb 14 19:04:11 UTC 2019



> On Feb 14, 2019, at 10:34 AM, Ryan Scott <ryan.gl.scott at gmail.com> wrote:
> 
>  the answer [j,a,k,b]! Strictly speaking, this answer meets the specification of ScopedSort,

I wish to point out that the specification of ScopedSort is very tight: it says exactly what we should get, given an input. This is important, because the behavior of ScopedSort is user-visible and must be stable. Another way of saying this: if we got [j,k,a,b], that would be wrong. Arguably, GHC's behavior w.r.t. type and kind variables is wrong because of its habit of putting kind variables first.

Once we treat kind and type variables identically, I want to just rely on ScopedSort. That is, GHC should infer the order [j,a,k,b]. While I understand the aesthetic appeal of moving k before a, I think it's simpler and more uniform just to use ScopedSort. No exceptions!

Richard


More information about the ghc-devs mailing list