[Haskell-cafe] Hello and type-level SKI

Gershom B gershomb at gmail.com
Sat Sep 13 03:28:53 UTC 2014


On September 12, 2014 at 7:30:28 PM, Brandon Allbery (allbery.b at gmail.com) wrote:
> On Fri, Sep 12, 2014 at 7:25 PM, Jay Sulzberger wrote:
>  
> >
> > What have I misunderstood? And, in case GHC really does now
> > handle stuff beyond the HMD horizon, what does the New Core
> > language look like?
> >
>  
> Standard Haskell is (or was) H-M extended with typeclasses. GHC moved
> beyond that years ago; internally it's System Fw (
> http://en.wikipedia.org/wiki/System_F#System_F.CF.89), and its Core
> language reflects this.

It has now moved beyond that too and is system FC (https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/FC) which adds equality constraints and coercions.

Also note that, as I understand it, typeclass constraints are dealt with in the typechecker, before core is generated. So if you use a terrible combination of features and instances and produce something at the type level that loops, then the typechecker just doesn’t terminate (well, it actually runs out of context stack typically…). You can find more details in the commentary (https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/HscMain) which now looks way clearer than last time I checked.

-g


More information about the Haskell-Cafe mailing list