mirror of
https://github.com/HigherOrderCO/Bend.git
synced 2024-09-11 11:56:54 +03:00
43 lines
406 B
Plaintext
43 lines
406 B
Plaintext
zero_succ = @x switch x {
|
|
0: 0
|
|
_: x-1
|
|
}
|
|
|
|
succ_zero = @x switch x {
|
|
_: x-1
|
|
0: 0
|
|
}
|
|
|
|
zero = @x switch x {
|
|
0: 0
|
|
}
|
|
|
|
succ = @x switch x {
|
|
_: x-1
|
|
}
|
|
|
|
succ_zero_succ = @x switch x {
|
|
_: x-1
|
|
0: 0
|
|
_: (+ x-1 1)
|
|
}
|
|
|
|
zero_succ_zero = @x switch x {
|
|
0: 0
|
|
_: x-1
|
|
0: 1
|
|
}
|
|
|
|
zero_zero_succ = @x switch x {
|
|
0: 0
|
|
0: 1
|
|
_: x-1
|
|
}
|
|
|
|
zero_succ_succ = @x switch x {
|
|
0: 0
|
|
_: x-1
|
|
_: (+ x-1 1)
|
|
}
|
|
|
|
main = 0 |