MLstate/opalang — Issue #28: Why doesn't OPA syntax allow optional parenthesis when functions accept a single argument?
Author: jordow
Created: 2012-01-13 09:30:35+00:00
State: open

In SML, all functions take a single argument that may be a tuple (which gives us the standard f(x,y,z) notation).
Furthermore, if I recall correctly, all functions are actually pattern matching their tuple arguments such as:
fn 0 => 0
| n => 1

This seems like a really elegant way to model function parameters. Why does OPA not adopt this, and might is the community open to adopting the convention?

The parenthesis-free single argument syntax makes named parameters very elegant as well.

result = callFunction {
param1: "someString",
param2: 23
}