This is a a rather interesting perspective.
So, what is your vision of data representation? Would a record be represented as follows?
module type ITEM = sig
(* ... within some module ... *)
val weight : float
val sprite : Sprite.t
val inventory_width : int
val inventory_height : int
(* etc. *)
end
Now, how would we actually implement self
? Or, do we need explicit variants (outside the module datatype), like in the following code?
type = t
Generic_item of (module GENERIC_ITEM)
Special_item of (module SPECIAL_ITEM)
(* etc. *)