Give Uniq[D]FM a phantom type for its key.

This fixes #17667 and should help to avoid such issues going forward.

The changes are mostly mechanical in nature. With two notable
exceptions.

* The register allocator.

  The register allocator references registers by distinct uniques.
  However they come from the types of VirtualReg, Reg or Unique in
  various places. As a result we sometimes cast the key type of the
  map and use functions which operate on the now typed map but take
  a raw Unique as actual key. The logic itself has not changed it
  just becomes obvious where we do so now.

* <Type>Env Modules.

As an example a ClassEnv is currently queried using the types `Class`,
`Name`, and `TyCon`. This is safe since for a distinct class value all
these expressions give the same unique.

    getUnique cls
    getUnique (classTyCon cls)
    getUnique (className cls)
    getUnique (tcName $ classTyCon cls)

This is for the most part contained within the modules defining the
interface. However it requires us to play dirty when we are given a
`Name` to lookup in a `UniqFM Class a` map. But again the logic did
not change and it's for the most part hidden behind the Env Module.

Some of these cases could be avoided by refactoring but this is left
for future work.

We also bump the haddock submodule as it uses UniqFM.
37 jobs for master in 792 minutes and 28 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  Lint
passed #392367
lint
lint-linters

00:00:14

failed #392370
lint allowed to fail
lint-submods

00:00:13

passed #392371
lint
lint-submods-branch

00:00:22

passed #392368
lint
lint-testsuite

00:00:16

passed #392369
lint
typecheck-testsuite

00:00:15

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

00:13:30

 
  Build
passed #392373
x86_64-linux
validate-x86_64-linux-deb9-hadrian

00:52:32

 
  Full Build
failed #392378
aarch64-linux allowed to fail
nightly-aarch64-linux-deb9

02:58:44

failed #392380
armv7-linux allowed to fail
nightly-armv7-linux-deb9

03:10:09

passed #392382
x86_64-linux
nightly-i386-linux-deb9

01:35:50

failed #392397
new-x86_64-windows test allowed to fail
nightly-i386-windows

00:00:41

failed #392393
new-x86_64-windows test allowed to fail
nightly-i386-windows-hadrian

00:03:24

failed #392375
x86_64-freebsd allowed to fail
nightly-x86_64-freebsd

01:38:11

failed #392390
x86_64-linux allowed to fail
nightly-x86_64-linux-alpine

02:00:43

passed #392389
x86_64-linux
nightly-x86_64-linux-deb10

01:01:35

failed #392383
x86_64-linux
nightly-x86_64-linux-deb9

00:55:54

passed #392387
x86_64-linux
nightly-x86_64-linux-deb9-integer-simple

01:32:25

failed #392385
x86_64-linux
nightly-x86_64-linux-deb9-llvm

01:26:21

failed #392395
new-x86_64-windows test allowed to fail
nightly-x86_64-windows

00:10:09

failed #392377
aarch64-linux allowed to fail
validate-aarch64-linux-deb9

02:58:28

failed #392379
armv7-linux allowed to fail
validate-armv7-linux-deb9

03:12:51

passed #392381
x86_64-linux
validate-i386-linux-deb9

00:50:33

failed #392396
new-x86_64-windows test allowed to fail
validate-i386-windows

00:00:42

passed #392376
x86_64-darwin
validate-x86_64-darwin

01:10:04

passed #392384
x86_64-linux
validate-x86_64-linux-deb9-debug

01:46:44

passed #392388
x86_64-linux
validate-x86_64-linux-deb9-dwarf

01:40:23

passed #392386
x86_64-linux
validate-x86_64-linux-deb9-integer-simple

01:22:24

passed #392374
x86_64-linux
validate-x86_64-linux-deb9-unreg-hadrian

02:41:55

passed #392391
x86_64-linux
validate-x86_64-linux-fedora27

01:33:54

failed #392394
new-x86_64-windows test allowed to fail
validate-x86_64-windows

00:29:03

failed #392392
new-x86_64-windows test allowed to fail
validate-x86_64-windows-hadrian

12:05:04

 
  Cleanup
passed #392398
x86_64-darwin
cleanup-darwin

00:00:25

 
  Packaging
skipped #392399
x86_64-linux allowed to fail
doc-tarball
 
  Testing
skipped #392400
x86_64-linux allowed to fail manual
hackage
skipped #392401
x86_64-linux
nightly-hackage
skipped #392402
x86_64-linux
perf-nofib
 
  Deploy
skipped #392403
x86_64-linux allowed to fail
pages
 
Name Stage Failure
failed
nightly-i386-windows Full Build
Git branch:   13-1-stable
GO version: go1.13.8
Built: 2020-06-19T21:12:23+0000
OS/Arch: windows/amd64
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=2856 revision=6214287e version=13.1.0
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit status 1
failed
lint-submods Lint
Entering 'libraries/unix'
Entering 'libraries/xhtml'
Entering 'nofib'
Entering 'utils/haddock'
Entering 'utils/hsc2hs'
Authenticating with credentials from job payload (GitLab Registry)
$ git fetch "$CI_MERGE_REQUEST_PROJECT_URL" $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
fatal: No path specified. See 'man git-pull' for valid url syntax
ERROR: Job failed: exit code 1
failed
validate-x86_64-windows-hadrian Full Build The script exceeded the maximum execution time set for the job
perf notes ref refs/notes/perf is 8868b5a94b6dba38170c4c8f8d3c942dcd1682a1
git notes --ref=perf append -F C:\GitLabRunner\builds\vtxL4Kke\0\ghc\ghc/performance-metrics.tsv HEAD
git push git@gitlab.haskell.org:ghc/ghc-performance-notes.git refs/notes/perf
To gitlab.haskell.org:ghc/ghc-performance-notes.git
8868b5a94b..e6afe51681 refs/notes/perf -> refs/notes/perf
WARNING: Failed to terminate process: exit status 128
WARNING: Failed to force-kill: exit status 128
WARNING: Timed out waiting for the build to finish
ERROR: Job failed: execution took longer than 12h0m0s seconds
failed
validate-i386-windows Full Build
Git branch:   13-1-stable
GO version: go1.13.8
Built: 2020-06-19T21:12:23+0000
OS/Arch: windows/amd64
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=8340 revision=6214287e version=13.1.0
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit status 1
failed
nightly-x86_64-windows Full Build
Git branch:   13-1-stable
GO version: go1.13.8
Built: 2020-06-19T21:12:23+0000
OS/Arch: windows/amd64
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=4916 revision=6214287e version=13.1.0
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit status 1
failed
nightly-i386-windows-hadrian Full Build
Git branch:   13-1-stable
GO version: go1.13.8
Built: 2020-06-19T21:12:23+0000
OS/Arch: windows/amd64
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=6804 revision=6214287e version=13.1.0
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit status 1
failed
nightly-aarch64-linux-deb9 Full Build
Uploading artifacts...
ghc-aarch64-linux-deb9.tar.xz: found 1 matching files and directories

junit.xml: found 1 matching files and directories

performance-metrics.tsv: found 1 matching files and directories

Uploading artifacts as "archive" to coordinator... ok
id=392378 responseStatus=201 Created token=87NDwqJz
Uploading artifacts...
junit.xml: found 1 matching files and directories

Uploading artifacts as "junit" to coordinator... ok
id=392378 responseStatus=201 Created token=87NDwqJz
ERROR: Job failed: exit code 1
failed
validate-x86_64-windows Full Build
Git branch:   13-1-stable
GO version: go1.13.8
Built: 2020-06-19T21:12:23+0000
OS/Arch: windows/amd64
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=5868 revision=6214287e version=13.1.0
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit status 1
failed
nightly-x86_64-linux-deb9 Full Build
Uploading artifacts...
./ghc-x86_64-deb9-linux.tar.xz: found 1 matching files and directories

junit.xml: found 1 matching files and directories

performance-metrics.tsv: found 1 matching files and directories

Uploading artifacts as "archive" to coordinator... ok
id=392383 responseStatus=201 Created token=wikK57Cv
Uploading artifacts...
junit.xml: found 1 matching files and directories

Uploading artifacts as "junit" to coordinator... ok
id=392383 responseStatus=201 Created token=wikK57Cv
ERROR: Job failed: exit code 1
failed
nightly-x86_64-linux-deb9-llvm Full Build
Uploading artifacts...
./ghc-x86_64-deb9-linux.tar.xz: found 1 matching files and directories

junit.xml: found 1 matching files and directories

performance-metrics.tsv: found 1 matching files and directories

Uploading artifacts as "archive" to coordinator... ok
id=392385 responseStatus=201 Created token=9ss-_rVZ
Uploading artifacts...
junit.xml: found 1 matching files and directories

Uploading artifacts as "junit" to coordinator... ok
id=392385 responseStatus=201 Created token=9ss-_rVZ
ERROR: Job failed: exit code 1
failed
nightly-x86_64-freebsd Full Build
ghc-x86_64-portbld-freebsd.tar.xz: found 1 matching files 
junit.xml: found 1 matching files

performance-metrics.tsv: found 1 matching files

Uploading artifacts to coordinator... ok
id=392375 responseStatus=201 Created token=WzeBxh2z
Uploading artifacts...
Runtime platform
arch=amd64 os=freebsd pid=52320 revision=58272c27 version=12.7.0
junit.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=392375 responseStatus=201 Created token=WzeBxh2z
ERROR: Job failed: exit status 1
failed
nightly-x86_64-linux-alpine Full Build
Uploading artifacts for failed job
Uploading artifacts...
ghc.tar.xz: found 1 matching files and directories

junit.xml: found 1 matching files and directories

Uploading artifacts as "archive" to coordinator... ok
id=392390 responseStatus=201 Created token=4Uua2R9q
Uploading artifacts...
junit.xml: found 1 matching files and directories

Uploading artifacts as "junit" to coordinator... ok
id=392390 responseStatus=201 Created token=4Uua2R9q
ERROR: Job failed: exit code 1
failed
validate-armv7-linux-deb9 Full Build
Uploading artifacts...
ghc-armv7-linux-deb9.tar.xz: found 1 matching files

junit.xml: found 1 matching files

performance-metrics.tsv: found 1 matching files

Uploading artifacts to coordinator... ok
id=392379 responseStatus=201 Created token=xBh-Jz8z
Uploading artifacts...
junit.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=392379 responseStatus=201 Created token=xBh-Jz8z
ERROR: Job failed: exit code 1
failed
nightly-armv7-linux-deb9 Full Build
Uploading artifacts...
ghc-armv7-linux-deb9.tar.xz: found 1 matching files

junit.xml: found 1 matching files

performance-metrics.tsv: found 1 matching files

Uploading artifacts to coordinator... ok
id=392380 responseStatus=201 Created token=xtAz74oS
Uploading artifacts...
junit.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=392380 responseStatus=201 Created token=xtAz74oS
ERROR: Job failed: exit code 1
failed
validate-aarch64-linux-deb9 Full Build
Uploading artifacts...
ghc-aarch64-linux-deb9.tar.xz: found 1 matching files and directories

junit.xml: found 1 matching files and directories

performance-metrics.tsv: found 1 matching files and directories

Uploading artifacts as "archive" to coordinator... ok
id=392377 responseStatus=201 Created token=CgqaPmEY
Uploading artifacts...
junit.xml: found 1 matching files and directories

Uploading artifacts as "junit" to coordinator... ok
id=392377 responseStatus=201 Created token=CgqaPmEY
ERROR: Job failed: exit code 1