Make IOEnv monad one-shot (#18202)

On CI (x86_64-linux-deb9-hadrian, compile_time/bytes_allocated):

    T10421     -1.8%    (threshold: +/- 1%)
    T10421a    -1.7%    (threshold: +/- 1%)
    T12150     -4.9%    (threshold: +/- 2%)
    T12227     -1.6     (threshold: +/- 1%)
    T12425     -1.5%    (threshold: +/- 1%)
    T12545     -3.8%    (threshold: +/- 1%)
    T12707     -3.0%    (threshold: +/- 1%)
    T13035     -3.0%    (threshold: +/- 1%)
    T14683     -10.3%   (threshold: +/- 2%)
    T3064      -6.9%    (threshold: +/- 2%)
    T4801      -4.3%    (threshold: +/- 2%)
    T5030      -2.6%    (threshold: +/- 2%)
    T5321FD    -3.6%    (threshold: +/- 2%)
    T5321Fun   -4.6%    (threshold: +/- 2%)
    T5631      -19.7%   (threshold: +/- 2%)
    T5642      -13.0%   (threshold: +/- 2%)
    T783       -2.7     (threshold: +/- 2%)
    T9020      -11.1    (threshold: +/- 2%)
    T9961      -3.4%    (threshold: +/- 2%)

    T1969 (compile_time/bytes_allocated)  -2.2%  (threshold: +/-1%)
    T1969 (compile_time/max_bytes_used)   +24.4% (threshold: +/-20%)

Additionally on other CIs:

    haddock.Cabal                  -10.0%   (threshold: +/- 5%)
    haddock.compiler               -9.5%    (threshold: +/- 5%)
    haddock.base (max bytes used)  +24.6%   (threshold: +/- 15%)
    T10370 (max bytes used, i386)  +18.4%   (threshold: +/- 15%)

Metric Decrease:
    T10421
    T10421a
    T12150
    T12227
    T12425
    T12545
    T12707
    T13035
    T14683
    T3064
    T4801
    T5030
    T5321FD
    T5321Fun
    T5631
    T5642
    T783
    T9020
    T9961
    haddock.Cabal
    haddock.compiler
Metric Decrease 'compile_time/bytes allocated':
    T1969
Metric Increase 'compile_time/max_bytes_used':
    T1969
    T10370
    haddock.base
22 jobs for !3843 with hsyl20/perf/ioenv in 363 minutes and 35 seconds
detached
Status Job ID Name Coverage
  Lint
passed #413975
lint
ghc-linters

00:00:15

passed #413976
lint
lint-linters

00:00:14

passed #413979
lint
lint-submods

00:00:21

passed #413977
lint
lint-testsuite

00:00:16

passed #413978
lint
typecheck-testsuite

00:00:15

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

00:11:03

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

01:39:12

 
  Full Build
failed #413984
aarch64-linux allowed to fail
validate-aarch64-linux-deb9

03:46:45

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

03:38:06

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

01:03:45

passed #413983
x86_64-darwin
validate-x86_64-darwin

01:10:16

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

01:48:50

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

01:46:41

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

01:15:25

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

02:17:40

passed #413990
x86_64-linux
validate-x86_64-linux-fedora27

01:41:25

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

00:32:47

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

00:50:13

 
  Cleanup
passed #413993
x86_64-darwin
cleanup-darwin

00:00:15

 
  Packaging
failed #413994
x86_64-linux allowed to fail
doc-tarball

00:02:37

 
  Testing
manual #413995
x86_64-linux allowed to fail manual
hackage
passed #413996
x86_64-linux
perf-nofib

00:22:46

 
Name Stage Failure
failed
doc-tarball Packaging
Entering 'utils/haddock'
Entering 'utils/hsc2hs'
Downloading artifacts
Downloading artifacts for validate-x86_64-linux-deb9-debug (413987)...
Downloading artifacts from coordinator... ok
id=413987 responseStatus=200 OK token=kWJwYxa7
Executing "step_script" stage of the job script
$ if [ ! -f "$LINUX_BINDIST" ]; then # collapsed multi-line command
Error: ghc-x86_64-mingw32.tar.xz does not exist. Did the 64-bit Windows job fail?
ERROR: Job failed: exit code 1
failed
validate-aarch64-linux-deb9 Full Build
   th/T12993.run                        T12993 [fragile] (ext-interp)
th/T13018.run T13018 [fragile] (ext-interp)
th/T13098.run T13098 [fragile] (ext-interp)
th/T13123.run T13123 [fragile] (ext-interp)
th/T13587.run T13587 [fragile] (ext-interp)
th/T13642.run T13642 [fragile] (ext-interp)
th/T13776.run T13776 [fragile] (ext-interp)
th/T13781.run T13781 [fragile] (ext-interp)
th/T13782.
Job's log exceeded limit of 16384000 bytes.
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=3368 revision=6214287e version=13.1.0
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit status 1
failed
validate-x86_64-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=8944 revision=6214287e version=13.1.0
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit status 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=413985 responseStatus=201 Created token=MWdqUE41
Uploading artifacts...
junit.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=413985 responseStatus=201 Created token=MWdqUE41
ERROR: Job failed: exit code 1