All Questions
Tagged with functional-programming c#
49
questions
1
vote
0
answers
69
views
Does Subscribe sound as a right name?
So I have a Know Your Customer provider interface like this to estimate risks associated with a customer:
...
3
votes
1
answer
128
views
Writing pure functions but have a chain
I'm trying to play around with Godot to learn C# and I was trying to creating pure functions to do the velocity, but I found I was repeating myself.
...
2
votes
0
answers
103
views
LINQ extensions for sequence comparing
The desired behavior would be:
...
7
votes
2
answers
345
views
Chaining statistics in a dice queue
I've previously came up with the question "Rolling dice in a method chain" and was interested if this could be improved. It could, so now I have this class:
...
8
votes
3
answers
1k
views
Rolling dice in a method chain
I've been writing code for nearly 40 years now and am still not too old to learn and understand new things. Right now, my focus is a bit of OO with functional programming combined and C# with Linq is ...
12
votes
2
answers
2k
views
Given an array A[] and a number x, check for pair in A[] with sum as x
LINQ/FP style:
Assert.IsTrue(new[] {1,2,3}.AnyPairSum(4));
Where:
...
5
votes
0
answers
134
views
Implement Sudoku using LINQ
WiKi and GitHub.
Sudoku rules are being checked with the following tests:
...
4
votes
1
answer
403
views
Paginate IEnumerable<T> sequence
I used the following to split sequence into batches:
...
7
votes
1
answer
340
views
String Format object extension
I wrote an extension to create a string-representation by an object:
...
6
votes
3
answers
433
views
Generic method to call API functions with simple retrial on errors
I have to develop a small security management application that relies on a Web API. Based on that API, I have generated the REST client classes (Open API generator), but I still have to code on top to ...
5
votes
1
answer
311
views
Make utility using LINQ
Make() takes projects with a list of tuples representing project references in the form of (Dependency, Dependent) and returns ...
0
votes
1
answer
100
views
Managing locking for access
I've been working for a while on locking resources (state objects) so that the only way to access them is by acquiring a lock. This moves the responsibility for locking from the user of the state to ...
4
votes
2
answers
600
views
2
votes
0
answers
60
views
Monadic implementation of asynchronous tasks (hidden overhead of threads)
So, I've been reading about monads and I wanted to see if I could implement a system for asynchronous computation in a monadic way.
I came up with two solutions:
The first one spawns a thread for ...
7
votes
1
answer
122
views
Monadic list for a more functional approach to C#
I am learning about monadic structures and have created a sort of monad list that implements the map and binding "operators" (or technically methods) in C#.
I understand that Linq already exists and ...