3 ms·
> let notAValue: string | null = null When did F# get unions?
by jfausdfwsdfa 2y ago
> let notAValue: string | null = null
When did F# get unions?
- datadeft 2y agoIt had it since the first version as far as I know.
- jfausdfwsdfa 2y agoDamn. It's only for nulls: https://github.com/fsharp/fslang-design/blob/main/RFCs/FS-1060-nullable-reference-types.md https://github.com/fsharp/fslang-design/blob/main/RFCs/FS-10... Wonder if they will generalize: https://github.com/fsharp/fslang-design/blob/main/RFCs/FS-1092-anonymous-type-tagged-unions.md https://github.com/fsharp/fslang-design/blob/main/RFCs/FS-10...
- ctenb 2y agoAt least they chose a syntax that makes it possible to generalize, which is a smart choice imho :)
- robertlagrant 2y agoYeah it looks a lot like Python's PEP 604[0]. [0] https://peps.python.org/pep-0604 https://peps.python.org/pep-0604