Re: -i in OPTIONS_GHC
Brandon Allbery <[email protected]> Wed, 30 Jul 2025 15:23:09 -0400
| Newsgroups | gmane.comp.lang.haskell.cafe |
|---|---|
| Message-ID | <CAKFCL4X87e-931zJyDSK5ua=dTNVWNL2hcZs4gxwE7AGV=g6ow@mail.gmail.com> |
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. On Wed, Jul 30, 2025 at 3:20 PM amindfv--- via Haskell-Cafe < [email protected]> wrote: > I'd like to update the search path of a Haskell module, using the > OPTIONS_GHC pragma. > > From the documentation[0], OPTIONS_GHC allows you to set dynamic flags, > which `-i` appears to be.[1] > > Here's a quick demo of what I believe _should_ work, but doesn't: > > A.hs: > > {-# OPTIONS_GHC -isrc #-} > > import B > > main = print b > > > src/B.hs: > > module B where > > b = "!" > > > `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?) > > Thanks, > Tom > > [0] > https://downloads.haskell.org/ghc/latest/docs/users_guide/using.html#command-line-options-in-source-files > [1] > https://downloads.haskell.org/ghc/latest/docs/users_guide/flags.html#finding-imports > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -- brandon s allbery kf8nh [email protected] _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.