I have this code in SMLNJ:
val reduce = fn : C list -> C list * int
datatype C = R | G | B | Y | SR | SG | SB | SY | DR | DG | DB | DY | P | W | W';
fun exhaustiveReduce(cList)=
let
fun helper((cList, score), prevScore, flag)=
if (0 = score andalso flag = true) then
(cList,prevScore)
else
helper(reduce(cList), prevScore+score, true)
in
helper((cList, 0), 0, false)
end
When I try to run the following line:
exhaustiveReduce ([B,B,B,G,G,G,G,Y,R,R,R,Y,Y,G,G,G])
I get this error:
I understand that the meaning is that I'm trying to send to the function an argument that
it doesn't expect to get, but what does the ?.
mean? how can I fix it?
P.S. I looked here:What does 'int ?. tree' mean in an SML error message? but didn't find it very useful.
Thanks