Google Groups Home
Help | Sign in
Message from discussion Question on Variant Types
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Jonathan Roewen  
View profile
 More options Jun 28 2006, 12:53 pm
Newsgroups: fa.caml
From: "Jonathan Roewen" <jonathan.roe...@gmail.com>
Date: Wed, 28 Jun 2006 16:53:19 UTC
Local: Wed, Jun 28 2006 12:53 pm
Subject: Re: [Caml-list] Question on Variant Types

> # let bar_of_foo t = (t : foo :> bar);;
> val bar_of_foo : foo -> bar = <fun>
> # g (bar_of_foo c);;
> - : bar = `Tree (`Tree `Nil)

I should've added that without needing an intermediate function, you
can also do:
g (c : foo :> bar);;

> Jonathan

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google