[GHC] #12782: Type inference shows (Num (a -> a), Num a)

GHC ghc-devs at haskell.org
Sat Oct 29 18:58:47 UTC 2016


#12782: Type inference shows (Num (a -> a), Num a)
-------------------------------------+-------------------------------------
        Reporter:  ciupakabra        |                Owner:
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |
      Resolution:  invalid           |             Keywords:
Operating System:  Linux             |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by nomeata):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 > Num (a -> a) is never going to be a number.

 It could be. Someone just has to give an `instance Num (a -> b)`. The
 compiler cannot assume that no such instance will ever be around.

 It seems to me that the compiler behaviour is ok and desired as is.

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


More information about the ghc-tickets mailing list