
29 Apr
2010
29 Apr
'10
12:58 a.m.
Ben, On 29/04/2010, at 6:16 AM, Ben wrote:
[...]
newtype STAuto s a b = STAuto { unSTAuto : (a, s) -> (b, s) }
As Felipe observes in detail, this can be made to work. He uses Read and Show for serialisation, but clearly you can use whatever you like instead. I just wanted to add that one can go to town with the approach: after you understand Felipe's stuff, take a look at Caspi and Pouzet's coalgebraic streams stuff. (I'd recommend looking at both the tech report and the published paper, and there is some Haskell code too.) BTW I was referring (off-list) to the original Arrows paper by John Hughes. cheers peter -- http://peteg.org/