title: Elixir equivalent of C#, Java, C++ enum
body: <p>In C#, I might declare an enumeration like this:</p>
  
  <pre><code>enum QuestionType { Range, Text };
  </code></pre>
  
  <p>How would I do this in Elixir? What I would like to do is be able to pattern-match something like this:</p>
  
  <pre><code>def VerifyAnswer(QuestionType.range, answer) do
    assert answer &gt;= 0 &amp;&amp; answer &lt;= 5
  end
  </code></pre>
  
  <p>Or something like this, where <code>QuestionType.range</code> is a numeric constant, so it can be efficiently stored in DBs or serialized as an int to JSON.</p>