title: Standard ML Binary Tree Traversal
body: <p>I am new to SML and doing a practice about tree traversal.
  This is the setting of question.</p>
  
  <pre><code>datatype 'a bTree = nil | bt of 'a bTree * 'a * 'a bTree;
  </code></pre>
  
  <p>I need to write a function inorder which accepts a binary tree and return a lists of all members of the tree in inorder traversal.</p>
  
  <p>I wrote this line:</p>
  
  <pre><code>fun inorder(nil) = nil
    | inorder(bt(left,key,right)) = inorder(left) @ [key] @ inorder(right);
  </code></pre>
  
  <p>But get some error and don't know how to fix:</p>
  
  <pre><code>Error: operator and operand don't agree [tycon mismatch]
  operator domain: 'Z list * 'Z list
  operand:         'Z list * 'Y bTree
  in expression:
    (key :: nil) @ inorder right
  
  Error: operator and operand don't agree [tycon mismatch]
  operator domain: 'Z list * 'Z list
  operand:         'Y bTree * _
  in expression:
    inorder left @ (key :: nil) @ inorder right
  </code></pre>