Generics: yes, see

[link:blogs.msdn.com]

[link:blogs.msdn.com]

Idiomatic abuses: no, but I'd be willing to try it anyway if it really earned me something (I have speculated about a number of fun 'abuses', but have not had a chance to try them out 'in anger' yet).

By on 9/16/2009 10:22 AM ()

Idiomatic abuses: no, but I'd be willing to try it anyway if it really earned me something (I have speculated about a number of fun 'abuses', but have not had a chance to try them out 'in anger' yet).

A while ago i did some experimentation with units of measure outside their normal use. I did not get very far. I believe the biggest limitation was that i was not able to define my own basic units, e.g. some other type than float or decimal. If someone has found interesting 'abuses' please share them.

By on 9/16/2009 3:26 PM ()

From the last release notes:

You can also use F#'s support for units-of-measure with integer types, e.g. to qualify integer types by annotations such as or <Clicks>.

By on 9/16/2009 3:32 PM ()

Units of Measure is an extraordinarily good idea.

For years engineers rolled their own. Now we have computer scientists who've rolled something much better into the language itself.

The capabilities this gives (after official launch) will, in my view, addict some technical users to the language. (<i>All languages without it will dim in their consciousness, to also rans<i>.) For those who have played with and discovered the power of <b>Buckingham ∏ (Pie)</b> will imagine some of the things they can now do more easily. (Edgar Buckingham in 1914 published work that showed how to determine <b>dimensionless groups</b> in engineering calculations. This can be used to derive things like <b>Reynolds</b>, <b>Prandtl</b> and <b>Mach</b> numbers with remarkably little effort. It was used to estimate the energy of one of the early nuclear bomb tests, from a film of the explosion. A really powerful idea.)

By on 9/16/2009 4:10 PM ()

Buckingham pie? [link:www.urbandictionary.com] I wrote a small blog post on the topic a while ago: [link:fortysix-and-two.blogspot.com] might give you some ideas, and shows that abuse is certainly possible. However, it seems you run into the "limitations" fairly quickly - it's obviously a type system extension for a very specific purpose. Kurt

By on 9/17/2009 2:03 AM ()

Thanks for reminding me about integer support. That's a good addition. What i was thinking about is an interface or "type class" for defining your own unit types. E.g. define multiplication, addition etc. for your type and then use it as a unit of measure. Not sure if there is a practical use for that though.

By on 9/16/2009 3:58 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