How to make this work?

Trying to understand how classes must be used:

signature MY_ORD = sig
  class strict_less
  val lt : t ::: Type -> strict_less t -> t -> t -> bool
  val le : t ::: Type -> strict_less t -> t -> t -> bool
end

structure My_Ord : MY_ORD = struct
  class strict_less a = a -> a -> bool
  fun lt [a] (f: strict_less a) (x:a) (y:a) = f x y
  (* causing Can't resolve type class instance 
     Class constraint:  Basis.eq a
  *)
  fun le [a] (f: strict_less a) (x:a) (y:a) = f x y || x = y
end

The le implementation does not know which eq implementation to use ?
Is using functor the way to go?

I can't trivially apply the max sample from: 
http://www.impredicative.com/ur/tutorial/intro.html

Marc Weber

_______________________________________________
Ur mailing list
[email protected]
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur

Reply via email to