From 6a3948e130f6f7485b03bc381ee15cd556ae8589 Mon Sep 17 00:00:00 2001 From: Mike Pilgrem Date: Tue, 20 Aug 2024 22:42:40 +0100 Subject: [PATCH] Document: Why use the Hpack format? --- doc/tutorial/package_description.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/tutorial/package_description.md b/doc/tutorial/package_description.md index 2a01a3cb04..3b8484a5c2 100644 --- a/doc/tutorial/package_description.md +++ b/doc/tutorial/package_description.md @@ -132,6 +132,19 @@ may be present in the package's root directory: +??? question "Why use the Hpack format?" + + A `package.yaml` file can be more concise and less repetitive than the Cabal + file that is generated from it. That is because the Hpack format uses + defaults and top-level fields common to sections. The YAML syntax, which may + already be familiar for some users, can also avoid repetition. + + In particular, the format's defaults can infer the names of exposed and + other modules. + + The format allows a user to specify defaults in a file on GitHub or a local + file. + ??? question "I use the Hpack format. Should I also check-in a Cabal file to my repository?" Yes. This helps people who do not use Stack or the Hpack tool separately.