Out-of-the-box dotnet provides what it calls the "the Options pattern" which it describes as:
The options pattern uses classes to provide strongly typed access to groups of related settings.
Whilst this might be "strongly typed" in the sense that you're interacting with statically typed options objects, the binding mechanism is not strictly safe and so the static types are often a lie. This leads to a few notable problems, especially when working with it from F#.
- It's a large source of
NullReferenceExceptions because the binder will hapily set a value to
nullif it's missing in the underlying config. This means your F# type is probably lying to you about the fact its value cannot be null. F# developers would rather model…