[GHC] #9017: Confusing error message with PolyKinds
GHC
ghc-devs at haskell.org
Mon Apr 21 09:58:03 UTC 2014
#9017: Confusing error message with PolyKinds
------------------------------------+-------------------------------------
Reporter: edsko | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.2
Keywords: | Operating System: Unknown/Multiple
Architecture: Unknown/Multiple | Type of failure: None/Unknown
Difficulty: Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: |
------------------------------------+-------------------------------------
Consider the following example code:
{{{
import Control.Arrow
foo :: a b (m b)
foo = arr return
}}}
if we typecheck this we rightly get two errors about missing instances
(Arrow a, Monad m). However, if we enable `PolyKinds` we get the following
error message:
{{{
T.hs:4:7:
Kind incompatibility when matching types:
a0 :: * -> * -> *
a :: k1 -> k -> *
Expected type: a b (m b)
Actual type: a0 b0 (m0 b0)
Relevant bindings include foo :: a b (m b) (bound at T.hs:4:1)
In the expression: arr return
In an equation for ‘foo’: foo = arr return
}}}
I can ''sort of'' see where this is coming from if I think really hard :),
so perhaps it's not a bug per se, but it's definitely confusing; and it's
a pity that a type error (forgotten type qualifier) is reported as a kind
error.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9017>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list