Re: type of minimumBy

2000-05-22 Thread Matt Harden
"S.D.Mechveliani" wrote: > I do not feel aggressive against Prelude. So you're not advocating eliminating the current min and max functions (and others), and leaving only list-based versions? > Concerningfoldl1 min, > there is a little spot that it tends to run i

type of minimumBy

2000-05-21 Thread S.D.Mechveliani
To my > When processing this tree, it would be natural to write in each node >m + b and min [m,b]. > > The former is "necessary" due to the infix-binary tradition. > The latter uses [,] because it is good to have one function min for a > list and for the two eleme

RE: Type of minimumBy

2000-05-20 Thread Simon Peyton-Jones
| (2) | On the other hand, the other "By" variants of functions that take | something constrained by `Ord', i.e. `insertBy' and `sortBy', use an | argument of type `a -> a -> Ordering'. So for consistency `minimumBy' | should do the same. This is probably a more compelling argument. My strong i

Re: type of minimumBy

2000-05-19 Thread Matt Harden
"S.D.Mechveliani" wrote: > (+), (&&) ... are different. Because they have classical tradition > to be applied as binary infix operations. > And gcd, min, max, lcm have not this "infix" tradition. Yes, but the "infix tradition" is not the only reason we have these operations. We have them bec

Re: type of minimumBy

2000-05-18 Thread S.D.Mechveliani
(+), (&&) ... are different. Because they have classical tradition to be applied as binary infix operations. And gcd, min, max, lcm have not this "infix" tradition. -- Sergey Mechveliani [EMAIL PROTECTED]

Re: type of minimumBy

2000-05-18 Thread Matt Harden
"S.D.Mechveliani" wrote: > Suggestion for standard library: > > to remove the names minimum(By), maximum(By) > and to make min(By), max(By), gcd, lcm > for the lists only. > For example, > min [x,y], min [x,y,x,u],

Re: Type of minimumBy

2000-05-18 Thread Matt Harden
Keith Wansbrough wrote: > > OTOH, if we were to redefine all the xxxBy functions that involve > > comparison, I'd vote for ((<=) :: a->a->Bool) over (compare :: > > a->a->Ordering) as the comparison function since (<=) is often easier to > > create a quick definition for. I wouldn't consider suc

Re: Type of minimumBy

2000-05-18 Thread Keith Wansbrough
> OTOH, if we were to redefine all the xxxBy functions that involve > comparison, I'd vote for ((<=) :: a->a->Bool) over (compare :: > a->a->Ordering) as the comparison function since (<=) is often easier to > create a quick definition for. I wouldn't consider such a change until > Haskell 2, tho

type of minimumBy

2000-05-17 Thread S.D.Mechveliani
> Summary: the Haskell 98 Report claims > > minimumBy :: (a -> a -> Ordering) -> [a] -> a > > but Hugs and GHC implement > > minimumBy :: (a -> a -> a) -> [a] -> a > minimumBy = foldl1 The Haskell report says first mimimumBy :: (a -> a -> Ordering) -> [a] -> a in 7.7 - w

Re: Type of minimumBy

2000-05-17 Thread Matt Harden
I agree with Fergus. minimumBy should be consistent with sortBy and insertBy, and we can't and shouldn't redefine sortBy and insertBy in terms of min. Also (minimumBy f) should not be the same function as (maximumBy f). That's confusing, to say the least. (minimumBy min) is also sounds redunda

Re: Type of minimumBy

2000-05-17 Thread Fergus Henderson
On 17-May-2000, Keith Wansbrough <[EMAIL PROTECTED]> wrote: > Moving this thread to the Haskell list... > > Summary: the Haskell 98 Report claims > > minimumBy :: (a -> a -> Ordering) -> [a] -> a > > but Hugs and GHC implement > > minimumBy :: (a -> a -> a) -> [a] -> a > minimumBy = foldl1 >

Re: Type of minimumBy

2000-05-17 Thread Keith Wansbrough
Moving this thread to the Haskell list... Summary: the Haskell 98 Report claims minimumBy :: (a -> a -> Ordering) -> [a] -> a but Hugs and GHC implement minimumBy :: (a -> a -> a) -> [a] -> a minimumBy = foldl1 Carl writes: > Sigbjorn Finne <[EMAIL PROTECTED]> writes: > > > This a doc bug o