I am following this tutorial and have created a demo.hs file with the following:
import Graphics.Gloss
window :: Display
window = InWindow "Nice Window" (200, 200) (10, 10)
background :: Color
background = white
drawing :: Picture
drawing = circle 80
main :: IO ()
main = display window background drawing
However, when I execute runhaskell demo.hs in my terminal, I get the following error message:
GLUT Fatal Error: internal error: NSInternalInconsistencyException, reason: nextEventMatchingMask should only be called from the Main Thread!
What does this error mean, and how can I fix it? I am using macOS Sierra version 10.12.5.