[Haskell-beginners] Critique my Code!

blackcat at pro-ns.net blackcat at pro-ns.net
Fri Apr 1 17:16:44 CEST 2011


 Thanks for the comments, Christian.

 Looking at the structure of the code overall, I should just be using a 
 set for the set of factors, not a list.  That's the fundamental problem 
 there.  I'm just so focused on list processing in Haskell that I didn't 
 take the time to examine if it was appropriate here.

> b) "sort $ nub" (even twice)
>
> first sort and then removing duplicates can be more efficient, I
> would suggest: "Data.Set.toList . Data.Set.fromList"
>





More information about the Beginners mailing list