[Haskell-beginners] FoldL/R Reducing List

Chaddaï Fouché chaddai.fouche at gmail.com
Mon Jun 22 12:27:45 EDT 2009


On Mon, Jun 22, 2009 at 2:12 PM, Waaaggh<waaaggh at gmail.com> wrote:
> i am trying to implement remowal of repetting elements from lists with fold
> eg. [1,1,1,2] -> [1,2]
> [1,1,2,2,3,1,1,1] -> [1,2,3,1]
>

It's pretty easy to do with foldr and a "variant" of cons (:), it's a
little bit more tricky to do it with proper lazyness but nothing
serious.

-- 
Jedaï


More information about the Beginners mailing list