SMLNJ Insertion Sort Operator and Operand dont agree error
问题 Im making an insertion sort code in SML, here it is fun compare(x:real, y:real, F) = F(x, y); fun isEqual(x:real, y:real) = ((x <= y) andalso (x >= y)); fun rinsert(x: real, [], F) = [x] |rinsert(x, (y::ys), F) = if isEqual(x, y) then rinsert (x, ys, F) else if compare(x, y, F) then x::y::ys else y::(rinsert (x, ys, F)); fun rinsort([], F) = [] |rinsort(x::xs, F) = rinsert(x, (rinsort(xs, F), F)); However, on running it i get this error val isEqual = fn : real * real -> bool val rinsert = fn