#2580: export Data.Map.toDescList
------------------------------+---------------------------------------------
 Reporter:  elaforge          |          Owner:  igloo           
     Type:  proposal          |         Status:  reopened        
 Priority:  normal            |      Milestone:                  
Component:  libraries/base    |        Version:  6.8.3           
 Severity:  normal            |     Resolution:                  
 Keywords:                    |     Difficulty:  Unknown         
 Testcase:                    |   Architecture:  Unknown/Multiple
       Os:  Unknown/Multiple  |  
------------------------------+---------------------------------------------
Changes (by sedillard):

  * status:  closed => reopened
  * resolution:  fixed =>

Comment:

 I've attached a patch which expands on Evan's changes and propagates them
 to `IntSet` and `IntMap`.

 Some (possibly controversial) changes of note :

  - Added `foldr` and `foldl` functions for the map types. This is
 redundant, but so is much of the interface. The argument to `foldlWithKey`
 has a strange type, `(a -> key -> value -> a)`, that does not place nice
 with `flip` and `const`. So I think its convenient to have `foldl` as
 well, and since we've got that why not throw `foldr` in too.

  - Specialized default implementations of `foldl` and `foldr` for
 `Foldable` class. This is perhaps better than exporting then from the map
 libraries. `Data.Sequence` does it this way, but the map libraries do not.
 If the API clutter is found to be unbearable then perhaps a major cleanup
 is in order, hiding all folds in the map/set modules and exporting them
 via `Foldable`.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2580#comment:6>
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