I am trying to implement a Binary Search Tree in SML. I have an insert function and I am trying to implement another function that takes a list and calls the insert function on each element in the list. This is what I have so far,
fun insertB (l) = insert (hd(l), Node(insertB(tl (l)), Nil, Nil))
but i don't have a base case, so thats one problem. My input function takes an int and a Node as parameters. The error I am currently getting is error right-hand-side of clause doesn't agree with function result type [tycon mismatch]