1. 5
  1.  

  2. 1

    When developing systems like this, it’s useful to remember that we’re designing for human beings more so than computers. With that in mind, we could use this type-based approach, but to use it exclusively leaves a lot on the table. Combine it with some more information, such as fuzzy text matching on the method name and documentation, and you can get something much more human-friendly.

    I’m imagining this kind of discoverability problem would be best solved not by a search engine, but by an editor or IDE that has a contextual inline dropdown with documentation built-in, similar to what you get in Visual Studio and the like today. If you think about it, current IDEs already do something approaching what the article suggests, but for OO languages instead: they use type information (the object that you’re calling your method on) to give you a contextual list of functions that might be relevant. If you’re not sure how to concatenate two strings, for example, you could just try typing mystring.concat or mystring.append, and a good auto-complete will suggest the right method, if the method name contains one of those words. This could obviously be augmented by looking deeper at the type information, especially in a language like Haskell, but it’s worth looking at what kinds of tools already exist and taking from them the best aspects of them. Especially when you’re looking at tools to improve the daily grind of coding, when one of the best things you can do is keep the feedback loop tight.