Auto generate a stack or cabal multi component hie.yaml file
Go to file
2022-09-16 10:36:29 +01:00
.github Add ormolu action 2020-11-15 17:08:06 -05:00
app Ormolu formatted. 2022-04-11 08:25:39 +01:00
src/Hie Use Cabal-syntax to parse cabal packages 2022-09-16 10:36:29 +01:00
test Fix: #30 2020-11-29 05:10:03 -05:00
.gitignore Ignore .hie directory 2020-11-09 18:57:39 -05:00
.travis.yml Add .travis.yml 2020-05-31 11:35:52 +02:00
ChangeLog.md Init 2020-04-23 20:48:49 -04:00
hie.yaml.cbl change extension of sample hie cabal file 2020-07-07 16:16:12 +12:00
hie.yaml.stack - added --cabal and --stack switches to command line, 2020-07-07 15:59:47 +12:00
implicit-hie.cabal Use Cabal-syntax to parse cabal packages 2022-09-16 10:36:29 +01:00
LICENSE Init 2020-04-23 20:48:49 -04:00
README.md Update README.md 2021-11-11 10:06:06 -05:00
Setup.hs Fmt and fixes 2020-11-09 18:35:45 -05:00
stack.yaml Add travis ci 2020-05-30 15:51:41 +02:00
stack.yaml.lock Fmt and fixes 2020-11-09 18:35:45 -05:00

implicit-hie

cd your-stack-or-cabal-package
stack install implicit-hie # or cabal install implicit-hie
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. You can use --cabal, or --stack options to override config type.

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
  • Handle Exe and Bench other-modules
  • common stanzas

Work, Twitter