19,237 questions
Advice
0 votes
1 replies
74 views
How to effectively use ASP.NET core Hybrid Cache with Result<T> type
Suppose a scenario where: you need to execute an expensive operation which can fail or succeed. the result of the operation is modeled by using a result object Result<T>. The result object ...
0 votes
1 answer
88 views
How to split a shell command into tokens in a quote-aware fashion? [closed]
The task Given the following string¹ one ' two 'three four the required function should split it in 3 tokens (one, two three, and four), in agreement with how the bash shell does: $ function ...
4 votes
1 answer
115 views
Understanding usage of withFileBlocking with named pipes
The following program assumes that /path/to/mypipe is a named pipe, e.g. created via mkfifo /path/to/mypipe, with no readers/writers waiting yet, runs two threads, of which the main thread keeps ...
3 votes
2 answers
102 views
Why doesn't readFile block on unix pipe in which no write has happened yet?
If in a terminal I enter mkfifo /tmp/pipe echo hello > /tmp/pipe (which blocks) and in another I run the haskell program main = readFile "/tmp/foobar" >>= putStr then I see it ...
1 vote
2 answers
227 views
How can I transform large nested PHP arrays immutably without creating expensive deep copies?
I’m working with large nested associative arrays in PHP and I need to apply transformations (like map, filter, reshape) immutably, meaning the original array should not be modified. The problem is ...
0 votes
1 answer
58 views
Haskell Parsec Parser giving strange error
I am having trouble getting the following code to work. I got it to work originally, then I changed it so all the Nonterminals also have positions. And I added the method parseLexeme that transforms ...
7 votes
2 answers
205 views
What is wrong with this closed type family in GHC2021-GHC2024 as compared to Haskell2010?
In Haskell in Depth, Chapter 11, there's an example aimed at avoiding character escaping in GHCi, which is what happens automatically when you enter print "ë", as it'll be printed like "...
0 votes
1 answer
85 views
What is a Nothing->Nothing function called in FP?
I am a beginner to functional programming where most of my experience comes from Java/Kotlin. From my understanding functional programming has special names for certain function signatures. Type ->...