On Thu, 2011-05-12 at 19:31 +0200, Daniel Fischer wrote: > > Minor nitpick: instead of doing 'sort . nub', please use 'import > > qualified Data.Set as S' and do 'S.toAscList . S.fromList'. This > > should be a lot faster. > > Or `map head . group . sort', which may be faster than building an > intermediate Set (haven't benchmarked, may be faster, slower or mkae no > difference).
if the input list has _many_ duplicates, wouldn't using 'map head . group . sort' require more memory than going the 'toAscList . fromList' way? _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe