[GHC] #12701: Eta reduce type synonyms when possible

#12701: Eta reduce type synonyms when possible -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: feature | Status: new request | Priority: lowest | Milestone: Component: Compiler | Version: 8.1 (Type checker) | Keywords: backpack | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- If you can eta reduce a type synonym, it is always better: {{{ -- Bad type F a = Maybe a instance Functor F -- illegal, partially applied type synonym! -- Good type F = Maybe instance Functor F -- ok with type synonym instances }}} So... GHC should do this automatically for users. Ordinarily this is not terribly important (thus the priority); in the context of #12680 it is a modestly helpful affordance which allows a user to implement `data Map a` using `type Map a = HashMap a` (signature matching requires the type synonym to be nullary.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12701 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12701: Eta reduce type synonyms when possible -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: feature request | Status: new Priority: lowest | Milestone: Component: Compiler (Type | Version: 8.1 checker) | Resolution: | Keywords: backpack Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): I'm -1 on this change, as it is very easy for a user to specify that they want eta-reduction. With this change, partially applying a type synonym would sometimes work and sometimes not, in ways that are perhaps surprising to users. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12701#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12701: Eta reduce type synonyms when possible -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: feature request | Status: closed Priority: lowest | Milestone: Component: Compiler (Type | Version: 8.1 checker) | Resolution: wontfix | Keywords: backpack Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by ezyang): * status: new => closed * resolution: => wontfix -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12701#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC