Unconstrained, type inference likes to string you along and then report some absurd speculative error based loosely on a mistake you made. An example from live code:

p2-tree.sml:41.6-43.39 Error: operator and operand don't agree (tycon
mismatch)
  operator domain: ((''Z * ''Z bintree_t * ''Z bintree_t)
                    * (''Z * ''Z bintree_t * ''Z bintree_t)
                    -> (''Z * ''Z bintree_t * ''Z bintree_t)
                       * (''Z * ''Z bintree_t * ''Z bintree_t)
                       -> bool)
                   * ((''Z * ''Z bintree_t * ''Z bintree_t)
                      * (''Z * ''Z bintree_t * ''Z bintree_t))
bintree_t
  operand:         ((''Z * ''Z bintree_t * ''Z bintree_t)
                    * (''Z * ''Z bintree_t * ''Z bintree_t)
                    -> bool) * _
  in expression:
    sorttree
        (lessfn,
         bintree
             ((case 
                of 
                 | ),(),rchild))


(go to my front-door page) eli+w3@cs.cmu.edu
19 Jan 2002