<span style="font-family:courier new,monospace"><font face="arial,helvetica,sans-serif">1. I wrote this:<br>-----8<----- test.hs ---<br></font> module Main where</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> import qualified Graphics.UI.GLFW as GLFW</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> main = do</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> True <- GLFW.initialize</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> print =<< GLFW.openGLProfile</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> print =<< GLFW.getGlfwVersion</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> print =<< GLFW.getGlVersion</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> print "Trying to open the window"</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> result <- GLFW.openWindow GLFW.defaultDisplayOptions</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> print result</span><br>
<span style="font-family:courier new,monospace"><font face="arial,helvetica,sans-serif">-----8<-----</font></span><br><br>2. Compiled like this: ghc --make -o test test.hs<br>3. Executed: ./test<br><span style="font-family:courier new,monospace"> DefaultProfile</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> Version {versionBranch = [2,7,2], versionTags = []}</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> Version {versionBranch = [0,0,0], versionTags = []}</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> "Trying to open the window"</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> True</span><br>4. Window appeared.<br>
<br>2'. Executed in GHCI like this:<br><span style="font-family:courier new,monospace"><span style="font-family:arial,helvetica,sans-serif"> ghci -fno-ghci-sandbox</span></span><br style="font-family:arial,helvetica,sans-serif">
<span style="font-family:arial,helvetica,sans-serif"> Prelude> :l test.hs</span><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif"> Prelude> main</span><br>3'. Get (random numbers as GLVersion):<br>
<span style="font-family:courier new,monospace"> Loading package GLFW-b-0.1.0.2 ... linking ... done.</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> DefaultProfile</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> Version {versionBranch = [2,7,2], versionTags = []}</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> Version {versionBranch = <b>[34972080,-1323041296,-1334802519]</b>, versionTags = []}</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> "Trying to open the window"</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> False</span><br>4'. Window didn't appear.<br>
<br>What should I do to get GLFW window in ghci too?<br>What do I do wrong?<br>