RE: [Haskell-cafe] Re: [Haskell] pros and cons of static typing andside effects ?

Technically this is trivial it seems. I think that some people consider this proposal a problem because typos (misspelled type parameters) immediately lead to the accidental exploration of a more advanced type-system feature and correspondingly more involved error messages. Of course, the type checker could perhaps consider adding "Did you really mean to ...?". Ralf
I once read a paper about type classes and existentials (can't remember exact title or author, was it Läufer?) where the proposal was to make existential quantification implicit (just as the universal one is in Haskell98). That is, any type variable that appears on the rhs of a data type, but not on the lhs, is implicitly existentially quantified, as in
data XWrap = Show a => XWrap a
I always thought this was a pretty nice idea.

Ralf,
Technically this is trivial it seems. I think that some people consider this proposal a problem because typos (misspelled type parameters) immediately lead to the accidental exploration of a more advanced type-system feature and correspondingly more involved error messages. Of course, the type checker could perhaps consider adding "Did you really mean to ...?".
Well, okay, but as soon as the type checker starts to asking these questions, I would immediately start adding the explicit quantifiers, just to get rid of those annoying warning messages. ;) So one would we also need to be able to control the behaviour of the type checker with respect to these warnings by means of a compiler flag like "fno-warn-on-implicit-existential-quantification". All of this is, of course, still trivial. :) Have we thought about it enough to make it a feature request? Regards, Stefan
participants (2)
-
Ralf Lammel
-
Stefan Holdermans