4 ms·
Don't forget Hoogle[1], the type-based search engine! Let's say that I want to combine a couple of my lists into one list. I know what my inputs look like, and
by erjiang 13y ago
Don't forget Hoogle[1], the type-based search engine! Let's say that I want to combine a couple of my lists into one list. I know what my inputs look like, and I know what I want my output to look like.
So I go to Hoogle, and search for "[a] -> [b] -> [(a, b)]". First result is "zip".
Or I want to get only the things in a list that satisfy a predicate, but I'm suffering from nominal amnesia. I type in "(a -> Bool) -> [a] -> [a]" and Hoogle lets me know that I meant to write "filter".
[1] http://www.haskell.org/hoogle/?hoogle=%28a+-%3E+Bool%29+-%3E+[a]+-%3E+[a] http://www.haskell.org/hoogle/?hoogle=%28a+-%3E+Bool%29+-%3E...
- garretraziel 13y agoSqueak Smalltalk is better in it - you can actually type in arguments of method and a result and it can find you method that, given these arguments, returns this result. So, for example you can type: 'hello'. 'HELLO' and it finds you 'asUppercase' method of String object.
- pkinsky 13y agoHow does it perform this search? I can't imagine running all functions with a matching type signature scaling to more complex examples.
- kencausey 13y agoWell, in fact it does something like this. But what messages it tries is actually limited. It has been a while since I looked at it and so don't remember the details. This is a very useful function of Squeak and I presume Pharo Smalltalk but I think users of it should have some awareness that it has limitations and not to simply assume that because a result is not found that it does not exist.
- deleted 13y ago[deleted]