Questions tagged [f#]

F# is a succinct, expressive, and efficient functional and object-oriented language for .NET

Filter by
Sorted by
Tagged with
7 votes
1 answer
1k views

F# Djikstras shortest path implementation

I'm just getting my feet wet with F#, by implementing some simple algorithms. First up: Djikstras shortest path. There is one piece I've written in this code which confuses me as to why it works: the ...
user avatar
  • 447
2 votes
2 answers
344 views

How can this functional implementation of Kadane's algorithm be improved?

Some time ago I posted on Stack Overflow an imperative C# implementation of Kadane's algorithm for finding a subarray with maximum sum. Then I considered implementing the same functionally in F# and ...
user avatar
3 votes
1 answer
1k views

Basic neural network

I just programmed a basic neural network in F# to learn the logical OR function. As I am very new to F# and especially functional programming, I did it the imperative way. And even tho it works, I ...
user avatar
3 votes
1 answer
739 views

String calculator in F#

This is some of my first real F# code ever. I have done a bit of reading and watched a few videos however. I chose to do a code kata for string calculator to try it out. The kata I was working on is ...
user avatar
  • 133
3 votes
1 answer
712 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. ...
user avatar
  • 81
4 votes
2 answers
896 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 ...
user avatar
3 votes
2 answers
516 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: ...
user avatar
9 votes
1 answer
725 views

Deleting from Red Black Tree in F#

Yes I'm very slowly making my way through Purely Functional Data Structures. So I went through the section on Red Black Trees. What he presents is amazingly concise, except for the fact that he didn't ...
user avatar
6 votes
3 answers
483 views

Is there any way to improve (shorten) this F# code?

I have a very good grasp of the syntax and features of F# as well as some of the concepts that mesh well with the language. However, I do not have enough experience writing it to feel comfortable that ...
user avatar
11 votes
1 answer
912 views

Approach to programmatically building hierarchical GUI components

At work I am developing an application using hand-coded Swing, and I've found that I have an easier time reading, writing, and maintaining hierarchical component creation using code blocks like: <...
user avatar
4 votes
1 answer
355 views

Processing a tab-delimited file with vertexes and ages

The following block of code needs to be as fast as possible as it likely to be called many thousands of times in a run. I am also conscious that my thinking style is leaning towards a more procedural ...
user avatar
  • 99
7 votes
1 answer
973 views

Map implementation in F#

Just as a refresher I put together a simple Map implementation and I would love to get some feedback on it. ...
user avatar
  • 1,743
6 votes
1 answer
428 views

How can I make this F# more functional?

I am currently learning myself a little F# and have written the following code to practice. The code uses the Mono.Cecil library to inject some IL at the start of every method in each .net assembly ...
user avatar
10 votes
1 answer
527 views

Getting the last date where a given week day occurred

I'm trying to learn a little bit about functional programming and as my tool I chose F# since I'm a .NET developer and the environment is more natural to me. In one of my pet projects I'm dealing ...
user avatar
  • 335

1
4 5 6 7
8