Hi everyone

I’ve got a question I can’t understand:

type comp = Inf | Egal | Sup

module type TYPE_ORDONNE =

sig

type t

val compare: t -> t -> comp

end

module Mesurable = struct

class virtual mesurable =

object

method virtual distance: unit -> float

end

end

Implement a module M which is compatible with the signature TYPE_ORDONNE and whose type t corresponds to the type measurable defined in the module Mesurable

I’ve written:

module M =

struct

type t = float

let compare ((a:t),(b:t)) = let c = a -. b in

match c with

|0. -> Egal

| x -> if x < 0. then Inf else Sup

end

Is it right or wrong?

And What does mean “type t corresponds to the type measurable defined in the module Mesurable”?

I will be grateful for any help you can offer