[GHC] #13262: Allow type synonym family application in instance head if it reduces away

GHC ghc-devs at haskell.org
Sat Feb 11 00:45:39 UTC 2017


#13262: Allow type synonym family application in instance head if it reduces away
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  lowest            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |
      Resolution:                    |             Keywords:
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):

 This has been proposed before (though I can't find where), and I find the
 idea quite distasteful. Consider what this would mean at the term level:

 {{{
 f :: Bool -> Int
 f (not True) = 5
 f True       = 6
 }}}

 Parsing challenges aside, there's nothing at all wrong with the above
 declaration. But do we really want programmers to be able to do this? It's
 the same at the type level.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13262#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list