Haskell Stack creates a specific executable

How to create a specific executable stack file, i.e. those indicated in projectname.cabal, for example:

executable executable-name
  hs-source-dirs:      tools
  main-is:             ExecutableModule.hs
  ghc-options:         -Wall -threaded -rtsopts -with-rtsopts=-N
  build-depends:       base
                     , hsass
                     , hlibsass

I would need to compile executable-nameand nothing else. It will be something like:

stack build --executable executable-name
+2
source share
1 answer

The stack uses component search , for example

stack build packagename:component-type:component-name

So, if your package is called "foo" and your executable is called "bar", you can use

stack build foo:exe:bar

However, if the component name is unique, you can remove the package name and component type. Therefore, if your executable is called "exectuable-name", it

stack build :executable-name
+2

All Articles