> <a href="http://cvs.haskell.org/cgi-bin" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://cvs.haskell.org/cgi-bin</a><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
/cvsweb.cgi/fptools/libraries/GLUT/examples/RedBook/
</blockquote><br>Ok, I'll take a look<br><br>> What makes a callback different from any other kind of function?<br><br>Well... what about inside monads? Does this break purity??? Does this require adding IO to the monad if the callback function does IO?
<br>
<br>As I'm writing this I kindof have this sense inside me that this is a really newbie-ish question. That the answer is no it doesnt break purity, yes it does require adding IO to the monad, but I'm asking anyway just to check :-)
<br><br><div><span class="gmail_quote">On 7/3/07, <b class="gmail_sendername">Dan Piponi</b> <<a href="mailto:dpiponi@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">dpiponi@gmail.com</a>
> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 7/2/07, Hugh Perkins <<a href="mailto:hughperkins@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">hughperkins@gmail.com</a>> wrote:<br><br>> Anyway, so the question is: how do we write callback functions in
<br>> FP/Haskell? Can someone provide a simple, but functional example?
<br><br>What makes a callback different from any other kind of function? In<br>Haskell, as in other functional programming languages, you're<br>completely free to pass functions into other functions and store them<br>
in datastructures. Take a look at the 'callbacks' used in the HOpenGL<br>examples. They're just ordinary functions:<br><a href="http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/libraries/GLUT/examples/RedBook/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/libraries/GLUT/examples/RedBook/</a><br>--<br>Dan<br>_______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Haskell-Cafe@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.haskell.org/mailman/listinfo/haskell-cafe</a>
<br></blockquote></div><br>