Join Kit Eason for an in-depth discussion in this video Error message improvements, part of What's New in Visual Studio 2017 for F# For Developers.
- [Instructor] Now we're going to look…at some of the improvements in error messages…to come out of the Fsharp compiler.…You might not think of this…as being the most important topic,…but it has been observed that Fsharp error messages…are comparatively unfriendly,…and specifically, they don't cue in you in…to things you need to do to rectify a mistake,…particularly if you're a beginner.…Well, that's all changed…and there's been some amazing work in this area.…So here we have a load of code…in which I've made various deliberate mistakes…and we're going to go through that code…and see how Fsharp helps us out.…
Let's do the simplest of all,…a typo.…So on line 5, I've declared something called umweltLevel,…and on line 8 I've done something I often do…which is mix up my w and my m,…and it may not be super obvious that that's what I've done…because the w and the m look visually quite similar,…but, let's hover over the error message,…the value or constructor umwelt,…when in fact, uwmeltLevel is not defined.…Maybe you want one of the following, umweltLevel.…
Kit Eason discusses the new value types that provide an opportunity for performance gains, the new result type which gives you access to the railway oriented programming style of error handling, and program organization and readability changes. Plus, he explores the evolution of tooling for F#, and explains how F# tooling has changed in Visual Studio 2017. To wrap up the course, he shares how you can contribute to the F# language and tooling by getting involved in the open-source community.
- Working with struct tuples
- Marking a record type as a struct value
- Marking a discriminated union as a struct type
- Using the fixed keyword to mark a value
- F# result type and associated functions
- Resolving potential naming clashes between modules and types
- Error message improvements
- The past and future of visual F# tooling in Visual Studio
- Reviewing F# tooling changes