Before you begin
This is a F# language class. To complete the coding exercises, you will need a Xamarin development environment (Mac or Windows) to run the exercise on. Please read the setup requirements if you need help installing the Xamarin development environment.
Overview
This class is designed to introduce you to the F# language. We will cover why F# is such an important language to learn, as well as some of the fundamentals of the language.
Lecture
Objectives
- Explain why F# is important
- Execute F# code in the REPL
- Working with expressions and loops
Exercises
Exercise materials are available from GitHub. The code can be cloned through a desktop Git client or downloaded directly as a ZIP file.
- Discover the REPLExercise
In this exercise, you will discover the convenience of working inside the F# REPL. - Working with immutable and mutable values in the F# REPLExercise
In this exercise, we will explore mutable and immutable values, and how the F# language reacts to both of them.
Additional Resources
Microsoft has extensive documentation on the F# language, you can start with the F# Language Reference (MSDN), or read through the Xamarin documentation on F#. Alternatively, you can read through a F# to C# Comparison, or a quick overview of F# syntax.
Type safetyF# is a statically typed language which provides great type safety features for the programmer. One of the interesting features we talked about in this class was the type safety supported for printfn.
Lambdas and anonymous functionsIn order to use many of the list and array operations, you must understand anonymous functions. Most of you will be familiar with this concept already through C#'s lambdas. You'll find the F# syntax is quite similar.