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.
Course info
Rating
(73)
Level
Intermediate
Updated
Jul 17, 2015
Duration
3h 56m
Table of contents
Feedback from Types
Behavior
Implementation
Stabilizing Transitions
Stabilizing Execution
Finishing Touches
Description
Course info
Rating
(73)
Level
Intermediate
Updated
Jul 17, 2015
Duration
3h 56m
Description

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.

About the author
About the author

Mark Seemann is the author of Dependency Injection in .NET and the inventor of AutoFixture. He is a professional programmer and software architect living in Copenhagen, Denmark, and currently an independent advisor. He enjoys reading, drawing, playing the guitar, good wine, and gourmet food.

More from the author
Test-Driven Development with F#
Intermediate
2h 17m
May 6, 2015
Introduction to Property-based Testing with F#
Intermediate
1h 34m
Apr 17, 2015
More courses by Mark Seemann
Section Introduction Transcripts
Section Introduction Transcripts

Feedback from Types
Hello. My name is Mark Seemann, and this is the Type-Driven Development with F# course, module one, Feedback from Types. Have you ever worked in a statically-typed language and felt that the type system was in your way? Have you ever wanted to return two values from an operation only to dread that that would mean coming up with yet another type to model those two values? Did you instead cop out and use an out parameter as in this C# example? Have you ever wanted to unit test some behavior only to realize that would entail introducing an interface? Did you go to the trouble of introducing that interface and give it a proper name? Or did you just forget about it and shirked writing that unit test? Now in contrast, have you ever worked in a dynamic language and felt the relief that there's no type system holding you back? Need to return two values from an operation? Not an issue, just do it like in this JavaScript example. Need to invoke an operation under dependency? No worries, just call it and monkey patch it from a unit test. It would seem that life is easier without static types, so why do we have statically-typed languages? Have you ever built a big system in a dynamic language? Have you ever wasted half a day troubleshooting an issue only to realize that you've mistyped something in a completely different part of the code base? Have you ever felt apprehension when refactoring such a code base? Have you ever felt that you had to write too many of the same unit tests over and over to have a safe feeling about some really basic functionality? Static typing can help with these issues, but it can do more if you let it. With a strong type system, you can have the best of both worlds. Learn how in this course.

Behavior
Hello. My name is Mark Seemann, and this is the Type-Driven Development with F# course, module two, Behavior. Have you ever encountered the expression behavior-driven design? Have you ever heard about outside-in development? A common problem in software development is that we programmers tend to get mired in implementation details instead of focusing on the so-called business problem. Unless you're writing software for fun, someone is paying you to solve problems with software, and the thinking behind outside-in development is that you should focus on solving those problems. In this module, you'll learn how you can approach a problem from the outside-in using F#'s type system to guide you and keep track of your remaining work as you go. In module one, you got an introduction to the polling consumer example. In this module, you'll see how to tackle that problem using a recipe for a finite state machine. You'll learn how this particular problem can be modeled as a finite state machine, and you'll see plenty of demos of how to apply the recipe in order to tease out the high-level behavior of the system without getting stuck with implementation details. All the time you'll see how the type system can guide you and keep track of remaining work. When you are done with this module, you should have gained an understanding of how to use the type system to your advantage while focusing on the desired behavior of the system.

Implementation
Hello. My name is Mark Seemann, and this is the Type-Driven Development with F# course, module three, Implementation. In the previous module, you saw how to use the type system to get feedback about high-level design. Some of that feedback may cause you to immediately change things as you work with a high-level behavior. Other feedback serves as an implicit to-do list indicating remaining work. In this module, you're going to hear more about the notion of using the type system as an implicit to-do list and how it informs the remaining work. While you'll learn a bit more about the abstract concepts, most of this module will be a continuation of the PollingConsumer example, so you'll see lots of demos. When the module is over, we'll have a PollingConsumer that can run and exit as required.

Stabilizing Transitions
Hello. My name is Mark Seemann, and this is the Type Driven Development with F# course, module four, Stabilizing Transitions. In the previous modules, you saw how you can experiment with your design while getting feedback from the type system. In this and the next module, you'll see how to stabilize the design. Specifically, you'll see how you can use property-based testing to cover the important behavior of the polling consumer with regression tests. In this module, you'll see how to cover the transitions, and in the next module, you'll see how to cover the execution of the state machine.

Stabilizing Execution
Hello. My name is Mark Seemann, and this is the Type-Driven Development with F# course, module five, Stabilizing Execution. In the previous module, you saw how to migrate the transitions from the prototype to a production-ready code base. In this module, you'll see how to continue the migration with the execution logic.

Finishing Touches
Hello. My name is Mark Seemann, and this is the Type-Driven Development with F# course, module six, Finishing Touches. In the previous two modules, you saw how to add regression tests to the important logic using property-based testing. In this module, you'll see how to put some finishing touches on the Polling Consumer in order to turn it into a real application. You'll see how to compose the application and how to report statistics before it exits.