Last active
August 29, 2015 14:14
-
-
Save muraiki/1658a29e82d941507bb5 to your computer and use it in GitHub Desktop.
multi+cached+subset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
subset NonNegativeInt of Int where * >= 0; | |
proto fib (|) is cached returns NonNegativeInt {*} | |
multi fib (0) { 0 } | |
multi fib (1) { 1 } | |
multi fib (NonNegativeInt $n) { fib($n - 1) + fib($n - 2) } | |
say fib(100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment