[Issue 4705] Redesign of std.algorithm.max()/min() + mins()/maxs()
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Mar 25 10:38:32 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=4705
--- Comment #8 from bearophile_hugs at eml.cc 2011-03-25 10:35:06 PDT ---
A max/min with a comparing function is present in the Haskel standard library
too, named "maximumBy":
import Data.List
import Data.Ord
longestWord words = maximumBy (comparing length) words
listx = ["x", "yyy", "zz"]
main = print $ longestWord listx
Prints:
"yyy"
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list