Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
grammar for class types, reraised
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-06-23 (19:53)
From: Jacques GARRIGUE <garrigue@k...>
Subject: Re: grammar for class types, reraised
From: Hendrik Tews <>

>    From: Jerome Vouillon <>

>    > 2. Why is it not possible to add type constraints to the first
>    > kind of type abbreviation, like in 
>    > 
>    > class type ['a] c = ['a, string] a constraint 'a = int;;
>    There is no real reason. I think I could add this quite easily to the
>    language if you need this.

In fact, you can already do that:

class type ['a, 'b] a = object method m : 'a -> 'b end
class type ['a] c = object
  inherit ['a,string] a
  constraint 'a = int

Remark also that inheritance at the type level does not presuppose
inheritance at the value level, so this should be general enough.

Jacques Garrigue      Kyoto University     garrigue at
		<A HREF=>JG</A>