Hello. I am writing an emulator using the SDL (v2) library as a screen. As usual in Haskell, it looks like my screen does not show until it is really required, i.e. the emulator is waiting for a key press (which luckily is done using the SDL as well). If it does not execute a “wait for key” instruction, everything else related to graphics is not executed (the window does not open at all).
Can I force evaluation in a cleaner way than a useless code block on the event loop complex enough so that the compiler cannot tag it as useless?
Coming from the OCaml world, Haskell’s laziness is beautiful but enabling it by default is probably the most painful feature, and I don’t really know how to strictify parts of the execution without writing dirty code. Thanks for your help!