Skip to content

separate warning for lambda length in single inner lambda bindings #152

Open

Description

@varon

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.

Activity

  1. duckmatt commented on Jan 26, 2016

    @duckmatt
    Collaborator

    Thanks for pointing this case out, I think as you say this should be the default behaviour

  2. added this to the Version 1.0.0 milestone on Jan 26, 2016
  3. self-assigned this
    on Jul 16, 2016
  4. added a commit that references this issue on Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions