[Q] Why is compose `max_function_count` fixed to 6?
andys8 opened this issue ยท 5 comments
The params max_function_count: number
and max_parameter_count: number
are set both set to max_curry_level
which is set to 6
. Same for pipe
and probably others.
I'm interested in the discussion and causes, why this limit was chosen. I could think of a pipe
where somebody is composing more than 6 functions. One could discuss, if there could be opinions against it, but it would be valid code, that won't be type checked. Is this about performance? The output size? Is it related to currying? Or did the number "feel right"? I'm just curious.
Although, if nothing speaks against it, I'd would ask to raise the number of composed functions to a value above 6
:)
Mostly "feel right", but the performance and the out size are also concerns. I'm not sure if we should increase it but if there's no significant impact, it should be fine.
Actually, there are times when we need to compose a list of fns...
type Fn = (a: any) => any;
const list: Fn[] = [];
R.compose(...list); // Expected 1-6 arguments, but got 0 or more.
(Or do I have to reduce the list?)
R.reduceRight(R.compose, R.identity /* or first fn */, list);
Anyway I could work around this artificial limitation? I understand that I can always compose two other compose functions, but that doesn't sound like a good practice.
Please raise it. I cannot make beautiful pipelines in typescript just because of this stuff.
any updates on this? quite a horrrible limitation