The "Why use F#?" series
This series of posts will give you a guided tour through the main features of F# and then show you ways that F# can help you in your day-to-day development.
-
1. Introduction to the 'Why use F#' series
An overview of the benefits of F# -
2. F# syntax in 60 seconds
A very quick overview on how to read F# code -
3. Comparing F# with C#: A simple sum
In which we attempt to sum the squares from 1 to N without using a loop -
4. Comparing F# with C#: Sorting
In which we see that F# is more declarative than C#, and we are introduced to pattern matching. -
5. Comparing F# with C#: Downloading a web page
In which we see that F# excels at callbacks, and we are introduced to the 'use' keyword -
6. Four Key Concepts
The concepts that differentiate F# from a standard imperative language -
7. Conciseness
Why is conciseness important? -
8. Type inference
How to avoid getting distracted by complex type syntax -
9. Low overhead type definitions
No penalty for making new types -
10. Using functions to extract boilerplate code
The functional approach to the DRY principle -
11. Using functions as building blocks
Function composition and mini-languages make code more readable -
12. Pattern matching for conciseness
Pattern matching can match and bind in a single step -
13. Convenience
Features that reduce programming drudgery and boilerplate code -
14. Out-of-the-box behavior for types
Immutability and built-in equality with no coding -
15. Functions as interfaces
OO design patterns can be trivial when functions are used -
16. Partial Application
How to fix some of a function's parameters -
17. Active patterns
Dynamic patterns for powerful matching -
18. Correctness
How to write 'compile time unit tests' -
19. Immutability
Making your code predictable -
20. Exhaustive pattern matching
A powerful technique to ensure correctness -
21. Using the type system to ensure correct code
In F# the type system is your friend, not your enemy -
22. Worked example: Designing for correctness
How to make illegal states unrepresentable -
23. Concurrency
The next major revolution in how we write software? -
24. Asynchronous programming
Encapsulating a background task with the Async class -
25. Messages and Agents
Making it easier to think about concurrency -
26. Functional Reactive Programming
Turning events into streams -
27. Completeness
F# is part of the whole .NET ecosystem -
28. Seamless interoperation with .NET libraries
Some convenient features for working with .NET libraries -
29. Anything C# can do...
A whirlwind tour of object-oriented code in F# -
30. Why use F#: Conclusion