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
It would be nice if we could infer the type of a lambda, by putting type annotations on the arguments:
-- infer type "integer -> integer"localf=function(x: integer) returnx+1end
However, we still want to allow the programmer to omit the type annotations for the arguments, if the function is used in a context where the type is known:
foreach(xs, function(x)
dosomething(x)
end)
One thing that I don't know how we should handle in the code, is if a lambda is used in a context of type any. If the type annotations are present, it should be possible to insert the type coercion. However, if the annotations are not present, then I guess it would have to be a type error.
localf: any=function(x) end
The text was updated successfully, but these errors were encountered:
It would be nice if we could infer the type of a lambda, by putting type annotations on the arguments:
However, we still want to allow the programmer to omit the type annotations for the arguments, if the function is used in a context where the type is known:
One thing that I don't know how we should handle in the code, is if a lambda is used in a context of type
any
. If the type annotations are present, it should be possible to insert the type coercion. However, if the annotations are not present, then I guess it would have to be a type error.The text was updated successfully, but these errors were encountered: