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 on the GHC (and Haskell report) side -
> > Hugs98's List.minimumBy type is the right one (and also
> > the type of the *defn* in the Lib Report.)
> 
> mimimumBy :: (a -> a -> Ordering) -> [a] -> a
> 
> seems much more useful than
> 
> mimimumBy = foldl1
> maximumBy = foldl1
> 
> Why do you say the latter is "right"?
> 
> Carl Witty
> [EMAIL PROTECTED]
> 

--KW 8-)
-- 
: Keith Wansbrough, MSc, BSc(Hons) (Auckland) -------------------:
: PhD Student, Computer Laboratory, University of Cambridge, UK. :
: Native of Antipodean Auckland, New Zealand: 174d47'E, 36d55'S. :
: http://www.cl.cam.ac.uk/users/kw217/ mailto:[EMAIL PROTECTED] :
:----------------------------------------------------------------:



Reply via email to