Update generic-constraints.md

added more for alternative 2
This commit is contained in:
Kiiyoko 2024-12-13 19:08:17 -05:00 committed by GitHub
parent dd7650a44b
commit 8e20e26f6c
Signed by: DevComp
GPG key ID: B5690EEEBB952194

View file

@ -104,4 +104,4 @@ In this example, `T` must either be a number or vector, and setting annotating v
1. Don't do this; this would make it impossible for functions like above to be able to be automatically inferred correctly. Just let people explicitly annotate their variables instead of inferring types. This makes code more verbose.
> This would disallow for code that specifically makes use of generics to automatically output a response.
2. Manually write verbose overloaded functions types.
> This is not ideal, and suffers the same pitfalls as alternative 1.
> This suffers the same pitfalls as alternative 1, and does not allow for code to be easily expandable. An example can be found as Attempt 3 of Equality Constraints.