[GHC] #14076: cons operator for list give weird output

GHC ghc-devs at haskell.org
Wed Aug 2 03:15:51 UTC 2017


#14076: cons operator for list give weird output
-------------------------------------+-------------------------------------
        Reporter:  AshHash           |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:
       Component:  GHCi              |              Version:  8.2.1
      Resolution:  invalid           |             Keywords:  cons(:)
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 goldfire):

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


Comment:

 This looks like correct behavior to me. Recall that numbers in Haskell are
 overloaded, meaning that the type of a number `1` is `Num a => a`. Your
 initial expression conses one number onto another -- thus both the element
 and the list type must be in the `Num` type class.

 Please reopen if you see a flaw here somewhere, and thanks for posting!

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


More information about the ghc-tickets mailing list