Created
May 26, 2015 20:32
-
-
Save keiichiw/5f20ed87e7c86edb85ed to your computer and use it in GitHub Desktop.
空腹関数(iso-recursive, equi-recursive)
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
let rec fix f x = f (fix f) x;; | |
(* hungry function *) | |
(* iso-recursive *) | |
type iso_hungry = Hungry of (int -> iso_hungry);; | |
let iso_hungryfun = Hungry (fix (fun f n-> Hungry f));; | |
(* equi-recursive *) | |
#rectypes;; | |
type equi_hungry = int -> equi_hungry;; | |
let equi_hungryfun = (fix (fun (f:equi_hungry) n -> f));; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment