-
Notifications
You must be signed in to change notification settings - Fork 72
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
Search by type signature #61
Comments
This would be very nice indeed! |
agree 100% that would be nice. |
I agree. This would be very nice. I don't have a clue as to how to implement it, but I want it. I was talking about this just the other day. If it were just text search, I think it would be easy enough, but it should be smart enough not to distinguish between Anyone have ideas? |
My only idea on this would be some tricky pattern matching or regexs. Such as just checking that structure and ignoring the value names. |
couldn't we replace the current search/filtering with a nice js fuzzy search library? |
do you have one in mind? |
The ones ive played around with: http://glench.github.io/fuzzyset.js/ |
I'm on the lookout for one for a work project too, although I haven't started actually looking yet. (I'm actually much more interested in solving that problem myself. It would be nice to do something algorithmically interesting for a change.) |
@CrossEye gotcha, maybe we can add something temporary and then switch it to something you've created... whatever works 😄 |
Ok, off to research the Bitap algorithm. Looks like fun. |
No, there's plenty of fun in Ramda; it's the day job that needs some sprucing up. It's also in a company with a long drawn-out approval process for third-party tools (not that we always tell them, but as this would be consumer-facing it might take some doing.) If I built my own there, there's no approval needed. I'm all for trying to find a good tool for Ramda to use. The trouble is that I think what we most want is a lot more tagging in order to search. It's not so much the fuzzy search, but the missing metadata. But I could be mistaken. |
In agreement here - more tags to group searches by would be excellent, and cater to a wider audience. However, fuzzy search on type signatures would definitely be a helpful addition too. |
makes sense, its probably just missing the signature in the filter code, i was just messing around with the libraries i mentioned above feeding them a data structure like which i scrapped from the DOM ...
{
"signature": "(a → a) → Number → [a] → [a]",
"name": "adjust",
"category": "List"
},
{
"signature": "(a → Boolean) → [a] → Boolean",
"name": "all",
"category": "List"
},
{
"signature": "[(*… → Boolean)] → (*… → Boolean)",
"name": "allPass",
"category": "Logic"
},
{
"signature": "[a] → Boolean",
"name": "allUniq",
"category": "List"
},
{
"signature": "a → (* → a)",
"name": "always",
"category": "Function"
}
... worked pretty well... |
The problem is that a good fuzzy type search seems much more sophisticated than a fuzzy text search. If we search Hoogle for foldl :: (a -> b -> a) -> a -> [b] -> a
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c] but do not include map :: (a -> b) -> [a] -> [b] I'm not sure if text searches would be able to do that well.
Funny, I was playing around with something similar thinking about #1652, also scraped from the DOM, although I would hope to do it differently someday. Mine was an object grouped by category, and |
I really like my new Alfred workflow for Ramda docs, which has baked in support for type signatures 😄 Here is an example usage off my desktop: I just choose the function I am looking for (in this example by type signature) and it takes me off to the required definition on ramdajs. Thanks to raine for taking the effort to set this up. Think I even prefer it to the bash support. |
I've tried to implement some type driven search on http://ramda-search.now.sh |
This looks like a very promising start. Is the code available somewhere? |
This week I will open a pull request for sanctuary-search, which will support type variable substitution as well as less fancy Hoogle features. The module will be used on the Sanctuary website; it may be a good fit for the Ramda website too. |
@CrossEye @davidchambers |
Would it be possible to incorporate type signature search in the current search bar. Something resembling Hoogle like functionality.
I would really like to be able to search for
(a → b) → f a → f b
and get map.The text was updated successfully, but these errors were encountered: