Hi,
I think that from the F# user perspective, there is no difference between these two types. The difference is in the internal representation - the first thing will be compiled as a .NET method (and can be for examle called from C#), while the second thing will be compiled as a FastFunc<..> value, which is an internal F# representation of functions. There may be also some difference in performance, but I'm not really sure and haven't tried that (but my guess would be that calling the first one could be faster and using the second one as an argument may be faster..but I'm just guessing!)

Another difference is when it comes to generic functions - You can't write the following:

1
2
3
 
let foo a b = (a, b)
let bar = foo 10

But if you define "bar" as a function than it works. This is because of "value restriction" - a value cannot have generic (or in the functional terminology <i>polymorphic<i>) type. Hope this helps! Tomas

By on 11/15/2008 10:18 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