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

18 lines
335 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 =
((action, store): (parameter, storage)) =>
{
let store =
store
+ (switch(action) {
| Addn => n
| Subn => -n
});
(([] : list(operation)), store)
};