[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Jeff Shaw <shawjef3@m...> |
| Subject: | Re: mutually dependent class and type |
I don't know how you might directly get what you want, but here's one way to get an equivalent result. class element_aux (c : [`Data of string | `Element of element list]) = object end type content = Data of string | Element of element list;; let content_of_variant = function Data d -> `Data d | Element e -> `Element e class element (c : content) = element_aux (content_of_variant c)