Introduce pipe operator |> (#371)

* Add pipe operator

* Add tests

* Update docs and CHANGELOG
This commit is contained in:
Gaith Hallak
2022-04-12 12:40:32 +03:00
committed by GitHub
parent cfcf0a8a81
commit 74aff5401b
7 changed files with 41 additions and 6 deletions
+18
View File
@@ -0,0 +1,18 @@
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