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

6
(* Similarly for toplevel function definitions *)
7

8 9 10 11
let f (x : Int) : Int = g x
let g (x : Int) : Int = 3
let a = 2
let h (x : Int) : Int = f x
12
   (* f and g are mutually recursive, but they cannot use h *)