#1952: Max and Min for Monoid
----------------------------+-----------------------------------------------
 Reporter:  conal           |          Owner:             
     Type:  proposal        |         Status:  new        
 Priority:  normal          |      Milestone:             
Component:  libraries/base  |        Version:  6.8.1      
 Severity:  normal          |     Resolution:             
 Keywords:                  |     Difficulty:  Easy (1 hr)
 Testcase:                  |   Architecture:  Unknown    
       Os:  Unknown         |  
----------------------------+-----------------------------------------------
Comment (by conal):

 Oops -- editing error.  The Min instance should use maxBound:
 {{{
 instance (Ord a, Bounded a) => Monoid (Min a) where
         mempty = Min maxBound
         Min a `mappend` Min b = Min (a `min` b)
 }}}
 Thanks, Ian.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1952#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to