[Haskell-cafe] modelling C in Haskell ..

Galchin, Vasili vigalchin at gmail.com
Fri May 30 02:46:25 EDT 2008


Hello,

     I don't want to write kludgy Haskell code!

typedef struct blah
{
       int val1;

       union {

           int  val2;

           struct {

                 int val3;

                 int val4;
           }
       }
}    C_type;

question: in Haskell, can I embed definition of the "union" inside of the C
typedef, i.e. recursion definition? Or must I have a separate definition for
the "union" which I "instantiate" inside the Haskell "typedef", i.e. Haskell
"data"?

Kind regards, Vasili
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080530/5676af8d/attachment.htm


More information about the Haskell-Cafe mailing list