We left off in a rather unsatisfying predicament, we can simulate OCaml functors with interfaces, but at the expense of passing in two type parameters and guarding all our functions with type constraints. Yuck!
|
||||||
|
We left off in a rather unsatisfying predicament, we can simulate OCaml functors with interfaces, but at the expense of passing in two type parameters and guarding all our functions with type constraints. Yuck!
The following page describes in detail the differences between the OCaml and F# languages. It’s a good read for anyone familiar with OCaml and an even better read for those who are not. For the first line of the summary declares
With Halloween tomorrow, now is the perfect time to take a look at phantom types in F#. So what are phantom types? Think of them as a way to embed a constraint into the type system of a language. Here’s a great example of using them [...] |
||||||
|
Copyright © 2010 Do Loop Until You Die - All Rights Reserved |
||||||