How to use my personal library in another project using Stack?

So, I have a personal stack library, call her Foo . In Foo , I have a FooModule module file called FooModule.hs . I have another project on the Bar stack. How to import the module FooModule.hs for the project Bar ?

+5
source share
1 answer

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 
+9
source

Source: https://habr.com/ru/post/1264576/


All Articles