
22 Jan
2012
22 Jan
'12
4:43 p.m.
What is natural Haskell representation of such enum? enum TypeMask { UNIT, GAMEOBJECT, CREATURE_OR_GAMEOBJECT = UNIT | GAMEOBJECT }; More sophisticated question is: and what data structures must be used when converting this naturally one to Haskell? // 1-byte flaged enum enum TypeMask { // ... UNIT = 0x0004, GAMEOBJECT = 0x0008, // ... CREATURE_OR_GAMEOBJECT = UNIT | GAMEOBJECT WORLDOBJECT = UNIT | PLAYER | GAMEOBJECT | DYNAMICOBJECT | CORPSE // ... even more enum combos ... };