Ryan Scott
Ryan Scott
I would be fine with disabling these suggestions.
Hm, I wonder if this is GHC's fault. I tried loading these modules into GHCi and seeing if `foo` was in scope: ``` $ ghci -fobject-code Label.hs GHCi, version 8.0.2:...
But then again, I don't think GHCi alone can explain the odd behavior in `doctest`. If I define another module which doesn't require `-fobject-code` to interpret, e.g., ```haskell module Bar...
I believe https://github.com/sol/doctest/issues/104#issuecomment-99483481 is another occurrence of this bug in the wild.
OK, I think I know what is going on here. `doctest` loads modules into GHCi with [this code](https://github.com/sol/doctest/blob/79b624698ba2f9ad709a5d0fe74b971aae86ec38/src/Runner.hs#L130): ```haskell void $ Interpreter.safeEval repl $ ":m *" ++ module_ ``` But...
The question now becomes: is it possible to fix this? You could use `:m Label` instead of `:m *Label` when `-fobject-code` is enabled, which would bring `foo` into scope: ```...
I didn't comment at the time, but when I tried prototyping this idea about two years ago, I ran into serious difficulties trying to make it work with modules that...
> I thought that it was being suggested that doctest would toggle between `:m` and `:m *` depending on if `-fobject-code` was in play or not. That is what I...
Having something like `DOCTEST_MODE` would definitely be nice as an analog to `OPTIONS_GHC`.
Great, thanks @TravisWhitaker. @hvr, does this look good to you?