NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
Explore union types in C# 15 (devblogs.microsoft.com)
karmakaze 3 days ago [-]
I haven't read this in detail but I expect it to be the same kind of sealed type that many other languages have. It doesn't cover ad-hoc unions (on the fly from existing types) that are possible in F# (and not many non-FP languages with TypeScript being the most notable that does).
orthoxerox 3 minutes ago [-]
Third paragraph from the top:

> unions enable designs that traditional hierarchies can’t express, composing any combination of existing types into a single, compiler-verified contract.

let_rec 9 minutes ago [-]
> ad-hoc unions (on the fly from existing types) that are possible in F#

Are you sure? This is a feature of OCaml but not F# IIUIR

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 12:25:13 GMT+0000 (Coordinated Universal Time) with Vercel.