Skip to content

Instantly share code, notes, and snippets.

@rrnewton
Created June 25, 2015 03:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rrnewton/f69dd5bd06fc92e5fec4 to your computer and use it in GitHub Desktop.
Save rrnewton/f69dd5bd06fc92e5fec4 to your computer and use it in GitHub Desktop.
let rec spower : int -> int code -> int code =
fun n x ->
if n = 0 then <1>
else < ~x * ~(spower (n-1) x) >
let spowern n = <fun x -> ~(spower n <x> )>
let powExp exp = ! (spowern exp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment