[Haskell-cafe] compilation succeeds -- execution fails

Stefan O'Rear stefanor at cox.net
Sun Mar 30 02:00:30 EDT 2008


On Sat, Mar 29, 2008 at 10:21:32PM -0700, Jason Dusek wrote:
> Stefan O'Rear <stefanor at cox.net> wrote:
> >  The only type that you are allowed to assume corresponds to a C int is
> >  CInt, in the Foreign.C.Types module.  This probably isn't the problem,
> >  but it could make problems of its own on a 64-bit or otherwise weird
> >  system.
> 
>   So say I turn everything back to pointers to CInt, what is the
>   accepted way to convert from CInt to Int

Same as any other pair of whole-number types - fromIntegral.

>   and CInt to Char?

fromIntegral and toEnum

>   Is relying on the fact that CInt always wraps a Haskell integer an
>   okay way to go?

What do you mean by wraps?  It's an opaque type...

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20080329/b36fd454/attachment.bin


More information about the Haskell-Cafe mailing list