Posts Tagged ‘F#’

Currying and F#

Posted: August 15, 2009 in F#

I have just started taking a look into the F# programming language for the past few days.While going through the functions in F# I found something very interesting.Let’s consider a very simple function which multiplies two integers.

let mul x y = x * y;;

Now if I call mul 5 10 I get the output 50 as expected.This is fine so far.But what happens if I do not pass the second argument and make a call like mul 5.Going by knowledge of C# it should throw an error but actually it does not.It returns me something like as shown below.