Questions tagged [f#]

F# is a succinct, expressive and efficient functional and object-oriented language for .NET which helps you write simple code to solve complex problems.

F# is an open source, functional-first programming language which empowers users and organizations to tackle complex computing problems with simple, maintainable and robust code. It is used in a wide range of application areas and is available across multiple platforms.

F# runs on Linux, macOS, Windows as well as HTML5 and GPUs. F# is free to use and has an OSI-approved open-source license. F# is supported by industry leading companies providing professional tools, and by an active open source community.


The Learning F# page provides information about tutorials and books. To install and run F# on various platforms including Windows, Linux, Mac, HTML5 and others, visit the Using F# page. For more information, see also Getting Started with F#.

Formal F# language specifications can be found on the F# at Microsoft Research website:

For idiomatic coding conventions and styles, please read F# Component Design Guidelines.

To search for F# operators such as "?" (dynamic operator) in StackOverflow, you can use http://symbolhound.com/.

Free F# Programming Resources

Copied as a part of: http://stackoverflow.com/tags/f%23/info

80 questions
74
votes
4 answers

What are the biggest differences between F# and Scala?

F# and Scala are both functional programming langugages that don't force the developer to only use immutable datatypes. They both have support for objects, can use libraries written in other languages and run on a virtual machine. Both languages…
Jonas
  • 14,867
  • 9
  • 69
  • 102
54
votes
3 answers

Why is an anemic domain model considered bad in C#/OOP, but very important in F#/FP?

In a blog post on F# for fun and profit, it says: In a functional design, it is very important to separate behavior from data. The data types are simple and "dumb". And then separately, you have a number of functions that act on those data…
37
votes
9 answers

Real world pitfalls of introducing F# into a large codebase and engineering team

I'm CTO of a software firm with a large existing codebase (all C#) and a sizable engineering team. I can see how certain parts of the code would be far easier to write in F#, resulting in faster development time, fewer bugs, easier parallel…
nganju
  • 512
  • 4
  • 9
34
votes
3 answers

Why is the rec keyword needed in F#?

In F# it is necessary to use the rec keyword. In Haskell there is no need to explicitly tell if a given function is recursive or not. Given the role of recursion in functional programming, the F# design seems rather odd to me. Is it a good…
Simon Bergot
  • 7,930
  • 3
  • 35
  • 54
33
votes
4 answers

Why does F# have an interactive mode but not C#?

F# comes out of the box with an interactive REPL. C# has nothing of the sort and is in fact kinda difficult to play around without setting up a full project (though LINQpad works and its also possible to do via powershell). Is there something…
George Mauer
  • 2,002
  • 1
  • 16
  • 18
29
votes
3 answers

Why not annotate function parameters?

To make this question answerable, let's assume that the cost of ambiguity in the mind of a programmer is much more expensive then a few extra keystrokes. Given that, why would I allow my teammates to get away with not annotating their function…
JDB
  • 628
  • 8
  • 15
27
votes
4 answers

Is pattern-matching against types idiomatic or poor design?

It seems like F# code often pattern matches against types. Certainly match opt with | Some val -> Something(val) | None -> Different() seems common. But from an OOP perspective, that looks an awful lot like control-flow based on a runtime type…
23
votes
3 answers

F# performance vs Erlang performance, is there proof the Erlang's VM is faster?

I've been putting time into learning functional programming and I've come to the part where I want to start writing a project instead of just dabbling in tutorials/examples. While doing my research, I've found that Erlang seems to be a pretty…
afuzzyllama
  • 367
  • 1
  • 2
  • 11
20
votes
2 answers

Y combinator and tail call optimizations

The definition of a Y combinator in F# is let rec y f x = f (y f) x f expects to have as a first argument some continuation for the recursive subproblems. Using the y f as a continuation, we see that f will be applied to successive calls as we can…
nicolas
  • 349
  • 1
  • 7
19
votes
3 answers

Fastest Functional Language

I've recently been delving into functional programming especially Haskell and F#, the prior more so. After some googling around I could not find a benchmark comparison of the more prominent functional languages (Scala,F# etc). I know it's not…
Farouk
  • 309
  • 1
  • 2
  • 5
18
votes
1 answer

Confusion between F# and C#

I am fairly new to functional programming and C#/F#. What is unclear to me is: Can you do functional programming in C# and/or in F#? Or is it something like, you write some OO code in C#, and some FP code in F#, and use them together?
voluminat0
  • 321
  • 1
  • 7
18
votes
2 answers

Does F# offer anything particularly useful for database-driven web development?

My organization finally upgraded to MS Visual Studio 2010 this year. One of the big new features that Visual Studio 2010 offers is the F# programming language. I understand that F# offers a functional programming paradigm, similar to Lisp. Unlike…
Vivian River
  • 2,397
  • 5
  • 21
  • 32
16
votes
3 answers

Should you use C# and F# together

I know you can use C# and F# together in the same project however I'm not sure if its a good idea to do so. It seems to me that mixing two very different coding styles (functional vs OOP) could cause a lack of cohesion in the design. Is this…
Tom Squires
  • 17,695
  • 11
  • 67
  • 88
14
votes
5 answers

How should someone used to FP thinking read imperative code?

I graduated from university about five months ago, and have been working in a local startup for past four months. While at university, I studied Haskell, F# etc on my own. We were taught Java at the university, but I was exposed to functional…
13
votes
4 answers

What are some good practices when trying to teach declarative programming to imperative programmers?

I offered to do a little bit training in F# at my company and they seemed to show some interest. They are generally VB6 and C# programmers who don't follow programming with too much passion. That being said I feel like it is easier to write correct…
ChaosPandion
  • 6,305
  • 2
  • 33
  • 33
1
2 3 4 5 6