I don't know about operator ?? but the defaultArg function can be used in place of the match currently.

By on 4/12/2008 3:20 AM ()

Hi Julien,

I didn't notice that defaultArg became part of fslib, thanks for the hint.

You've got to admit, though, that `a ?? v` is more readable than `a defaultArg b`, not only because it's terser and doesn't clutter up longer expressions, but also because it stands out from normal expressions and immediately signals "a is an option type".

Given that option types are ubiquitous in typical F# code and that there is a precedent for a very similar operator in C#, wouldn't such a definition of ?? be a good fit for F#?

By on 4/12/2008 3:46 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper