The type should be mobile->mobile
where
datatype mobile = Object of int | Wire of mobile * mobile
Code gives me error constructor and argument dont agree in pattern and operator and operand dont agree
fun reflect (Object v) = Object v
| reflect (Wire(x,t1,t2)) = Wire(x,reflect t2,reflect t1);
The error message is very indicative.
Wireconstructor has 2 arguments while you provide 3 arguments forWireinreflectfunction.A corrected version: