Significant refactor of Lint

This refactoring of Lint was triggered by #17923, which is
fixed by this patch.

The main change is this.  Instead of
   lintType :: Type -> LintM LintedKind
we now have
   lintType :: Type -> LintM LintedType

Previously, all of typeKind was effectively duplicate in lintType.
Moreover, since we have an ambient substitution, we still had to
apply the substition here and there, sometimes more than once. It
was all very tricky, in the end, and made my head hurt.

Now, lintType returns a fully linted type, with all substitutions
performed on it.  This is much simpler.

The same thing is needed for Coercions.  Instead of
  lintCoercion :: OutCoercion
               -> LintM (LintedKind, LintedKind,
                         LintedType, LintedType, Role)
we now have
  lintCoercion :: Coercion -> LintM LintedCoercion

Much simpler!  The code is shorter and less bug-prone.

There are a lot of knock on effects.  But life is now better.
23 jobs for !2920 with wip/T17923 in 207 minutes and 40 seconds (queued for 2 minutes and 24 seconds)
detached
Status Job ID Name Coverage
  Lint
passed #291579
lint
ghc-linters

00:00:14

passed #291580
lint
lint-linters

00:00:15

passed #291583
lint
lint-submods-mr

00:00:18

passed #291581
lint
lint-testsuite

00:00:17

passed #291582
lint
typecheck-testsuite

00:00:15

 
  Quick Build
passed #291584
x86_64-linux
hadrian-ghc-in-ghci

00:19:43

 
  Build
failed #291585
x86_64-linux
validate-x86_64-linux-deb9-hadrian

03:06:45

 
  Full Build
skipped #291588
aarch64-linux allowed to fail
validate-aarch64-linux-deb9
skipped #291589
armv7-linux
validate-armv7-linux-deb9
skipped #291590
x86_64-linux
validate-i386-linux-deb9
skipped #291597
new-x86_64-windows test allowed to fail
validate-i386-windows
skipped #291587
x86_64-darwin
validate-x86_64-darwin
skipped #291591
x86_64-linux
validate-x86_64-linux-deb9-debug
skipped #291593
x86_64-linux
validate-x86_64-linux-deb9-dwarf
skipped #291592
x86_64-linux
validate-x86_64-linux-deb9-integer-simple
skipped #291586
x86_64-linux
validate-x86_64-linux-deb9-unreg-hadrian
skipped #291594
x86_64-linux
validate-x86_64-linux-fedora27
skipped #291596
new-x86_64-windows test allowed to fail
validate-x86_64-windows
skipped #291595
new-x86_64-windows test allowed to fail
validate-x86_64-windows-hadrian
 
  Cleanup
passed #291598
x86_64-darwin
cleanup-darwin

00:00:19

 
  Packaging
skipped #291599
x86_64-linux allowed to fail
doc-tarball
 
  Testing
skipped #291600
x86_64-linux allowed to fail manual
hackage
skipped #291601
x86_64-linux
perf-nofib
 
Name Stage Failure
failed
validate-x86_64-linux-deb9-hadrian Build
hadrian/build-cabal --flavour=validate -j4 --broken-test= test --summary-junit=./junit.xml --test-compiler=/builds/ghc/ghc/_build/install/bin/ghc failed
Running after script...
$ .gitlab/ci.sh clean
Running make --quiet clean...
Running rm -Rf _build...
Uploading artifacts...
junit.xml: found 1 matching files
Uploading artifacts to coordinator... ok
id=291585 responseStatus=201 Created token=p_33QsKs
ERROR: Job failed: exit code 1