[Haskell-cafe] Time consumption nub

Miguel Mitrofanov miguelimo38 at yandex.ru
Wed Jul 18 08:19:45 EDT 2007


AG> Wondering about time space consuming: 'nub' vs 'map
AG> head.group.sort'

Prelude> :t Data.List.nub
Data.List.nub :: (Eq a) => [a] -> [a]
Prelude> :t Data.List.sort
Data.List.sort :: (Ord a) => [a] -> [a]

nub uses less information than sort, so it MUST be slower.



More information about the Haskell-Cafe mailing list