Type-Driven Development with F#
Learn how to use the superior type system of F# to get rapid feedback on your design, how to rapidly evolve a prototype, and how to produce a final product based on the knowledge learned from creating the prototype.
What you'll learn
Learn how to use the strong type system of F# to your advantage – not only to check for correctness, but also in iterative development with short feedback cycles. You can use the type system to get rapid feedback about design ideas and implementation details, but also to get guidance on what to do next. Due to F#’s strong type inference, the type system of the language can be used in ways not available in C#, Java, or similar strongly typed languages. Learn how to combine the safety of static typing with the ease of development typically only offered by dynamically typed languages. The combination though, is even stronger than the mere sum of its parts.
Table of contents
- Introduction 2m
- Course Outline and Prerequisites 2m
- In This Module 0m
- Type-Driven and Test-Driven Development 1m
- If It Compiles, It Works? 1m
- F# Type System 1m
- Introduction to the Polling Consumer Example 3m
- Demo Introduction: Capturing Time 1m
- Demo: Capturing Time 8m
- Demo Recap: Capturing Time 1m
- Demo Introduction: Measuring Time 1m
- Demo: Measuring Time 7m
- Demo Recap: Measuring Time 0m
- Demo Introduction: Clocks 1m
- Demo: Clocks 15m
- Demo Recap: Clocks 0m
- Summary 1m
- Introduction 1m
- Outside-In Development 1m
- Help from Types 2m
- Finite State Machine Recipe 2m
- Polling Consumer Finite State Machine 2m
- Demo Introduction: Itemizing States 1m
- Demo: Itemizing States 3m
- Demo Recap: Itemizing States 1m
- Finite State Machine Recipe Step 1 and 2 1m
- Demo Introduction: Transition from Stopped 0m
- Demo: Transition from Stopped 2m
- Demo Recap: Transition from Stopped 0m
- Degenerate Cases 1m
- Demo Introduction: Transition from No Message 1m
- Demo: Transition from No Message 7m
- Demo Recap: Transition from No Message 2m
- Demo Introduction: Transition from Ready 1m
- Demo: Making the Transition Function Compile 5m
- Demo: Adding Statistics 5m
- Demo: Adding a Message Handler 3m
- Demo: Closing Over a Message 3m
- Demo Recap: Transition from Ready 2m
- Demo Introduction: Transition from Received 0m
- Demo: Transition from Received 5m
- Demo Recap: Transition from Received 1m
- Summary 2m
- Introduction 1m
- Demo Introduction: Run Function 0m
- Demo: Run Function 2m
- Demo Recap: Run Function 0m
- Demo Introduction: Transition Function 0m
- Demo: Transition Function 2m
- Demo Recap: Transition Function 0m
- Implementation Details 1m
- Demo Introduction: Should Idle Function 1m
- Demo: Should Idle Function 2m
- Demo Recap: Should Idle Function 1m
- Demo Introduction: Idle Function 0m
- Demo: Idle Function 2m
- Demo Recap: Idle Function 1m
- Demo Introduction: Should Poll Function 0m
- Demo: Should Poll Function 3m
- Demo Recap: Should Poll Function 1m
- Demo Introduction: Poll Function 1m
- Demo: Poll Function 4m
- Demo Recap: Poll Function 1m
- Outside In 1m
- Demo Introduction: Calculate Average 1m
- Demo: Calculate Average 3m
- Demo Introduction: Calculate Standard Deviation 1m
- Demo: Calculate Standard Deviation 3m
- Demo Introduction: Calculate Expected Duration 1m
- Demo: Calculate Expected Duration 2m
- Demo Recap: Calculate Expected Duration 0m
- Demo Introduction: Composition 3m
- Demo: Backwards Composition 3m
- Demo: Composition by Partial Function Application 6m
- Demo: Composition with Configuration Values 3m
- Demo Recap: Composition 1m
- Summary 1m
- Introduction 1m
- Stabilization 2m
- Property-based Testing 1m
- Demo Introduction: Testing Transition from No Message 1m
- Demo: Writing the First Property 5m
- Demo: Custom Equality 4m
- Demo: Transitioning from No Message to Ready 3m
- Demo: Transitioning from No Message to Stopped 2m
- Demo Recap: Testing Transition from No Message 1m
- Changes in Design 1m
- Demo Introduction: Testing Transition from Ready 0m
- Demo: Transitioning from Ready to Stopped 3m
- Demo: Transitioning from Ready to No Message 3m
- Demo: Transitioning from Ready to Received Message 4m
- Demo Recap: Testing Transition from Ready 1m
- Properties of Single-path Functions 1m
- Summary 1m
- Introduction 0m
- Demo Introduction: Testing Run Function 0m
- Demo: Testing Run Function 4m
- Demo Recap: Testing Run Function 1m
- Demo Introduction: Deconstructing Run 2m
- Demo: First Unfurl Property 5m
- Demo: Second Unfurl Property 3m
- Demo: Third Unfurl Property 4m
- Demo Interlude: Deconstructing Run 1m
- Demo: First Run Property 5m
- Demo: Second Run Property 3m
- Demo: Returning Statistics from Stopped 7m
- Demo Recap: Deconstructing Run 0m
- Start State 1m
- Transition 1m
- Summary 1m