I am trying to write a function in ML (SML/NJ) to check if a value is a list or not.
fun is_list [] = true | is_list (h::t) = true | is_list _ = false;
I expected the is_list function to be a 'a -> bool function. Instead, I get a match redundant error. Why is that? And how should the function be written?
thanks!