mutrec.cd 436 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
(* All the types submitted at once are mutually recursive *)
type T = <t>S;;
type S = [ (Char | T)* ];;
let x : S = [ 'abc' <t>['def'] 'ghi' ];;

(* Consecutive function definitions (without any other toplevel phrase
   in the middle) are grouped together  *)

let fun f (x : Int) : Int = g x;;
let fun g (x : Int) : Int = 3;;
let a = 2;;
let fun h (x : Int) : Int = f x;;
   (* f and g are mutually recursive, but they cannot use h *)