Attributes & Properties

Value specifications that take a single argument t will be interpreted as bindings to Python attributes or properties.

Value specs for attributes and properties look like this:

val f : t -> 'a


  • The first and only function argument must be t.
  • The return type can be any of the types mentioned earlier.


val x : t -> int
val name : t -> string
val price : t -> float