<font face="'courier new', monospace">What is natural Haskell representation of such enum?<br><br>enum TypeMask<br>{<br> UNIT,<br> GAMEOBJECT,<br><br> CREATURE_OR_GAMEOBJECT = UNIT | GAMEOBJECT<br>};<br><br>More sophisticated question is: and what data structures must be used when converting this naturally one to Haskell?<br>
<br>// 1-byte flaged enum<br>enum TypeMask<br>{<br> // ...<br> UNIT = 0x0004,<br> GAMEOBJECT = 0x0008,<br> // ...<br><br> CREATURE_OR_GAMEOBJECT = UNIT | GAMEOBJECT</font><div><span class="n" style="background-color:rgb(255,255,255);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre"> WORLDOBJECT</span><span style="background-color:rgb(255,255,255);font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre"> </span><span class="o" style="background-color:rgb(255,255,255);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;font-weight:bold;font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre">=</span><span style="background-color:rgb(255,255,255);font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre"> </span><span class="n" style="background-color:rgb(255,255,255);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre">UNIT</span><span style="background-color:rgb(255,255,255);font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre"> </span><span class="o" style="background-color:rgb(255,255,255);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;font-weight:bold;font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre">|</span><span style="background-color:rgb(255,255,255);font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre"> </span><span class="n" style="background-color:rgb(255,255,255);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre">PLAYER</span><span style="background-color:rgb(255,255,255);font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre"> </span><span class="o" style="background-color:rgb(255,255,255);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;font-weight:bold;font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre">|</span><span style="background-color:rgb(255,255,255);font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre"> </span><span class="n" style="background-color:rgb(255,255,255);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre">GAMEOBJECT</span><span style="background-color:rgb(255,255,255);font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre"> </span><span class="o" style="background-color:rgb(255,255,255);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;font-weight:bold;font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre">|</span><span style="background-color:rgb(255,255,255);font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre"> </span><span class="n" style="background-color:rgb(255,255,255);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre">DYNAMICOBJECT</span><span style="background-color:rgb(255,255,255);font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre"> </span><span class="o" style="background-color:rgb(255,255,255);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;font-weight:bold;font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre">|</span><span style="background-color:rgb(255,255,255);font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre"> </span><span class="n" style="background-color:rgb(255,255,255);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;font-family:'Bitstream Vera Sans Mono','Courier New',monospace;font-size:12px;line-height:16px;white-space:pre">CORPSE</span> </div>
<div><font face="'courier new', monospace"> // ... even more enum combos ...</font></div><div><font face="'courier new', monospace">};</font></div>