[Haskell-cafe] GHCi infers a type but refuses it as type signature

wren ng thornton wren at freegeek.org
Thu Jun 25 19:25:59 EDT 2009

Bulat Ziganshin wrote:
> Hello wren,
> Thursday, June 25, 2009, 6:35:36 AM, you wrote:
>> Rank2Types, RankNTypes, ExistentialQuantification, ScopedTypeVariables,
>> and GADTs are fairly benign ---though this is where you start loosing 
>> compatibility with non-GHC compilers.
> afair, except for GADTs these are supported by Hugs. actually, until a
> last few years, GHC and Hugs were pretty close on extensions list

True. I couldn't remember whether Hugs supported RankNTypes or not. In 
my mind all these extensions are of roughly the same bleeding-edge-ness, 
which is to say more than MPTCs and fundeps, but less than Template 
Haskell and type families. That's not entirely fair since GADTs are more 
bleeding-edge than Rank2Types (as witnessed by being GHC-only and still 
undecided on by the haskell' committee), and fundeps are still difficult 
to implement correctly, but all the same.

Haskell98 has a Hindley--Milner type system (more or less). My point was 
that once you start extending the type system as far as existential 
quantification, higher-order universal quantification, polymorphic 
components, existential components, GADTs, and the like then you've left 
HM so far behind that most Haskell compilers cannot keep up. UHC also 
supports Rank2Types/RankNTypes and ExistentialQuantification, though it 
doesn't support fundeps. I don't know how well nhc98, yhc, jhc, or lhc 
support options like these or what the timeline would be for offering 
such support. In short, this is where portability beyond GHC becomes spotty.

Live well,

More information about the Haskell-Cafe mailing list