I have not used measures yet myself but I was just wondering if the OCaml
world had already seen anything like this?
I had been under the impression that this could not be made to work but,
obviously, I was wrong!
--
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e
_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
Jon,
The OSP Delimited Overloading project has an example which does a very
simple version of something similar to F# measures. The relevant
example files can be viewed here:
https://forge.ocamlcore.org/plugins/scmsvn/viewcvs.php/trunk/examples/length/?root=pa-do
The underlying Length library code is based on a post by Richard
Jones' (http://camltastic.blogspot.com/2008/05/phantom-types.html) and
the syntactic sugar comes from the work done by the Delimited
Overloading folks. It does not provide the very cool "x meters per
second times y seconds gives z meters" that the F# feature seems to
provide, but it does provide a start - meters + feet will throw a
compile-time error, for example.
Hez
--
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science