On Tue, Sep 16, 2003 at 02:32:48PM -0500, Yu Di wrote: > What I am trying to do is to use Haskell to simulate some process, and > meanwhile collecting information about the data-flow throughout the whole > process into the output. The (String, a) example is just a simplified > version of that. Thanks for pointing out my mistakes, I will try to do it > as a decorated-data combinator.
This sounds a bit like the example in http://www.soi.city.ac.uk/~ross/talks/fop.4.ps.gz The idea is to define your network as a generic arrow, and instantiate it differently for different interpretations. For simulation, one can use Stream i -> Stream o, though there are other possibilities. To get a map, you use a state transformer (with the map as the state), and pass edge labels through the arrows. I think the reason you're getting in a tangle is that you're trying to do both with the same interpretation. _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell