Update CPP check for __GLASGOW_HASKELL__

Signed-off-by: Austin Seipp <aseipp@pobox.com>
<+>: Don't insert a space when concatenating empty nodes

(cherry picked from commit cf73b006faf95512b28c744ecfbdf47c044acb67)
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
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.

(cherry picked from commit 7d2106e18f26a680d157ef943da2602e7199afa1)
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Update tests

This updates tests due to Haddock Trac #271 fix and due to removal of
TypeHoles as an extension from GHC.

(cherry picked from commit 18e9417edcda21dd23edf675b41f46ab336d773f)
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
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 "+"

(cherry picked from commit 039b2346cd7a9998135636146ea234eb9cc0fbab)
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Correct whitespace in ‘hidden’ test for <+> change

(cherry picked from commit 880b91ed0f2fe63c7d35a83ecebb3aa29c2ffc1d)
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Document module header.

Fixes Haddock Trac #270.

(cherry picked from commit 1e21c673a42d3337e05607ed4f47024c65d0cc9d)
Insert a space between module link and description

Fixes Haddock Trac #277.

(cherry picked from commit 01de3a355ee0db773eba5f4368ac8ef4d75425b5)
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.

(cherry picked from commit 860d6504530a163e7483960ca8837eb596e05634)
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>
(cherry picked from commit e0718f203f2448ba2029e70d14aed075860b7fac)
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>
(cherry picked from commit bc5756d062bbc5cad5d4fa60798435ed020c518e)
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>

(cherry picked from commit 7e53f628440169f90cfb6aeeaf74ffbe2b1cfa6d)
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>

(cherry picked from commit d86f68860c40d45d2cec94edd15d4bf4fc4292d8)
Only warn about missing docs when docs are missing

This fixes the ‘Missing documentation for…’ message for modules with
100% coverage.

(cherry picked from commit 50d1d18cc70cf6c8ffcf247743cd8af0ff9aae16)
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>
(cherry picked from commit 6b35adfb811d9e41e5bfa1c11963e441740c2836)
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.

(cherry picked from commit 91e2c21cfdaca7913dbfec17bdd7712c0c1ed732)
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.

(cherry picked from commit fc7fd1875d31dbfd37eaa058177e534b4fc6bc25)
Turn a source code comment into specs

(cherry picked from commit dfc006ad2b8f5cb27570ac02c77aa63c5c027cd9)
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.

(cherry picked from commit 49b2a05ee0d769568d97a091de93f2ce2512eef6)
Don't shadow ‘strip’.

-Wall complains

(cherry picked from commit 1944b94edca881d14e979d564719da6f196f8e63)