
4 Aug
2011
4 Aug
'11
9:53 a.m.
On Thu, 04 Aug 2011 11:31:02 +0200, Luca Ciciriello
Hi All. Is there any function in Prelude that removes the repeated elements in a list?
In example I've a list like this one: xs = ["3","3","3","3","3","4","4","4","4","4","5","5","5","5","5","6","6","6","6","6","6","6"]
I need a function f such that f xs = ["3","4","5","6"]
Not in Prelude, but in Data.List: nub Prelude Data.List> nub ["3","3","3","3","3","4","4","4","4","4","5","5","5","5","5","6","6","6","6","6","6","6"] ["3","4","5","6"] Regards, Henk-Jan van Tuyl -- http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html --