Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#1134 closed proposal (fixed)

swap minView/maxView return value

Reported by: jpbernardy Owned by: jpbernardy
Priority: normal Milestone: 6.8.1
Component: libraries/base Version: 6.6
Keywords: collections Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Easy (less than 1 hour)
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by jpbernardy)

Some time ago (before ghc 6.6 / base 2.0 release), I introduced minView and maxView in Data.Set and Data.Map (at a user's request). I agreed with Robert Dockins to implement the same functionality as in his version of the Edison library. Unfortunately, I uselessly swapped the return values of minView and maxView, introducing a difference both with the corresponding functions in the edison library and similar functions in Data.Map/Set?.

I propose to restore the symmetry, at the cost of incompatibility.

New proposed types:

Data.Set:

minView,maxView:: Monad m => Set a -> m (a, Set a)

Data.Map:

minViewWithKey,maxViewWithKey :: Monad m => Map k a -> m ((k,a), Map k a)

minView,maxView :: Monad m => Map k a -> m (a, Map k a)

The incompatibility is probably acceptable because the functions are still short-lived.

relevant urls:
http://www.eecs.tufts.edu/~rdocki01/docs/edison/Data-Edison-Coll.html#v%3AminView
http://www.eecs.tufts.edu/~rdocki01/docs/edison/Data-Edison-Assoc.html#v%3AminView
http://hackage.haskell.org/darcsweb/darcsweb.cgi?r=base;a=commit;h=20060616180121-9c550-c9530b7eab87ea834f826a7d5c531a5bbed22306.gz

Attachments (1)

views.patch (47.4 KB) - added by jpbernardy 7 years ago.
darcs patch implementing the proposal

Download all attachments as: .zip

Change History (10)

comment:1 Changed 7 years ago by jpbernardy

  • Description modified (diff)

comment:2 Changed 7 years ago by jpbernardy

  • Description modified (diff)

comment:3 Changed 7 years ago by jpbernardy

  • Milestone changed from 6.8 to 6.6.1
  • Type changed from feature request to bug

comment:4 Changed 7 years ago by igloo

  • Milestone changed from 6.6.1 to 6.8
  • Type changed from bug to proposal

Unfortunately fixing this for 6.6.1 would mean changing the interface, which we don't allow within a stable branch.

Changed 7 years ago by jpbernardy

darcs patch implementing the proposal

comment:5 Changed 7 years ago by jpbernardy

  • Resolution set to fixed
  • Status changed from new to closed

comment:6 Changed 6 years ago by igloo

  • Milestone changed from 6.8 branch to 6.8.1

comment:7 Changed 6 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:8 Changed 6 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple

comment:9 Changed 4 years ago by simonmar

  • Difficulty changed from Easy (1 hr) to Easy (less than 1 hour)
Note: See TracTickets for help on using tickets.