Sounds like a fold to me. Try looking at the doc of either foldl/r/l' or mapAccum depending on what you want.. Then write a function for one iteration that returns the value from that iteration combined with the value from the last iteration
-- Jeff On Sun, Jun 7, 2009 at 3:44 PM, ptrash<ptr...@web.de> wrote: > > What i am exactly to do is this: > > I have a list of pupils (type Pupil = (Name, Grade)) where I store the name > of the pupil and which grade he has. No I want to get the number (and > average number) of each grade. Something like 10 Pupils have a A (23%), 2 > Pupils have a B ( 4 %) etc > -- > View this message in context: > http://www.nabble.com/Change-value-of-a-variable-tp23913404p23914558.html > Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe