[Felix-language] unions

2014-12-07 Thread john skaller
So, we know the standard representation of a sum type is: struct _uctor_ { int variant; void *data; }; which is layout compatible with int * address however there are various special representations. For example if a variant has no argument, it's just represented by the "int" ta

[Felix-language] unions

2012-02-19 Thread john skaller
Now I have unions appearing to work so that a union of one constructor is replaced by its argument. Eg union X = | R of int is replaced by int. This is still not fully efficient, since you still need to use a match to extract the value: let R ?r = x in ...l and the match still u