Skip to content
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

Fix traverse type signature in documentation comment #2797

Merged

Conversation

googol
Copy link
Contributor

@googol googol commented Mar 12, 2019

Since traverse = sequence of (map f traversable), and sequence :: (x -> f x) -> t (f x) -> f (t x), f :: a -> f b and traversable :: t a, the type of (map f traversable) is t (f b).

Therefore the type parameter x in sequence is b, and the type of the of parameter needs to be b -> f b.

Since `traverse = sequence of (map f traversable)`, and
`sequence :: (x -> f x) -> t (f x) -> f (t x)`,
`f :: a -> f b` and `traversable :: t a`, the type of `(map f traversable)`
is `t (f b)`. Therefore the type parameter `x` in `sequence` is `b`,
and the type of the `of` parameter needs to be `b -> f b`.
@CrossEye
Copy link
Member

Somehow, a whole lot of issues/prs were dropped around this time. I don't know if anyone had looked at this one. Thanks, @googol!

@CrossEye CrossEye merged commit fd97ee3 into ramda:master Jan 23, 2022
@googol googol deleted the fix-traverse-documentation-typesignature branch January 23, 2022 20:40
@googol
Copy link
Contributor Author

googol commented Jan 23, 2022

I had already forgot about this :D I'm glad it's in now, thanks!

@adispring adispring mentioned this pull request Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants