Skip to main content

Questions tagged [f#]

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

Filter by
Sorted by
Tagged with
2 votes
1 answer
149 views

I have the following EF Core table: ...
Parsa99's user avatar
  • 267
4 votes
2 answers
921 views

The following code is an example of railway-oriented programming that allows a password string to be validated: ...
Parsa99's user avatar
  • 267
3 votes
2 answers
139 views

I stumbled across something a long while ago, fetching the environments variables from say env under linux (say on a pod via argos), anyway, point is I could fetch ...
Natalie Perret's user avatar
0 votes
1 answer
161 views

I have two collections: A list of strings A hashtable ...
Alex_P's user avatar
  • 123
3 votes
0 answers
278 views

I am seeking a review of my command line wordle game. Having only recently started exploring functional programming, I expect that there will be no shortage of areas to improve. This is my first ...
Adam Hodgson's user avatar
2 votes
1 answer
206 views

after looking at the pseudocode for the Sieve of Eratosthenes on wikipedia I tried implementing a similar version using F#. The code runs just fine, that is, it returns all prime numbers up until a ...
Antônio Salomão's user avatar
2 votes
0 answers
138 views

The purpose This code is intended to achieve the following goals:- Create a hard coded list of lifts, this is pretty static and I add some extra info so I'm ok with this being in the code but I may ...
David Hayes's user avatar
1 vote
1 answer
106 views

I've been experimenting with the F# Bolero environment to learn F# a bit and I was trying to get the hang of pattern matching by generating ordinal numbers (1st, 2nd, 3rd, ...) from cardinal numbers (...
JansthcirlU's user avatar
2 votes
1 answer
117 views

I am a new F# programmer, and a student in a security class. As part of my notes, I wrote a small implementation of a monoalphabetic cipher as follows: ...
TimeTravelPenguin's user avatar
2 votes
1 answer
101 views

This code represents logic used to retry failed calls to a crypto exchange: ...
Thomas's user avatar
  • 173
2 votes
3 answers
196 views

I have a list of path I want to filter out. I want to keep only paths matching a specific pattern and remove all paths matching another specific pattern. To achieve this I pattern matched on each ...
aloisdg's user avatar
  • 561
-1 votes
1 answer
155 views

I am writing a credit card generator. I have method GenerateVisa() who will return either a 13 or 16 numbers string. This is the default value but GenerateVisa can ...
aloisdg's user avatar
  • 561
3 votes
1 answer
330 views

this is my first F# program, very simple concept but took me a few minutes to get it. I'm new to functional programming so I'd appreciate if you could have a look ...
Santanor's user avatar
  • 131
0 votes
1 answer
99 views

This code succeeds in downloading log text files from multiple URLs. Can this be made more efficient? ...
user1206480's user avatar
1 vote
2 answers
925 views

In the context of a library to generate random credit card, it would be nice to let the user the possibility to set some optional options on some cards. Lets take Visa. Two lengths are available: 13 ...
aloisdg's user avatar
  • 561
1 vote
1 answer
143 views

The following code creates a simple tree structure and then walks through the tree looking for node with the value 9 that appears after we have seen a node with the value 1 and a node with the value 4 ...
Jackson's user avatar
  • 507
1 vote
1 answer
166 views

While trying to grasp the potentials of the collection features in F#, I encountered this one: ...
Thanasis K's user avatar
4 votes
1 answer
184 views

I'm trying to refactor the working code below which intends to handle bill cancellation, but doesn't seem "linear" enough. ...
Natalie Perret's user avatar
7 votes
1 answer
239 views

I've written some F# code to handle commands in the context of event sourcing which works along the lines below: Read Events from a specific event store stream Build the current state in the given ...
Natalie Perret's user avatar
5 votes
1 answer
192 views

I was inspired by this video by Matt Parker to use the Farey Sequence to convert a float into a string representation of a fraction, how did I do? How well did I follow F# workflow and patterns (I'm ...
stonkilla4's user avatar
4 votes
2 answers
149 views

This is my first major project in F#, looking for any critique on how I can make it more standard or more concise. Some things I feel like I could have done better are the command flag parsing and the ...
Dalton Edmsiten's user avatar
6 votes
1 answer
150 views

This is my first F# program. It's a simple Rock-Paper-Scissors implementation. I am looking for feedback of all sorts, e.g. the choice of types (e.g. List vs Array), whether there are parts that could ...
cimnine's user avatar
  • 201
4 votes
1 answer
271 views

How can I make the solution to this https://www.codewars.com/kata/5506b230a11c0aeab3000c1f/train/fsharp more "functional"? ...
reggaeguitar's user avatar
4 votes
1 answer
219 views

I have put together this f# code in an attempt to solve the following problem Given a mapping operation that may not be able to return a value Cease mapping over the remaining items of a sequence if ...
OrdinaryOrange's user avatar
3 votes
3 answers
406 views

I've written a function that takes a sequence and check for every item in that sequence whether the current value a selection (obtained with a selection function) is different (or on the first ...
Natalie Perret's user avatar
2 votes
1 answer
268 views

I have a sample code and some question. Simple type property ...
Wojciech Szabowicz's user avatar
4 votes
0 answers
196 views

The N-Queens puzzle can be solved in many ways. One is by a depth-first-search backtracking algorithm. Below is my generalized version using mutual recursion: ...
user avatar
2 votes
2 answers
145 views

I sped through the 5hr F# pluralsight course this week-end and thought I'd sement my learning by going through as many Advent of Code puzzles I could with this new learning. However, already on day 2 ...
Lars-Erik's user avatar
  • 1,384
2 votes
1 answer
197 views

During a discussion in a development chat, a user suggested to another (in the context of C# originally), UserA: Challenge: Create an implementation of RPS, and then show how it can be extended to ...
Kroltan's user avatar
  • 284
3 votes
2 answers
145 views

I was playing the game Set online, and thought it would be a good exercise to write an F# script to find all of the sets for me. The rules of set are as follows: A SET is 3 cards for which each ...
natemcintosh's user avatar
4 votes
1 answer
861 views

So for an side exercise on exercism I implemented a BinarySearchTree. I was confident in implementing the creation of the binary tree. But I'm very unsure about the traversal of the tree. So I came ...
Matthias Herrmann's user avatar
3 votes
0 answers
147 views

The F# web-development framework Giraffe supports a functional style of Dependency Injection using a form of the Reader monad, as explained in this GitBook. I would like to use this pattern more ...
Aaron M. Eshbach's user avatar
2 votes
1 answer
98 views

I'm new to F# and functional programming in general (coming from an object oriented background). I just wanted to get some criticism on an algorithm for assigning jobs to crew members. I want to be as ...
James Bateson's user avatar
3 votes
0 answers
231 views

In my endeavor to learn Angular, I've created a flashcard site with an F#/Mongo backend. As I'm new to Angular, I'm going to post everything; any and all feedback is welcome. First, some pictures of ...
user avatar
3 votes
1 answer
435 views

...
Vlad Lutsenko's user avatar
4 votes
1 answer
161 views

I have the following code: ...
Thomas's user avatar
  • 173
0 votes
1 answer
157 views

This code is asp.net core middleware written in f# and called from c# for a blazor server-side app. How can this be made more efficient if any in regards to the async code. F#: ...
user1206480's user avatar
2 votes
0 answers
117 views

I have the following piece of code which is FSI tested and works. However, I want to trim it as much as possible (not only the comments, which are there for my own future reference) and make it as ...
user avatar
3 votes
2 answers
149 views

I am quite new to F# and just wrote my first program. It checks if the query exists in the brand list and returns the matching brand. Query is the string you are searching for in the brand list. So ...
Bas van Dijk's user avatar
4 votes
0 answers
450 views

I am working on SEPA XML generator in F#. I developed two solutions that are roughly equivalent, one relies on the XmlSerializer while the other relies on ...
Natalie Perret's user avatar
2 votes
1 answer
398 views

I am writing some unit tests using XUnit in F# and I am wondering what is the most idiomatic way in the F# sense to write them. Let's start a simple case: ...
Natalie Perret's user avatar
6 votes
2 answers
328 views

I am working on an iban api which is about saving the iban of some members after (iban validation) in a database. The code is split between Domain (entities, behaviour for iban validation), Database ...
Natalie Perret's user avatar
1 vote
1 answer
328 views

I have a review request about this part of the code: ...
Wojciech Szabowicz's user avatar
4 votes
1 answer
168 views

I have this little exercise writing a binary trie in F#. In C# it can be done in few lines, but here it became more complicated than I had expected (especially the ...
user avatar
4 votes
1 answer
272 views

As part of small MIDI library i've implemented the conversion of a VLQ (variable length quantity) for byte[] -> bigint and ...
Streamline's user avatar
3 votes
0 answers
294 views

In F# the Railway Oriented Programming pattern can be implemented synchronously using the Result<'t,'terr> type as result value for functions, so they can be ...
user avatar
6 votes
1 answer
102 views

I am writing an event sourced system in which I need to have the state based on the events that already occurred for a given bank account. The events are defined such as: ...
Natalie Perret's user avatar
4 votes
2 answers
291 views

Hi I have a simple tcp server, and that server receives messages with specific length so basically i need to wait for TcpClient to fill buffer with that amount of data, and it works. But I am not ...
Wojciech Szabowicz's user avatar
3 votes
0 answers
209 views

This is my first attempt at creating a small module to wrap the .NET library EasyNetQ in F# to make it more functional. I am pretty new to F# and I would like to get feedbacks on everything: types, ...
Natalie Perret's user avatar
4 votes
2 answers
659 views

I've created the following module to allow me to generate a SHA256 signature for a file. (In real life this is used to verify an image file hasn't been amended). The cut down code looks like this: <...
Jackson's user avatar
  • 507

1
2 3 4 5
7