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
If we apply a higher order function like "map" to an overloaded closure like negate and an int list, the type inference algorithm currently infers a type like
map :: negate -> [Int] -> [Int]
This means that if you apply map to a different function, like square, it infers a separate judgement
map :: square -> [Int] -> [Int]
This can be serious performance hit, causing degradation by factors of up to infinity. It would be much better to notice that in each case map only applies the closure to arguments of a single type, and infer the generalization
map :: (Int -> Int) -> [Int] -> [Int]
Note that this almost happens automatically if "map" has a standard type signature.
The text was updated successfully, but these errors were encountered:
If we apply a higher order function like "map" to an overloaded closure like negate and an int list, the type inference algorithm currently infers a type like
This means that if you apply map to a different function, like square, it infers a separate judgement
This can be serious performance hit, causing degradation by factors of up to infinity. It would be much better to notice that in each case map only applies the closure to arguments of a single type, and infer the generalization
Note that this almost happens automatically if "map" has a standard type signature.
The text was updated successfully, but these errors were encountered: