Earlier quoted context omitted.
> Nobody has yet convinced me that recursion has any sustained advantage over looping. Looping may require trampolining or defunctionalisation, whilst recursion can be written much more directly and simply. As a very simple example (in pseudocode): even(n: uint): boolean = n match { case 0: true case n: odd(n-1) } odd(n: uint): boolean = n match { case 0: false case n: even(n-1) } Whilst these are pretty silly implem…
It's heretic and beside the point, but: bool odd(uint n){return n&1;} bool even(uint n){ return !odd(n);} I can't help but think in terms of classic CPU.
fun odd (n: Uint32) -> Bool =
let Uint32(n0, _, _, _) = n in
let Byte(b0, _, _, _, _, _, _, _) = n0 in
b0
Who needs hardware support for integers anyway? If you want a two-complement arithmetic, you can build it yourself (although presumably it'll be in the standard library).