There are very few implicit conversions in F#, you must explicitly convert most data types.

You should have a look at units of measure, though I am unclear how applicable it is to your domain:

[link:blogs.msdn.com]

By on 2/24/2009 10:16 PM ()

I see. I was checking this out earlier and it seemed like - according to the "upcasts and downcasts" section - there is some coercion for arguments to a function.

just a stab in the dark, but could the issue be that there is coercion for arguments but not return values that are used in the context of an expression that takes that return value as an argument to an ungeneralized C# method?

By on 2/24/2009 10:40 PM ()

No, a closer approximation is that "F# will sometimes upcast through a class hierarchy for you (e.g. you can pass a Cat to a method expecting an Animal), but that's about it." F# will never implciitly convert e.g. an 'int' to an 'int64'.

By on 2/24/2009 10:44 PM ()

<dumb> of course.</dumb>

sorry man, its late. nice lambda cats, btw.

By on 2/24/2009 11:16 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