Re: [Haskell-cafe] FRP demos and tutorials page

2010-05-10 Thread Jean-Marie Gaillourdet
Hi,

since I never took the time to understand frp properly I thought it would be 
helpful to look at some examples. I was able to compile and run the first to 
programs after I managed to find out the dependencies. But I failed to compile 
third one. I just got the a compiler error with ghc-6.12.1 on Mac OS X 10.6, 
see below. 

Best regards,
Jean

leibniz:robot_sim jmg$ ./go 
Compiling Generator
[1 of 2] Compiling Model( Model.hs, Model.o )
[2 of 2] Compiling Main ( Main.hs, Main.o )
Linking main ...
Compiling Player
[1 of 5] Compiling ReadImage( ReadImage.hs, ReadImage.o )
[2 of 5] Compiling Sprites  ( Sprites.hs, Sprites.o )
[3 of 5] Compiling ViewSupport  ( ViewSupport.hs, ViewSupport.o )

ViewSupport.hs:32:7:
No instance for (MatrixComponent Double)
  arising from a use of `scale' at ViewSupport.hs:32:7-11
Possible fix:
  add an instance declaration for (MatrixComponent Double)
In the expression: scale
In the definition of `scal': scal = scale

ViewSupport.hs:100:9:
No instance for (NormalComponent Double)
  arising from a use of `normal' at ViewSupport.hs:100:9-33
Possible fix:
  add an instance declaration for (NormalComponent Double)
In a stmt of a 'do' expression: normal (Normal3 nx ny nz)
In the second argument of `($)', namely
`do { normal (Normal3 nx ny nz);
  mapM_
(\ ((vx, vy, vz), tcoord)
 - do { texCoord tcoord;
  })
(zip ([q0] ++ [q1] ++ [q2] ++ [q3]) ts) }'
In the expression:
  renderPrimitive Quads
$ do { normal (Normal3 nx ny nz);
   mapM_
 (\ ((vx, vy, vz), tcoord)
  - do { texCoord tcoord;
   })
 (zip ([q0] ++ [q1] ++ [q2] ++ [q3]) ts) }

ViewSupport.hs:102:18:
No instance for (TexCoordComponent Double)
  arising from a use of `texCoord' at ViewSupport.hs:102:18-32
Possible fix:
  add an instance declaration for (TexCoordComponent Double)
In a stmt of a 'do' expression: texCoord tcoord
In the expression:
do { texCoord tcoord;
   vertex $ Vertex3 vx vy vz }
In the first argument of `mapM_', namely
`(\ ((vx, vy, vz), tcoord)
  - do { texCoord tcoord;
vertex $ Vertex3 vx vy vz })'

ViewSupport.hs:103:18:
No instance for (VertexComponent Double)
  arising from a use of `vertex' at ViewSupport.hs:103:18-23
Possible fix:
  add an instance declaration for (VertexComponent Double)
In the first argument of `($)', namely `vertex'
In the expression: vertex $ Vertex3 vx vy vz
In the expression:
do { texCoord tcoord;
   vertex $ Vertex3 vx vy vz }


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] FRP demos and tutorials page

2010-05-10 Thread Tom Poliquin

On Monday 10 May 2010 00:08, Jean-Marie Gaillourdet wrote:

 We have created are a set of demos and tutorials for 
 FRP (Conal reactive).   It consists of four demos: the simple furnace,
 the human controlled furnace, the hybrid robot sim, and the FRP robot sim.  

 since I never took the time to understand frp properly I thought it would
 be helpful to look at some examples. I was able to compile and run the
 first to programs after I managed to find out the dependencies. But I
 failed to compile third one. I just got the a compiler error with
 ghc-6.12.1 on Mac OS X 10.6, see below.


  No instance for (MatrixComponent Double)

  .. and various other complaints about Doubles.

Thanks Jean for trying the examples out!

We'll look into this tomorrow. I think we are down rev a bit
in our OpenGL.
Our Doubles should be GLdoubles to make everybody
happy. We'll upload new code when fixed and let you know.

Tom


On Monday 10 May 2010 00:08, Jean-Marie Gaillourdet wrote:
 Hi,

 since I never took the time to understand frp properly I thought it would
 be helpful to look at some examples. I was able to compile and run the
 first to programs after I managed to find out the dependencies. But I
 failed to compile third one. I just got the a compiler error with
 ghc-6.12.1 on Mac OS X 10.6, see below.

 Best regards,
 Jean

 leibniz:robot_sim jmg$ ./go
 Compiling Generator
 [1 of 2] Compiling Model( Model.hs, Model.o )
 [2 of 2] Compiling Main ( Main.hs, Main.o )
 Linking main ...
 Compiling Player
 [1 of 5] Compiling ReadImage( ReadImage.hs, ReadImage.o )
 [2 of 5] Compiling Sprites  ( Sprites.hs, Sprites.o )
 [3 of 5] Compiling ViewSupport  ( ViewSupport.hs, ViewSupport.o )

 ViewSupport.hs:32:7:
 No instance for (MatrixComponent Double)
   arising from a use of `scale' at ViewSupport.hs:32:7-11
 Possible fix:
   add an instance declaration for (MatrixComponent Double)
 In the expression: scale
 In the definition of `scal': scal = scale

 ViewSupport.hs:100:9:
 No instance for (NormalComponent Double)
   arising from a use of `normal' at ViewSupport.hs:100:9-33
 Possible fix:
   add an instance declaration for (NormalComponent Double)
 In a stmt of a 'do' expression: normal (Normal3 nx ny nz)
 In the second argument of `($)', namely
 `do { normal (Normal3 nx ny nz);
   mapM_
 (\ ((vx, vy, vz), tcoord)
  - do { texCoord tcoord;
   })
 (zip ([q0] ++ [q1] ++ [q2] ++ [q3]) ts) }'
 In the expression:
   renderPrimitive Quads
 $ do { normal (Normal3 nx ny nz);
mapM_
  (\ ((vx, vy, vz), tcoord)
   - do { texCoord tcoord;
    })
  (zip ([q0] ++ [q1] ++ [q2] ++ [q3]) ts) }

 ViewSupport.hs:102:18:
 No instance for (TexCoordComponent Double)
   arising from a use of `texCoord' at ViewSupport.hs:102:18-32
 Possible fix:
   add an instance declaration for (TexCoordComponent Double)
 In a stmt of a 'do' expression: texCoord tcoord
 In the expression:
 do { texCoord tcoord;
vertex $ Vertex3 vx vy vz }
 In the first argument of `mapM_', namely
 `(\ ((vx, vy, vz), tcoord)
   - do { texCoord tcoord;
 vertex $ Vertex3 vx vy vz })'

 ViewSupport.hs:103:18:
 No instance for (VertexComponent Double)
   arising from a use of `vertex' at ViewSupport.hs:103:18-23
 Possible fix:
   add an instance declaration for (VertexComponent Double)
 In the first argument of `($)', namely `vertex'
 In the expression: vertex $ Vertex3 vx vy vz
 In the expression:
 do { texCoord tcoord;
vertex $ Vertex3 vx vy vz }
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] FRP demos and tutorials page

2010-05-10 Thread Limestraƫl
Really?
There are only 4 fundamental functions in Reactive?

Seems simpler than I thought...

Thanks, btw, I've been looking quite a long time to simple reactive tutos.

2010/5/10 Tom Poliquin poliq...@softcomp.com


 On Monday 10 May 2010 00:08, Jean-Marie Gaillourdet wrote:

  We have created are a set of demos and tutorials for
  FRP (Conal reactive).   It consists of four demos: the simple furnace,
  the human controlled furnace, the hybrid robot sim, and the FRP robot
 sim.

  since I never took the time to understand frp properly I thought it would
  be helpful to look at some examples. I was able to compile and run the
  first to programs after I managed to find out the dependencies. But I
  failed to compile third one. I just got the a compiler error with
  ghc-6.12.1 on Mac OS X 10.6, see below.
 
 
   No instance for (MatrixComponent Double)
 
   .. and various other complaints about Doubles.

 Thanks Jean for trying the examples out!

 We'll look into this tomorrow. I think we are down rev a bit
 in our OpenGL.
 Our Doubles should be GLdoubles to make everybody
 happy. We'll upload new code when fixed and let you know.

 Tom


 On Monday 10 May 2010 00:08, Jean-Marie Gaillourdet wrote:
  Hi,
 
  since I never took the time to understand frp properly I thought it would
  be helpful to look at some examples. I was able to compile and run the
  first to programs after I managed to find out the dependencies. But I
  failed to compile third one. I just got the a compiler error with
  ghc-6.12.1 on Mac OS X 10.6, see below.
 
  Best regards,
  Jean
 
  leibniz:robot_sim jmg$ ./go
  Compiling Generator
  [1 of 2] Compiling Model( Model.hs, Model.o )
  [2 of 2] Compiling Main ( Main.hs, Main.o )
  Linking main ...
  Compiling Player
  [1 of 5] Compiling ReadImage( ReadImage.hs, ReadImage.o )
  [2 of 5] Compiling Sprites  ( Sprites.hs, Sprites.o )
  [3 of 5] Compiling ViewSupport  ( ViewSupport.hs, ViewSupport.o )
 
  ViewSupport.hs:32:7:
  No instance for (MatrixComponent Double)
arising from a use of `scale' at ViewSupport.hs:32:7-11
  Possible fix:
add an instance declaration for (MatrixComponent Double)
  In the expression: scale
  In the definition of `scal': scal = scale
 
  ViewSupport.hs:100:9:
  No instance for (NormalComponent Double)
arising from a use of `normal' at ViewSupport.hs:100:9-33
  Possible fix:
add an instance declaration for (NormalComponent Double)
  In a stmt of a 'do' expression: normal (Normal3 nx ny nz)
  In the second argument of `($)', namely
  `do { normal (Normal3 nx ny nz);
mapM_
  (\ ((vx, vy, vz), tcoord)
   - do { texCoord tcoord;
    })
  (zip ([q0] ++ [q1] ++ [q2] ++ [q3]) ts) }'
  In the expression:
renderPrimitive Quads
  $ do { normal (Normal3 nx ny nz);
 mapM_
   (\ ((vx, vy, vz), tcoord)
- do { texCoord tcoord;
 })
   (zip ([q0] ++ [q1] ++ [q2] ++ [q3]) ts) }
 
  ViewSupport.hs:102:18:
  No instance for (TexCoordComponent Double)
arising from a use of `texCoord' at ViewSupport.hs:102:18-32
  Possible fix:
add an instance declaration for (TexCoordComponent Double)
  In a stmt of a 'do' expression: texCoord tcoord
  In the expression:
  do { texCoord tcoord;
 vertex $ Vertex3 vx vy vz }
  In the first argument of `mapM_', namely
  `(\ ((vx, vy, vz), tcoord)
- do { texCoord tcoord;
  vertex $ Vertex3 vx vy vz })'
 
  ViewSupport.hs:103:18:
  No instance for (VertexComponent Double)
arising from a use of `vertex' at ViewSupport.hs:103:18-23
  Possible fix:
add an instance declaration for (VertexComponent Double)
  In the first argument of `($)', namely `vertex'
  In the expression: vertex $ Vertex3 vx vy vz
  In the expression:
  do { texCoord tcoord;
 vertex $ Vertex3 vx vy vz }
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] FRP demos and tutorials page

2010-05-09 Thread Tom Poliquin
Haskell Cafe'rs,

My student and I (sometimes it's difficult to determine who is who) have 
struggled to understand Reactive for several months and thanks to some 
initial help from the Reactive list (thanks Paul C) have been able to write 
some demos and tutorials.

Apologies for posting this to the Haskell Cafe, instead of the FRP list
but we wanted to make our efforts available to a wider audience, and the
experts there are the choir.

We have created are a set of demos and tutorials for FRP (Conal reactive). 
It consists of four demos: the simple furnace, the human controlled furnace, 
the hybrid robot sim, and the FRP robot sim. The furnace demos both consist 
of a thermostat like application, in which a furnace heats up and cools down 
in attempt maintain a constant temperature. In the simple furnace, the goal 
temperature is a fixed constant, while in the human controlled furnace, the 
user can control the goal temperature. The robot sim demos both consist of a 
3D simulation in which a robot follows the walls of an arena using a simple 
control algorithm. The hybrid robot sim consists of two programs, one with 
FRP that simulates the robot, and one GLUT program that reads piped date from 
the first program to display the 3D view. The FRP robot sim is a single 
program that simulates the same robot scenario as the first, but uses 
reactive GLUT and FRP to do the whole demo in reactive style.

We attempted to but as much documentation in the programs as possible, as well 
as give an overview on the webpage about the functions we used. Please note 
that both of us are rather new to Haskell, and so, we may have used poor 
programming practices in these tutorials and demos. If you have any 
suggestions about them, please feel free to write to us.

Website:
http://www.formicite.com/dopage.php?frp/frp.html

Thanks,
Tom and Tony
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe