GSOC proposal: Pursuit enhancements
PureScript is a language similar to (and written in) Haskell, which compiles to
provide lots of information and even guarantees about their structure and
behaviour, through just their type signatures. For example, types can capture
information such as not having any side effects, possibility of modifying the
DOM, possibility of returning
null, and so on.
The expressiveness of the type system means that a tool which can search for
functions or data by type can be very useful. Haskell already has this, in the
form of Hoogle. For example, if I forget how to get the integer code point
for a Unicode character, I can just search for
Char -> Int, and get
If I want to split a list into two lists based on a predicate, I can search
(a -> Bool) -> [a] -> ([a], [a]) and get
Hoogle is frequently cited by Haskellers as an extremely valuable tool, and one that is sorely missed in languages that either don't have an equivalent, or would not be able to create one (as a result of insufficiently expressive type systems). Therefore, I think that a similar tool for PureScript would be extremely valuable for making PureScript easier to use, and could provide benefits for users with almost any experience level.
Currently there exists a tool called Pursuit, but it is quite primitive. It can only search by function or data names, not types, and it has no way of ranking search results by relevance. Part of my proposal is to work on Pursuit to make its searching more useful: this means enabling fuzzy searching for type and value names, as well as type searching.
Given the similarity of the type systems of Haskell and PureScript, I expect that I will be able to use work already done in this area -- that is, the algorithms that Hoogle uses -- which I now have a basic understanding of, having read the information about them on Neil Mitchell's website. I hope that I will also be able to reuse some of its code and possibly contribute to it too. However, since Hoogle was built for Haskell, it does not have knowledge of PureScript's effect types and row types, so I expect that I will implement that myself: either by building a separate layer to mediate between the Pursuit frontend and a Hoogle instance on the backend, or by including parts of Hoogle as a library into the main Pursuit server.
PureScript also suffers, currently, from not having a real centralized home for API documentation, like Hackage for Haskell code. Phil Freeman (the creator of PureScript) and I have discussed expanding Pursuit to serve this capability too, so that generated HTML documentation is available to read on the web, with correct links between types and functions in separate packages. This would involve:
- modifying the documentation generator to give more control to the author about how the documentation appears: in what order, with what headings, and so on;
- for exported values which have not been annotated with a type signature, possibly modifying the PureScript compiler so that it can generate better names for inferred types (for example, by making use of aliases where appropriate, by using information about what modules are imported and how, and so on) - this would be very nice to have, as it could improve type errors from the compiler itself as well;
I also have over two years of experience at two separate companies as a full time software developer. My CV and further details of some of my other open source development experience can be found on my personal website: http://harry.garrood.me.