6

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 another stack project called Bar. How do I import the FooModule.hs module to project Bar?

duplode
  • 33,731
  • 7
  • 79
  • 150
Gal
  • 5,338
  • 5
  • 33
  • 55

1 Answers1

11

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
jkeuhlen
  • 4,401
  • 23
  • 36