mutrec.cd 367 Bytes
Newer Older
1
(* Adjacent type declarations are mutually recursive *)
2 3 4 5
type T = <t>S;;
type S = [ (Char | T)* ];;
let x : S = [ 'abc' <t>['def'] 'ghi' ];;

6
(* Similarly for toplevel function definitions *)
7 8 9 10 11 12

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 *)