
Hi everybody, I'm pretty new to the Reactive library, but I see it very useful; currently trying to get to work simple clock examples from http://netsuperbrain.com/blog, but can't find any simple examples of the full reactive control flow :( serfing this mail list gives little help too (or maybe I just can't search well). I mean, can somebody give a code snippet with the event (atTime 5 would be enough), the sink (simple IO, or the sound bell call, or anything observable at all) - I hope I understand the sink as an event handler correctly - and a main function call that fires the event. Just need a full example with an observable effect to start with Sorry for a bit silly question, but anyway I think that a full example of that kind would be a good start point for beginners. Thank you Regards, Paul Sujkov

On 14 Dec 2008, at 04:53, Paul Sujkov wrote:
Hi everybody,
I'm pretty new to the Reactive library, but I see it very useful; currently trying to get to work simple clock examples from http://netsuperbrain.com/blog , but can't find any simple examples of the full reactive control flow :( serfing this mail list gives little help too (or maybe I just can't search well). I mean, can somebody give a code snippet with the event (atTime 5 would be enough), the sink (simple IO, or the sound bell call, or anything observable at all) - I hope I understand the sink as an event handler correctly - and a main function call that fires the event. Just need a full example with an observable effect to start with
Sorry for a bit silly question, but anyway I think that a full example of that kind would be a good start point for beginners. Thank you
In theory, you shouldn't need to write your own sink. If you use one of the legacy adapters (reactive-glut, or reactive-fieldtrip) at the moment, then it will do all of the event input for you. The tetris program linked earlier on the mailing list uses reactie-fieldtrip, and should give you a good idea of how to go about it. Bob

Thanks for asking Paul. The final blog in the tutorial series, which isn't
finished yet, is going to be on adapting the reactive code to the IO Monad.
I've attached a simple BellMachine adapter (note that this doesn't work on
windows due to a ghc bug) that you can play around with. Also note that
errors in reactive prevent the more complex examples from working properly.
Maybe you'd be interested in helping us out fixing them?
Have a good one,
David
2008/12/13 Paul Sujkov
Hi everybody,
I'm pretty new to the Reactive library, but I see it very useful; currently trying to get to work simple clock examples from http://netsuperbrain.com/blog, but can't find any simple examples of the full reactive control flow :( serfing this mail list gives little help too (or maybe I just can't search well). I mean, can somebody give a code snippet with the event (atTime 5 would be enough), the sink (simple IO, or the sound bell call, or anything observable at all) - I hope I understand the sink as an event handler correctly - and a main function call that fires the event. Just need a full example with an observable effect to start with
Sorry for a bit silly question, but anyway I think that a full example of that kind would be a good start point for beginners. Thank you
Regards, Paul Sujkov
-- David Sankel
participants (3)
-
David Sankel
-
Paul Sujkov
-
Thomas Davie