mirror of https://github.com/pulumi/pulumi.git
7ff4b2c8be
Adds the pulumix subpackage implementing strongly-typed inputs, outputs, and combinators. internal/cmd/gen-pux-applyn generates all four variants of `Apply` for up to 8 parameters. **Note**: Input[T] is not a constraint for most combinators. Making Input[T] a constraint for the provided combinators results in annoying, unreadable type signatures. Users will not find these enjoyable to use. ```go func Apply8[ I1 Input[A1], I2 Input[A2], I3 Input[A3], I4 Input[A4], I5 Input[A5], I6 Input[A6], I7 Input[A7], I8 Input[A8], A1, A2, A3, A4, A5, A6, A7, A8, B any, ]( i1 I1, i2 I2, i3 I3, i4 I4, i5 I5, i6 I6, i7 I7, i8 I8, fn func(A1, A2, A3, A4, A5, A6, A7, A8) B, ) Output[B] ``` Versus: ```go func Apply8[A1, A2, A3, A4, A5, A6, A7, A8, B any]( i1 Input[A1], i2 Input[A2], i3 Input[A3], i4 Input[A4], i5 Input[A5], i6 Input[A6], i7 Input[A7], i8 Input[A8], fn func(A1, A2, A3, A4, A5, A6, A7, A8) B, ) Output[B] ``` Users of Go 1.21 or higher will not need to provide any type parameters for these functions with the new, improved type inference in Go 1.21. Users of prior versions will have to provide `A*` type parameters. We consider this an acceptable tradeoff for the usabililty and readability win of these APIs. |
||
---|---|---|
.. | ||
go | ||
nodejs | ||
proto/go | ||
python | ||
README.md | ||
go.mod | ||
go.sum |