On Sun, Jun 16, 2013 at 01:03:48PM -0700, bri...@aracnet.com wrote:
> wireframe :: Double -> Double -> Double -> IO ()
> wireframe wx wy wz = do 
>   -- yz plane
>   renderPrimitive LineLoop $ do
>                        vertex $ Vertex3 0.0 0.0 0.0
>                        vertex $ Vertex3 0.0 wy 0.0
>                        vertex $ Vertex3 0.0 wy wz
>                        vertex $ Vertex3 0.0 0.0 wz
[...]
> 
>     No instance for (VertexComponent Double)
>       arising from a use of `vertex'
[...]
> 
> Changing the declaration to GLdouble -> GLdouble -> GLdouble -> IO() and using
> (0.0::GLdouble) fixes it

Vertex3 takes three arguments, all of which must be of the same instance of
VertexComponent.  Specifying GLdoubles in the signature of wireframe
specifies the types in the last three calls to Vertex3, but (0.0 ::
GLdouble) is still requried on the first to fix the type there.  How else
could the compiler know that you mean 0.0 to be a GLdouble and not a
GLfloat?

Tom

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

Reply via email to