On Thursday 12 May 2011 19:14:09, Felipe Almeida Lessa wrote:
> On Thu, May 12, 2011 at 2:04 PM, Stefan Kersten <[email protected]> wrote:
> > extractModules = sort . nub . everything (++) ([] `mkQ` f)
> >     where f (NameQ x) = [modString x]
> >           f (NameG _ _ x) = [modString x]
> >           f _ = []
> 
> 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).

> 
> Cheers, =)

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to