proptest icon indicating copy to clipboard operation
proptest copied to clipboard

Overload replicate with more precise types

Open paldepind opened this issue 7 years ago • 3 comments

This PR makes the types for replicate more precise. If replicate is given a number smaller than 10 the return type is an array where TypeScript knows the length.

Is having one, two, three and four is still necessary? After this PR replicate will give just as accurate types. Additionally one doesn't seem very useful and two is the same as pair (I think) which is confusing.

paldepind avatar Mar 21 '18 11:03 paldepind

Thanks, I like this change. It does make the one-four functions redundant.

There is a difference: two replicates one generator twice whereas pair tuples two different generators.

danr avatar Mar 21 '18 11:03 danr

There is a difference: two replicates one generator twice whereas pair tuples two different generators.

Ah. I see. Makes sense.

paldepind avatar Mar 25 '18 17:03 paldepind

Should this be merged?

paldepind avatar Apr 12 '18 09:04 paldepind