|
|
|
|
|
by Zababa
1722 days ago
|
|
I agree that ML-style function signature is probably the best and most readable. `name: type` is a lot better than `type name`. I would argue that `match x with` would be better than `case x of`, to highlight that pattern matching is different than your usual switch. Calling out explicitely the contructors with `contructors` is a good idea, I think it can make things easier for new people. Edit: I wonder if it would help to also have a record type. Enum allows you to have full ADTs, but named tuples are often more useful than regular tuples. |
|
This is highly subjective. I find the latter to be far more readable. Reading a variable name knowing it's type makes more sense.