-
Notifications
You must be signed in to change notification settings - Fork 377
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
use TypeRep f
in traverse instead of a -> f a
#207
Comments
I think the type of the second argument should be |
Updated thanks! |
I was trying to understand this signature and the part
|
@dmitriz to be precise the :: Applicative f, Traversable t => t a ~> (a -> f b, (forall c. c -> f c)) -> f (t b) |
@safareli Does it mean, in order to use But even providing it for all Unless, of course, you can infer the type class On another note, libraries like Ramda still use the If that data does not provide the And then, if the library does provide its own Then, would not Ramda (which refers to FL for the spec of its users) potentially break trying to Further, if I understand correctly, this problem can wouldn't be there with the Having As always, I may be missing some important details in my understanding, so any critics or corrections are welcome 😄 |
Referring to Ramda's behaviour is counterproductive, Dmitri. Ramda only supports a rather old version of the Fantasy Land spec. |
@davidchambers I am sorry if it was counterproductive. It was mostly meant as illustration that the BTW, I have read the Version 1.0 release note and the relevant PR, which states:
I have tried to follow the linked discussions but could not find the answer to the following questions:
Again, apologies if it is just me, and if those questions are naive, it is my genuine attempt to understand things, rather than hijacking this issue. 😄 Apologies if that feels so, I felt they might be relevant to the discussion of |
It is incredibly instructive to implement For more insight, try to understand why the |
It is not. There is no reason; simply a lack of action. |
Same as most things in FL tbh, I've moved far away from JS and not had much time to maintain something that i'm not using day to day. Sad reality. |
@joneshf Great example, instructive indeed, thank you to point it out! I suppose the problem here is the lack of any reference from
(where So this perfectly answers my question as to why that argument Prelude> :t traverse id Nothing
traverse id Nothing :: Applicative f => f (Maybe b)
Prelude> traverse id Nothing
Nothing
it :: Maybe () So the evaluation result is not of the declared signature! |
It doesn't work like that for haskell because of type inference. |
As continuation of #206 I think we should change the signature of traverse
sanctuary-type-classes
TypeReps are first arguments and i think it's fine, but if someone things thatTypeRep f
should be last argument let's discuss that too.This would be a breaking change so we might hold it for some time.
The text was updated successfully, but these errors were encountered: