Best recursion choice for "penultimax"

Dr Mark H Phillips mark@austrics.com.au
26 Nov 2002 16:43:19 +1030


On Tue, 2002-11-26 at 02:38, Richard Braakman wrote:
> penultimax1' :: Ord a => [a] -> a
> penultimax1' = head . tail . sortBy (flip compare) . nub

What does "nub" stand for?  (This is the first I've heard of it.)
>From the definition in List.hs it seems to remove repeats, keeping
only the first.  Is there documentation on List.hs, along the lines
of the "A Tour of the Haskell Prelude"?

Thanks,

Mark.

-- 
Dr Mark H Phillips
Research Analyst (Mathematician)

AUSTRICS - smarter scheduling solutions - www.austrics.com

Level 2, 50 Pirie Street, Adelaide SA 5000, Australia
Phone +61 8 8226 9850
Fax   +61 8 8231 4821
Email mark@austrics.com.au