fun merge(nil,M) = M | merge(L,nil) = L | merge(L as x::xs, M as y::ys) = if x