Type error. The right-hand operand of : is required to be
a list. But head(B) is an integer.
Nonsense. I don't know what is meant by ->. Why does
this contain a comparison of head(tail(A)) to head(tail(B))?
That test needs to be done by a recursive call to merge. Don't
try to do the recursive call's work for it.