From: Ivan Gotovchits <ivg@ieee.org>
To: Didier Cassirame <didier.cassirame@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Polymorphic variants and inheritance
Date: Fri, 26 Oct 2012 07:37:40 +0400 [thread overview]
Message-ID: <87a9v99a4b.fsf@golf.niidar.ru> (raw)
In-Reply-To: <CA+LkvyomeUuZS3MDgyuCuHzWVWmvQOP3hXyM2FkC2XEJaDv-eA@mail.gmail.com> (Didier Cassirame's message of "Thu, 25 Oct 2012 14:14:58 +0200")
Didier Cassirame <didier.cassirame@gmail.com> writes:
> type odds = [`One | `Three ]
> type evens = [`Two | `Four ]
> type numbers = [ odds | evens ]
>
> class type ['a] number = object
> constraint 'a = [< numbers]
> method category: 'a
> end
>
> class type odd = object
> inherit [odds] number
> method category: odds
> end
>
> class type even = object
> inherit [evens] number
> method category: evens
> end
>
> It's probably even better like this :)
>
It's an excellent solution, Didier! Thanks alot =)
prev parent reply other threads:[~2012-10-26 3:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-25 11:54 Ivan Gotovchits
2012-10-25 11:57 ` Didier Cassirame
2012-10-25 12:14 ` Didier Cassirame
2012-10-26 3:37 ` Ivan Gotovchits [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a9v99a4b.fsf@golf.niidar.ru \
--to=ivg@ieee.org \
--cc=caml-list@inria.fr \
--cc=didier.cassirame@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).