Hello, I want to convert a Haskell Integer (Data.Int.Int32) to a C long (Foreign.C.Types.CLong), but it seems this code here doesn't work:
intToLong :: Int32 -> Clong
intToLong num =
let maybelong = cast num
in if isNothing maybelong
then
0
else
fromJust maybeLong
(It always returns 0)
Could anyone give me a hint as to what the problem is?
Thanks!
_______________________________________________
Haskell mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell
