Cabal Conditional For Detecting GHCi

Hi all, I was wondering if Cabal has a predicate which allows me to only enable options when running GHCi. The use-case is I have a set of `ghc-options` that I do *not* want enabled when I run `cabal repl` or `stack repl`. Ideally I'm looking for something along the lines of: if !repl ghc-options: ... -deech

On 9 February 2017 at 14:40, aditya siram
Hi all, I was wondering if Cabal has a predicate which allows me to only enable options when running GHCi. The use-case is I have a set of `ghc-options` that I do *not* want enabled when I run `cabal repl` or `stack repl`.
If you're not using either of these, then what role does Cabal have to play if you open a file in ghci? Though if it's for ghci options, why not just launch ghci with those options (using a .ghci file in the current directory, etc.)? -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com http://IvanMiljenovic.wordpress.com

I have ghc-options that are used to link with a static library when building. But the same options don't work in GHCi where I need to the shared version of the library. Currently when I do `stack repl ...` the static library linking options are also passed to `ghc`. -deech On Wed, Feb 8, 2017 at 9:48 PM, Ivan Lazar Miljenovic < ivan.miljenovic@gmail.com> wrote:
On 9 February 2017 at 14:40, aditya siram
wrote: Hi all, I was wondering if Cabal has a predicate which allows me to only enable options when running GHCi. The use-case is I have a set of `ghc-options` that I do *not* want enabled when I run `cabal repl` or `stack repl`.
If you're not using either of these, then what role does Cabal have to play if you open a file in ghci?
Though if it's for ghci options, why not just launch ghci with those options (using a .ghci file in the current directory, etc.)?
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com http://IvanMiljenovic.wordpress.com

If this is just for local development, what about adding a new flag
that is disabled by default but you can configure with locally?
On 9 February 2017 at 15:21, aditya siram
I have ghc-options that are used to link with a static library when building. But the same options don't work in GHCi where I need to the shared version of the library. Currently when I do `stack repl ...` the static library linking options are also passed to `ghc`. -deech
On Wed, Feb 8, 2017 at 9:48 PM, Ivan Lazar Miljenovic
wrote: On 9 February 2017 at 14:40, aditya siram
wrote: Hi all, I was wondering if Cabal has a predicate which allows me to only enable options when running GHCi. The use-case is I have a set of `ghc-options` that I do *not* want enabled when I run `cabal repl` or `stack repl`.
If you're not using either of these, then what role does Cabal have to play if you open a file in ghci?
Though if it's for ghci options, why not just launch ghci with those options (using a .ghci file in the current directory, etc.)?
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com http://IvanMiljenovic.wordpress.com
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com http://IvanMiljenovic.wordpress.com

If nothing like the predicate I want exists in Cabal I guess a custom flag would be next best option. I was hoping to keep it transparent to the user. On Wed, Feb 8, 2017 at 10:29 PM, Ivan Lazar Miljenovic < ivan.miljenovic@gmail.com> wrote:
If this is just for local development, what about adding a new flag that is disabled by default but you can configure with locally?
On 9 February 2017 at 15:21, aditya siram
wrote: I have ghc-options that are used to link with a static library when building. But the same options don't work in GHCi where I need to the shared version of the library. Currently when I do `stack repl ...` the static library linking options are also passed to `ghc`. -deech
On Wed, Feb 8, 2017 at 9:48 PM, Ivan Lazar Miljenovic
wrote: On 9 February 2017 at 14:40, aditya siram
wrote:
Hi all, I was wondering if Cabal has a predicate which allows me to only enable options when running GHCi. The use-case is I have a set of `ghc-options` that I do *not* want enabled when I run `cabal repl` or `stack repl`.
If you're not using either of these, then what role does Cabal have to play if you open a file in ghci?
Though if it's for ghci options, why not just launch ghci with those options (using a .ghci file in the current directory, etc.)?
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com http://IvanMiljenovic.wordpress.com
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com http://IvanMiljenovic.wordpress.com
participants (2)
-
aditya siram
-
Ivan Lazar Miljenovic