cabal repl --ghc-option='-package xyz'
This will load the package you are calling cabal repl
from and the package xyz
.
To do that after the fact, i.e. when you’re already in the REPL and want to load an extra helper module from another package:
GHCi> :set -package xyz
GHCi> :m +XYZ.Module.You.Suddenly.Need