I have a Stack based project and with the following:
ghcid --command 'stack ghci' --allow-eval --clear --no-height-limit '-o ghcid.log'
I can have ghcid execute/evaluate a function as follows:
-- $> unit_simple_single
unit_simple_single :: IO ()
unit_simple_single = runTest 1 superSimplSuite
If I switch the project from Stack to Cabal and run:
ghcid --command 'cabal repl' --allow-eval --clear --no-height-limit '-o ghcid.log'
I get:
<interactive>:28:1-18: error:
Variable not in scope: unit_simple_single
I understand that Stack does a lot of work introspecting modules in a project and loading them when you call stack ghci
and cabal repl
doesn't, so I guess I need to create a .ghci
file but I haven't been able to get this to work.
eg.
:load SuiteRuntimeTest
I still get the same result.
So what needs to go into .ghci
to get ghcid
eval working?
Is there a utility, like an "hpack for ghci", that could generate this file?