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
[Caml-list] recursive type declaration
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: dengping zhu <zhudp@c...>
Subject: [Caml-list] recursive type declaration
Hi, all, I have to raise another question about recursive type in Ocaml.

Now I want to define a type and a class, both of which are recursive
defined as follows:
type ty1 =
   | Int of int
   | String of string
   | Class of typeClass

class virtual typeClass =
      method virtual typeCon : ty1
However, it does not work. 
I can use another way to solve it by define ty1 as 'a ty1. Besides this
way, is there any method to solve it? What's more, what's the common way
to define such types?


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: