title: Haskell-function to convert lower case char to uppercase char
body: <p>I've stumbled across some code in a Haskell tutorial that does not seem to work for me.</p>
  
  <pre><code>fromEnum :: Char -&gt; Int
  toEnum :: Int -&gt; Char
  
  offset :: Int
  offset = fromEnum 'A' - fromEnum 'a'
  
  toUpper :: Char -&gt; Char
  toUpper ch = toEnum (fromEnum ch + offset)
  </code></pre>
  
  <p>The text book from which this excerpt is taken states that the following conversion function will convert a lower case Char to an upper case one. However when I try running the script I get the following error message:</p>
  
  <pre><code>eval.hs:1:1:
      The type signature for ‘fromEnum’ lacks an accompanying binding
        (The type signature must be given where ‘fromEnum’ is declared)
  
  eval.hs:2:1:
      The type signature for ‘toEnum’ lacks an accompanying binding
        (The type signature must be given where ‘toEnum’ is declared)
  Failed, modules loaded: none.
  </code></pre>
  
  <p>I'm new to Haskell, so can someone tell me what I'm missing here? Is the textbook wrong? </p>