I built an example project showing how to build shared libraries in Haskell, in 2019.
https://github.com/mietek/haskell-so-example