Any shorthand version can be converted like so:

let myFunc = function

...

let myFunc a = match a with

...

The difference between the two is function returns a function that takes an argument to match against and returns the result, and match just gives the result.

By on 3/6/2010 9:26 PM ()
By on 3/6/2010 10:23 PM ()

Thank you very much brianmcn. That post explained it really well.

The long version of the fucntion is:

1
2
3
4
5
6
7
let rec concatStringList stringList =

    match stringList with

    | head::tail -> head + concatStringList tail

    | [] -> "" 

PS how do you format code in these posts? I've seen it in other posts, and I cannot even get the indenting happening.

By on 3/8/2010 4:46 AM ()

how do you format code in these posts? I've seen it in other posts, and I cannot even get the indenting happening.

See

[link:cs.hubfs.net]

By on 3/8/2010 8:33 AM ()

OK. I've got the coloring happening.

But still no indentation. Any ideas? I used notepad in combination with the F# toolbar button.

By on 3/8/2010 3:56 PM ()

I'm sorry BFalkner, but I cannot understand what you are saying. I tend to understand things better when I have an example.

I've provided a funtion in some kind of shorthand notation. How can that be written in it's corresponding long-hand version?

By on 3/6/2010 9:47 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper