-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What's the right order in Apply? #62
Comments
Hey!
This example seem wrong because the first argument should be a value that contains a function. For example
This example also seems wrong. I would expect it to look something like this:
|
Ah, you're correct in the second example. It should be |
How so? Assuming @tounano's So since const R = require('ramda');
const E = require('crocks/Either');
R.ap(E.Left(1), E.Left(2)).inspect(); // --> "Left 1" Looking at the [E.Left(1), E.Left(2)] argument of the second example, I'd ask myself if R.sequence(E, [E.Left(1), E.Left(2)]).inspect() // --> "Left 1" |
Right. I always forget which one is the error in Either. In that case order completely depends on the specific implementation of Apply for Either. The spec has no opinion on it, as far as I can tell. |
Thanks everyone, I'll do it like Crocks then. I remember that long time ago I read about an issue with which error comes first in the case of Futures and Apply. Maybe my memory betrays me. In the case of a Future or any other Async type, it would mean which of the Futures would be forked first. I'm developing a static land module for good old callbacks. Thanks again, and would appreciate additional thoughts. p.s. I close it by mistake. |
My way to remember: The right value must be right, right? So the left is left for the error.
I think Fluture has a "non-standard" Because of that missing fantasyland spec of combining two asyncs in parallel, still today reactive stream libs like Bacon.js and @most/core have not adopted fantasyland. |
Hey, Are you sure that's the reason? I don't think it's possible to do Apply on a stream. Since you'll need to replay the stream several times. I mean from what I understand a stream is a one time thing, if you can replay it than it's an array, isn't it? |
As for T.Serial
T.Parallel where T.Serial === T The only difference would be is the But even if you develop a With fluture, I assume they use a race, since they have cancellation logic. I'm not going to have cancellation logic, so both futures going to run until the end. I checked Crocks, they also use race logic, to display the first error fired. Feels too random for me. What I'm going to do is to display the |
I don't know what you mean with replay.
Just the links to the discussions to implement Fantasyland: The bacon issue, the @most/core issue |
I understand what you want now, and I've seen you commented that there is a conflict between monadic laws and applicative laws. In any case, not sure you're familiar or not. For streams I'm using 'pull-stream' lib. It's not fantasy-land, neither static-land, but if you're using StaticLand, why does it matter?
I developed something like you say for pull-streams, it's really handy as a streaming state of sort. |
Btw. |
I guess there are some use cases for it, I just can't think of any :) |
I would not do that. In that case The idea that your Racing, or collecting all is ok, imo. |
Hi,
What's the right order in apply.
What should be the result in the following case?
Following the same logic, what would be the right order on traverse?
Thanks.
The text was updated successfully, but these errors were encountered: