[Haskell-cafe] FRP demos and tutorials page

Jean-Marie Gaillourdet jmg at gaillourdet.net
Mon May 10 03:08:21 EDT 2010


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 }




More information about the Haskell-Cafe mailing list