#2605: Possible error message improvement when -XRankNTypes is missing
--------------------------------+-------------------------------------------
Reporter: kaol | Owner:
Type: feature request | Status: new
Priority: normal | Component: Compiler
Version: 6.8.2 | Severity: trivial
Keywords: | Testcase:
Architecture: Unknown | Os: Unknown
--------------------------------+-------------------------------------------
I'm forwarding wishlist bug [http://bugs.debian.org/499217 #499217] from
Debian's BTS.
----
If I ask ghc to interpret a higher-rank function type, I get this
error:
{{{
Prelude> :t undefined :: ((forall a . a -> a) -> a -> a)
<interactive>:1:24:
Illegal operator `.' in type `forall a . (a -> a)'
(Use -XTypeOperators to allow operators in types)
}}}
If I turn on -XExistentialQuantification, I get this one instead:
{{{
Prelude> :t undefined :: ((forall a . a -> a) -> a -> a)
<interactive>:1:0:
Illegal polymorphic or qualified type: forall a. a -> a
In an expression type signature:
(forall a. a -> a) -> a -> a
}}}
It might not be possible in the first case (where forall isn't a
keyword), but in the second case it would be nice if ghc could detect
my attempt to enter a higher-rank type and suggest the appropriate
extension. (-XRankNTypes)
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2605>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs