sophia/test/contracts/pipe_operator.aes
Gaith Hallak 74aff5401b
Introduce pipe operator |> (#371)
* Add pipe operator

* Add tests

* Update docs and CHANGELOG
2022-04-12 12:40:32 +03:00

19 lines
374 B
Plaintext

contract Main =
function is_negative(x : int) =
if (x < 0)
true
else
false
function inc_by_one(x : int) = x + 1
function inc_by_two(x : int) = x + 2
type state = bool
entrypoint init(x : int) = x
|> inc_by_one
|> inc_by_one
|> inc_by_two
|> ((x) => x * 5)
|> is_negative