Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
munchler
· 5y ago · 0 comments
F# has anonymous records, which are great, but I definitely wouldn't want them to be the default.
Comments
[–]
grumpyprole
5y ago
The F# ones are tacked-on and have awkward syntax, but otherwise, why not? As I said, anonymous records could permit named arguments for free, e.g.
let foo {x, y} = x + y in foo {x=1, y=2}
The function "foo" above has type:
{ x:int, y:int } -> int
Again, a nominal type can always easily be created from a structural type.