Skip to content

Arity limitation for R.compose's rightmost function? #452

@NicoleRauch

Description

@NicoleRauch

I would like to apply @types/ramda to my project but I bumped into an error with R.compose. The documentation claims that

The last argument may have any arity

But looking at the provided typings, the maximum allowed arity is... 3?

I am aware of the comment in the typings:

// generic rest parameters in TS 3.0 allows writing a single variant for any number of Vx
// compose<V extends any[], T1>(fn0: (...args: V) => T1): (...args: V) => T1;
// compose<V extends any[], T1, T2>(fn1: (x: T1) => T2, fn0: (...args: V) => T1): (...args: V) => T2;
// but requiring TS>=3.0 sounds like a breaking change, so just leaving a comment for the future

and I was wondering whether you could reconsider this issue, as TS 3.0 is maybe not such a breaking change any more after all...

(Also, if you make the move to TS 3.0, could I ask you to use unknown[] instead of any[] to make things more type-safe?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions