How do I add the “containers” package to my .cabal file (without getting overwritten by stack at compile time)?

拈花ヽ惹草 提交于 2019-12-03 11:55:12

This is hinting at the problem:

-- This file has been generated from package.yaml by hpack version 0.14.0.
--
-- see: https://github.com/sol/hpack

hpack is an alternative, YAML-based specification format for Haskell packages which can be used instead of the traditional cabal format. The hpack program can then be used to convert a specification from the hpack format to the cabal format to be able to integrate with the rest of the Haskell toolchain.

Some basic support for hpack was added to stack some time ago. It checks for a file called package.yaml in the current directory, which is the standard name for hpack format package specifications, and if it exists, it runs hpack to convert it to a cabal file and then proceeds building as normal. This is what's trampling over your .cabal file.

To solve this, either:

  • Modify package.yaml instead of roman-numerals.cabal to achieve the same effect.
  • Delete package.yaml and continue working directly with roman-numerals.cabal.

The syntax for adding dependencies in the hpack format is:

dependencies:
  - base
  - containers
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!