In a normal stack project, I can add extra-deps in the stack.yaml file:
extra-deps:
- text-1.2.2.0
- unm-hip-0.3.1.6
- safe-exceptions-0.1.4.0
- quickcheck-properties-0.1
- time-interval-0.1.1
- time-units-1.0.0
- snowball-1.0.0.1
- dictionaries-0.1.0.0
resolver: lts-8.3
allow-newer: true
But how do I do this in a script?
#!/usr/bin/env stack
{- stack
--resolver lts-8.5
--install-ghc
runghc
--package MissingH
--package process
--package attoparsec
--package split
--package dictionaries
--package bytestring
-}
When using shebang style, you can (now at least) do --extra-dep mypackage-1.3.3.7
within the script.
Credit to @lyxia for pointing me to this (and more generally that I should check stack script --help
).
It is possible to specify extra packages on the commande line using e.g.
stack runghc --resolver lts-12.20 --package raven-haskell-0.1.2.0 ./using-sentry.hs
it does not work with shebang style, inside the file AFAICT
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With