accessing OCaml records

Posted by hyperboreean on Stack Overflow See other posts from Stack Overflow or by hyperboreean
Published on 2010-06-13T18:03:06Z Indexed on 2010/06/13 18:12 UTC
Read the original article Hit count: 326

Filed under:
|

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

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

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

let s = {i = 12; j = 15;} clearly doesn't work - I know it has something to do with accessing the module in which the record is defined, but I've yet to get the syntax right.

© Stack Overflow or respective owner

Related posts about ocaml

Related posts about record