haskell Binary Tree exercises : <p>In Graham Hutton's book Programming in Haskell, there was an error in solving Chapter 10 Exercise 3.</p>

<p>When the number of leaves on the left and right side trees is not more than one, these trees are said to be balanced.
Of course, it seems to be balanced by itself. Define a function to determine if the tree is balanced.
First, define a function that counts how many leaves are in the tree.</p>

<pre><code>data Tree = Leaf Int | Node Tree Tree

leaves :: Tree -&gt; Int
leaves (Leaf _) = 1 leaves 
leaves (Node l r) = leaves l + leaves r

balanced :: Tree -&gt; Bool
(-) :: Int -&gt; Int -&gt; Integer
balanced (Leaf _) = True
balanced (Node l r) = abs (leaves l - leaves r) &lt;= 1
&amp;&amp; balanced l &amp;&amp; balanced r
</code></pre>

<p>I do not know anything about Haskell, but my professor gave me the assignment. Help</p>
