Ticket #1482 (closed bug: invalid)
unsafeCoerce# doesn't always fully coerce
Description
{-# OPTIONS_GHC -fglasgow-exts #-}
import GHC.Prim( unsafeCoerce# )
e1 = unsafeCoerce# (+)
e2 = unsafeCoerce# shows
e1 coerces fine, even with the Num constraint, but e2 does not. The error for e2 is
Ambiguous type variable `a' in the constraint:
`Show a' arising from use of `shows' at T.lhs:7:20-24
Probable fix: add a type signature that fixes these type variable(s)
Weirder still, ghci coerces shows fine:
*Main> :t unsafeCoerce# shows unsafeCoerce# shows :: forall b. b
Change History
Note: See
TracTickets for help on using
tickets.
