google / hrepl

Interactive development for Bazel/Haskell rules
Apache License 2.0
47 stars 10 forks source link

Dependencies aren't loaded by default #4

Open judah opened 4 years ago

judah commented 4 years ago

hrepl doesn't expose dependencies by default. To load a dependency into the interpreter, it needs to be either passed explicitly on the command line, or else exposed with :set -package .... This could be considered "working as intended" since it's how the actual Bazel build rules work. However, it's not a great user experience:

The current recommended approach is to use --package //some:label which will add the given target as an exposed (compiled) dependency. But in all cases, if you want to expose a new dependency you effectively need to start a new session.

Google's internal version of hrepl exposes everything, but that has its own tradeoff: Two modules from different targets could conflict, and distinguishing between them with -XPackageImports is cumbersome due to the mangled package names. Internally, we modified GHC to be more permissive and allow unmangled labels as package names.