Hi,
F# is case sensitive and functions for working with lists are located in a module called "List", so the following will work fine:

1
2
3
4
 
#light
open System
let reverseNums = List.fold_left (fun a x -> x :: a) [] [1..10]

Lowercase "list" is a name of the type, so you can see only static methods there.

(Edit: Corrected the issue - I accidentaly posted it with lowercase "list" too - oops!)

By on 11/3/2008 4:19 AM ()

You mean, of course:

1
2
3
4
 
#light
open System
let reverseNums = List.fold_left (fun a x -> x :: a) [] [1..10]

Yup, this works. Haha, I knew it would be a silly mistake like that. Many thanks! I shall now crawl away and feel slightly embarrassed :-)

By on 11/3/2008 4:30 AM ()
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