Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Since the null-related blog post isn't published yet, anyone here knows the reason to implement null rather than write middle-layer in C# for whatever you want to use?


At this point, almost all community and all standard library APIs use nullable reference types (and types that aren't NRTs are obviously expected to always have a value).

This change in F# makes it able to interoperate with C# NRTs, where C#'s T? becomes F#'s T | null and vice versa.

I feel like the ease of integration of F# into existing codebases is one of the major selling points. You don't need to write wrappers in order to consume most existing C# code, which, for example, enables writing a core with business logic in F# while keeping the IO in C# if necessary.


F# has chosen this approach of implementing compatibility with newer C# features such as support for ValueTuple<T> and Span<T>. It has been pretty successful at keeping F# inside the compatibility story.

---EDIT---

Mean to post this under the GP




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: