Fixed pretty printing and pattern split (#111)

This commit is contained in:
Radosław Rowicki
2019-07-29 13:27:01 +02:00
committed by Dincho Todorov
parent 4bf382a997
commit 045df292be
3 changed files with 59 additions and 9 deletions
+36
View File
@@ -0,0 +1,36 @@
contract TuplesMatch =
entrypoint tuplify3() = (t) => switch(t)
(x, y, z) => 3
entrypoint fst(p : (int, string)) =
switch(p)
(x, y) => x
entrypoint fst'(p : (int, string)) =
switch(p)
(x, _) => x
entrypoint snd(p : (int, string)) =
switch(p)
(x, y) => y
entrypoint snd'(p : (int, string)) =
switch(p)
(_, y) => y
entrypoint sum(p) =
switch(p)
(x, y) => x + y
entrypoint swap(p : (int, string)) =
switch(p)
(x, y) => (y, x)
entrypoint id(p : (int, int, string)) =
switch(p)
(x, y, z) => (x, y, z)
entrypoint nest(p : ((int, int), string)) =
switch(p)
(xy, z) => switch(xy) (x, y) => (x, y, z)
entrypoint deep(p : ((int, int), (int, int))) =
switch(p)
((x, y), (z, w)) => (x, y, z, w)
entrypoint deep_sum(p : ((int, int), (int, int))) =
switch(p)
((x, y), (z, w)) => x + y + z + w