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

learn more… | top users | synonyms

0
votes
0answers
55 views

Best way to handle language interoperability

Background In a language like F#, direct interoperability with most other .NET languages is possible. For example, it is possible to use classes written in C# directly in F#, and it is possible to ...
3
votes
3answers
157 views

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 ...
1
vote
1answer
81 views

What is the value of a let expression

From what I understand, every code in f# is an expression, including let binding. Say we got the following code: let a = 5 printfn "%d" a I've read that this would be seen by the compiler as let a ...
3
votes
1answer
182 views

Have enterprises adopted pure FP to create desktop user interfaces? Examples? [closed]

I see some evidence (F#) online that functional programming is penetrating enterprise. Where I work we primarily develop VB.NET WinForms applications. The .NET infrastructure for developing ...
0
votes
0answers
38 views

Can a type provider mimic an anonymous class?

I'm working on building a website using the F# MVC 5 template, and I noticed that the template creator uses formally declared types for the route defaults. In VB.Net and C#, this is typically done ...
5
votes
1answer
109 views

Why are F# exceptions generally not suffixed with 'Exception'?

In .NET, it is idiomatic to suffix exception types with Exception. But most, if not all, sources I have seen for custom exception types in F# don't follow this idiom. Most seem to use the suffix ...
6
votes
2answers
196 views

Why does F# Core define generic array types?

I just noticed that the FSharp.Core namespace includes generic array types of up to 4 dimensions, i.e. Core.[]<'T>, Core.[,]<'T>, etc. C# and VB seem to be doing just fine with System.Array - ...
7
votes
4answers
981 views

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 ...
16
votes
3answers
732 views

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 ...
6
votes
1answer
1k views

How do I approach a serious F# project without C# knowledge?

So, essentially the project I wish to undertake is an SVG editor. I would prefer to use WPF because then I can leverage XAML for my application layout (that designer is so nifty). Unfortunately, I ...
3
votes
2answers
299 views

Is there a way to created nested computation expressions?

In F#, I want to build a hierarchical data structure in a way with a minimum amount of language noise. The actual problem is trying to build an RSpec inspired framework using F#. RSpec allows the ...
4
votes
3answers
2k views

Why C# is not statically typed but F# and Haskell are?

There was a talk given by Brian Hurt about advantages and disadvantages of static typing. Brian said that by static typing he don't mean C#, but F# and Haskell. Is it because of dynamic keyword added ...
1
vote
1answer
619 views

Why was F# created?

For my current class, I have to pick and research a Programming Language (or popular scripting language) and answer quite a few questions about it, write a paper, and do some example programs ...
5
votes
4answers
593 views

From a high level programming perspective, where does the 'different-paradigm' barrier between C# and F# really kick in?

I'm aware that they both use different programming paradigms, but from a high level perspective apart from differing syntax it seems most basic tasks can be achieved in similar fashion. I only say ...
8
votes
0answers
177 views

Why does OCaml's (and F#'s) type inference algorithm need tagging functions as recursive? [duplicate]

From Real World OCaml (beta): OCaml distinguishes between non-recursive definitions (using let) and recursive definitions (using let rec) largely for technical reasons: the type-inference ...
26
votes
1answer
2k views

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 ...
3
votes
1answer
428 views

How to serialize and deserialize lambda expression in F#?

I serialized lambda expressions in C# before. Now I wanna use F# instead of C# for serialization and deserialization. I heard F# is better in this area. Is it true? How can I do that with F#? I’d ...
5
votes
2answers
656 views

Use Queue<T> or stick to native f# lists

I need something that represents a queue in F#. The queue will be filled with items once, and (as the application progresses) items will be taken from this queue and moved to other lists. Should I ...
19
votes
2answers
1k views

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 ...
9
votes
3answers
4k views

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 ...
4
votes
1answer
431 views

Why Does F# Contain Both Modules and Namespaces?

I've been assuming that F# includes the module keyword in addition to the namespace keyword due to backwards compatibility with OCaml. Is this the only reason for the inclusion of the module keyword ...
6
votes
2answers
313 views

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 ...
5
votes
1answer
525 views

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 ...
18
votes
3answers
879 views

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# ...
30
votes
4answers
4k views

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 ...
2
votes
2answers
405 views

How do functional languages handle a mocking situation when using Interface based design?

Typically in C# I use dependency injection to help with mocking; public void UserService { public UserService(IUserQuery userQuery, IUserCommunicator userCommunicator, IUserValidator userValidator) ...
0
votes
1answer
971 views

Database Driven Web Application, C# Front-End and F# Back-End meaning

Hi I am an intern working with ASP.NET. My current task is to make a website which will incorporate some jquery viewing features. This project seems to me will be primarily dealing with reading data ...
21
votes
5answers
2k views

How to make the transition to functional programming?

Lately, I have been very intrigued with F# which I have been working a bit with. Coming mostly from Java and C#, I like how concise and easily understandable it is. However, I believe that my ...
8
votes
4answers
693 views

Design in “mixed” languages: object oriented design or functional programming?

In the past few years, the languages I like to use are becoming more and more "functional". I now use languages that are a sort of "hybrid": C#, F#, Scala. I like to design my application using ...
13
votes
3answers
5k views

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, ...
9
votes
4answers
5k views

Example of where Functional Programming is Superior to Imperative or Object-Oriented Programming? [duplicate]

Possible Duplicate: Which problems domains are more suited to functional programming solutions I've been reading about functional programming. I've been using mostly C#.net recently, and ...
10
votes
3answers
1k views

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 OO) could cause ...
5
votes
3answers
876 views

How can I translate ML code to F#?

Recently I found a book, Purely Functional Data Structures and all the examples in this book are given in ML with Haskell versions in its appendix. But I only know one programming language with the ...
10
votes
2answers
804 views

Is using F# good enough for learning the important functional programming concepts of Haskell?

I'm coming from Linux and Ruby. I've been interested in learning more functional programming, and in particular the ML-ish style. I've tried reading through the Real World Haskell book and trying some ...
13
votes
5answers
526 views

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 ...
16
votes
2answers
2k views

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 ...
1
vote
4answers
562 views

Usage of “Multi-Paradigm Languages” in commercial applications

I am currently learning the two languages F-Sharp and Scala. These two languages are, in my opinion, both quite comprehensive to grasp. Nonetheless, what seems to make Scala and F-Sharp similar, is ...
11
votes
4answers
957 views

Functional Programming — Immutability

I am trying to understand dealing with immutable data in FP (specifically in F#, but other FP’s are ok as well) and break the old habit of state-full thinking (OOP style). A part of the selected ...
3
votes
2answers
490 views

are f# computational expressions a form of aspect oriented programming?

are monads, or more specifically f# computational expressions, a form of aspect oriented programming? Update: f# workflow builders have methods other than bind and unit. They have hooks for lots of ...
7
votes
6answers
942 views

Reading SICP with F#? [closed]

I've been meaning to read the SICP book for a while, and am finally about to get around to it (now that I can read it on Kindle :) I'd like to learn a functional language, and I use C# at work so ...
1
vote
2answers
251 views

How to run a F# app in Windows Azure?

I have a project that requires me to write a library management system in F# and using Windows Azure for the development. I am quite new to Cloud concept and i don't know what to do as a next step. Is ...
4
votes
1answer
394 views

What's new in Expert F# 2.0?

I own the first edition of Expert F# by Don, et al. and I'm considering buying the next edition, Expert F# 2.0. But I'm wondering if it's worth it. Sure the syntax will be updated and all, but I'd be ...
10
votes
7answers
1k views

Arguments for Functional Programming [closed]

I've recently been learning F# for fun (I'm a VB.NET/C# dev), and I really like some of what it has to offer. Theoretically that is. But I'm having trouble thinking up of scenarios where I would ...
0
votes
2answers
206 views

F# open source project hosting using SVN

I'm looking to choose open source project hosting site for an F# project using SVN. CodePlex is where the .NET community in general and most F# projects are hosted, but I'm worried TFS + SvnBridge is ...
32
votes
9answers
3k views

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

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 ...
7
votes
6answers
688 views

Challenges for the experienced coder to learn functional programming? [closed]

What are the challenges that an experienced programmer with the usual C++/UNIX background would face when trying to learn functional programming? The main motive for learning is to gain a fresh ...
4
votes
2answers
2k views

Do you think F# and Python might rule the future market? [closed]

I am seeing that Microsoft is concentrating too much on F#. What type of language it is going to be and will it replace the C# user base? In the last few months I am noticing Ruby posts in some ...
42
votes
3answers
4k views

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 ...
13
votes
4answers
601 views

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 ...
1
vote
3answers
204 views

Should I bother with trying to come up with names for these?

If you were to run across code like this in your travels would the short names bother you? let setPropertyAssignment = parser { let! a = setIdentifierName let! b = propertyName ...