Skip to main content

Questions tagged [functional-programming]

Use this tag for programs where "functional" style is important - likely making use of function composition and without side-effects. NOT simply because your code contains functions!

4votes
1answer
102views

C# railway oriented programming with async support

In my application there are many business workflows. Most of them are quite simple and can be put in one function. A few of them however are very complex and have many business validations, require ...
Parsa99's user avatar
3votes
2answers
118views

Base16/32/64 implementation for C++ ranges

Introduction The following code is an implementation of, in ambition, RFC 4648 compliant Base16, Base32 and Base64 conversions as range adaptors and constrained algorithms in C++23. It can be used at ...
nilo's user avatar
  • 791
2votes
0answers
70views

std::ranges compile time (and run time) RFC 4648 compliant Base16 conversions in C++23 (improved 2)

This increment This obsoletes a former version, after taking a great review into account: The encoding now preserves sized_range and ...
nilo's user avatar
  • 791
2votes
1answer
160views

Compile time (and run time) RFC 4648 compliant Base16 conversions as range adaptors in C++23 (improved) [duplicate]

Edit: obsoleted by an improved version. Edit: now updated with unit tests that show that this implementation also works for non-forward ranges, i.e. string streams, files streams, on-the-fly encoding/...
nilo's user avatar
  • 791
3votes
2answers
326views

Compile time (and run time) RFC 4648 compliant Base16 conversions as range adaptors in C++23

This obsoletes a former version and is obsoleted by an improved version. The following code is an implementation of, in ambition, RFC 4648 compliant Base16 conversions as range adaptors in C++23. It ...
nilo's user avatar
  • 791
4votes
1answer
210views

Hexadecimal conversions as range adaptors in C++23 that work at compile time (and run time) [duplicate]

This is obsoleted by a significantly better version. The following code is an implementation of hexadecimal conversions as range adaptors in C++23. It can be used at compile time, but should of course ...
nilo's user avatar
  • 791
5votes
3answers
231views

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 ...
tijko's user avatar
4votes
6answers
422views

Search values by priority in a Stream

I have a simple list of results, and I need to return only one value depending on content, for example: ...
zond's user avatar
  • 149
3votes
1answer
399views

Event sourcing javascript implementation

An event source built around an observer design pattern implementation… ...
user avatar
1vote
1answer
70views

Buffered source of HTMLElement(s)

Temporary storing the element(s) returned by document.querySelector and document.querySelectorAll methods could improve ...
user avatar
8votes
1answer
113views

Haskell 2-player TicTacToe terminal game

I want to get better at functional programming so I started with this simple 2-player TicTacToe game. Next I want to add a simple min-max algorithm to make it a 1-player game, but before that I'd like ...
Peter's user avatar
8votes
3answers
2kviews

fmap for containers in c++

I implemented a simple fmap for containers. However containers don't have a unified function to add elements. So I wrote different concepts for different containers. Is there a better way to implement ...
Yu Cong's user avatar
3votes
1answer
101views

In Java, replace for loop with condition with lambdas [closed]

I want to replace a for loop with a break/return condition inside with a lambda. I think I have a good replacement, but I want ...
Oscar Besga Panel's user avatar
1vote
1answer
84views

Sprinkler effect

Developed around visibility CSS property and HTMLElement#offsetHeight and ...
user avatar
4votes
3answers
223views

Get the contents of a table cell for all selected rows

I have a table of user info. When you click the button, I want to get the email address from each selected row, output into a comma-separated string. I got it to work with the following code, but I'm ...
LBF's user avatar
  • 143

153050per page
close