CComplex type

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

CComplex type

Daniel Cartwright
I have recently found it useful while working with the FFI to have a CComplex data type, like so:

data CComplex a = Complex {-# UNPACK #-} !a {-# UNPACK #-} !a

Would something like this be a good addition to Foreign.C.Types?

_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: CComplex type

Carter Schonwald
More broadly: the FFI types ghc has should be revamped to add not just that but also the StdInt types like (U)Int_{Ptr,64,32} etc

but yes, thats definitely specfied in like c99 or c11, and should be in the ffi addendum etc

all of the above should also be reflected in the 2020 haskell revision.

Ostensibly John Wiegley volunteered for that, but if you wanna lead the charge on that, i'm pretty confident he'd be happy to let you.  I'm "cosponsoring" that too, so any way i can help let me know :) 


On Tue, May 29, 2018 at 2:27 PM, Daniel Cartwright <[hidden email]> wrote:
I have recently found it useful while working with the FFI to have a CComplex data type, like so:

data CComplex a = Complex {-# UNPACK #-} !a {-# UNPACK #-} !a

Would something like this be a good addition to Foreign.C.Types?

_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries



_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: CComplex type

Daniel Cartwright
Yes, there should be a lot more in the C FFI. I would definitely be interested in working on that.

On Wed, May 30, 2018 at 1:49 PM, Carter Schonwald <[hidden email]> wrote:
More broadly: the FFI types ghc has should be revamped to add not just that but also the StdInt types like (U)Int_{Ptr,64,32} etc

but yes, thats definitely specfied in like c99 or c11, and should be in the ffi addendum etc

all of the above should also be reflected in the 2020 haskell revision.

Ostensibly John Wiegley volunteered for that, but if you wanna lead the charge on that, i'm pretty confident he'd be happy to let you.  I'm "cosponsoring" that too, so any way i can help let me know :) 


On Tue, May 29, 2018 at 2:27 PM, Daniel Cartwright <[hidden email]> wrote:
I have recently found it useful while working with the FFI to have a CComplex data type, like so:

data CComplex a = Complex {-# UNPACK #-} !a {-# UNPACK #-} !a

Would something like this be a good addition to Foreign.C.Types?

_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries




_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries