
#15205: Unnecessary equality superclass
-------------------------------------+-------------------------------------
Reporter: simonpj | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.4.3
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
Consider
{{{
{-# LANGUAGE MultiParamTypeClasses, GADTs, TypeOperators #-}
module Foo where
class (a ~ b) => C a b where
op :: a -> a -> b
f :: C a b => a -> b
f x = op x x
}}}
If you compile this you'll end up with
{{{
f = \ (@ a_a1dk)
(@ b_a1dl)
($dC_a1dn :: C a_a1dk b_a1dl)
(eta_B1 :: a_a1dk) ->
case GHC.Types.heq_sel
@ *
@ *
@ a_a1dk
@ b_a1dl
((Foo.$p1C @ a_a1dk @ b_a1dl $dC_a1dn)
`cast` (Data.Type.Equality.N:~[0] <*>_N