[Haskell-beginners] repetition

Luca Ciciriello luca_ciciriello at hotmail.com
Thu Aug 4 11:41:34 CEST 2011


Thanks.

Luca.

On Aug 4, 2011, at 11:33 AM, Thomas Davie wrote:

> 
> On 4 Aug 2011, at 10:31, Luca Ciciriello wrote:
> 
>> 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"]
>> 
>> thanks in advance for any answer.
> 
> map head . group
> 
> Bob




More information about the Beginners mailing list