haskell - 将 ghc-options 传递给 Stack 脚本解释器
问题描述
我正在使用堆栈解释器功能并具有如下代码:
#!/usr/bin/env stack
-- stack script --resolver lts-12.7 --package yesod
main = print "hello"
我想将ghc-options
选项传递给堆栈解释器。是否可以 ?
解决方案
最新版本的 Stackghc-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"
推荐阅读
- function - OCaml 中的 Map.fold
- html - 角材料中的引导面板等效项是什么?
- r - R Shiny:使用 input$ 值创建 reactiveValues 对象
- java - 如何在密码程序中包含空格?
- ios - Swift UIAlertAction segue 数据传递
- javascript - 如何通过单击Vuetify中轮播上的按钮将属性设置为true
- javascript - Bootstrap Vue 可编辑表格列
- php - 如何在一个查询中执行插入?
- fabric - Fabric fab -f:找不到任何名为“fabfile”的集合
- c++ - 将一个类的方法指针存储到另一个类中