fsprojects / fsprojects/FSharpLint

separate warning for lambda length in single inner lambda bindings

Open
#152 1 comment 0 reactions 1 assignee View on GitHub

@duckmatt is already working on this.

Since Jul 16, 2016.

enhancement up-for-grabs
Dominant language
F#
Stars
327
Forks
74
PR merge metrics
No merged PRs in 30d

Description

I commonly use a pattern such as this:

let someFunction =
   // expensive once-off initialization here
   fun x y ->
       // do stuff with this expensive data

This is a pretty common pattern I use to store data from expensive once-off computations. The major benefits of having shorter lambdas do not apply here - I could easily refactor to bring the parameters to the top of the function, but that would mean repeating the expensive call each time.

Instead, I'd suggest that length checking of such a pattern should use the standard 'function length' rather than global lambda length in cases where a single lambda is bound to a let as part of a parameterless value. Failing that please at least allow for the warnings on lambda length to be turned off for 'single-lambda' functions.

Contributor guide

Open the contributing guide

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.