title: Haskell source encoding
body: <p>The Haskell 2010 Language Report says:</p>
  
  <blockquote>
  Haskell uses the Unicode [2] character set. However, source programs are currently biased toward the ASCII character set used in earlier versions of Haskell.
  </blockquote>
  
  <p>Does this mean UTF-8?</p>
  
  <p>In ghc-7.0.4/compiler/parser/Lexer.x.source:</p>
  
  <pre><code>$unispace    = \x05 -- Trick Alex into handling Unicode. See alexGetChar.
  $whitechar   = [\ \n\r\f\v $unispace]
  $white_no_nl = $whitechar # \n
  $tab         = \t
  
  $ascdigit  = 0-9
  $unidigit  = \x03 -- Trick Alex into handling Unicode. See alexGetChar.
  $decdigit  = $ascdigit -- for now, should really be $digit (ToDo)
  $digit     = [$ascdigit $unidigit]
  
  $special   = [\(\)\,\;\[\]\`\{\}]
  $ascsymbol = [\!\#\$\%\&amp;\*\+\.\/\&lt;\=\&gt;\?\@\\\^\|\-\~]
  $unisymbol = \x04 -- Trick Alex into handling Unicode. See alexGetChar.
  $symbol    = [$ascsymbol $unisymbol] # [$special \_\:\"\']
  
  $unilarge  = \x01 -- Trick Alex into handling Unicode. See alexGetChar.
  $asclarge  = [A-Z]
  $large     = [$asclarge $unilarge]
  
  $unismall  = \x02 -- Trick Alex into handling Unicode. See alexGetChar.
  $ascsmall  = [a-z]
  $small     = [$ascsmall $unismall \_]
  
  $unigraphic = \x06 -- Trick Alex into handling Unicode. See alexGetChar.
  $graphic   = [$small $large $symbol $digit $special $unigraphic \:\"\']
  </code></pre>
  
  <p>...I'm not sure what to make of this. <code>alexGetChar</code> wasn't really helpful.</p>