Re: [Haskell-cafe] Decorating a list of strings

2006-11-03 Thread Chris Kuklewicz
Steve Schafer wrote: > I have a list of text strings: > > ["Alice", "Bob", "Cindy", "Bob", "Bob", "Dave", "Cindy"] > > As you can see, some of the strings occur only once; others appear two > or more times. > > I would like to end up with a new list, according to the following > rules: > > 1)

Re: [Haskell-cafe] Decorating a list of strings

2006-11-02 Thread Steve Schafer
On Thu, 02 Nov 2006 12:20:55 -0800, you wrote: >It seems you only need a table of counts of the number of times >the string has occurred previously, which you can have available >on the first pass. > >e.g, >import Data.List >import Data.Map as Map >mark strings = snd $ mapAccumL >(\counts str -> >

Re: [Haskell-cafe] Decorating a list of strings

2006-11-02 Thread Brandon Moore
Steve Schafer wrote: I have a list of text strings: ["Alice", "Bob", "Cindy", "Bob", "Bob", "Dave", "Cindy"] As you can see, some of the strings occur only once; others appear two or more times. I would like to end up with a new list, according to the following rules: 1) If a string occurs o

[Haskell-cafe] Decorating a list of strings

2006-11-02 Thread Steve Schafer
I have a list of text strings: ["Alice", "Bob", "Cindy", "Bob", "Bob", "Dave", "Cindy"] As you can see, some of the strings occur only once; others appear two or more times. I would like to end up with a new list, according to the following rules: 1) If a string occurs only once in the origina