Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A good F# codebase to learn from [closed]

Tags:

f#

I've been teaching myself F# for a while now. I've read Programming F# by Chris Smith (great book) and I've written a few small scripts for getting the job done here and there.

But IMO the best way to learn a new programming language—and more importantly, the idioms that come with it—is to read a good open source codebase written in that language. Naturally, writing code in that language is crucial, but in the beginning, you're basically struggling with your own ignorance about how things should be done. You could perform certain tasks one way or the other, but it takes experience to realize the flaws and virtues of each. Even after you've gotten a firm grasp of how things work, reading the code of people who have an even firmer one helps a great deal.

Most would agree that the most insightful parts of any learn-a-programming-language book are the code examples, and reading a well-written open source codebase is the next level of that.

So are there any out there for F#?

like image 252
Lucas Avatar asked Dec 22 '22 02:12

Lucas


2 Answers

Ref this question.

IMO, F# PowerPack is the best code base there.

like image 111
Yin Zhu Avatar answered Jan 06 '23 20:01

Yin Zhu


Here are a few additional links that you may find interesting:

  • If you download F# for Visual Studio 2008, it also comes with sources of the entire F# library. This is sometimes a bit difficult code and it uses some internal tricks in a few places, but it is sometimes very good resource for learning (for example, Map type is a great example of a tree data structure).

  • There are some official F# Samples and some F# Community Samples (which includes my 3D fractal, example of working with quotations and a few shorter examples).

  • You can also look at the source code of samples from my Real-World Functional Programming book. Especially later chapters contain relatively complex sample applications (parallel simulations of animas, rectangle drawing application, etc.) The code has quite a lot of comments, so this may be useful for learning F#.

like image 45
Tomas Petricek Avatar answered Jan 06 '23 20:01

Tomas Petricek