"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
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
| (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
"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
(+), (&&) ... 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]
"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],
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
> 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
> 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
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
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
>
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
12 matches
Mail list logo