|
|
|
|
|
by grndn
3651 days ago
|
|
You are on the right track (no pun intended). Your second and third function signatures are actually the same thing in F# (and any other language with curried functions by default). Similar functions such as "map" and "filter" can be thought of the same way. A big benefit of currying by default is that all functions can be treated as one parameter functions -- a very powerful tool for function composition. Also, providing only some of the parameters (e.g. the first) and leaving some to be provided later is the technique known as "partial application" -- another key tool in functional programming. If you think these things look interesting, you should for sure look into F#/OCaml/Haskell/Elm/etc. |
|