Re: [Haskell-cafe] Calling a C function that returns a struct by value

2011-05-25 Thread Nick Bowler
On 2011-05-25 16:19 -0400, Matthew Steele wrote: > From Haskell, I want to call a C function that returns a struct by > value (rather than, say, returning a pointer). For example: > >typedef struct { double x; double y; } point_t; >point_t polar(double theta); > > I can create a Haske

[Haskell-cafe] Calling a C function that returns a struct by value

2011-05-25 Thread Matthew Steele
From Haskell, I want to call a C function that returns a struct by value (rather than, say, returning a pointer). For example: typedef struct { double x; double y; } point_t; point_t polar(double theta); I can create a Haskell type Point and make it an instance of Storable easily enough