Switch to variadic generics for property and tuple
See original GitHub issueRecent addition of “Extracting and spreading parameter lists with tuples” in TypeScript - https://blogs.msdn.microsoft.com/typescript/2018/07/12/announcing-typescript-3-0-rc/
It might be used to simplify multiple prebuild scripts.
Unfortunately it might impact the signatures provided for fc.property
as rest parameters have to be at the end.
// OK
function call<TS extends any[], R>(fn: (...args: TS) => R, ...args: TS): R {
return fn(...args);
}
// Not OK
function call2<TS extends any[], R>(...args: TS, fn: (...args: TS) => R): R {
return fn(...args);
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (4 by maintainers)
Top Results From Across the Web
PEP 646 – Variadic Generics - Python Enhancement Proposals
In this PEP, we introduce TypeVarTuple , enabling parameterisation with an arbitrary number of types - that is, a variadic type variable, ...
Read more >Three steps to Variadic Generics - Pitches - Swift Forums
variadic generics can be realized by the combination of "1. Operations for tuples" and "2. Variadic tuples". The former realizes operations for ...
Read more >How do I create a new tuple from a variadic generic tuple in ...
First is that the compiler does not know that the array map() method will turn a tuple into a tuple, and it definitely...
Read more >Allow variadic generics · Issue #193 · python/typing - GitHub
The idea is that you can have a generic class with a variable number of type variables, like typing.Tuple[] has. Here is a...
Read more >TypeScript: Variadic Tuple Types Preview - fettblog.eu
A variadic tuple type is a tuple type that has the same properties — defined length and the type of each element is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can replicate the existing API with the new variadic tuple feature in TS 4.0.
(approximated the existing types, Property and Arbitrary)
In order to use this new TypeScript feature for fast-check code and get rid of all the unnecessary prebuild scripts, I see two potential alternatives for the signature of
property
:fc.property([arb1, arb2,...], predicate)
- not sure it is feasiblefc.property(predicate, arb1, arb2,...)
I’m not sure I will be able to keep today’s signature and use this feature.