Wired-in type class

Simon Peyton-Jones simonpj at microsoft.com
Mon Aug 19 10:30:55 CEST 2013


| Is there any reason to prefer such “slightly wrong” definitions which
| are overwritten with built-in stuff over simply putting the type
| constructors and functions into GHC.Prim?

Because we must generate executable machine instructions for mkCast, and a real info-table for the NT data constructor.  

GHC.Prim, by contrast, has no associated code whatsoever.

| > * We are only going to allow GHC-derived instances of NT.
| 
| Just to be sure: Preventing manual instances is currently not possible
| and such a feature would have to be added to GHC, right?

Well Typable is close.  We are trying to prevent user-defined instances of that.  But generally yes it's a new feature.

Simon


More information about the ghc-devs mailing list