<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> I don&#39;t understand how this turned into an argument about simplicity. I never said it was complex.</blockquote>
<div><br></div><div>i wasn&#39;t arguing, just confused about what you were asking cuz i didn&#39;t see what wasn&#39;t straightforward.  so i addressed the straightforward interpretation in order to ask what that was missing.  :)  looks like polyphony is the issue, so i think you need a directed acyclic graph (DAG).</div>
<div><br></div><div><a href="http://hackage.haskell.org/packages/archive/containers/0.3.0.0/doc/html/Data-Graph.html">http://hackage.haskell.org/packages/archive/containers/0.3.0.0/doc/html/Data-Graph.html</a></div><div><br>
</div><div>since every note has at most one pre-Tie and one post-Tie, i guess you don&#39;t need a general DAG -- but a graph library would have the algorithms for walking the Ties (ie, <font class="Apple-style-span" face="&#39;courier new&#39;, monospace">dfs, components, reachable, </font>etc. in the mentioned library).</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">I conceive of this problem as multiple passes. On the first pass, I translate XML notes into a convenient internal representation, on the second pass sort them, then make a pass to figure out ties. Whether this is the best approach, I do not know.</div>
</blockquote><div><br></div><div>sure that makes sense, i was just addressing the last pass, the matter of wiring up the tie references.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Regarding my use of Rational, it&#39;s because I&#39;m representing *notated* durations or positions in time, which are always fractions of integers. Suppose I give the command to my program to play via midi everything from bar 1 beat 1 to bar 2 beat 2 1/2. I want to use Rational so I know 2 1/2 means 2 1/2 and not 2.49999999999. </blockquote>
<div><br></div><div>i wasn&#39;t suggesting anything Numeric for durations -- those are NoteDurs like (Dotted $ Triplet Half).  you don&#39;t need numerics until resolving temporal locations, like milliseconds or subdivisions of a beat.  those may be irrational numbers (consider if the tempo is irrational, or tiny random jitter in timing) -- though it&#39;s a totally pedantic point on my part and realistically won&#39;t matter.  ;)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I don&#39;t quite get this:<div class="im"><br>
&gt; forall x. (Real x, Fractional x) =&gt; x if you&#39;re picky.<br></div></blockquote><div> </div><div>just being agnostic about the true representation as long as you have <font class="Apple-style-span" face="&#39;courier new&#39;, monospace">(/),</font> <font class="Apple-style-span" face="&#39;courier new&#39;, monospace">compare, realToFrac, toRational</font>.  the client can choose some concrete representation like Rationals, Floats, Doubles, some Fixed resolution, some C type, something they make up, etc.  space or speed or compatibility may trump precision for some applications.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
(*) I may want to use the location of a note (bar and beat) as the key in a Map, which I believe should be done with Rational and not Float.</blockquote><div><br></div><div>location needs subdiv, which is (very pedantically) not Rational.  :)</div>
<div><br></div><div>-e</div></div>