reason icon indicating copy to clipboard operation
reason copied to clipboard

Simpler syntax for local opens in expression blocks

Open mlms13 opened this issue 5 years ago • 0 comments

I'd like syntax support for: MyModule.{ let v = ...; v }, which is currently a syntax error. It works if you wrap the {} in parentheses, which it then prints as { open MyModule; let v = ...; v }. I think that supporting "open module in block" syntax will be especially useful with the new let operators:

let x = Decode.{
  let+ name = field("name", string)
  and+ age = field("age", int)
  and+ email = field("emailAddress", email);
  make(~name, ~age, ~email);
};

mlms13 avatar Apr 03 '20 18:04 mlms13