Skip to content

Commit 93b3d33

Browse files
committed
#1022, document how to enable additional hints
1 parent 2a30ac0 commit 93b3d33

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Diff for: README.md

+19
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,25 @@ Some hints are off-by-default. Some are ignored by the configuration settings. T
201201

202202
HLint uses the `hlint.yaml` file it ships with by default (containing things like the `concatMap` hint above), along with the first `.hlint.yaml` file it finds in the current directory or any parent thereof. To include other hints, pass `--hint=filename.yaml`.
203203

204+
#### Are there any extra hints available?
205+
206+
There are a few groups of hints that are shipped with HLint, but disabled by default. These are:
207+
208+
* `future`, which suggests switching `return` for `pure`.
209+
* `extra`, which suggests replacements which introduce a dependency on the [`extra` library](https://hackage.haskell.org/package/extra).
210+
* `use-lens`, which suggests replacements which introduce a dependency on the [`lens` library](https://hackage.haskell.org/package/lens).
211+
* `use-th-quotes`, which suggests using `[| x |]` where possible.
212+
* `generalise`, which suggests more generic methods, e.g. `fmap` instead of `map`.
213+
* `generalise-for-conciseness`, which suggests more generic methods, but only when they are shorter, e.g. `maybe True` becomes `all`.
214+
* `dollar` which suggests `a $ b $ c` is replaced with `a . b $ c`.
215+
* `teaching` which encourages a simple beginner friendly style, learning about related functions.
216+
217+
These can be enabled by passing `--with-group=future` or adding the following to your `.hlint.yaml` file:
218+
219+
```yaml
220+
- group: {name: future, enabled: true}
221+
```
222+
204223
### Design
205224
206225
#### Why are hints not applied recursively?

0 commit comments

Comments
 (0)