commit 2b9e05dc71f1484ca666c9ec8718c7a0d41ab83f Author: nihonium Date: Wed Oct 4 22:56:34 2023 +0300 task 3 diff --git a/task3/01.jpg b/task3/01.jpg new file mode 100644 index 0000000..ca2f2d2 Binary files /dev/null and b/task3/01.jpg differ diff --git a/task3/02.jpg b/task3/02.jpg new file mode 100644 index 0000000..c76764f Binary files /dev/null and b/task3/02.jpg differ diff --git a/task3/functions.ml b/task3/functions.ml new file mode 100644 index 0000000..4c96ddd --- /dev/null +++ b/task3/functions.ml @@ -0,0 +1,11 @@ +type ('a, 'b) or_ = + | Inl of 'a + | Inr of 'b;; + +let f1 x = match snd x with + |Inl y -> Inl (fst x, y) + | Inr z -> Inr (fst x, z);; + +let f2 x = match x with + |Inl y -> (fst y, Inl (snd y)) + |Inr z -> (fst z, Inr (snd z));;