let .. in
を想像するとわかりやすい id
に多相性がないと型エラーになるmllet id = fun x -> x in if id true then 1 else id 2
id
は Int -> Int
だが、二度目は Bool -> Bool
だからmllet id = fun x -> x in
if (fun x -> x) true then 1 else (fun x -> x) 2
id
を使っていると見なして、letの範囲でのみ適当な型を与えられる