Updating Vim haskellmode for GHC-7.0.1

New version of haskellmode plugins for Vim: haskellmode-20101118.vba .

Several features of the haskellmode plugins for Vim depend on building an index of locally installed Haddock documentation. If you are using Vim and Haskell, and haven’t used these plugins yet, the screencasts will give you an overview of the main features.

Apart from the obvious, looking up docs for the identifier under the cursor, I’ve found it useful to be able to refer to identifiers that have not yet been imported. There is a variant of identifier completion wrt documented identifiers, we can add import statements for the identifier under the cursor, and we can get suggestions on valid qualifiers for unqualified identifiers. All together, this supports a style of programming where you first decide the function you want, then have haskellmode fill in the details of imports and qualifiers (of course, that is in addition to traditional completion wrt identifiers already in scope).

Building such a Haddock index has been done by scraping identifiers and URLs from Haddock’s HTML indices, and the format of those has changed with the Haddock included with the new GHC-7.0.1. This update adapts the scraping code to these changes.

Scraping index information from HTML has never been pretty, and the format is no longer as stable as it used to be, either. Fortunately, Haddock has recently been growing an API, so I hope to extract the index directly from Haddock’s interface files in future. That code is almost ready, but since it will mean installing Haskell code together with haskellmode, and the matching version of Haddock has not hit hackage yet, I thought I’d update the old-fashioned way first, for users who want to start using the new GHC before the next Haskell Platform release comes out.

This entry was posted in Uncategorized and tagged , , , , . Bookmark the permalink.