All Questions
Tagged with functional-programming algorithms
24 questions
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 ...
12
votes
1
answer
981
views
Functional Reactive/Relational Programming – Is there a difference?
I've been using Reactive Cocoa (by GitHub), a Functional Reactive Programming API for use with the Cocoa libraries for a while now, but have just read "Out of the Tar Pit", the paper that supposedly ...
11
votes
5
answers
1k
views
Convert list of 24-hour-precipitation values into total-by-hour
Let's say I have a list of precipitation values by hour, each showing how much rain happened in the prior 24 hours, ordered by date. For example:
{
'2012-05-24 12:00': 0.5, // .5" of rain from 5/...
8
votes
11
answers
4k
views
Is Object Oriented stuff really that important? [closed]
For years, I have been doing Algorithmic stuff, writing scalable data structures for internet search, for example Randomized Binary Search Trees for Auto Recommendation, BitMaps, Wisdom of Crowd based ...
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, ...
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 ...
3
votes
4
answers
3k
views
Resources for learning common algorithms by Lisp [closed]
Many books about algorithms and data structures are coded by imperative languages. Is there any book that can show functional programming languages can do the same thing or do them better?
In ...
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 ...
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 ...
2
votes
2
answers
1k
views
Ring of numbers where adjacent entries sum up to a prime
Given a number n, find a permutation of the numbers 1...n such that all adjacent entries sum up to primes. If such a permutation does not exist, throw an error.
Is there a purely-functional way to do ...
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
...
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
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 ...
2
votes
1
answer
284
views
LOOP-computable functions
I was just reading a chapter about LOOP-computable functions and I have the following question: Is it possible to numerate every LOOP program with an algorithm?
Formally: Is it possible to have a ...
1
vote
2
answers
232
views
Sorting : Useful for more than just viewing data?
Context
I'm currently working on a personal project involving functional reactive JavaScript, and I've come up with an odd question. Note that this question is not JavaScript specific, but that is ...