[GHC] #1134: swap minView/maxView return value
GHC
trac at galois.com
Tue Feb 6 08:34:56 EST 2007
#1134: swap minView/maxView return value
-----------------------------+----------------------------------------------
Reporter: jpbernardy | Owner: jpbernardy
Type: feature request | Status: new
Priority: normal | Milestone: 6.8
Component: libraries/base | Version: 6.6
Severity: normal | Resolution:
Keywords: collections | Difficulty: Easy (1 hr)
Testcase: | Architecture: Unknown
Os: Unknown |
-----------------------------+----------------------------------------------
Old description:
> 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)
New description:
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
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1134>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list