Hi there,
The code could not be simpler. Just ldapInit, ldapSimpleBind.
I just found that the code works with ghci, too. So to sum up,
ghci/runhaskell works, ghc not.
A possibility that occurs to me: does it by any chance work with ghc -threaded? Perhaps the issue relates to the different behavior of the threaded runtime (which is used automatically by ghci/runghc).
--