Will OCaml convert multi-argument function to currying or the other way around?

前端 未结 4 1538
醉梦人生
醉梦人生 2021-01-13 01:53

When I was learning OCaml essentials, I was told that every function in OCaml is actually a function with only one parameter. A multi-argument function is actually a functio

4条回答
  •  青春惊慌失措
    2021-01-13 02:38

    Both case 1 and case 2 are curried functions. Here is the non-curried version:

    let plus (x, y) = x + y
    

提交回复
热议问题