Auto generate a stack or cabal multi component hie.yaml file
Go to file
2020-05-12 18:12:14 -04:00
app Read cabal.project and stack.yaml packages 2020-05-12 16:11:36 -04:00
src/Hie Fix glob edge case 2020-05-12 18:12:14 -04:00
test Read cabal.project and stack.yaml packages 2020-05-12 16:11:36 -04:00
.gitignore Ignore codex.tags 2020-05-04 21:13:13 -04:00
ChangeLog.md Init 2020-04-23 20:48:49 -04:00
hie.yaml Generate a single hie.yaml file 2020-05-08 23:05:54 -04:00
implicit-hie.cabal Get packages from cabal.project and stack.yaml 2020-05-11 23:04:09 -04:00
LICENSE Init 2020-04-23 20:48:49 -04:00
package.yaml Get packages from cabal.project and stack.yaml 2020-05-11 23:04:09 -04:00
README.md Fix glob edge case 2020-05-12 18:12:14 -04:00
Setup.hs Init 2020-04-23 20:48:49 -04:00
stack.yaml Init 2020-04-23 20:48:49 -04:00
stack.yaml.lock Init 2020-04-23 20:48:49 -04:00

implicit-hie

cd your-stack-or-cabal-package
gen-hie > hie.yaml

gen-hie should be run the root of a cabal or stack project. The config type (cabal or stack) is determined by the existence of dist-newstyle, .stack-work, stack.yaml, if none are found the default is cabal.

Cabal Multi project example

 git clone https://github.com/well-typed/optics.git
 cd optics
 gen-hie
cradle:
  cabal:
    - path: "indexed-profunctors/src"
      component: "lib:indexed-profunctors"

    - path: "optics-th/src"
      component: "lib:optics-th"

    - path: "optics-th/tests"
      component: "optics-th:test:optics-th-tests"

    - path: "optics-vl/src"
      component: "lib:optics-vl"

    - path: "codegen/./Subtypes.hs"
      component: "optics-codegen:exe:optics-codegen-subtypes"

    - path: "optics-core/src"
      component: "lib:optics-core"

    - path: "optics-sop/src"
      component: "lib:optics-sop"

    - path: "optics-extra/src"
      component: "lib:optics-extra"

    - path: "template-haskell-optics/src"
      component: "lib:template-haskell-optics"

    - path: "optics/src"
      component: "lib:optics"

    - path: "optics/tests"
      component: "optics:test:optics-tests"

    - path: "metametapost/src/Cli.hs"
      component: "metametapost:exe:metametapost-optics"

Features

All common Cabal and Stack configurations should just work. If you use more advanced features, the generated config may not be complete.

  • multi component cabal, stack projects
  • multiple executables under a single path
  • multiple paths provided to hs-source-dirs
  • lookup nested packages in cabal.project or stack.yaml
  • common stanzas

Work, Twitter

  • I'm currently looking for work as a Haskell or Rust developer. I can be reached via email or a twitter message.
  • Follow me on twitter @AviDessauer.