Produces ctags "tags" and etags "TAGS" files for Haskell programs


Version on this page:0.72.0@rev:2
LTS Haskell 22.29:0.73.0@rev:2
Stackage Nightly 2024-07-19:0.73.0@rev:2
Latest on Hackage:0.73.0@rev:2

See all snapshots hasktags appears in

BSD-3-Clause licensed by The GHC Team
This version can be pinned in stack with:hasktags-0.72.0@sha256:1d3cb246cf1b374bcbf5dfab2dd0f99c9c0898412281583ef89fe9bdc6347b38,2866

Module documentation for 0.72.0


A tool to generate tag files for vim and emacs

What is it for? A tag file is a index containing key items of your project such as

  • function names
  • module names
  • data declarations

So that you can find / jump to them fast.


Build hasktags (standard cabal build)

Ctag format:

hasktags --ctags .

Etag format (used by emacs):

hasktags --etags .

Both formats:

hasktags --both .

NB: Generating both tags generates a file called TAGS for Emacs, and one called ctags for Vim.



let tags+=tagfile " tags,TAGS is the default setting so probably you don't have to do anything

:tjump foo<tab> or such. See :h tags

You can use a configuration like this one with Tagbar to produce a tagbar like this:

Tagbar1 Tagbar2

Enormous thanks to Alexey Radkov for the hierarchical design necessary for this usage.


Load the “tags” file using File/Load Tags File. Use “Ctrl-D” to search for a tag.


Load the “TAGS” file using “visit-tags-table” Use “M-.” to search for a tag.


There is a plugin.


To run the tests, do cd testcases; sh test.sh.


In the past this tool was distributed with ghc. I forked and added some features. hasktags itself was moved out of the ghc repository. Then I only verified that my fork finds at least as much tags as the one forked by Igloo.


Things which could be done in the future:

  • make json support optional
  • Marco Túlio Pimenta Gontijo proposed replacing json by aeson because it might be faster


See cabal file

Comments about literate haskell (lhs):

Alex no longer supports bird style “>”, so should we drop support, too?


  • Jack Henahan (maintainer)
  • Marc Weber
  • Marco Túlio Pimenta Gontijo
  • Nikolay Yakimov
  • Alois Cochard
  • Liyang HU
  • Ben Gamari
  • Chris Done
  • Chris Stryczynski
  • Max Nordlund gmail
  • Kwang Yul Seo
  • Pedro Rodriguez
  • Thomas Miedema
  • Vincent B
  • dnhgff
  • Alexey Radkov
  • Michael Baikov
  • Magnus Therning
  • Felix Gruber


Add all people having contributed before Oct 2012 This includes people contributing to the darcs repository as well as people having contributed when this repository has been part of ghc

Related work

And probably much more