On Sat, Mar 16, 2013 at 6:53 PM, Jesper Särnesjö
<sarnesjo@gmail.com> wrote:
To be clear, I think this isn't really an OpenGL problem, but rather
one related to FFI or event handling. If anyone could explain to me,
in general, how and why a call to a foreign function returning IO ()
might cause different behavior in Haskell than in C, that might help
me track down the problem.
I haven't finished reading your other email, but I can suggest a possible answer to this query.
Lots of the native GUI libraries attached thread local storage to the process's initial thread. In GHCi expressions are not evaluated in that thread (in the default setup). One thing that may be worth investigating is the difference between ghci behavior when you start with and without -fno-ghci-sandbox.
The release notes for 7.0.1 said this about that flag:
There is a new -fno-ghci-sandbox flag, which stops GHCi running computations in a separate thread. In particular, this is useful for GLUT on OS X, which only works if being run on the main thread.