FoldL/R Reducing List

Hi.how can i reduce list with foldl.r ? np (1,1,1,2,3,3,4,5,5) -> (1,2,3,4,5) ??? Azz.

Am Montag 22 Juni 2009 13:10:08 schrieb Waaaggh:
Hi.how can i reduce list with foldl.r ?
np (1,1,1,2,3,3,4,5,5) -> (1,2,3,4,5) ??? Azz.
First, these are tuples, not lists. Second, what are you trying to do? Implement nub via fold(l)r? Is http://www.haskell.org/haskellwiki/Homework_help relevant to your request?

i am trying to implement remowal of repetting elements from lists with foldeg.
[1,1,1,2] -> [1,2]
[1,1,2,2,3,1,1,1] -> [1,2,3,1]
2009/6/22 Daniel Fischer
Am Montag 22 Juni 2009 13:10:08 schrieb Waaaggh:
Hi.how can i reduce list with foldl.r ?
np (1,1,1,2,3,3,4,5,5) -> (1,2,3,4,5) ??? Azz.
First, these are tuples, not lists. Second, what are you trying to do? Implement nub via fold(l)r? Is http://www.haskell.org/haskellwiki/Homework_help relevant to your request? _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

On Mon, Jun 22, 2009 at 2:12 PM, Waaaggh
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ï
participants (3)
-
Chaddaï Fouché
-
Daniel Fischer
-
Waaaggh