it's not me that say first ghc can have bug. There is a misunderstanding, i first thought that if there was a problem it was not the core ghc interpreter/compiler (note that i never try to compile with ghc, possible the behavior is different in interpreter than in compile mode) but i had a lot of doubt about the stability of the mysql* packages.
BUT i just made more test with the same mysql* package (version is the latest,just installed with cabal) on another system this time 32bits:
[mattei@asteroide ~]$ uname -a
Linux asteroide 3.10.0-862.3.3.el7.x86_64 #1 SMP Fri Jun 15 04:15:27 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[mattei@asteroide ~]$ cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
[mattei@asteroide ~]$ ghci
GHCi, version 8.4.3:
http://www.haskell.org/ghc/ :? for help
ghci version 8.4.3
and the program works fine, this does not means that the ghci v8.2 have bugs nor the mysql* packages , just means that there is some incompatibilies between ghc 8.2 and the latest versions of mysql* packages (mysql-simple-0.4.5)
i think there is something that can be enhanced in the cabal or the package installion script of mysql* packages to detect those incompatibilities but i do not know how, perheaps if with cabal and ghc 8.2 i had installed an earlier verison of mysql* it could have worked without problem.
Damien