Skip to content

Instantly share code, notes, and snippets.

@keiichiw
Created May 26, 2015 20:30
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 keiichiw/c86e68195f49a55fcaa3 to your computer and use it in GitHub Desktop.
Save keiichiw/c86e68195f49a55fcaa3 to your computer and use it in GitHub Desktop.
iso-recursive and equi-recursive
(* ones = (1,(1,(1,...)))*)
(* iso-recursive *)
type 'a infTuple = InfTuple of ('a * 'a infTuple);;
let rec iso_ones = InfTuple(1, iso_ones);;
(* equi-recursive *)
#rectypes;;
let rec equi_ones : (int * 'a) as 'a = (1, equi_ones);;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment