Browse thread
Question on Variant Types
[
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: | Seth J. Fogarty <sfogarty@g...> |
| Subject: | Re: [Caml-list] Question on Variant Types |
Followup question:
Given I have:
type foo = [`A | `B of int | `C of char]
type bar = [`B of int | `C of char| `D]
and a function
let f (x : foo) : bar =
match x with
`A -> `D
|`B _
|`C _ -> (x : bar)
Is there any way to properly coerce this using the restricted variant
information of x? Or do I have to duplicate code and reconstruct x?
--
Seth Fogarty sfogarty@[gmail.com|rice.edu|livejournal]
Neep-neep at large AIM: Sorrath
"I know there are people in this world who do not love their fellow
human beings - and I hate people like that" --Tom Lehrer.