Hi Stephen,

It actually sounds like your representation has structure, but you
dislike structure because it's hard to work with. The solution is a
generics library, and I recommend Uniplate:
http://community.haskell.org/~ndm/uniplate

Imagine you have a ridiculously complex AST, with beam groups under
tuplets etc, and you want to delete the first item from every beam
group:

transform f
  where f (Beam (x:xs)) = Beam xs
           f x = x

Uniplate moves through tuplets and any other hierarchical syntax, so
you just specify the transformation. My guess is if you throw away the
structure then you'll need it back for some operations.

Thanks, Neil

2010/3/22 Stephen Tetley <stephen.tet...@gmail.com>:
> Hi Malcolm
>
> Thanks - particularly I don't want to go to an AST because its I'm
> finding it too convoluted 'shape wise' - processing beam groups inside
> tuplets etc. is a nightmare - music representations have had at least
> eight centuries of ad hoc extension.
>
> I know Norman Ramsey and colleagues papers on low-level
> representations - I'll give them a re-reading.
>
> Thanks again
>
> Stephen
> _______________________________________________
> 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

Reply via email to