Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sol committed Nov 4, 2020
1 parent a679e76 commit ce9ee11
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,25 @@ at the Singapore Haskell meetup: http://typeful.net/talks/hpack

## Documentation

### Handling of `Paths_` module

Cabal generates a `Paths_` module fore every package. By default Hpack adds
that module to `other-modules` when generating a `.cabal` file. This is
sometimes useful and most of the time not harmful.

However, there are situations when this can lead to compilation errors (e.g
when using a custom `Prelude`).

To prevent Hpack from adding the `Paths_` module to `other-modules` add the
following to `package.yaml`:

```yaml
library:
when:
- condition: false
other-modules: Paths_name # substitute name with the package name
```
### Quick-reference
#### Top-level fields
Expand Down Expand Up @@ -376,7 +395,6 @@ Conditionals with an else branch:
- Must have a `condition` field
- Must have a `then` field, itself an object containing any number of other fields
- Must have a `else` field, itself an object containing any number of other fields
- All other top-level fields are ignored
For example,
Expand All @@ -394,6 +412,8 @@ becomes
else
ghc-options: -O0
**Note:** Conditionals with `condition: false` are omitted from the generated
`.cabal` file.
### <a name="file-globbing"></a>File globbing
Expand Down

0 comments on commit ce9ee11

Please sign in to comment.