Currying: Difference between revisions

254 bytes added ,  11 years ago
Added F# example
m (→‎{{header|Common Lisp}}: Removed the SBCL prompt, as it looked confusing without context.)
(Added F# example)
Line 75:
 
where FUNCTION [ANY, TUPLE [Y], Z] denotes the type ''Y'' → ''Z'' (agents taking as argument a tuple with a single argument of type Y and returning a result of type Z), which is indeed the type of the agent expression used on the next-to-last line to define the "Result" of g.
 
=={{header|F Sharp|F#}}==
This is a translation of the Python example:
<lang fsharp>let addN n = (+) n</lang>
 
<lang fsharp>> let add2 = addN 2;;
 
val add1 : (int -> int)
 
> add2;;
val it : (int -> int) = <fun:addN@1>
> add2 7;;
val it : int = 9</lang>
 
=={{header|Haskell}}==
Anonymous user