haskell - Difference between new-template.cabal and stack.yaml -
i want use reactive-banana in new haskell project. never used cabal-install or stack before. created directory , initialized project files in using stack new. see 2 files in directory: new-template.cabal , stack.yaml.
how set dependencies , make sure downloaded , compiled?
at first tried add - reactive-banana-0.8.0.2 in stack.yaml under extra-deps:, both stack build , stack solver didn't download it. augmented part called library in new-template.cabal this:
library hs-source-dirs: src exposed-modules: lib build-depends: base >= 4.7 && < 5 , reactive-banana >= 0.8 default-language: haskell2010 every time tried run stack build, crashed error , suggestion add package stack.yaml under extra-deps:, , happened 3 times until packages installed, , import them in stack ghci repl.
so question is, idiomatic way use stack? of these 2 files should use specify dependencies , other project metadata? sample workflow of average haskell developer stack?
when using stack don't put versions bounds in .cabal file. let resolver , extra-deps setting in stack.yaml file determine versions of packages select.
here stack.yaml file brings in reactive-banana-0.8.1.2:
flags: {} packages: - '.' extra-deps: - reactive-banana-0.8.1.2 - psqueues-0.2.0.2 resolver: lts-2.17 in .cabal file have:
build-depends: base >= 4.7 && < 5, reactive-banana the reactive-banana version pinned stack.yaml file.
if want use ghc 7.10 change resolver nightly-2015-06-17.
i determine extra-deps iteratively, running stack build , adding whatever dependencies missing stack.yaml file until dependencies satisfied.
you need packages not in stackage - reactive-banana. great many of commonly used packages in stackage , versions determined resolver setting.
Comments
Post a Comment