Standard ML of New Jersey (32-bit) v110.99 [built: Thu Dec 24 11:01:10 2020] - - datatype BoolInt = BoolPart of bool | IntPart of int; datatype BoolInt = BoolPart of bool | IntPart of int - - val x = BoolPart true; val x = BoolPart true : BoolInt - val y = BoolPart false; val y = BoolPart false : BoolInt - val z = IntPart 5; val z = IntPart 5 : BoolInt - val w = IntPart ~3; val w = IntPart ~3 : BoolInt - - x; val it = BoolPart true : BoolInt - w; val it = IntPart ~3 : BoolInt - - - val a = (false, 5); val a = (false,5) : bool * int - - a; val it = (false,5) : bool * int - x; val it = BoolPart true : BoolInt - - - fun f x = if x < 0 then (false, ~1) else (true, 1); val f = fn : int -> bool * int - - fun g x = if x < 0 then BoolPart false else IntPart 1; val g = fn : int -> BoolInt - - - f; val it = fn : int -> bool * int - g; val it = fn : int -> BoolInt - - - val x:BoolInt = true; stdIn:25.5-25.22 Error: pattern and expression in val dec do not agree [tycon mismatch] pattern: BoolInt expression: bool in declaration: x : BoolInt = true - - - val x:BoolInt = BoolPart true; val x = BoolPart true : BoolInt - val x:BoolInt = true;