title: How to know if it is on the left or on the right after doing a function that returns Either?
body: <p>I'm new to Haskell and I want to do a function that returns an exit if it's left but I don't know how to do it.H
  ere is my function which returns either :</p>
  <pre><code>getOpts :: Conf-&gt;[String]-&gt; Either String Conf
  getOpts Help _ = Right Help
  getOpts c@Conf{} (&quot;--start&quot;:x:xs) = readPos x &gt;&gt;= (\x-&gt; getOpts c{start = x} xs)
  getOpts c@Conf{} (&quot;--lines&quot;:x:xs) = 
      readPos x &gt;&gt;= (\x-&gt; getOpts c{Main.lines = x} xs)
  getOpts c@Conf{} (&quot;--window&quot;:x:xs) = 
      readPos x &gt;&gt;= (\x-&gt; getOpts c{window = x} xs)
  getOpts c@Conf{} (&quot;--move&quot;:x:xs) = readPos x &gt;&gt;= (\x-&gt; getOpts c{move = x} xs)
  getOpts c@Conf{} (&quot;--rules&quot;:x:xs) = 
      readMPos x &gt;&gt;= (\x-&gt; getOpts c{rules = x} xs)
  getOpts c []  = Right c 
  getOpts _ _ = Left &quot;Invalid Parameter!&quot;```
  </code></pre>