Join Kit Eason for an in-depth discussion in this video Underscores in numeric literals, part of What's New in Visual Studio 2017 for F# For Developers.
- [Instructor] In this chapter of the course…which is comparatively brief,…we're going to have a look at some of the changes…that have been made to make F# code in the environment…a little more readable and friendly.…Specifically we've got underscores in numeric literals…which lets you make things a little more readable…when you're dealing with long numbers…and we've got error message improvements…which has some really, really nice improvements…to the way error messages are rendered by the compiler.…So here we have some code…where we're declaring some literals…so we're binding some literal values.…On line five we're making a count…and it's quite hard to see it at glance…whether that's ten million or a 100 million or one million…but now in F# 4.1 you can put underscores…in arbitrary places in these literals…and they will not effect in any way the value…that's generated but they do make it much easier on the eye…and you can tell at a glance that's ten million…so just to reiterate that point…F# is not caring where you put those underscores.…
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