在yesod开发中使用预编译的二进制文件

时间:2016-04-03 21:20:24

标签: haskell ghc yesod haskell-stack

Yesod quickstart建议我:

Follow the installation instructions for stack to get stack.
Create a new scaffolded site: stack new my-project yesod-sqlite && cd my-project
    NOTE: Use stack templates to see other available Yesod scaffoldings.
Install the yesod command line tool: stack install yesod-bin cabal-install --install-ghc
Build libraries: stack build
Launch devel server: stack exec -- yesod devel
View your Yesod site at http://localhost:3000/

然而,stack install ..stack build想要下载和编译~200个包,并且构建时间是不可接受的(大约一个小时)。

最重要的是,你的应用程序本身在stack exec之前不会被编译,如果我有很多像hashlet这样的东西,那么它可能需要一些时间。

我认为最好让我的堆栈或cabal将所有内容下载为预编译的二进制文件,并通过runhaskellstack exec runhaskell运行我的开发站点,以缩短编译时间。所以这是我的两个问题:

  1. 如何使用预编译的二进制文件进行堆栈和yesod安装?
  2. 如何在解释模式下运行时让ghci在编辑后重新加载源? yesod devel这样做,但它会尝试重新编译..

1 个答案:

答案 0 :(得分:2)

查看Yesod Web Framework Book的Deploying your Webapp章节。简而言之,有一个名为Keter的部署管理器,它集成到yesod工具中,可用于部署已编译的应用程序。