|
|
|
|
|
by acjohnson55
1472 days ago
|
|
I've heard the List monad described as modeling nondeterminism as an effect. As you chain flatMaps, at each stage, you're consuming a discrete set of possible inputs and producing a new set of potential outputs per input. So it's a little different from thinking of your program as something that is once. Instead, you have your program being run multiple times, with the environment injecting different at each stage. I think the Future/Promise monad is similar. The environment is taking responsibility for pausing and resuming computation. But I'm curious if you have other monads in mind where the analogy fails. |
|