-
-
Save chrisdone/23654c576759671d92360b6130b51b0b to your computer and use it in GitHub Desktop.
Ackermann function in Dhall
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
-- Credit to: https://news.ycombinator.com/item?id=15186988 | |
let iterate | |
: (Natural → Natural) → Natural → Natural | |
= \f n -> | |
fold (n + 1) f 1 | |
let increment : Natural → Natural = \n -> n + 1 | |
let ackermann | |
: Natural → Natural → Natural | |
= \m -> fold m iterate increment | |
in ackermann |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment