Hacker News new | ask | show | jobs
by to11mtm 310 days ago
> But why records and classes when records can also have methods.

Records have built in equality logic, Classes don't.

And, because of the interop story, they wanted to be able to define classes.

> C# reified generics and rust like monomorphised generics (with inline keyword) and they used to have two different syntaxes until recently

I almost prefer the old way, where SRTPs required the other syntax. On the other hand I guess between 'inline' and constraints the compiler makes the 'best choice' now...

Also, just minor pedantic comment, both C# and F# will monomorphize for struct of T

1 comments

> Records have built in equality logic, Classes don't.

I'm aware of this but i feel this is confusing. Just putting () changes semantics a whole lot

> Also, just minor pedantic comment, both C# and F# will monomorphize for struct of T

I wasn't aware thanks