ndmitchell / ndmitchell/hlint

Smaller dot application hints

Open
#166 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
1.6k
Forks
210
PR merge metrics
No merged PRs in 30d

Description

From https://code.google.com/p/ndmitchell/issues/detail?id=570:

Given:

boo = map f . map g . z

HLint suggests:

Sample.hs:5:7: Warning: Use map once
Found:
  map f . map g . z
Why not:
   map (f . g) . z

The . z at the end is correct, but a little inelegant. This is added because of the associativity of (.). One possible "quick fix" would be to change (.) to associate the other way round, since it is associative anyway - not sure if that would break anything though.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source files or tests are named. Reproduce the HLint warning using the provided map f . map g . z example, then trace the hint that rewrites chained map applications. Done means the suggestion avoids the inelegant trailing . z while preserving the intended transformation.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.