Access OCaml Records

How can I use some OCaml entry that I defined in some other file? Say, for example, that I have an a.ml file in which I define an r record:

type r = { i: int; j: int; };

and the b.ml file in which I want to use the r record. Something like that:

let s = {i = 12; j = 15;} obviously doesn't work - I know this has something to do with accessing the module in which the entry is defined, but I haven't got the syntax correctly yet.

+5
source share
1 answer

, a.ml, A. , open A ( A ), i j A.i A.j .

+8

All Articles