将-ddump-splices传递给Stack脚本解释器

时间:2017-12-07 19:17:44

标签: haskell ghc haskell-stack

我正在使用Stack解释器功能并拥有如下代码:

#!/usr/bin/env stack
{- stack
     --resolver lts-9.0
     --install-ghc
     runghc
     --package yesod
     --package yesod-core
-}


{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes       #-}
{-# LANGUAGE TemplateHaskell   #-}
-- and the code goes on

我想将ddump-splices选项传递给堆栈解释器。有可能吗?

1 个答案:

答案 0 :(得分:3)

是的,在传递实际的ghc选项之前,你必须使用--。即:

#!/usr/bin/env stack
{- stack
     --resolver lts-9.0
     --install-ghc
     runghc
     --package yesod
     --package yesod-core
     -- -ddump-splices
-}

您可以使用ghc --show-options查看可以传递的选项类型。有关详细信息,请参阅此处:https://github.com/commercialhaskell/stack/issues/650#issuecomment-123470879