Support for -XPatternSynonyms

Signed-off-by: Austin Seipp <austin@well-typed.com>
Update CPP check for __GLASGOW_HASKELL__

Signed-off-by: Austin Seipp <austin@well-typed.com>
<+>: Don't insert a space when concatenating empty nodes
Fix @ code blocks

In cases where we had some horizontal space before the closing ‘@’, the
parser would not accept the block as a code block and we'd get ugly
output.
Update tests

This updates tests due to Haddock Trac #271 fix and due to removal of
TypeHoles as an extension from GHC.
Handle infix vs prefix names correctly everywhere, by explicitly specifying the context

The basic idea is that "a" and "+" are either pretty-printed as "a" and "(+)"  or "`a`" and "+"
Correct whitespace in ‘hidden’ test for <+> change
Document module header.

Fixes Haddock Trac #270.
Insert a space between module link and description

Fixes Haddock Trac #277.
Ensure a space between type signature and ‘Source’

This is briefly related to Haddock Trac #249 and employs effectively the
suggested fix _but_ it doesn't actually fix the reported issue. This
commit simply makes copying the full line a bit less of a pain.
Add support for type/data families

This adds support for type/data families with their respective
instances, as well as closed type families and associated type/data
families.

Signed-off-by: Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>
Improve display of poly-kinded type operators

This now displays them as (==) k a b c ... to mirror GHC's behavior,
instead of the old (k == a) b c ... which was just wrong.

Signed-off-by: Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>
Add test case for PatternSynonyms

This just tests various stuff including poly-kinded patterns and
operator patterns to make sure the rendering isn't broken.

Signed-off-by: Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>
Get rid of re-implementation of sortBy

I have no idea what this was doing lying around here, and due to the
usage of tuples it's actually slower, too.

Signed-off-by: Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>
Only warn about missing docs when docs are missing

This fixes the ‘Missing documentation for…’ message for modules with
100% coverage.
Add test case for inter-module type/data family instances

These should show up in every place where the class is visible, and
indeed they do right now.

Signed-off-by: Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>
Use a bespoke data type to indicate fixity

This deals with what I imagine was an ancient TODO and makes it much
clearer what the argument actually does rather than having the user
chase down the comment.
Strip a single leading space from bird tracks (#201)

This makes bird tracks in the form

> foo
> bar
> bat

parse as if they had been written as

>foo
>bar
>bat

ie. without the leading whitespace in front of every line.

Ideally we also want to look into how leading whitespace affects code
blocks written using the @ @ syntax, which are currently unaffected by
this patch.
Turn a source code comment into specs
Update test case for lifted GADT type rendering

The parsing of these seems to have been fixed by GHC folk and it now
renders differently. IMHO it now renders in a better way so I'm updating
the test to reflect this.