繁体   English   中英

将ghc-options传递给Stack脚本解释器

[英]Passing ghc-options to Stack script interpreter

我正在使用堆栈解释器功能并具有如下代码:

#!/usr/bin/env stack 
-- stack script --resolver lts-12.7 --package yesod 

main = print "hello"

我想将ghc-options选项传递给堆栈解释器。 可能吗 ?

最新版本的Stack直接支持ghc-options

#!/usr/bin/env stack 
-- stack script --resolver lts-12.7 --package yesod --ghc-options -Wall

main = print "hello"

执行时:

$ stack jest.hs

/home/sibi/github/subsite/jest.hs:4:1: warning: [-Wmissing-signatures]
    Top-level binding with no type signature: main :: IO ()
  |
4 | main = print "hello"
  | ^^^^
"hello"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM