[Haskell-cafe] Re: Existentially-quantified constructors: Hugs is fine, GHC is not?

Ben Rudiak-Gould Benjamin.Rudiak-Gould at cl.cam.ac.uk
Fri May 19 09:01:30 EDT 2006

Ross Paterson wrote:
> Why would a type variable be present at runtime, let alone bound to _|_?

Well, it'd be present in jhc. And you want your intermediate language to 
typecheck even if the types disappear before you get to assembly language. 
And the same issue shows up with dictionaries, e.g. in

     data MyObj = forall a. MyInterface a => MyObj a

     f x = myFunc o where MyObj o = x

In order to make this work, you have to support lifted dictionaries, which 
means a potential performance penalty on every dictionary lookup.

Hugs does accept that code, so I assume it's paying that penalty, unless 
there's some other solution to this problem that I'm missing.

-- Ben

More information about the Glasgow-haskell-users mailing list