Programming F# 3.0
Format: PDF / Kindle (mobi) / ePub
Why learn F#? With this guide, you’ll learn how this multi-paradigm language not only offers you an enormous productivity boost through functional programming, but also lets you develop applications using your existing object-oriented and imperative programming skills. You’ll quickly discover the many advantages of the language, including access to all the great tools and libraries of the .NET platform.
Reap the benefits of functional programming for your next project, whether you’re writing concurrent code, or building data- or math-intensive applications. With this comprehensive book, former F# team member Chris Smith gives you a head start on the fundamentals and walks you through advanced concepts of the F# language.
- Learn F#’s unique characteristics for building applications
- Gain a solid understanding of F#’s core syntax, including object-oriented and imperative styles
- Make your object-oriented code better by applying functional programming patterns
- Use advanced functional techniques, such as tail-recursion and computation expressions
- Take advantage of multi-core processors with asynchronous workflows and parallel programming
- Use new type providers for interacting with web services and information-rich environments
- Learn how well F# works as a scripting language
Grouping Patterns, Combining active patterns or (||) Boolean operator, Boolean Values or (|||) bitwise operator, Bitwise Operations, When to Use an Enum Versus a Discriminated Union ORM (object-relational mapping), SQL Data Type Providers OverflowException exception, Intentional Shadowing overloading methods, Method Overloading operators, Operator Overloading–Operator Overloading override keyword, Method Overriding overriding methods, Method Overriding–Method Overriding
printfn, and sprintf. printf takes the input and writes it to the screen, whereas printfn writes it to the screen and adds a line continuation: > // printf and printfn printf "Hello, " printfn "World";; Hello, World Note The existing .NET System.Console class can be used for writing text to the screen, but printf is better suited for the functional style because its arguments are strongly typed and therefore contribute to type inference. System.Console.Read should still be used for
with FunctionsPartial Function ApplicationPassing functions as parameters Eliminating Redundant Code Closures Functional PatternsMemoizationMemoizing recursive functions Mutable Function Values Lazy ProgrammingReducing memory usage Abstracting data access Functional Data StructuresFunctional Set Functional Map 8. Applied Object-Oriented ProgrammingOperatorsOperator Overloading Indexers Adding Slices Generic Type Constraints Delegates and EventsDefining
lost switching between the different threads. The same program on a multiprocessor or multicore machine, on the other hand, would be able to execute several threads concurrently, so it will often go much faster. The drawback with multiple things going on at once is that it can be difficult to keep track of data being read or written. Is the data that thread alpha read out of date because thread beta just updated the value? What if thread alpha needs to access a file that thread beta has locked
moment to fork and explore the repository for this book’s source code. How the Book Is Organized This book is divided into three parts. Part I focuses on multiparadigm programming in F#. Early chapters are devoted to programming in a specific F# paradigm, whereas later ones will help flesh out your understanding of language capabilities. By the end of Part I you will be fluent in the F# language and its idioms. Part II will introduces a few lingering concepts but primarily focuses on