Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add an annotation API #19
Inspired by the
The current state of this change is:
For those who are curious as to how these annotations can be useful, I wrote a blog post about how we use them in Idris: http://www.davidchristiansen.dk/2014/09/06/pretty-printing-idris/
The basic idea is that the annotations track semantic information about their document, which can then be rendered differently in different contexts. In Idris, we use it to have semantic coloring at the console (for example, showing type constructors and data constructors in different colors), while richer output contexts such as the Emacs REPL or tryidris.org can make information like docstrings and type annotations for names available in tooltips. It's also possible to do things like normalizing terms that occur in error messages.
It's great to see that @elliottt has implemented this for the HughesPJ interface - hopefully we'll see better REPLs all around!