Let's say I have a data type with a lot of constructors.
data ManyValues
= Value0
| Value1
| Value2
...
| Value255
| Value256
deriving (Show,Eq)
How much memory is there for any value of this data type? My initial understanding was that each constructor is an 8-bit word in memory, but that if there are more constructors in the data type than 8 bits, possible values are possible. Does the constructor contain up to 16 bits, and so on, until it can address the entire range of constructors present in the data type? Or am I confused all this?
source
share