Name: Anonymous 2014-09-13 5:48
Is it okay to use lower bits for a type tag?
data Either a b = Left a | Right b
Left "testicle"
Either String b
value but we can't tell the b
from the tag. It's a classification tag and can of course be encoded various ways, but it's in no way a type tag.Numeric = I Int | D Double
I
or D
) in the lowest bits of its representation, but it still wouldn't make them type tags. There's no way to find out at runtime if the value D 2.71
has the type Numeric
or maybe some other typeAsswipe = I Int | D Double | C Char Char Char Char Char Char