AK
Size: a a a
AK
AK
к
к
к
type alias X a =
{ a | f1 : Int }
type alias Y =
X { f2 : Int }
f : X {} -> Y
f x =
{ f1 = x.f1
, f2 = 1
}
к
к
type alias X a =
{ a | f1 : Int }
type alias Y =
X { f2 : Int }
f : X { d : Int } -> Y
f x =
{ f1 = x.f1
, f2 = 1
}
к
к
к
type X<A> = {| ...A, a: number |};
type Y = X<{||}>;
type Z = X<{| b: number |}>
function f(x: Y): Z {
return { ...x, b: 0 };
}
const x = f({ a: 1 });
AK
AK
NK
NK
NK
к
NK
к
к