F# advanced exercises

I've finished reading books on F# and I've done most of the exercises in the book which were kind of basic. Now I'm looking for more advanced exercises to improve my skills with the language and functional programming concepts in general.

Is there a place or a book where I can practice F# with specially designed exercises to learn the language features? Right now I've only managed to find introductory stuff or general programming problems websites (for example Project Euler).

My goal is really to learn how to think in a functional way and get used to things like pattern matching, partially applied function, monads/workflows, tail recursion, and so on. I want to learn how to solve problems using functional constructs.

I'd be also interested in any good exercises that were designed for other functional programming languages (like Haskell).


If you believe in learning through hand-on experience, Project Euler problems may be the exercises for you. They are not limited to functional programming but their mathematical nature is well-suited to F# and other functional languages. Yet Another Project Euler Series is a good resource to get started with Project Euler in F#.

I used to learn Prolog through 99 problems but I saw people learn Lisp, Haskell, OCaml, etc through them as well. I think these exercises are useful resources to learn F#. They are well-designed problems. The first few ones teach you to work with lists (basic data structure in F#). More advanced problems on logic, tree and graph are good opportunities to explore advanced F# features. Here are the sets of solutions in OCaml and F# in case you need them for reference.


I got started by going through the first 50 Project Euler problems. That was a great initial learning experience.

Soon after I started participating actively on Stackoverflow F# tag. Seeing the answers provided by others, and having to research answers of my own was very educational (you know what they say about learning by teaching, it's true).

Then my greatest learning experience came from work on open source projects in F#. Namely FsEye and Unquote. Both of those ideas came from reflecting on my experience with F# and seeing what opportunities existed for enriching the F# ecosystem. In the case of FsEye, it was enhancing the FSI experience. In the case of Unquote, it was exploiting a unique F# feature. These two learning by doing experiences on serious projects were what really brought me to a point of deep understanding and skill in F#.


tryfsharp.org is a great site for learning F#. Tutorials are broken down by skill level and problem domain. It might be just what you're looking for.

链接地址: http://www.djcxy.com/p/80490.html

上一篇: 为什么没有功能性编程呢?

下一篇: F#高级练习