Re: [Haskell-cafe] Code from Haskell School of Expression hanging.

The sample program (the "active" version) here runs fine, so the OpenGL GLFW must have been installed properly. Must be the SOE stuff causing the problem.
http://www.haskell.org/haskellwiki/GLFW
Michael
--- On Sat, 1/29/11, Daniel Fischer
I'm using the OpenGL stuff (GLFW). Same set of problems?
No idea, I haven't used a graphics library for a long time.

I'm the maintainer of the SOE code. This is rather puzzling, since
apparently GLFW works on your setup. I don't think there is much big
difference in SOE than the sample GLFW program from the Haskell Wiki.
So when you run the SOE program, did you see the window but just all blank?
Or you never see the window popping up?
Regards,
Paul Liu
On Sat, Jan 29, 2011 at 7:34 PM, michael rice
The sample program (the "active" version) here runs fine, so the OpenGL GLFW must have been installed properly. Must be the SOE stuff causing the problem.
http://www.haskell.org/haskellwiki/GLFW
Michael
--- On *Sat, 1/29/11, Daniel Fischer
*wrote: From: Daniel Fischer
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: "michael rice" Date: Saturday, January 29, 2011, 9:37 PM On Sunday 30 January 2011 03:27:55, michael rice wrote:
I'm using the OpenGL stuff (GLFW). Same set of problems?
No idea, I haven't used a graphics library for a long time.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

What you see below is what I get. No window opens. System Monitor shows CPU usage negligible.
Michael
[michael@localhost ~]$ cd ./SOE/SOE/src
[michael@localhost src]$ ghci
GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
Prelude> :l Snowflake.lhs
Ok, modules loaded: Snowflake, SOE.
Prelude Snowflake> main
Loading package old-locale-1.0.0.2 ... linking ... done.
Loading package old-time-1.0.0.5 ... linking ... done.
Loading package OpenGLRaw-1.1.0.1 ... linking ... done.
Loading package GLURaw-1.1.0.0 ... linking ... done.
Loading package ObjectName-1.0.0.0 ... linking ... done.
Loading package StateVar-1.0.0.0 ... linking ... done.
Loading package Tensor-1.0.0.1 ... linking ... done.
Loading package OpenGL-2.4.0.1 ... linking ... done.
Loading package GLFW-0.4.2 ... linking ... done.
Michael
--- On Sun, 1/30/11, Paul L
I'm using the OpenGL stuff (GLFW). Same set of problems?
No idea, I haven't used a graphics library for a long time. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Ok, in the GLFW sample program from Haskell Wiki, can you change the
GLFW.openWindow line to the following, and try again?
GLFW.openWindow (GL.Size 400 400) [GLFW.DisplayStencilBits 8,
GLFW.DisplayAlphaBits 8] GLFW.Window
Does it still run?
Regards,
Paul Liu
On Sun, Jan 30, 2011 at 10:50 AM, michael rice
What you see below is what I get. No window opens. System Monitor shows CPU usage negligible.
Michael
[michael@localhost ~]$ cd ./SOE/SOE/src [michael@localhost src]$ ghci GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. Prelude> :l Snowflake.lhs Ok, modules loaded: Snowflake, SOE. Prelude Snowflake> main Loading package old-locale-1.0.0.2 ... linking ... done. Loading package old-time-1.0.0.5 ... linking ... done. Loading package OpenGLRaw-1.1.0.1 ... linking ... done. Loading package GLURaw-1.1.0.0 ... linking ... done. Loading package ObjectName-1.0.0.0 ... linking ... done. Loading package StateVar-1.0.0.0 ... linking ... done. Loading package Tensor-1.0.0.1 ... linking ... done. Loading package OpenGL-2.4.0.1 ... linking ... done. Loading package GLFW-0.4.2 ... linking ... done.
Michael
--- On Sun, 1/30/11, Paul L
wrote: From: Paul L
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: "michael rice" Cc: "Daniel Fischer" , haskell-cafe@haskell.org Date: Sunday, January 30, 2011, 1:03 PM I'm the maintainer of the SOE code. This is rather puzzling, since apparently GLFW works on your setup. I don't think there is much big difference in SOE than the sample GLFW program from the Haskell Wiki. So when you run the SOE program, did you see the window but just all blank? Or you never see the window popping up? Regards, Paul Liu
On Sat, Jan 29, 2011 at 7:34 PM, michael rice
wrote: The sample program (the "active" version) here runs fine, so the OpenGL GLFW must have been installed properly. Must be the SOE stuff causing the problem.
http://www.haskell.org/haskellwiki/GLFW
Michael
--- On Sat, 1/29/11, Daniel Fischer
wrote: From: Daniel Fischer
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: "michael rice" Date: Saturday, January 29, 2011, 9:37 PM On Sunday 30 January 2011 03:27:55, michael rice wrote:
I'm using the OpenGL stuff (GLFW). Same set of problems?
No idea, I haven't used a graphics library for a long time.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Regards, Paul Liu

The expression (the swapped line) on line 12 is all on one line in my code.
Michael
======================
[michael@localhost ~]$ ghc --make rat2.hs
[1 of 1] Compiling Main ( rat2.hs, rat2.o )
rat2.hs:12:37:
Couldn't match expected type `(Int -> DisplayBits)
-> t
-> DisplayBits'
against inferred type `DisplayBits'
In the expression: DisplayStencilBits 8 DisplayAlphaBits 8
In the second argument of `openWindow', namely
`[DisplayStencilBits 8 DisplayAlphaBits 8]'
In a stmt of a 'do' expression:
openWindow
(Size 400 400) [DisplayStencilBits 8 DisplayAlphaBits 8] Window
[michael@localhost ~]$
--- On Sun, 1/30/11, Paul L
What you see below is what I get. No window opens. System Monitor shows CPU usage negligible.
Michael
[michael@localhost ~]$ cd ./SOE/SOE/src [michael@localhost src]$ ghci GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. Prelude> :l Snowflake.lhs Ok, modules loaded: Snowflake, SOE. Prelude Snowflake> main Loading package old-locale-1.0.0.2 ... linking ... done. Loading package old-time-1.0.0.5 ... linking ... done. Loading package OpenGLRaw-1.1.0.1 ... linking ... done. Loading package GLURaw-1.1.0.0 ... linking ... done. Loading package ObjectName-1.0.0.0 ... linking ... done. Loading package StateVar-1.0.0.0 ... linking ... done. Loading package Tensor-1.0.0.1 ... linking ... done. Loading package OpenGL-2.4.0.1 ... linking ... done. Loading package GLFW-0.4.2 ... linking ... done.
Michael
--- On Sun, 1/30/11, Paul L
wrote: From: Paul L
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: "michael rice" Cc: "Daniel Fischer" , haskell-cafe@haskell.org Date: Sunday, January 30, 2011, 1:03 PM I'm the maintainer of the SOE code. This is rather puzzling, since apparently GLFW works on your setup. I don't think there is much big difference in SOE than the sample GLFW program from the Haskell Wiki. So when you run the SOE program, did you see the window but just all blank? Or you never see the window popping up? Regards, Paul Liu
On Sat, Jan 29, 2011 at 7:34 PM, michael rice
wrote: The sample program (the "active" version) here runs fine, so the OpenGL GLFW must have been installed properly. Must be the SOE stuff causing the problem.
http://www.haskell.org/haskellwiki/GLFW
Michael
--- On Sat, 1/29/11, Daniel Fischer
wrote: From: Daniel Fischer
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: "michael rice" Date: Saturday, January 29, 2011, 9:37 PM On Sunday 30 January 2011 03:27:55, michael rice wrote:
I'm using the OpenGL stuff (GLFW). Same set of problems?
No idea, I haven't used a graphics library for a long time.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Regards, Paul Liu

You missed the comma after the first 8.
On Sun, Jan 30, 2011 at 12:15 PM, michael rice
The expression (the swapped line) on line 12 is all on one line in my code.
Michael
======================
[michael@localhost ~]$ ghc --make rat2.hs [1 of 1] Compiling Main ( rat2.hs, rat2.o )
rat2.hs:12:37: Couldn't match expected type `(Int -> DisplayBits) -> t -> DisplayBits' against inferred type `DisplayBits' In the expression: DisplayStencilBits 8 DisplayAlphaBits 8 In the second argument of `openWindow', namely `[DisplayStencilBits 8 DisplayAlphaBits 8]' In a stmt of a 'do' expression: openWindow (Size 400 400) [DisplayStencilBits 8 DisplayAlphaBits 8] Window [michael@localhost ~]$
--- On *Sun, 1/30/11, Paul L
* wrote: From: Paul L
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: "michael rice" Cc: haskell-cafe@haskell.org Date: Sunday, January 30, 2011, 1:57 PM Ok, in the GLFW sample program from Haskell Wiki, can you change the GLFW.openWindow line to the following, and try again?
GLFW.openWindow (GL.Size 400 400) [GLFW.DisplayStencilBits 8, GLFW.DisplayAlphaBits 8] GLFW.Window
Does it still run?
Regards, Paul Liu
On Sun, Jan 30, 2011 at 10:50 AM, michael rice
http://mc/compose?to=nowgate@yahoo.com> wrote: What you see below is what I get. No window opens. System Monitor shows
CPU usage negligible.
Michael
[michael@localhost ~]$ cd ./SOE/SOE/src [michael@localhost src]$ ghci GHCi, version 6.12.3: http://www.haskell.org/ghc/ http://www.haskell.org/ghc/%C2%A0:? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. Prelude> :l Snowflake.lhs Ok, modules loaded: Snowflake, SOE. Prelude Snowflake> main Loading package old-locale-1.0.0.2 ... linking ... done. Loading package old-time-1.0.0.5 ... linking ... done. Loading package OpenGLRaw-1.1.0.1 ... linking ... done. Loading package GLURaw-1.1.0.0 ... linking ... done. Loading package ObjectName-1.0.0.0 ... linking ... done. Loading package StateVar-1.0.0.0 ... linking ... done. Loading package Tensor-1.0.0.1 ... linking ... done. Loading package OpenGL-2.4.0.1 ... linking ... done. Loading package GLFW-0.4.2 ... linking ... done.
Michael
--- On Sun, 1/30/11, Paul L
http://mc/compose?to=ninegua@gmail.com> wrote:
From: Paul L
http://mc/compose?to=ninegua@gmail.com Subject: Re: [Haskell-cafe] Code from Haskell School of Expression
To: "michael rice"
http://mc/compose?to=nowgate@yahoo.com Cc: "Daniel Fischer"
http://mc/compose?to=daniel.is.fischer@googlemail.com>, haskell-cafe@haskell.org http://mc/compose?to=haskell-cafe@haskell.org Date: Sunday, January 30, 2011, 1:03 PM I'm the maintainer of the SOE code. This is rather puzzling, since apparently GLFW works on your setup. I don't think there is much big difference in SOE than the sample GLFW program from the Haskell Wiki. So when you run the SOE program, did you see the window but just all blank? Or you never see the window popping up? Regards, Paul Liu
On Sat, Jan 29, 2011 at 7:34 PM, michael rice
http://mc/compose?to=nowgate@yahoo.com> wrote: The sample program (the "active" version) here runs fine, so the OpenGL GLFW must have been installed properly. Must be the SOE stuff causing the
hanging. problem.
http://www.haskell.org/haskellwiki/GLFW
Michael
--- On Sat, 1/29/11, Daniel Fischer
http://mc/compose?to=daniel.is.fischer@googlemail.com> wrote:
From: Daniel Fischer
http://mc/compose?to=daniel.is.fischer@googlemail.com Subject: Re: [Haskell-cafe] Code from Haskell School of Expression
hanging.
To: "michael rice"
http://mc/compose?to=nowgate@yahoo.com Date: Saturday, January 29, 2011, 9:37 PM
On Sunday 30 January 2011 03:27:55, michael rice wrote:
I'm using the OpenGL stuff (GLFW). Same set of problems?
No idea, I haven't used a graphics library for a long time.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mc/compose?to=Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Regards, Paul Liu
-- Regards, Paul Liu

Yeah, I got a parse error when it was on two lines and I must have backed over the comma when I put it all on one line. Sorry.
Yes, it compiles and runs, just like it did before.
Michael
--- On Sun, 1/30/11, Paul L
What you see below is what I get. No window opens. System Monitor shows CPU usage negligible.
Michael
[michael@localhost ~]$ cd ./SOE/SOE/src [michael@localhost src]$ ghci
GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. Prelude> :l Snowflake.lhs Ok, modules loaded: Snowflake, SOE. Prelude Snowflake> main Loading package old-locale-1.0.0.2 ... linking ... done. Loading package old-time-1.0.0.5 ... linking ... done. Loading package OpenGLRaw-1.1.0.1 ... linking ... done.
Loading package GLURaw-1.1.0.0 ... linking ... done. Loading package ObjectName-1.0.0.0 ... linking ... done. Loading package StateVar-1.0.0.0 ... linking ... done. Loading package Tensor-1.0.0.1 ... linking ... done.
Loading package OpenGL-2.4.0.1 ... linking ... done. Loading package GLFW-0.4.2 ... linking ... done.
Michael
--- On Sun, 1/30/11, Paul L
wrote:
From: Paul L
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging.
To: "michael rice"
Cc: "Daniel Fischer" , haskell-cafe@haskell.org
Date: Sunday, January 30, 2011, 1:03 PM
I'm the maintainer of the SOE code. This is rather puzzling, since apparently GLFW works on your setup. I don't think there is much big difference in SOE than the sample GLFW program from the Haskell Wiki.
So when you run the SOE program, did you see the window but just all blank? Or you never see the window popping up? Regards, Paul Liu
On Sat, Jan 29, 2011 at 7:34 PM, michael rice
wrote: The sample program (the "active" version) here runs fine, so the OpenGL GLFW must have been installed properly. Must be the SOE stuff causing the problem.
http://www.haskell.org/haskellwiki/GLFW
Michael
--- On Sat, 1/29/11, Daniel Fischer
wrote:
From: Daniel Fischer
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression
hanging.
To: "michael rice"
Date: Saturday, January 29, 2011, 9:37 PM On Sunday 30 January 2011 03:27:55, michael rice wrote:
I'm using the OpenGL stuff (GLFW). Same set of problems?
No idea, I haven't used a graphics library for a long time.
_______________________________________________
Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Regards, Paul Liu -- Regards, Paul Liu

Can you try simpler SOE programs, for example, ghci SimpleGraphics,
and type main0 at the prompt. Does it show anything?
Regards,
Paul Liu
On Sun, Jan 30, 2011 at 12:59 PM, michael rice
Yeah, I got a parse error when it was on two lines and I must have backed over the comma when I put it all on one line. Sorry.
Yes, it compiles and runs, just like it did before.
Michael
--- On Sun, 1/30/11, Paul L
wrote: From: Paul L
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: "michael rice" Cc: haskell-cafe@haskell.org Date: Sunday, January 30, 2011, 3:53 PM You missed the comma after the first 8.
On Sun, Jan 30, 2011 at 12:15 PM, michael rice
wrote: The expression (the swapped line) on line 12 is all on one line in my code.
Michael
======================
[michael@localhost ~]$ ghc --make rat2.hs [1 of 1] Compiling Main ( rat2.hs, rat2.o )
rat2.hs:12:37: Couldn't match expected type `(Int -> DisplayBits) -> t -> DisplayBits' against inferred type `DisplayBits' In the expression: DisplayStencilBits 8 DisplayAlphaBits 8 In the second argument of `openWindow', namely `[DisplayStencilBits 8 DisplayAlphaBits 8]' In a stmt of a 'do' expression: openWindow (Size 400 400) [DisplayStencilBits 8 DisplayAlphaBits 8] Window [michael@localhost ~]$
--- On Sun, 1/30/11, Paul L
wrote: From: Paul L
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: "michael rice" Cc: haskell-cafe@haskell.org Date: Sunday, January 30, 2011, 1:57 PM Ok, in the GLFW sample program from Haskell Wiki, can you change the GLFW.openWindow line to the following, and try again?
GLFW.openWindow (GL.Size 400 400) [GLFW.DisplayStencilBits 8, GLFW.DisplayAlphaBits 8] GLFW.Window
Does it still run?
Regards, Paul Liu
On Sun, Jan 30, 2011 at 10:50 AM, michael rice
wrote: What you see below is what I get. No window opens. System Monitor shows CPU usage negligible.
Michael
[michael@localhost ~]$ cd ./SOE/SOE/src [michael@localhost src]$ ghci GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. Prelude> :l Snowflake.lhs Ok, modules loaded: Snowflake, SOE. Prelude Snowflake> main Loading package old-locale-1.0.0.2 ... linking ... done. Loading package old-time-1.0.0.5 ... linking ... done. Loading package OpenGLRaw-1.1.0.1 ... linking ... done. Loading package GLURaw-1.1.0.0 ... linking ... done. Loading package ObjectName-1.0.0.0 ... linking ... done. Loading package StateVar-1.0.0.0 ... linking ... done. Loading package Tensor-1.0.0.1 ... linking ... done. Loading package OpenGL-2.4.0.1 ... linking ... done. Loading package GLFW-0.4.2 ... linking ... done.
Michael
--- On Sun, 1/30/11, Paul L
wrote: From: Paul L
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: "michael rice" Cc: "Daniel Fischer" , haskell-cafe@haskell.org Date: Sunday, January 30, 2011, 1:03 PM I'm the maintainer of the SOE code. This is rather puzzling, since apparently GLFW works on your setup. I don't think there is much big difference in SOE than the sample GLFW program from the Haskell Wiki. So when you run the SOE program, did you see the window but just all blank? Or you never see the window popping up? Regards, Paul Liu
On Sat, Jan 29, 2011 at 7:34 PM, michael rice
wrote: The sample program (the "active" version) here runs fine, so the OpenGL GLFW must have been installed properly. Must be the SOE stuff causing the problem.
http://www.haskell.org/haskellwiki/GLFW
Michael
--- On Sat, 1/29/11, Daniel Fischer
wrote: From: Daniel Fischer
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: "michael rice" Date: Saturday, January 29, 2011, 9:37 PM On Sunday 30 January 2011 03:27:55, michael rice wrote:
I'm using the OpenGL stuff (GLFW). Same set of problems?
No idea, I haven't used a graphics library for a long time.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Regards, Paul Liu
-- Regards, Paul Liu
-- Regards, Paul Liu

I tried that yesterday, but here it is again.
Michael
============
[michael@localhost ~]$ cd ./SOE/SOE/src
[michael@localhost src]$ ghci
GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
Prelude> :l SimpleGraphics.lhs
[2 of 2] Compiling SimpleGraphics ( SimpleGraphics.lhs, interpreted )
Ok, modules loaded: SimpleGraphics, SOE.
*SimpleGraphics> main0
Loading package old-locale-1.0.0.2 ... linking ... done.
Loading package old-time-1.0.0.5 ... linking ... done.
Loading package OpenGLRaw-1.1.0.1 ... linking ... done.
Loading package GLURaw-1.1.0.0 ... linking ... done.
Loading package ObjectName-1.0.0.0 ... linking ... done.
Loading package StateVar-1.0.0.0 ... linking ... done.
Loading package Tensor-1.0.0.1 ... linking ... done.
Loading package OpenGL-2.4.0.1 ... linking ... done.
Loading package GLFW-0.4.2 ... linking ... done.
--- On Sun, 1/30/11, Paul L
Yeah, I got a parse error when it was on two lines and I must have backed over the comma when I put it all on one line. Sorry.
Yes, it compiles and runs, just like it did before.
Michael
--- On Sun, 1/30/11, Paul L
wrote: From: Paul L
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: "michael rice" Cc: haskell-cafe@haskell.org Date: Sunday, January 30, 2011, 3:53 PM You missed the comma after the first 8.
On Sun, Jan 30, 2011 at 12:15 PM, michael rice
wrote: The expression (the swapped line) on line 12 is all on one line in my code.
Michael
======================
[michael@localhost ~]$ ghc --make rat2.hs [1 of 1] Compiling Main ( rat2.hs, rat2.o )
rat2.hs:12:37: Couldn't match expected type `(Int -> DisplayBits) -> t -> DisplayBits' against inferred type `DisplayBits' In the expression: DisplayStencilBits 8 DisplayAlphaBits 8 In the second argument of `openWindow', namely `[DisplayStencilBits 8 DisplayAlphaBits 8]' In a stmt of a 'do' expression: openWindow (Size 400 400) [DisplayStencilBits 8 DisplayAlphaBits 8] Window [michael@localhost ~]$
--- On Sun, 1/30/11, Paul L
wrote: From: Paul L
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: "michael rice" Cc: haskell-cafe@haskell.org Date: Sunday, January 30, 2011, 1:57 PM Ok, in the GLFW sample program from Haskell Wiki, can you change the GLFW.openWindow line to the following, and try again?
GLFW.openWindow (GL.Size 400 400) [GLFW.DisplayStencilBits 8, GLFW.DisplayAlphaBits 8] GLFW.Window
Does it still run?
Regards, Paul Liu
On Sun, Jan 30, 2011 at 10:50 AM, michael rice
wrote: What you see below is what I get. No window opens. System Monitor shows CPU usage negligible.
Michael
[michael@localhost ~]$ cd ./SOE/SOE/src [michael@localhost src]$ ghci GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. Prelude> :l Snowflake.lhs Ok, modules loaded: Snowflake, SOE. Prelude Snowflake> main Loading package old-locale-1.0.0.2 ... linking ... done. Loading package old-time-1.0.0.5 ... linking ... done. Loading package OpenGLRaw-1.1.0.1 ... linking ... done. Loading package GLURaw-1.1.0.0 ... linking ... done. Loading package ObjectName-1.0.0.0 ... linking ... done. Loading package StateVar-1.0.0.0 ... linking ... done. Loading package Tensor-1.0.0.1 ... linking ... done. Loading package OpenGL-2.4.0.1 ... linking ... done. Loading package GLFW-0.4.2 ... linking ... done.
Michael
--- On Sun, 1/30/11, Paul L
wrote: From: Paul L
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: "michael rice" Cc: "Daniel Fischer" , haskell-cafe@haskell.org Date: Sunday, January 30, 2011, 1:03 PM I'm the maintainer of the SOE code. This is rather puzzling, since apparently GLFW works on your setup. I don't think there is much big difference in SOE than the sample GLFW program from the Haskell Wiki. So when you run the SOE program, did you see the window but just all blank? Or you never see the window popping up? Regards, Paul Liu
On Sat, Jan 29, 2011 at 7:34 PM, michael rice
wrote: The sample program (the "active" version) here runs fine, so the OpenGL GLFW must have been installed properly. Must be the SOE stuff causing the problem.
http://www.haskell.org/haskellwiki/GLFW
Michael
--- On Sat, 1/29/11, Daniel Fischer
wrote: From: Daniel Fischer
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: "michael rice" Date: Saturday, January 29, 2011, 9:37 PM On Sunday 30 January 2011 03:27:55, michael rice wrote:
I'm using the OpenGL stuff (GLFW). Same set of problems?
No idea, I haven't used a graphics library for a long time.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Regards, Paul Liu
-- Regards, Paul Liu
-- Regards, Paul Liu

And here's the same with GHC. It never gets to linking and creating an executable the way the GLFW sample program does.
Michael
===============
[michael@localhost ~]$ cd ./SOE/SOE/src
[michael@localhost src]$ ghc --make SimpleGraphics.lhs
[2 of 2] Compiling SimpleGraphics ( SimpleGraphics.lhs, SimpleGraphics.o )
[michael@localhost src]$
--- On Sun, 1/30/11, Paul L
Yeah, I got a parse error when it was on two lines and I must have backed over the comma when I put it all on one line. Sorry.
Yes, it compiles and runs, just like it did before.
Michael
--- On Sun, 1/30/11, Paul L
wrote: From: Paul L
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: "michael rice" Cc: haskell-cafe@haskell.org Date: Sunday, January 30, 2011, 3:53 PM You missed the comma after the first 8.
On Sun, Jan 30, 2011 at 12:15 PM, michael rice
wrote: The expression (the swapped line) on line 12 is all on one line in my code.
Michael
======================
[michael@localhost ~]$ ghc --make rat2.hs [1 of 1] Compiling Main ( rat2.hs, rat2.o )
rat2.hs:12:37: Couldn't match expected type `(Int -> DisplayBits) -> t -> DisplayBits' against inferred type `DisplayBits' In the expression: DisplayStencilBits 8 DisplayAlphaBits 8 In the second argument of `openWindow', namely `[DisplayStencilBits 8 DisplayAlphaBits 8]' In a stmt of a 'do' expression: openWindow (Size 400 400) [DisplayStencilBits 8 DisplayAlphaBits 8] Window [michael@localhost ~]$
--- On Sun, 1/30/11, Paul L
wrote: From: Paul L
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: "michael rice" Cc: haskell-cafe@haskell.org Date: Sunday, January 30, 2011, 1:57 PM Ok, in the GLFW sample program from Haskell Wiki, can you change the GLFW.openWindow line to the following, and try again?
GLFW.openWindow (GL.Size 400 400) [GLFW.DisplayStencilBits 8, GLFW.DisplayAlphaBits 8] GLFW.Window
Does it still run?
Regards, Paul Liu
On Sun, Jan 30, 2011 at 10:50 AM, michael rice
wrote: What you see below is what I get. No window opens. System Monitor shows CPU usage negligible.
Michael
[michael@localhost ~]$ cd ./SOE/SOE/src [michael@localhost src]$ ghci GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. Prelude> :l Snowflake.lhs Ok, modules loaded: Snowflake, SOE. Prelude Snowflake> main Loading package old-locale-1.0.0.2 ... linking ... done. Loading package old-time-1.0.0.5 ... linking ... done. Loading package OpenGLRaw-1.1.0.1 ... linking ... done. Loading package GLURaw-1.1.0.0 ... linking ... done. Loading package ObjectName-1.0.0.0 ... linking ... done. Loading package StateVar-1.0.0.0 ... linking ... done. Loading package Tensor-1.0.0.1 ... linking ... done. Loading package OpenGL-2.4.0.1 ... linking ... done. Loading package GLFW-0.4.2 ... linking ... done.
Michael
--- On Sun, 1/30/11, Paul L
wrote: From: Paul L
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: "michael rice" Cc: "Daniel Fischer" , haskell-cafe@haskell.org Date: Sunday, January 30, 2011, 1:03 PM I'm the maintainer of the SOE code. This is rather puzzling, since apparently GLFW works on your setup. I don't think there is much big difference in SOE than the sample GLFW program from the Haskell Wiki. So when you run the SOE program, did you see the window but just all blank? Or you never see the window popping up? Regards, Paul Liu
On Sat, Jan 29, 2011 at 7:34 PM, michael rice
wrote: The sample program (the "active" version) here runs fine, so the OpenGL GLFW must have been installed properly. Must be the SOE stuff causing the problem.
http://www.haskell.org/haskellwiki/GLFW
Michael
--- On Sat, 1/29/11, Daniel Fischer
wrote: From: Daniel Fischer
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: "michael rice" Date: Saturday, January 29, 2011, 9:37 PM On Sunday 30 January 2011 03:27:55, michael rice wrote:
I'm using the OpenGL stuff (GLFW). Same set of problems?
No idea, I haven't used a graphics library for a long time.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Regards, Paul Liu
-- Regards, Paul Liu
-- Regards, Paul Liu

On Monday 31 January 2011 00:27:41, michael rice wrote:
And here's the same with GHC. It never gets to linking and creating an executable the way the GLFW sample program does.
Michael
===============
[michael@localhost ~]$ cd ./SOE/SOE/src [michael@localhost src]$ ghc --make SimpleGraphics.lhs [2 of 2] Compiling SimpleGraphics ( SimpleGraphics.lhs, SimpleGraphics.o ) [michael@localhost src]$
The module name is not Main, so to get an executable, you have to tell ghc what the Main module is. Assuming SimpleGraphics.lhs contains a main function, $ ghc --make SimpleGraphics -main-is SimpleGraphics should do it. Cheers, Daniel

SimpleGraphics has a bunch of main programs: main0, main1, main2, main3, and main3book. I sequentially changed each to main and ran all five successfully. Then I did the same for Snowflake.lhs (see code below) which already had a single main function. Michael ============== [michael@localhost src]$ ghc --make Snowflake -main-is Snowflake Linking Snowflake ... /usr/lib/ghc-6.12.3/libHSrtsmain.a(Main.o): In function `main': (.text+0x10): undefined reference to `ZCMain_main_closure' /usr/lib/ghc-6.12.3/libHSrtsmain.a(Main.o): In function `main': (.text+0x18): undefined reference to `__stginit_ZCMain' collect2: ld returned 1 exit status [michael@localhost src]$ ============== This code was automatically extracted from a .lhs file that uses the following convention: -- lines beginning with ">" are executable -- lines beginning with "<" are in the text, but not necessarily executable -- lines beginning with "|" are also in the text, but are often just expressions or code fragments.
module Snowflake where import SOE m = 81 :: Int -- multiple of 3 for triangle size x = 250 :: Int -- x and y coordinates of y = 250 :: Int -- center of snowflake colors = [ Magenta, Blue, Green, Red, Yellow ] snowflake :: Window -> IO () snowflake w = do drawTri w x y m 0 False -- draw first triangle w/flat top flake w x y m 0 True -- begin recursion to complete job flake :: Window -> Int -> Int -> Int -> Int -> Bool -> IO () flake w x y m c o = do drawTri w x y m c o -- draw second triangle let c1 = (c+1)`mod`5 -- get next color if (m<=3) then return () -- if too small, we're done else do flake w (x-2*m) (y-m) (m`div`3) c1 True -- NW flake w (x+2*m) (y-m) (m`div`3) c1 True -- NE flake w x (y+2*m) (m`div`3) c1 True -- S flake w (x-2*m) (y+m) (m`div`3) c1 False -- SW flake w (x+2*m) (y+m) (m`div`3) c1 False -- SE flake w x (y-2*m) (m`div`3) c1 False -- N drawTri :: Window -> Int -> Int -> Int -> Int -> Bool -> IO () drawTri w x y m c o = let d = (3*m) `div` 2 ps = if o then [(x,y-3*m), (x-3*m,y+d), (x+3*m,y+d)] -- side at bottom else [ (x,y+3*m), (x-3*m,y-d), (x+3*m,y-d)] -- side at top in drawInWindow w (withColor (colors !! c) (polygon ps)) main = runGraphics ( do w <- openWindow "Snowflake Fractal" (500,500) drawInWindow w (withColor White (polygon [(0,0),(499,0),(499,499),(0,499)])) snowflake w spaceClose w ) spaceClose :: Window -> IO () spaceClose w = do k <- getKey w if k==' ' || k == '\x0' then closeWindow w else spaceClose w --- On Sun, 1/30/11, Daniel Fischer
wrote:
From: Daniel Fischer
And here's the same with GHC. It never gets to linking and creating an executable the way the GLFW sample program does.
Michael
===============
[michael@localhost ~]$ cd ./SOE/SOE/src [michael@localhost src]$ ghc --make SimpleGraphics.lhs [2 of 2] Compiling SimpleGraphics ( SimpleGraphics.lhs, SimpleGraphics.o ) [michael@localhost src]$
The module name is not Main, so to get an executable, you have to tell ghc what the Main module is. Assuming SimpleGraphics.lhs contains a main function, $ ghc --make SimpleGraphics -main-is SimpleGraphics should do it. Cheers, Daniel

Maybe you want to remove Snowflake.o (or even *.o) and then try compiling it
again.
Regards,
Paul Liu
On Sun, Jan 30, 2011 at 4:11 PM, michael rice
SimpleGraphics has a bunch of main programs: main0, main1, main2, main3, and main3book. I sequentially changed each to main and ran all five successfully.
Then I did the same for Snowflake.lhs (see code below) which already had a single main function.
Michael
==============
[michael@localhost src]$ ghc --make Snowflake -main-is Snowflake Linking Snowflake ... /usr/lib/ghc-6.12.3/libHSrtsmain.a(Main.o): In function `main': (.text+0x10): undefined reference to `ZCMain_main_closure' /usr/lib/ghc-6.12.3/libHSrtsmain.a(Main.o): In function `main': (.text+0x18): undefined reference to `__stginit_ZCMain' collect2: ld returned 1 exit status [michael@localhost src]$
==============
This code was automatically extracted from a .lhs file that uses the following convention:
-- lines beginning with ">" are executable -- lines beginning with "<" are in the text, but not necessarily executable -- lines beginning with "|" are also in the text, but are often just expressions or code fragments.
module Snowflake where import SOE
m = 81 :: Int -- multiple of 3 for triangle size x = 250 :: Int -- x and y coordinates of y = 250 :: Int -- center of snowflake colors = [ Magenta, Blue, Green, Red, Yellow ]
snowflake :: Window -> IO () snowflake w = do drawTri w x y m 0 False -- draw first triangle w/flat top flake w x y m 0 True -- begin recursion to complete job
flake :: Window -> Int -> Int -> Int -> Int -> Bool -> IO () flake w x y m c o = do drawTri w x y m c o -- draw second triangle let c1 = (c+1)`mod`5 -- get next color if (m<=3) then return () -- if too small, we're done else do flake w (x-2*m) (y-m) (m`div`3) c1 True -- NW flake w (x+2*m) (y-m) (m`div`3) c1 True -- NE flake w x (y+2*m) (m`div`3) c1 True -- S flake w (x-2*m) (y+m) (m`div`3) c1 False -- SW flake w (x+2*m) (y+m) (m`div`3) c1 False -- SE flake w x (y-2*m) (m`div`3) c1 False -- N
drawTri :: Window -> Int -> Int -> Int -> Int -> Bool -> IO () drawTri w x y m c o = let d = (3*m) `div` 2 ps = if o then [(x,y-3*m), (x-3*m,y+d), (x+3*m,y+d)] -- side at bottom else [ (x,y+3*m), (x-3*m,y-d), (x+3*m,y-d)] -- side at top in drawInWindow w (withColor (colors !! c) (polygon ps))
main = runGraphics ( do w <- openWindow "Snowflake Fractal" (500,500) drawInWindow w (withColor White (polygon [(0,0),(499,0),(499,499),(0,499)])) snowflake w spaceClose w )
spaceClose :: Window -> IO () spaceClose w = do k <- getKey w if k==' ' || k == '\x0' then closeWindow w else spaceClose w
--- On *Sun, 1/30/11, Daniel Fischer
*wrote: From: Daniel Fischer
Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: haskell-cafe@haskell.org, "michael rice" Date: Sunday, January 30, 2011, 6:48 PM On Monday 31 January 2011 00:27:41, michael rice wrote:
And here's the same with GHC. It never gets to linking and creating an executable the way the GLFW sample program does.
Michael
===============
[michael@localhost ~]$ cd ./SOE/SOE/src [michael@localhost src]$ ghc --make SimpleGraphics.lhs [2 of 2] Compiling SimpleGraphics ( SimpleGraphics.lhs, SimpleGraphics.o ) [michael@localhost src]$
The module name is not Main, so to get an executable, you have to tell ghc what the Main module is. Assuming SimpleGraphics.lhs contains a main function,
$ ghc --make SimpleGraphics -main-is SimpleGraphics
should do it.
Cheers, Daniel
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Regards, Paul Liu

That worked, though not sure why I had to delete the .o file.
On to ghci?
Michael
--- On Sun, 1/30/11, Paul L
module Snowflake where
import SOE
m = 81 :: Int -- multiple of 3 for triangle size
x = 250 :: Int -- x and y coordinates of
y = 250 :: Int -- center of snowflake
colors = [ Magenta, Blue, Green, Red, Yellow ]
snowflake :: Window -> IO ()
snowflake w = do
drawTri w x y m 0 False -- draw first triangle w/flat top
flake w x y m 0 True -- begin recursion to complete job
flake :: Window -> Int -> Int -> Int -> Int -> Bool -> IO ()
flake w x y m c o = do
drawTri w x y m c o -- draw second triangle
let c1 = (c+1)`mod`5 -- get next color
if (m<=3) then return () -- if too small, we're done
else do
flake w (x-2*m) (y-m) (m`div`3) c1 True -- NW
flake w (x+2*m) (y-m) (m`div`3) c1 True -- NE
flake w x (y+2*m) (m`div`3) c1 True -- S
flake w (x-2*m) (y+m) (m`div`3) c1 False -- SW
flake w (x+2*m) (y+m) (m`div`3) c1 False -- SE
flake w x (y-2*m) (m`div`3) c1 False -- N
drawTri :: Window -> Int -> Int -> Int -> Int -> Bool -> IO ()
drawTri w x y m c o =
let d = (3*m) `div` 2
ps = if o
then [(x,y-3*m), (x-3*m,y+d), (x+3*m,y+d)] -- side at bottom
else [ (x,y+3*m), (x-3*m,y-d), (x+3*m,y-d)] -- side at top
in drawInWindow w
(withColor (colors !! c)
(polygon ps))
main
= runGraphics (
do w <- openWindow "Snowflake Fractal" (500,500)
drawInWindow w (withColor White
(polygon [(0,0),(499,0),(499,499),(0,499)]))
snowflake w
spaceClose w
)
spaceClose :: Window -> IO ()
spaceClose w
= do k <- getKey w
if k==' ' || k == '\x0'
then closeWindow w
else spaceClose w
--- On Sun, 1/30/11, Daniel Fischer
And here's the same with GHC. It never gets to linking and creating an executable the way the GLFW sample program does.
Michael
===============
[michael@localhost ~]$ cd ./SOE/SOE/src
[michael@localhost src]$ ghc --make SimpleGraphics.lhs [2 of 2] Compiling SimpleGraphics ( SimpleGraphics.lhs, SimpleGraphics.o ) [michael@localhost src]$
The module name is not Main, so to get an executable, you have to tell ghc what the Main module is. Assuming SimpleGraphics.lhs contains a main function, $ ghc --make SimpleGraphics -main-is SimpleGraphics should do it. Cheers, Daniel _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Regards, Paul Liu

On Monday 31 January 2011 01:11:59, michael rice wrote:
SimpleGraphics has a bunch of main programs: main0, main1, main2, main3, and main3book. I sequentially changed each to main and ran all five successfully.
For future use, you can do that without changing the file in between, you can pass a module name or a function name to -main-is, in this case a qualified function name: $ ghc -fforce-recomp --make SimpleGraphics -main-is SimpleGraphics.main0 -o simple0 -- that's one line, mail client wraps probably arrow up, change main0 to main1 and the executable name, enter; repeat until done
Then I did the same for Snowflake.lhs (see code below) which already had a single main function.
Michael
==============
[michael@localhost src]$ ghc --make Snowflake -main-is Snowflake Linking Snowflake ... /usr/lib/ghc-6.12.3/libHSrtsmain.a(Main.o): In function `main': (.text+0x10): undefined reference to `ZCMain_main_closure' /usr/lib/ghc-6.12.3/libHSrtsmain.a(Main.o): In function `main': (.text+0x18): undefined reference to `__stginit_ZCMain' collect2: ld returned 1 exit status [michael@localhost src]$
==============
The module has not been compiled again, ghc only tries to link, but because it wasn't told that there's going to be an executable when compiling, it didn't create all necessary pieces. Make sure it's recompiled, pass -fforce-recomp on the command line, $ ghc -fforce-recomp --make Snowflake -main-is Snowflake or ( $ touch Snowflake.hs (perhaps, if you're on Windows, there is no touch command) or delete Snowflake.o and/or Snowflake.hi ), then compile with --make -main-is Snowflake
participants (3)
-
Daniel Fischer
-
michael rice
-
Paul L