ali

OCaml Trick: Ommitting module names in records

In Uncategorized on October 26, 2009 at 2:22 pm

Instead of typing the module name every time.

Compare

let pos = {
  Lexing.pos_fname = fname;
  Lexing.pos_lnum = lnum;
  Lexing.pos_bol = bol;
  Lexing.pos_cnum = bol + n;
}

to

let pos = {
  Lexing.pos_fname = fname;
  pos_lnum = lnum;
  pos_bol = bol;
  pos_cnum = bol + n;
}
Advertisements
%d bloggers like this: