All Questions
Tagged with functional-programming algorithms
24 questions
0
votes
2
answers
124
views
How to convert vehicle schedule time window calculation algorithm to FP
I am working on an algorithm that optimizes utilitization of a vehicle. What I have is a list of paths the vehicle is planned to take and between which times (time windows) it has to be at a certain ...
-5
votes
1
answer
58
views
Choosing 2 or 3 values out 3 values after calculating their closeness
I want to find a specific algorithm to choose either 2 or 3 out of 3 given values.
Like if I have a set of values 10,11,12 all three are close enough so I will calculate the mean of the value and ...
0
votes
1
answer
367
views
What's the benefit of separating specialised data from behaviour in an algorithm?
Functional programming strongly suggests to separate data from behaviours (functions). However, I can't see the benefit of this for an algorithm's implementation intrinsically tied with particular ...
1
vote
2
answers
140
views
How can an iterative algorithm be controlled dynamically?
Suppose we need an iterative algorithm for mathematical optimisation. Each iteration takes a long and random time. After each iteration, a stopping condition is checked for the iterate x, based on ...
6
votes
3
answers
383
views
Can referential transparency be assumed when dealing with floating-point arithmetic?
A pure function is assumed to produce the same outputs given the same inputs. Suppose an (otherwise) side-effects free function computes with floating-point numbers. Due to numerical error, these ...
0
votes
3
answers
236
views
Use case, design, and how to append to an immutable object in functional programming
This is not (supposed to be) an opinion question, but it is a newbie question, so if there is just a resource I haven't found that I need to read, point me there :)
I am in the design stages of a ...
-1
votes
1
answer
81
views
Need Help to build a Custom Notification read logic for Individual user basis
I'm building a custom Notification section, which provides notification or messages to multiple users on any particular object update, I've created a HTML page like Dashboard where I have added a ...
2
votes
1
answer
741
views
Is a trace table useful in functional programming?
A trace table is a technique used to test algorithms.
"The table usually takes the form of a multi-column, multi-row table;
With each column showing a variable, and each row showing each number
...
6
votes
1
answer
830
views
What does "the standard stateless functional view of algorithms" mean?
From Kelvin Murphy's review on Algorithms (4th Edition) by Sedgewick and Wayne
For data structures, it is obviously natural to use classes, but they
also adopt this approach for many algorithms, ...
0
votes
1
answer
115
views
Functional reactive ideomatic 'OR' function
I'm would like to know your opinion of what is an ideomatic way writing a OR function in functional reactive programming.
That is, if I have x number of signals which can return a truthy or falsy ...
2
votes
2
answers
2k
views
Designing the recursive solution
I understand the recursion and find it useful and intuitive while solving problems on trees but for many other problems recursion never fails me to leave puzzled. Recently I was solving the following ...
2
votes
4
answers
3k
views
What is Big-O notation for purely functional languages?
Is it still relevant?
Instead of
var result = new List<int>();
for (var i = 0; i < prev.Count; ++i)
{
result.Add(prev[i] * 2);
}
where the result.Add, prev[i], and * 2 instructions are ...
3
votes
1
answer
2k
views
JavaScript functional conversion from flat list to tree
I've been going through the RxJS tutorials http://reactivex.io/learnrx/.
Almost all of the exercises involve moving from a hierarchical structure to a flat structure so I thought I'd try to do the ...
14
votes
2
answers
3k
views
Functional programming and stateful algorithms
I'm learning functional programming with Haskell. In the meantime I'm studying Automata theory and as the two seem to fit well together I'm writing a small library to play with automata.
Here's the ...
2
votes
1
answer
207
views
Strategy for normalising and interpreting location data
I'm a bit stuck with a problem involving the normalisation of location input data from the user (which comes from a third party).
Aim
To logically breakdown and interpret the user location input ...