F # and attribute [<GeneralizableValue>]

What is the difference between these two functions like F #:

let defaultInstance1<'a when 'a:(new: unit->'a)> = new 'a() [<GeneralizableValue>] let defaultInstance2<'a when 'a:(new: unit->'a)> = new 'a() 
+4
source share
2 answers
 let defaultInstance1<'a when 'a:(new: unit->'a)> = new 'a() [<GeneralizableValue>] let defaultInstance2<'a when 'a:(new: unit->'a)> = new 'a() let x1 = defaultInstance1 // value restriction let x2 = defaultInstance2 
+4
source

Here is a good blog:

http://blogs.msdn.com/b/mulambda/archive/2010/05/01/value-restriction-in-f.aspx

It takes a little reading to get to the part of GeneralizableValue , but if you get there I think you will understand that. :)

+7
source

All Articles