mirror of
https://github.com/anoma/juvix.git
synced 2024-11-30 14:13:27 +03:00
12 lines
245 B
Plaintext
12 lines
245 B
Plaintext
|
-- Pattern matching with integers
|
||
|
module test050;
|
||
|
|
||
|
import Stdlib.Prelude open;
|
||
|
|
||
|
f : Int -> Int
|
||
|
| (negSuc zero) := ofNat 0
|
||
|
| (negSuc m@(suc n)) := ofNat n + ofNat m
|
||
|
| (ofNat n) := neg (ofNat n - ofNat 7);
|
||
|
|
||
|
main : Int := f -10 - f 1 + f -1;
|