Today, I discovered something interesting that could potentially cause a bug while working with FFI.
GHCi, version 9.4.8: https://www.haskell.org/ghc/ :? for help
ghci> :set -package bytestring
package flags have changed, resetting and loading new packages...
ghci> import qualified Data.ByteString as BS
ghci> import qualified Data.ByteString.Internal as BSI
ghci> import Foreign.ForeignPtr
ghci> :set -XOverloadedStrings
ghci> BS.empty == ""
True
ghci> withForeignPtr (fst (BSI.toForeignPtr0 "")) print
0x0000004200431e70
ghci> withForeignPtr (fst (BSI.toForeignPtr0 BS.empty)) print
0x0000000000000000
ghci>