commercialhaskell / commercialhaskell/stack
`stack ghcid` command
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
Seeing #1939 now I kind of want to do the same for `ghcid` (it's so good)
There has to be more convenience things we can wrap around, but first what comes to mind is something like:
``` sh
$ STACK_YAML="foo/stack.yaml" stack ghcid stack:exe:stack --exec ':main --numeric-version'
# should be the same as
# ghcid --restart="foo/stack.yaml" \
# --restart="stack.cabal" \
# --restart="some-other-implicit-local?.cabal" \ # imagine multi-package project
# --commad="stack ghci stack:exe:stack" \
# --test=":main --numeric-version"
```
##
I find the name "ghcid" not so intuitive so most likely have an alias with a clear/friendly name, but it's benefits are worth it:
pretty much _dev workflow_ on steroids :muscle: and _close_ to "light speed" :zap:
I also really want to simplify stack's `--help` output and this is not contributing, but that is talk for another issue :joy: and..
I should really get around to getting the multi-package story sorted for #1364 to make this even faster for packages that require presence of autogen files
people not familiar with `ghcid` here are few short clips I show off what it can do
- [clip 1](https://cldup.com/tu8euZobN1.mp4) servant server that restarts with new code loaded on valid file change:
- [clip 2](https://cldup.com/_-eR3itPtI.mp4) hspec + ghcid : rerun only tests that fail on valid file change:
- another thing that I like doing during dev is `ghcid --command="stack ghci" --test=":!stack build"` (ghcid give me fast error feedback and only tell stack to build once it's "all good"[in ex. typechecks] :raised_hands: ) [great alternative to `stack build --file-watch` :ok_hand: ]
great work by @ndmitchell aka haskell tooling ninja and @reiddraper for showing this is possible in [ordeal](https://github.com/reiddraper/ordeal)
##
Also, cljs/js we are coming! :turtle: :rocket:
First, I would :green_heart: it if @luite makes `ghcjsi` behave similarly to `ghci` :pray: (don't steal stderr :stuck_out_tongue: )
Contributor guide
Assessment
This issue has not been assessed yet.