Show's how to define units of measure to add stronger typing to your numerical functions.
75 people like thisPosted: 13 years ago by Robert Pickering
A vector type with units of measure built on top of XNA's Vector3. Not complete, the point is mainly to show how to use generic units of measure to adapt an existing type.
9 people like thisPosted: 12 years ago by Johann Deneux
Continuing from https://twitter.com/JKPappas/status/558339587719045120, here's an approach on extending units of measure to arbitrary types.
18 people like thisPosted: 9 years ago by Eirik Tsarpalis
Calculates profitability of a Bitcoin mining operation today (February 25, 2017) using current difficult level, Bitcoin price and a state of the art Bitcoin miner.
2 people like thisPosted: 7 years ago by Ademar Gonzalez
An approach to using annotated types in F# using overloaded methods.
3 people like thisPosted: 6 years ago by Eirik Tsarpalis
The snippet demonstrates how to write a general power function that has correct type involving units-of-measure. The function uses numbers represented using types. The snippet is mainly an example of what can be done (not recommended for the real world).
5 people like thisPosted: 13 years ago by Tomas Petricek
A typical problem when working with arrays and indices is that it's easy to access an array with the wrong index. Units of measure in F# can be applied to integers, which makes it possible to abuse them to prevent this kind of error.
7 people like thisPosted: 12 years ago by Johann Deneux
Improved version of http://fssnip.net/pm/title/Extending-units-of-measure-to-arbitrary-types that adopts the "type class" approach and sheds requirement for passing the witness type when tag/untagging UoM values.
3 people like thisPosted: 7 years ago by Eirik Tsarpalis
An approach to using annotated types in F# using SRTPs.
4 people like thisPosted: 6 years ago by Eirik Tsarpalis
An exploration of the power of Computation Expressions, Type Extensions, Extension Methods, and Method Overloading. May or may not be a monad or a monoid - we're not sure, nor do we care to check.
7 people like thisPosted: 6 years ago by Tomas Petricek, Krzysztof Cieślak, John Azariah, Phillip Carter