This sounds something like using a continuation function.<br><br>In imperative languages, we might have something like:<br><br>class MyDisplayForm<br>{<br>&nbsp;&nbsp; void ButtonGo_Press()<br>&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Processor.Go( new CallbackDelegate( 
this.SetStatus ) );<br>&nbsp;&nbsp; }<br><br>&nbsp;&nbsp; public void SetStatus( string message )<br>&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StatusLbl.Text = message;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Application.DoEvents();<br>&nbsp;&nbsp; }<br>}<br><br><br>So: we call Processor.Go, passing in a pointer to the function SetStatus (a &quot;delegate&quot; in C# terminology, an &quot;interface&quot; in Java, a pointer in C, ...).
<br><br>The Processor.Go function is going to update the status bar in MyDisplayForm as it goes along with useful messages &quot;Processing blah.txt...&quot;, etc.<br><br>It does that by calling the passed in &quot;callback&quot; function, with the appropriate status message as a parameter.
<br><br>This is also implicit to the Observer pattern, which may or may not be useful in FP (?)<br><br><br>Anyway, so the question is: how do we write callback functions in FP/Haskell?&nbsp; Can someone provide a simple, but functional example?
<br><br><br>