All Questions
Tagged with functional-programming performance
57 questions
5
votes
3
answers
231
views
HackerRank, Haskell simple "compression" algorithm
The question asked is very straight-forward and is simple enough to solve. What I am looking for is that hopefully I can get some understanding for using the constructs and built-ins of the Haskell ...
4
votes
4
answers
1k
views
Merging sorted integer arrays (without duplicates)
I have written a Python function called merge_arrays which takes two lists and returns the new list merge without duplicate.
The function works as expected, but my ...
1
vote
2
answers
68
views
Imrove performance when updating DataFrame rows based on complex criteria
My question got rejected the last time so I am trying a better approach to getting a solution:
...
1
vote
1
answer
274
views
Fizzbuzz Solution - complexity, readability, performance, lines, obfuscation... - .sort()
The fizzbuzz challenge presents a lot of interesting questions for 'intermediate' programmers like myself. I have found that I don't actually know where to draw the line with, complex (hard to read ...
4
votes
2
answers
3k
views
Download entire localStorage as file
I would like to download the entire contents from localStorage to a json file (in a "clear" formatting).
I've tried this and it works perfectly. However, ...
3
votes
1
answer
268
views
Efficiently calculating perfect powers in Haskell
I'm trying to calculate perfect powers to solve this code wars challenge: https://www.codewars.com/kata/55f4e56315a375c1ed000159/haskell
The number 81 has a special property, a certain power of the ...
3
votes
0
answers
196
views
Advent of Code 2021, Day 3 in Haskell
This is a working solution to today's Advent of Code puzzle, written in Haskell. However, I feel like this solution is not optimal.
...
-2
votes
2
answers
111
views
-1
votes
1
answer
84
views
Simplifying and optimising function logic [closed]
I asked the same question on StackOverflow but was told to instead ask here since it was better suited. I have a function that I implemented. It is doing a lot of heavy lifting. I would like to ...
3
votes
1
answer
72
views
Finding the difference between the estimated value and the true value in a reward task
I have this function called error, which estimates value based on previous value and rewards in trials. The difference between the estimated value and true value is then calculated, giving the error. ...
1
vote
1
answer
68
views
Abstracting device IO / glue logic in a CPU emulator
In my Motorola 6809 CPU emulator (written in C++14) I'm working on an abstraction to represent the wiring between emulated devices, such as the ports on a 6522 VIA, or the interrupt lines connecting a ...
4
votes
2
answers
91
views
User defined function call on a stack based interpreter for concatenative language
I would like to receive some advice on how to improve a small concatenative stack-based interpreter, executing a joy-like programming language. It is really minimal, and is in fact a subset of a ...
1
vote
1
answer
435
views
Group items by types: replace nested for loops with reduce
I have a working code that groups items by their type values. The types can be one or multiple, however they are always returned as an array.
To illustrate: if an item has types with values ...
9
votes
2
answers
2k
views
c++17 compatible std::bind_front alternative
One of the things that has been really exciting me in c++20 is std::bind_front. Using placeholders with std::bind and ...
1
vote
1
answer
939
views
Python implementation of Quicksort using list comprehensions
I wrote an implementation of quicksort that I think is pythonic. I based it off of this common Haskell implementation:
...