ligo/src/test/contracts/match.religo
2019-12-10 13:47:31 +00:00

18 lines
251 B
Plaintext

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);
};