Units of Measure in F#
bearophile
bearophileHUGS at lycos.com
Mon Oct 6 13:41:29 PDT 2008
I have found this interesting old thread, I don't know how much those things are true today too:
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=36939
Beside allowing algebraic data types, that are quite useful, a functional-like type system allows to implement Units of Measure in a nice way:
http://blogs.msdn.com/andrewkennedy/archive/2008/08/20/units-of-measure-in-f-part-one-introducing-units.aspx
For people that don't remember what algebraic data types are:
http://en.wikipedia.org/wiki/Algebraic_data_type
This power also allows to use pattern matching, absent in Python, present in Haskell, Ocaml, Scala, etc.
Bye,
bearophile
More information about the Digitalmars-d
mailing list