<div dir="ltr">Dunno about security implications (ignoring potential interactions with Safe Haskell) but it sounds like a code organization wart to me. Having to dig through source files to find variant import paths sounds like a nightmare for trying to understand a codebase.</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Jul 30, 2025 at 3:20 PM amindfv--- via Haskell-Cafe <<a href="mailto:haskell-cafe@haskell.org">haskell-cafe@haskell.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I'd like to update the search path of a Haskell module, using the OPTIONS_GHC pragma.<br>
<br>
>From the documentation[0], OPTIONS_GHC allows you to set dynamic flags, which `-i` appears to be.[1]<br>
<br>
Here's a quick demo of what I believe _should_ work, but doesn't:<br>
<br>
A.hs:<br>
<br>
{-# OPTIONS_GHC -isrc #-}<br>
<br>
import B<br>
<br>
main = print b<br>
<br>
<br>
src/B.hs:<br>
<br>
module B where<br>
<br>
b = "!"<br>
<br>
<br>
`ghc A.hs` fails, but (of course) `ghc -isrc A.hs` succeeds. Is there a way to get this to work? Is the current behavior intended? Is what I want a misfeature? (E.g. there are security implications?)<br>
<br>
Thanks,<br>
Tom<br>
<br>
[0] <a href="https://downloads.haskell.org/ghc/latest/docs/users_guide/using.html#command-line-options-in-source-files" rel="noreferrer" target="_blank">https://downloads.haskell.org/ghc/latest/docs/users_guide/using.html#command-line-options-in-source-files</a><br>
[1] <a href="https://downloads.haskell.org/ghc/latest/docs/users_guide/flags.html#finding-imports" rel="noreferrer" target="_blank">https://downloads.haskell.org/ghc/latest/docs/users_guide/flags.html#finding-imports</a><br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>brandon s allbery kf8nh</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a></div></div></div></div></div>