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
7
votes
1 answer

When do you use a class instead of a record when you do not want to use mutable fields?

I'm imagining a situation where you are creating an F# module in a purely functional style. This means objects do not have mutable fields and are not modified in place. I'm assuming for simplicity that there is no need to use .NET objects or other…
fairflow
  • 173
  • 6
6
votes
2 answers

Are There Other Use Cases For F# Type Providers?

So I think I know the main use case for F# 3.0's Type Providers, i. e. better Intellisense when working with data stores that use them. Are there other use cases for Type Providers or is that pretty much it?
Onorio Catenacci
  • 2,947
  • 3
  • 27
  • 37
5
votes
2 answers

How to define IntsWithoutZero type in f#

Recently I saw a great video of Scott Wlaschin about patterns in functional programming. He gives an example of dividing a numbers. In f# we'd use int option for the result to handle division by zero in a nice functional way. As another possibility…
5
votes
3 answers

simple let binding vs constant function

I understand the reasons why I would prefer let a = f(x) over let a() = f(x), especially when f takes is a long running function. I also think it is correct to say, that, considering lambda calculus origins of functional programming let a() is truly…
4
votes
1 answer

List asymetry in F#

I am trying out F# for the first time with little prior theoretical functional programming knowledge. I have written a small function so calculate simple moving average on a list. Here it is: let rec sma n data = let length = List.length data if…
Gabor Angyal
  • 1,079
3
votes
2 answers

What is idiomatic way in f# to express sequence of if statements with overlapping conditions

Let's say I got code like this: if(conditionA) do something if(conditionA && conditionB) do something more Obviously, I could nest the ifs (although when there are more complicated conditions this is not readable for me) like…
2
votes
1 answer

What is the point of an Expr in vanilla F#? How can it be applied?

Without using the power pack to convert Expr to C# expressions, it seems like once I create an Expr, the only thing I can do with it is either print out a string representation of it, or...create another Expr. If I print out a code quotation of an…
1
vote
2 answers

Is the "_" character in the first anonymous function a wildcard?

Given this function let readInput() = Seq.initInfinite (fun _ -> Console.ReadLine()) |> Seq.takeWhile (fun s -> s <> null) ` |> Seq.map int` is the _ in the function called by Seq.initInfinite a wild card, so that anything can be read off…