[Haskell-cafe] Please help me debug my arrow

2010-01-18 Thread Paul Johnson

Hi,

I'm trying to write an arrow for a real-time stream processor.  I'm 
basing it on the SP type in Hughes paper on Generalising Monads to 
Arrows (http://www.cs.chalmers.se/~rjmh/Papers/arrows.pdf) section 6.  
I've extended this with a notion of time by making each step a function 
of time.  But I can't get the compose operator to work.


The arrow itself is defined in http://haskell.pastebin.com/m49944f64 
with the (.) function highlighted.  Some simple tests are in 
http://haskell.pastebin.com/m6d90f27 with the problematic call highlighted.


When run it produces an infinite list of puts, which causes the 
SimulateRTSP interpreter function to diverge.  But I've run the 
expansions by hand, and they seem to work (see the test case file at the 
bottom).


I'm going nuts looking at this.  Can anyone see what I'm doing wrong?

Thanks,

Paul.


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


Re: [Haskell-cafe] Please help me debug my arrow

2010-01-20 Thread Paul Johnson

On 18/01/10 20:33, Paul Johnson wrote:


I'm going nuts looking at this.  Can anyone see what I'm doing wrong?

I found the problem eventually.  Its a scoping problem with "rt1" in the 
(.) function when composeSP gets called recursively.



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