Union and Type** with FFI in Haskell?

C unions are not tagged unions, see wikipedia on this . In haskell MyUnion would take up more memory than a single raw (unboxed) 64-bit int. In GHC it would be a special pointer to either a thunk or a value: the thunk is when a lazy MyUnion has not been evaluated yet, the value is for when it has been evaluated and the pointed-to memory size can vary (unlike unions in C).

The "special" pointer would use the usually-zero low bits of the 64-bit pointer to indicate whether it is known to be a C or I value, to combine the tagging with the pointer.

Even in C you wouldn't know which member to use (unless clear from the context) if you were handed a.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions