[
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: | micha <micha-1@f...> |
| Subject: | phantom type thing question |
I'm getting confused while trying to implement some subtyping hierachy with polymorphic variants. say I have the hierachy: symbol -> image -> xpmimage and types like that: type 'a sym;; make_symbol : params -> [`Symbol] sym;; make_image: params -> [`Image] sym;; or should it be: make_image: params -> [`Symbol | `Image] sym;; make_xpm; params -> [`Symbol | `Image | `Xpm ] sym;; so that some functions work only on some symbols: val get_image_width: [< `Image | `XpmImage] sym -> int;; I think I mix up the [< ..] and [> ... ] type constructs, allthough I thought I understood it :-) Michael