Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
-1 votes
0 answers
50 views

I have no idea how to implement MonadError for case class MyPair[+A, +B](a: A, b: B), since I don't understand how to deal with 2 types in Monad. I've been trying to write it for 2 weeks already, no ...
Best practices
3 votes
4 replies
107 views

When writing modules, i am always struggling trying to identify the related dependencies of the functions, properties, etc... That's why i am now trying to code using only pure functions, and to ...
1 vote
1 answer
94 views

I have a C# application with multiple layers (controllers, services, domain logic, and background workers). Error handling has become inconsistent because many methods contain their own try/catch ...
0 votes
0 answers
52 views

I want to make my mutually recursive functions stack-safe, but because they have different signatures - one traverses a list and other a tree(?) of sorts - I'm not clear how to go about this. Here's ...
1 vote
2 answers
141 views

Here is the question from Mitchell Wand's Essentials of Programming Language: Exercise 1.19 [⋆ ⋆] (list-set lst n x) returns a list like lst, except that the n-th element, using zero-based indexing, ...
Advice
0 votes
2 replies
106 views

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 ...
Best practices
5 votes
3 replies
154 views

I had a nice idea of using applicative for nondeterministic financial modelling. Or maybe it is a simple case of sentization. So the basic example is to define newtype ValueRange. newtype ValueRange a ...
0 votes
1 answer
96 views

The task Given the following string1 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 ...
0 votes
1 answer
128 views

tl;dr Ideally, I'd want the following "hello world" is split in "hello" and " world" " world" is split in "" and " world" "hello "...
4 votes
1 answer
119 views

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
157 views

tldr; how does one deal with logic that depends on data that are too heavy to fetch up-front when subscribing to the functional core, imperative shell line of thought? Years ago I was inspired by Gary ...
3 votes
2 answers
108 views

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 ...
2 votes
1 answer
88 views

I'm reading the paper Selective Applicative Functors. So far I've read from page 16 out 29, and I think I've understood the gist of this abstraction, but I'm having some trouble with some basic ...
1 vote
2 answers
237 views

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 ...
1 vote
0 answers
121 views

Consider the following toy code which performs very simple (a few instructions) operations on a hot loop over a large amount of values: template<float (*f)(float)> void process_f(int count, ...

15 30 50 per page
1
2 3 4 5
...
1283

AltStyle によって変換されたページ (->オリジナル) /