I feel that many of the advantages of switching to OCaml are minimised when you are already using an ML!
Soon, there should be a compelling performance case for using OCaml. There are rumours that in the next release, there'll be an MLton type whole program optimisation setup, which should reduce the cost of abstraction to zero.
MLs are such that the value-level stuff and the module-level stuff are more or less independent. So you can go a long way just liking the value-level stuff without really caring about the status of the module-level stuff. But it's also a pretty big motivator for the design of ML. F# is at least weirdly missing out here.
A good example is the Set.Make functor in the OCaml stdlib. Elements in a Set must be orderable for efficiency's sake, so to construct a Set you parameterize it over a module specifying not only the type but also its ordering.
module type Set = sig
module type OrderedType =
sig
type t
val compare : t -> t -> int
end
module type S =
sig
type elt
type t
val empty : t
(* ... *)
end
module Make :
functor (Ord : OrderedType) -> S
with type elt = Ord.t
end
Here the OrderedType module signature represents any type that also has an ordering. The S signature represents the result signature of calling the Make functor which is passed any OrderedType-substantiating module and uses it to construct the (Set.S with type elt = Ord.t) module.http://www.mpi-sws.org/~rossberg/1ml/
"a redesign of ML in which modules are truly first-class values, and core and module layer are unified into one language. In this "1ML", functions, functors, and even type constructors are one and the same construct; likewise, no distinction is made between structures, records, or tuples."
Maybe not for folks whose primary platform in Windows? The .NET stack is the primary advantage there, no?
For those of us on Linux, IMO OCaml is the similar language with complete platform support. I know .NET core is now available, but some time will have to pass to know if Microsoft's support for .NET on Linux is a long term plan.