#5392: Warnings about impossible MPTCs would be nice
---------------------------------+------------------------------------------
Reporter: pumpkin | Owner:
Type: feature request | Status: new
Priority: normal | Component: Compiler
Version: 7.0.4 | Keywords:
Testcase: | Blockedby:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
In the following class declaration:
{{{
{-# LANGUAGE MultiParamTypeClasses #-}
class C a b where
f :: a -> a
}}}
it is possible to declare this class, and to make instances of it, but it
will be impossible to ever call `f`, even with `unsafeCoerce` and other
evil attempted workarounds. It seems fairly easy for GHC to spot this
situation, where a method doesn't mention all of the class arguments, and
it might save some confusion for newbies. I remember trying pretty hard
when I was first learning haskell to tell GHC which instance I wanted
there, but obviously failed quite miserably.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5392>
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