Below are the abstract data types for conj and or presented in lecture notes lect2.
abstype ('a,'b) conj = c of 'a * 'b with
fun pair x y = c(x,y)
fun left (c(x,y)) = x
fun right(c(x,y)) = y end;
abstype ('a,'b) or = left of 'a | right of 'b with
fun putl x = left x
fun putr x = right x
fun cases (left x) f g = f x
| cases (right x) f g = g x end;
Write ML programs of the following types using only these data types
and applications and abstractions ( fn).
('a -> 'a -> 'b) -> 'a -> 'b
(('a,'b) or -> 'c) -> ('a -> 'c,'b -> 'c) conj
(('a,'a -> 'b) or -> 'b) -> 'b
((('a -> 'b) -> 'c) -> 'd) -> 'a -> ('b -> 'c) -> 'd