ligo/src/test/contracts/expected/match.religo.expected

18 lines
339 B
Plaintext
Raw Normal View History

2020-06-03 12:41:26 +02:00
type storage = int;
type parameter = Add(int) | Sub(int);
type return = (list(operation), storage);
let main =
2020-06-04 21:36:12 +02:00
((action, store): (parameter, storage)) =>
2020-06-03 12:41:26 +02:00
{
let store =
store
+ (switch(action) {
2020-06-04 09:54:25 +02:00
| Add(n) => n
| Sub(n) => -n
2020-06-03 12:41:26 +02:00
});
(([] : list(operation)), store)
};