[GHC] #4099: Slighlty confusing error message with data families
GHC
cvs-ghc at haskell.org
Wed May 26 22:11:52 EDT 2010
#4099: Slighlty confusing error message with data families
---------------------------------+------------------------------------------
Reporter: rl | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 6.13 | Keywords:
Os: Unknown/Multiple | Testcase:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Example code:
{{{
data family T a
foo :: T a -> a
foo (Just x) = x
}}}
Error message:
{{{
Couldn't match expected type `T a' against inferred type `Maybe a1'
NB: `T' is a type function
In the pattern: Just x
In the definition of `foo': foo (Just x) = x
}}}
Calling `T` a type function is confusing, I had to double check that I
hadn't accidentally declared it as a type family. I would
* call these things type families and data families in messages and
* omit the message for data families altogether because it doesn't
matter that `T` is one in this case.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4099>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list