datatype foo = A | B of bar and bar = C | D of foo val q = B (D A) fun main () = return {case q of B (D A) => Good | _ => Bad}