1
let printfn<'a> (x : 'a) = System.Console.WriteLine x

You need to add an argument and also parameterize the fucntion to handle all the WriteLine overloads.

By on 8/16/2008 2:30 AM ()

ah, that's very ugly. i was afraid it would be something like that. i was hoping for something like

1
let printfn = self( System.Console.WriteLine )

it's not your fault though, thanks :D

By on 8/16/2008 3:22 AM ()

I wonder why the C# generic syntax works properly

1
let printfn<'a> (x : 'a) = System.Console.WriteLine x

while the classic type param syntax gives a syntax error

1
let 'a printfn  (x : 'a) = System.Console.WriteLine x
By on 8/16/2008 3:55 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