[GHC] #12107: Strange behavior of Foldable (,) a

GHC ghc-devs at haskell.org
Mon May 23 23:09:29 UTC 2016


#12107: Strange behavior of Foldable (,) a
-------------------------------------+-------------------------------------
           Reporter:  polarke        |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Core           |           Version:  8.0.1
  Libraries                          |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Other
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 The definion of ''Foldable (,) a'' is as follows.

 {{{#!hs
 instance Foldable ((,) a) where
     foldMap f (_, y) = f y
     foldr f z (_, y) = f y z
 }}}

 I am very confused with this definition. As a consequence, we have
 {{{#!hs
 maximum (1,0) == 0
 }}}
 I believe this is not something we want.

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


More information about the ghc-tickets mailing list