
#9118: Can't eta-reduce representational coercions -------------------------------------+------------------------------------ Reporter: goldfire | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: #9117 -------------------------------------+------------------------------------ Comment (by goldfire): I agree with rwbarton on this -- I think the `F1`/`F2` example doesn't really apply. But, there remains a problem case: {{{ newtype Pair a = Mk (a, a) }}} We can easily derive `Coercible (Pair Int) ((,) Int Int)`, but it would be bad to derive `Coercible Pair ((,) Int)`. The problem is that the newtype definition has a repeated variable on the right, and thus the definition cannot be eta-reduced. Probably, a sufficiently complicated Core construction can detect and avoid this case, but I don't think it would be easy. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9118#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler