On Tue, May 4, 2010 at 9:37 AM, Edgar Friendly <thelema314@gmail.com> wrote:
module M : sig
type momentum
val of_kin : kinematic -> momentum
val to_kin : momentum -> kinematic
end = struct
type momentum = kinematic
let of_kin x = x
let to_kin x = x
end
Yes, it's a lot of boilerplate for each type, but you only have to write it once (per type), and cross-module inlining should give zero runtime cost. If not, use "%identity", and expose it in the interface. This method is along the lines of Anthony's proposal #4.