A few days ago I released an update to the Yesod scaffolding. It's nothing major, but it has some new niceness I thought people would be interested in:
- I've (finally) moved the Haskell source files into a
src
directory. I rejected some moves in the past. But since then, this style has become the dominant style in the Haskell world, and it makes sense to embrace it. Instead of putting language extensions in the
default-extensions
field of the cabal file, they are now inLANGUAGE
pragmas in each source file. This was not an obvious decision to make, and there are still people (myself included) who are conflicted on it. You can see some of the discussion of this on Twitter:Where should the Yesod scaffolding put language extensions? https://t.co/6qZZm8gVhE
— Michael Snoyman (@snoyberg) May 28, 2017- We've moved from a cabal file to an hpack
package.yaml
file. I only started using hpack a few months back, but it's completely won me over already. For those not familiar, check out the hpack repo. Note that hpack generates a cabal file, so there is full compatibility with cabal-the-build-system. We just get some niceties, like leaving offexposed-modules
.
Next time you create a scaffolded Yesod project (by running,
e.g. stack new mysite yesod-postgres
), you'll automatically get this
updated scaffolding.