data constructor used without argument in pattern?
<p>I'm not that familiar with SML but I have wrote the following program:</p>

<pre><code>datatype 'a bin_tree = Leaf of 'a
|   Node of 'a bin_tree * 'a bin_tree

fun height Leaf (x) = 0
|   height Node (l1,l2) = 1 + Int.max(l1,l2)

fun is_balanced Leaf (x) = true
|   is_balanced Node (l1,l2) = 
    if(abs(height(l1) - height(l2))&lt;2)
        then (is_balanced(l1); is_balanced(l2))
    else false

val prod_tree = fold_tree
    op* (fn x =&gt; x)

fun fold_tree e f Leaf (x) =  f(x)
|   fold_tree e f Node (l1, l2) = (e(fold_tree e f(l1)), e(fold_tree e f(l2)))
</code></pre>

<p>However, when the is compiled <code>use "lab2.sml";</code> I get the following error:</p>

<pre><code>lab2.sml:4.12-4.16 Error: data constructor Leaf used without argument in pattern
lab2.sml:5.10-5.14 Error: data constructor Node used without argument in pattern
lab2.sml:7.17-7.21 Error: data constructor Leaf used without argument in pattern
lab2.sml:8.15-8.19 Error: data constructor Node used without argument in pattern
lab2.sml:9.10-9.33 Error: operator and operand don't agree [overload conflict]
</code></pre>

<p>I've done my research but maybe I'm just missing something. Any help would  be greatly appreciated. Thanks!</p>