Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は以下の機能を持っています、そしてそれは働きます:
(fn x => x * 2) 2;
しかし、これは機能しません:
(fn x y => x + y ) 2 3;
誰か教えてもらえますか?または、それを機能させるためのヒントを教えてください。
(fn x => fn y => x+y) 2 3;動作します。fn単に、持っているカレー関数を定義するための同じ構文糖衣を持っていませんfun。
(fn x => fn y => x+y) 2 3;
fn
fun
標準 ML では、関数は引数を 1 つしか持てないため、
(fn (x,y) => x + y) (2,3)
タイプは
fn: int * int -> int
このとき (x,y) と (2,3) はリスト構造であり、