2
votes
1answer
163 views

Barnes-Hut implementation of the N-Body problem translated from F# to C#

I am after a peer review of a C# implementation of the Barnes-Hut algorithm which I have translated from F#. The F# version is the base for comparison, therefore the C# version is suppose to reflect ...
6
votes
1answer
299 views

Discriminated-unions in C#

So I really want to have something similar to discriminated unions in C#. One way to do it is to use a visitor pattern, but it takes half a life to write all broilerplate code by hands. There is ...
4
votes
2answers
311 views

Learning F# - Porting C# Function to F#

I'm an advanced C# programmer learning F#. As an exercise I'm porting a function that calculates the check digit of a US ABA (routing) number. Here are 2 C# implementations: ...
2
votes
2answers
229 views

My implementation of lexicographic permutation in F# is 3x slower than C#?

Can someone help me with the following micro optimization for the f# code for lexicographic permutation? I have code in C#, which runs 0.8s in x86 and x64. As a learning practice, I translated it ...
2
votes
3answers
442 views

How to improve this array manipulation function? [closed]

The function takes 2 arguments: array: int[], cap: int Members would be ranged from 0 to cap. e.g. array = [0,0,0,2,6,3,0,4,2,4,0] cap = 6 The return value is ...
4
votes
1answer
100 views

How to refactor this groupby alike method but with index?

I have got such 2d jagged array (row is 1st dimension, column is 2nd dimension, bottom to up, left to right) ...
4
votes
1answer
496 views

Rewrite C# class in F# result in half performance, any suggestion?

This is my c# class takes 2.6s ...
2
votes
1answer
899 views

Symbolic derivative in C#

I have translated the following F# code to C# and would appreciate constructive criticism. This code computes the symbolic derivative of the expression f(x)=x³-x-1: ...
3
votes
1answer
500 views

Review an asynchronous/message-oriented library actor

I'd like to get input on a F# actor that coordinates receives around a blocking message buffer. The actor is a piece of code that continuously tries to fetch messages from Azure Service Bus. ...
3
votes
2answers
457 views

Immutable pure data classes with public setters on properties

I'm putting together some classes as a model for some information (that I'm currently pulling from a website). The classes are implemented in C# - because in the current version of F# there are no ...
3
votes
2answers
366 views

Using a Function to emulate F# Match in C#

So this was inspired by: this question But doesn't actually answer it: What do you think of: ...