title: Converting byte to an instance of an enum in F#
body: <p>Let's consider the following enum in C#</p>
  
  <pre><code>public enum ScrollMode : byte
  {
        None = 0,
        Left = 1,
        Right = 2,
        Up = 3,
        Down = 4
  }
  </code></pre>
  
  <p>The F# code receives a byte and has to return an instance of the enum
  I have tried</p>
  
  <pre><code>let mode = 1uy
  let x = (ScrollMode)mode
  </code></pre>
  
  <p>(Of course in the real application I do not get to set 'mode',
   it is received as part of network data).</p>
  
  <p>The example above does not compile, any suggestions?</p>