title: Haskell: show and pretty-print instance
body: <p>I started Intelligent System studies at a university and our first language is Haskell. I must admit that I am not really familiar with it so far. Part of this week's task is to develop an algebraic datatype <code>Expr a</code> which represents the basic arithmetic operations <code>(+,-,*,/)</code>.</p>
  
  <p>The solution IMO should be:</p>
  
  <pre><code>module Expression where
  
      data Expr a = Number a |
      Var |
      Sum (Expr a) (Expr a) |
      Prod (Expr a) (Expr a) |
      Div (Expr a) (Expr a) |
      Pot (Expr a) a
              deriving (Show)     
  </code></pre>
  
  <p>Okay so far. The task is to implement a pretty-instance for our function now. i.e.:</p>
  
  <p>from</p>
  
  <p><code>Plus ( Pot ( Var 2)) ( Num 3)</code></p>
  
  <p>to</p>
  
  <p><code>x^2 + 3</code></p>
  
  <p>So, I had no idea what "pretty" means. After searching the internet I found out that "pretty" only means to rewrite the output in a human readable form. Is this correct? If it is, what does it mean to my function? Do I have to replace the <code>show</code> function with a <code>pretty</code> function? I don't really know where to start. </p>
  
  <p>I read several similar questions here but didn't get the point there. I would really be happy if someone could give me some hints, advice, solutions or whatever!</p>