title: What to use instead of a list comprehension
body: <p>I'm just getting started with Haskell and finished a nice <a href="http://www.cs.nott.ac.uk/~gmh/mgs-appsem-exam.pdf" rel="nofollow">exercise</a> to make a Caesar cipher. </p>
  
  <p>One of the first steps was to make a function that will take a letter and turn it into a number. I know that chr and ord can do this already but part of the exercise was to write your own. </p>
  
  <pre><code>let2num c = head [ b | (a,b) &lt;- zip ['a'..'z'] [0..25], a==c]
  </code></pre>
  
  <p>I'm new to the Haskell syntax and one of the first things I learned was list comprehensions, so that has become my hammer. I'm very curious though, what is another (likely better) way to write this function? </p>
  
  <p>If you're curious the rest of the cipher is in a <a href="https://gist.github.com/796430" rel="nofollow">gist</a>.</p>
  
  <p>EDIT</p>
  
  <p>I'm also interested in other ways to translate back from numbers to letters.</p>
  
  <pre><code>num2let d = head [ a | (a,b) &lt;- zip ['a'..'z'] [0..25], b==(d `mod` 26)]
  </code></pre>