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


On Fri, Feb 22, 2019 at 12:35 PM Sven Panne <svenpanne@gmail.com> wrote:
Am Fr., 22. Feb. 2019 um 11:39 Uhr schrieb Damien Mattei <damien.mattei@gmail.com>:
[...] but i think it's the 8.2 compiler that cause the bug...

After a quick look at your code, I very much doubt that. You use the mysql-simple package, which in turn uses the mysql package, which in turn uses the native mysqlclient library. My (and probably most people's) reaction here is: It is much, much more probable that either

   a) you use the package/library incorrectly

or

   b) the package/library has a bug

than that you have discovered a compiler bug for otherwise farily trivial code. Your best bet is to either rip out the mysql dependencies and still reproduce the bug or issue a bug report at e.g. https://github.com/paul-rouse/mysql-simple/issues.

Note that I'm not saying that GHC is bug-free, it is just a question where people will probably like to spend their time on. Given the fact that there are tons of buggy packages/libraries with questionable quality out there, it is basically *your* onus to show that your problem is GHC's fault.

Just my 2c...