Skip to content

Instantly share code, notes, and snippets.

@t-katsushima
Created December 17, 2016 04:50
Show Gist options
  • Save t-katsushima/11aa0f8f3de1f38a9438e75def03b982 to your computer and use it in GitHub Desktop.
Save t-katsushima/11aa0f8f3de1f38a9438e75def03b982 to your computer and use it in GitHub Desktop.
let rec power n x =
if n = 0 then .<1>. else .< .~x * .~(power (n-1) x) >.;;
let rec power n x =
if n = 0 then .<1>. else .< x * .~(power (n-1) x) >.;;
let power5 = power 5;;
power5 .<3>.;;
Runcode.run;;
let f x = .< .< .~x >. >.;;
let f (x:'a code) = .< x >.;;
let f g = fun a -> .< .~g .~a >.;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment