ligo/src/contracts/super-counter.ligo

11 lines
259 B
Plaintext
Raw Normal View History

2019-05-13 00:56:22 +04:00
type action is
| Increment of int
| Decrement of int
function main (const p : action ; const s : int) : (list(operation) * int) is
block {skip} with ((nil : list(operation)),
case p of
| Increment (n) -> s + n
| Decrement (n) -> s - n
2019-05-13 00:56:22 +04:00
end)