title: Pattern matching in a let expression
body: <p>How do you extract a value from a variable of an unknown constructor?</p>
  
  <p>For instance, I would like to negate the value in an Either if was constructed as a Right:</p>
  
  <pre><code>let Right x = getValue
  in Right (negate x)</code></pre>
  
  <p>This code successfully binds Right's value (an Int in this case) to x.</p>
  
  <p>This works, but what if getValue returns a Left instead?  Is there a way to determine the type of a variable in a let expression?  Or is there a better way to approach this problem?</p>