在 Haskell 中,您使用 Cabal 配置。在您的项目顶级目录中,放置一个扩展名为 的文件.cabal
,例如<yourprojectname>.cabal
. 内容大致如下:
Name: myfancypackage
Version: 0.0
Description: myfancypackage
License: BSD3
License-file: LICENSE
Author: John Doe
Maintainer: john@example.com
Build-Type: Simple
Cabal-Version: >=1.4
Flag pure-haskell-md5
Description: Choose the purely Haskell MD5 implementation
Default: False
Executable haq
Main-is: Haq.hs
Build-Depends: base-4.*
if flag(pure-haskell-md5)
Build-Depends: pureMD5-0.2.*
else
Build-Depends: hopenssl-1.1.*
Cabal 文档有更多详细信息,特别是有关配置的部分。