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
Deduce types when a function is applied to a record selector. For example, map #x [{x=1, y=2}, {x=2, y=3}] applies the map function to the record selector #x.
The record selector has a function type {x: something, ...} -> something. When the type resolver has deduced the argument type, in this case {x: int, y: int}, we can deduce what something is.
So we can deduce that #x has type {x: int, y: int} -> int, and the expression map #x [{x=1, y=2}, {x=2, y=3}] has type int list.
The text was updated successfully, but these errors were encountered:
Deduce types when a function is applied to a record selector. For example,
map #x [{x=1, y=2}, {x=2, y=3}]
applies themap
function to the record selector#x
.The record selector has a function type
{x: something, ...} -> something
. When the type resolver has deduced the argument type, in this case{x: int, y: int}
, we can deduce whatsomething
is.So we can deduce that
#x
has type{x: int, y: int} -> int
, and the expressionmap #x [{x=1, y=2}, {x=2, y=3}]
has typeint list
.The text was updated successfully, but these errors were encountered: