title: Pattern matching string prefixes in Haskell
body: <p>Let's say I want to make a special case for a function that matches strings that start with the character 'Z'. I could easily do it using pattern matching by doing something like the following:</p>
  
  <pre><code>myfunc ('Z' : restOfString) = -- do something special
  myfunc s = -- do the default case here
  </code></pre>
  
  <p>But what if I want to match strings with a longer prefix? Say I want to have a special case for strings that start with the word "toaster". What's the best way to write a pattern to match such a string?</p>