Class interface with parameters?

Is there a way to define an interface for the following class?

class point x  y =
  object (self)
    method dist = sqrt ((x *. x) +. (y *. y))
    method toString =
      "(" ^ (string_of_float x) ^ (string_of_float y) ^ ")"

If it didn’t have parameters, the class interface would be:

class type pointType =
    method dist : float
    method  toString : string

If I try to add parameters analogously to the following type that utop infers, I get a syntax error.

class point : float -> float ->
    method dist : float
    method toString : bytes

Looking at the manual, in particular the syntax of class type definitions, what you ask for doesn’t seem possible. class type only introduces an abbreviation for an object ... end part. Notice that the class and object layer of OCaml may seem exotic to newcomers used to more mainstream OO languages.
What did you want to achieve?

what about

type pointType = < dist : float; toString : string>


I was experimenting with making instance variables truly private by hiding them from subclasses. If you can’t include the parameters in the type then that’s slightly more complicated.

I was looking for something specific: a type for a class. Your solution would work as the type of self, though.