Ticket #1 (new defect)
keep a single GHCi/GHC API session for each project
|Reported by:||claus||Owned by:||claus|
Due to Vim not providing a standard API for keeping connections to external tool sessions running in the background (:help design-not; this is my main gripe with Vim), haskellmode currently uses tools like ghc, ghc-pkg as short-term filters.
In theory, it is possible to work around this Vim limitation, but this raises issues of portability (eg, Vim's client-server communication relies on GUI access, so it won't work in a terminal-only situation), complexity (the most promising approach would be to communicate via sockets), dependencies (several of Vim's plugin script languages support asynchronous subprocess control, but which one to depend on - python/perl/..?), and stability (Vim supports dynamic linking, so one might try to use Haskell's own facilities via FFI, but any bugs there can bring down the Vim session).
On recent machines, the short-term filter approach is just fast enough, but it is a waste, and doesn't scale to large projects (workaround: compile all modules, so only the currently edited module will need to be interpreted).