4 ms·
This is also a great feature of Haskell, especially Hoogle, which is what I miss the most when working in Java. If I want to find a function which, say, removes
by lalaithion 7y ago
This is also a great feature of Haskell, especially Hoogle, which is what I miss the most when working in Java. If I want to find a function which, say, removes items from a Map based on a function over values, in Java I have to look and see if it's in the Map class. Nope. Is it in Guava Maps? Ah, there it is, "filterValues".
In Hoogle, I can type `Map k v -> (v -> Bool) -> Map k v` into the search bar, and it finds the function, even though I got the order of the arguments wrong.
https://hoogle.haskell.org/?hoogle=Map%20k%20v%20-%3E%20(v%20-%3E%20Bool)%20-%3E%20Map%20k%20v https://hoogle.haskell.org/?hoogle=Map%20k%20v%20-%3E%20(v%2...
- rovolo 7y agoI'm impressed. Being able to search for functionality by the function signature seems incredibly useful. In the "Verb-Noun vs Noun-Verb" thread from a couple days ago [0], people were saying that OO languages make autocomplete much easier because you start with the parameter you're operating on. But, autocomplete (at least in IntelliJ) only lets you search by method name. There have been lots of times where I want to search by return type or param type instead. When you're looking for functions, do you generally use Hoogle, or do you have a local autocomplete-like feature hooked in to your editor? I really want to be able to use this while writing code. [0] https://news.ycombinator.com/item?id=21271212 https://news.ycombinator.com/item?id=21271212
- marcosdumay 7y agoIf you try, you'll discover it is much less useful in Java. That's probably the reason it's not available there. Pure languages get a lot of hate, but this is the kind of thing you get when you enable better static analysis of your code.