You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When making higher order functions that return functions, type parameters are not preserved in return type. Notice in the following example how identityM has the generic type parameter A changed into {}, resulting in a loss of type safety in the rest of the code.
Ideally identityM would have the type <A>(a: A) => A. If this isn't possible, issuing a compiler warning (or error) about loss of genericity would be very helpful in tracking down errors like this.
When making higher order functions that return functions, type parameters are not preserved in return type. Notice in the following example how
identityMhas the generic type parameterAchanged into{}, resulting in a loss of type safety in the rest of the code.Ideally
identityMwould have the type<A>(a: A) => A. If this isn't possible, issuing a compiler warning (or error) about loss of genericity would be very helpful in tracking down errors like this.