From outside Argentina, you can
En Argentina (⭐️⭐️⭐️)
Si te interesa el contenido en español, mirá LEEME.md
These guides are oriented to those programmers interested in learning some concepts on functional programming, from a practical perspective. F# is an excelent first functional programming language: it is functional (of course), it has a clean and readable syntax (not a lot of fancy symbols and stuff), it is flexible (in case you need to grasp some other paradigm in the middle of your code) and it is concise enough to express your ideas with clarity.
Learning a new language and a new programming paradigm is a wonderful adventure. You do not need any special preparation, although I assume that the reader has some background in at least one popular language (let us say C, Python, Java or JavaScript, for example).
This guides are entirely written as Jupyter Notebooks. Yes, it is possible to run F# in a Jupyter notebook interactive environment, which is fantastic for learning.
The path of the course starts at functional programming, then delves into F# and finally .NET is introduced as a vast, resourceful library. No experience in the .NET ecosystem is needed! The course is aimed to the understanding of the functional side of F#. I purposedly left aside many possibilities that the language offers, but drift apart from this core of the course. Hopefully so of them can be revisited in more advanced lessons.
If you need the course in other language, you can use nbTranslate, a Jupyter notebook extension that creates multilanguage notebooks by translating the content using google translate. Follow the instructions in those sites to get it work.
I tried to reference all the material to their respective authors. If you find some of your work unreferenced, drop me a line and I will gladly include it.
The course is structured as a collection of Polyglot Jupyter Notebooks. A Jupyter Notebook is a simple application that enables one to run chucks of code in cells, that can be intertwined with text, plots, math, etc. The notebook attaches itself to a kernel, that takes care of executing the code in a web browser. The most popular language used in notebooks is Python, however, many different languages can be used. A polyglot notebook includes the chance to run many different languages, F# among them.
To run the lessons as is, just open this repo in MyBinder:
Give it a little time, and this will open the notebooks in your web browser.
Open the one of your choice, check that the Kernel
on the right is properly selected:
It automatically detects .NET C#,
but that is not the language you are looking for:
and you are good to go.
If you want to play around the guides, make the exercises, etc., it is better to get your own copy of this repo by forking it.
Once you fork the repo, go to MyBinder. You will land into this page:
Copy the url of your forked repo into the GitHub
field, and you can leave the Git ref
and Path to a notebook
empty. Click on launch and wait a while until My Binder works the magic.
One the binder is opened, click on the es
(en español) or en
(english version) directory in the panel at the left, and you will see all the available notebooks.
Follow the instructions above to select the F# kernel.
If you want to experience the notebooks at your own computer, you need to install the polyglot extension for VS Code. Follow the instructions there to get everything working offline.
No problem! Simply copy/paste the codes from the notebooks in the repo into Fable REPL, which is an online F# compiler. Just write your code in the left pane, click the usual play button (or Alt+Enter) and that's it, you're programming in F#!
Intermezzo: A classic Kata
Intermezzo: Exercises
- Type Providers
- Exercises
- Exploring exoplanets with Type Providers and Plotly: Part 1
- Exploring exoplanets with Type Providers and Plotly: Part 2
- Exploring exoplanets with Type Providers and Plotly: Part 3
This is an opinionated list of web resources and books that helped me with F#. These are books and sites I use frequently, for a more a complete list of resources, check the list of the F# Foundation and the learning resources in Microsoft .NET site.
-
Stylish F# 6 by Kit Eason. Loved the first chapter about the sense of style in programming, and the next chapters follows that spirit.
-
Essential F#, by Ian Russell. With a big difference from other approaches, this book starts with a full example in F# that is througly discussed, and then presents the elements of the language in the next chapters.
-
Beginning F# 4.0, by Robert Pickering and Kit Eason. Just a little outdated (we are now at version 7.0), approaches the language from its different paradigms, from functional to object oriented to imperative programming.
-
Expert F# 4.0, by Don Syme, Adam Granicz, Antonio Cisternino. By the very same creator of the language, it also showcases the flexibility of F# to adopt different programming paradigms. The examples are advanced in general, but useful to understand deeply the inner works of F#.
-
F# for fun and profit, by Scott Wlaschin. One of the most complete references with detailed examples and a profound view of fundamentals. Check also Scott's presentations in YouTube.
-
What I wish I knew when learning F#, by Daniel Bachler.
-
Fable, the amazing transpiler from F# to JavaScript (and lately, other languages. Is not just a compiler, but a way to use these languages together. Depending on the recipe you would like to prepare, add the ingredients at your own pleasure. Also, check Fable REPL, where you can sketch with F#, no installation of anything needed
-
Feliz is kind of hard to define, but basically it enables you to build and/or interact with React components directly in F#.
-
Feliz.Bulma is a wrapper around the well-known Bulma CSS framework, tailored to the Feliz DSL.
-
Html2Feliz enables you to translate plain HTML into Feliz.
-
SAFE Stack is a full fledged F# framework to build web applications. It takes care of the front end, the backend and even the deployment into the Azure cloud.
- Topological sort in F# by Matthew Crews. In this fantastic series, Matthews starts with a pure functional version of a topological sort, and squeezes all the (rather advanced to me) features of F# to speed up the code.
- What I wish I knew when learning F#, by Daniel Bachler.
- A nice thread on reusability of binding names.
- Decoupling decisions from effects, by Mark Seemann.
- Dependency Rejection, by Mark Seemann.
A playlist of videos somewhat related to this content.
- Serge Tihon for a weekly summary of F# stuff.
- Mark Seemann, fantastic in-deep blog on programming.
- Scott Hanselman for software, the universe and everything.
- F# Online for, well, all F#.
- Fast F#, squeezing out F# for performance.
- Angel Muñoz, for F# and the www.