Henning Thielemann wrote:

On Sun, 4 Jul 2010, Michael Mossey wrote:

Henning Thielemann wrote:

On Sun, 4 Jul 2010, Michael Mossey wrote:

I can solve a simpler problem which is

computeSoundedEnd :: Item -> [Item] -> Loc
computeSoundedEnd firstNote notes = compSndEnd (pitch firstNote) notes

You will certainly not be able to make use of foldl or foldr, but you may use a manual recursion instead. Just like

computeAllEnds :: [Item] -> [Item]

What makes it harder than this is that the original document is not a single list of Item's--they are broken into measures.

That is, you want a function of type

computeAllEnds :: [Measure] -> [Measure]

?

Right, although it occurs to me that it might be superior to represent the document as [Item] and give Item a measure-number attribute. There are also other measure attributes, so in that case the doc would look like:

data Doc = Doc [MeasureInfo] [Item]

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to