How to use import a personal library in another project with Stack?

后端 未结 1 1724
眼角桃花
眼角桃花 2021-02-04 20:36

So I have a personal stack library, let\'s call it Foo. In Foo, I have a FooModule module file named FooModule.hs. I have an

相关标签:
1条回答
  • 2021-02-04 21:29

    I do this all the time. In your stack.yaml file, add the path to the Foo package:

    -- stack.yaml
    packages:
    - '.'
    - lib/foo
    

    And then in your Bar.cabal file you say that your build depends on Foo

    -- project.cabal
    ...
    build-depends:       base >= 4.7 && < 5
                       , foo
    
    0 讨论(0)
提交回复
热议问题