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

Documentation - filter function shows wrong type in overview #2572

Closed
NicoleRauch opened this issue Jul 2, 2018 · 8 comments
Closed

Documentation - filter function shows wrong type in overview #2572

NicoleRauch opened this issue Jul 2, 2018 · 8 comments

Comments

@NicoleRauch
Copy link

image

In the overview, the type for the filter function is specified as List, whereas in the documentation on the right-hand side it is given as Filterable.

@buzzdecafe
Copy link
Member

buzzdecafe commented Jul 2, 2018

Those annotations are serving two different roles in the docs.

List, on the left, is a bucket functions get thrown into so that people can find them quickly based on typical use.

Filterable, on the right, part of the type signature of filter. It is a constraint on the type f that says that whenever f appears in the following signature, it must be Filterable. f could be a list, but it may be a tree, or a stream, etc.

@CrossEye
Copy link
Member

CrossEye commented Jul 2, 2018

... and there would be no rationale for a category of one, where Filterable contains only Filter.

@NicoleRauch
Copy link
Author

Hm, ok, sorry, I think I need to elaborate a little bit more on my usecase.

I had in mind that Ramda's filter is able to filter objects, not only lists. So I typed in filter into the search box. In the overview I saw that it only showed List - I was disappointed and thought I might have misremembered. Nonetheless, I clicked on the documentation, and by pure chance I spotted the example of filter being applied to an object.

So, my actual point is: I cannot see from the overview that filter can be applied to an object.

Does this make things clearer?

@CrossEye
Copy link
Member

CrossEye commented Jul 2, 2018

Ahh, that makes more sense. I would certainly support adding @category Object to the JSDoc tags for filter. And I have been playing with the documentation code to fix a bug. Perhaps I can also make a fix that allows multiple categories to be shown. (See, for instance, that the code for addIndex lists two categories but only one shows up in the docs. I can't imagine this would be too hard to fix.)

@buzzdecafe
Copy link
Member

buzzdecafe commented Jul 2, 2018

ah, gotcha, thank you for the clarification. IMO we should leave the type-sig as-is, but make the "bucket" more descriptive some how, e.g. "List, Object". Would that be satisfactory? I am not sure if we have any such multi-bucketed functions atm

@CrossEye
Copy link
Member

CrossEye commented Jul 2, 2018

timing...

@buzzdecafe
Copy link
Member

i know right? at least we agree on a solution for a change 😛

@NicoleRauch
Copy link
Author

Hey, sorry that I was not more descriptive up-front!

And great to see how like-minded you are ;-) Sounds like a perfect solution for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants