[Haskell-cafe] open gl type conversions
svenpanne at gmail.com
Fri May 22 06:56:59 UTC 2015
2015-05-22 7:13 GMT+02:00 <briand at aracnet.com>:
> [...] GL.Size really needs a CInt so it seems like I have to do some sort
of explicit conversion, but I can never seem to figure out exactly how to
find the necessary function.
To be exact, Size expects 2 GLsizei
and GLsizei is a type synonym for CInt
but what this latter type actually is shouldn't matter most of the time.
The only thing you need to know here is that it's an integral number, and
your swiss army knife for conversion between integral numerical types is:
:: (Integral a, Num b) => a -> b
Don't be scared by its canonical definition (fromInteger . toInteger), GHC
has enough RULES to make this very efficient most of the time or even a
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe