http://impredicative.com/wiki/index.php/Polymorphic_Variants_Usage_Example

(* The commented out functions below do not compile .. the Medium constructor 
is not polymorphic;
 * it must "decide" on one of temp or size type
 *)

If you replace the first Medium by _ it compiles.
do those constructors Hot, Medium, Cold, Large, Small share the same
namepsace? If not can I identify the first medium somehow, eg
temp.Medium?

If so declaration should be prohibited. If its not - why 

fun tempvalue temp =
    case temp of
        Hot => 10
      | Medium => 5 (* replace Medium by _ and it compiles *)
      | Cold => 1

fun sizevalue size =
    case size of
        Large => 8
      | Medium => 4
      | Small => 2


>From reading the definitions in basis.urs I find it hard to find out how
to use them.  How do you think about comments like this:

(* See manual or
http://impredicative.com/wiki/index.php/Polymorphic_Variants_Usage_Example
*)

Or do you think this kind of documentation will break thus causing more
trouble than value?

Marc Weber

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

Reply via email to