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)