ligo/src/test/contracts/match.religo

18 lines
251 B
Plaintext
Raw Normal View History

2019-12-10 13:47:31 +00:00
type storage = int;
type param =
| Add(int)
| Sub(int);
let main = ((p: param), storage) => {
let storage =
storage
+ (
switch (p) {
| Add(n) => n
| Sub(n) => 0 - n
}
);
(([]: list(operation)), storage);
};