On Mon, 2005-11-28 at 08:24 +0100, David Baelde wrote:
> First, I'd like to point that you're talking about sum types and not
> variants. For short, variants are the backquoted labels `Int of int,
> and I think they cost more at runtime, for they cannot be encoded as
> integers.
Sum types are also known as variant types. This terminology is even
used in the OCaml documentation.
What you're talking about are *polymorphic* variants, and they are in
fact encoded as integers, but they don't fit in the tag-portion of the
GC header so they take up more space than regular variants if they have
any parameters.