Who is this course for?
- Developers who see the benefits of F# and want to learn how to use the techniques in real projects.
- Those who want to harness the F# type system by turning specifications into easy-to-read F# code.
- Use Test Driven Development (TDD) so that you can assist the type system while creating F# code to represent a problem domain.
- This course is not aimed at advanced users who are already using F# in their day jobs. It is designed to cover general aspects of the F# type system and TDD.
F# is a mature, functional-first, general purpose language especially well suited to computer science, machine learning, distributed computing and web applications, Domain Driven Design and Test-Driven Development too. There really is no limit to what F# can do for you.
Section 1: Modelling a Domain with F#
In this lecture we introduce the course and describe the topics you are going to encounter.
In this lecture we start creating the concept of a card using F# code.
Now we have the concept of a card underpinned we can start constructing a full deck of cards.
In this video we examine what is required to deal a card from the deck, learning about the restrictions we should enforce on how we call the deal function.
We have a deal function and now we can begin to test the function to ensure it is behaving as we desire.
After highlighting some shortcomings in the method we have chosen to deal cards, we go over the code and refactor it and come out with a complete function that can deal a card properly.
To ensure we are going to be able to create a game of cards that can be played fairly we need to know how to shuffle the deck of cards to add an element of unpredictability. In this lecture we create a shuffler.
In this video we learn how we can utilise the type system to create a deal function that is fully functioning and prevents predictability.
In this video we will fix the failures we caused in our test by introducing a new type; 'ShuffledDeck'
This lecture demonstrates how to benchmark your algorithms to help you have a better intuition for implementing algorithms of your own.
Final steps to clean up the domain file Cards.fs, in this video we compact the file and demonstrate how the entire domain can be represented on a single page.
Well done for completing the course, you have learned how to successfully and effectively turn poorly written specifications into beautiful, concise and readable F# code.
Section 2: Type Driven Development
In this video we introduce Paket, a library for helping you maintain the dependencies within your projects, it provides more than vanilla Nuget.
In this video you'll create a test that will help guide you as we develop the functionality for scoring hands. You'll start by using FsUnit as a wrapper around NUnit, just to get you started with writing unit tests in more of an F# oriented manner.
In this lecture you'll learn about the algorithm required to deal cards to each of the players within the game.
We need to know which hand is the highest rated hand, we can try ordering the hands to find the highest rated hand. In this video we see how this might be achieved.
Now you have the hands in order from highest rated to lowest rated, you can make a guess at what the highest rated hand might be. In this lecture you will learn how.
In poker you need to do more than simply identifying the highest rated hand based on the card rank values within the hand. You also need to rate based on the type of Poker combinations, in this lecture we start with the easiest to find, a 4 of a Kind combination. We show you how to identify this combination.
Like 4 of a Kind, this combination is easy to identify but it can also produce a Full house, in this lecture I show you how to refactor the existing 4 of a Kind combination and prepare for identifying further combinations.
F# in the Workplace
3+ hours of course content.
Average 4.4 out of 5 Star rating.
The course is designed to show you techniques you can use in your work place.
You should allow 10 hours in total for challenge time.