From: james woodyatt <jhw@wetware.com>
To: Remi VANICAT <vanicat@labri.u-bordeaux.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Is a Cow an Animal?
Date: Thu, 18 Apr 2002 17:51:52 -0700 [thread overview]
Message-ID: <A3677512-532F-11D6-9686-000502DB38F5@wetware.com> (raw)
In-Reply-To: <87y9fkilme.dlv@wanadoo.fr>
On Thursday, April 18, 2002, at 05:21 PM, Remi VANICAT wrote:
> james woodyatt <jhw@wetware.com> writes:
>>
>> I borrowed a technique I learned here from Brian Rogoff that uses an
>> abstract type with a contravariant type parameter for passing the type
>> of energy a food object contains to an animal object that can eat it.
>> (I wish I were smart enough to know the name for this technique.)
>
> the use of an abstract type with a covariant or contravariant type (or
> even not variant) parameter, and where the actual implementation of
> the type doesn't use this parameter (as in type 'a eater = int) is
> often call phantom type.
>
> one can read the very interesting mail about this in the archive of
> this mailing list
> http://caml.inria.fr/archives/200109/msg00097.html
That's precisely where I learned the technique. It's true I forgot the
"phantom type" terminology, but the contribution I was trying to make to
the list is that such types are frequently useful in representing
complicated associations between related class hierarchies.
I don't think Pixel's exercise is really covered well by the
"subject-observer" pattern, and I wonder if the pattern I used in my
solution is one that is already identified by a better name than the
"association-by-phantom-type" pattern.
Surely somebody has already published a paper on this by now, right?
--
j h woodyatt <jhw@wetware.com>
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
prev parent reply other threads:[~2002-04-19 0:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-17 23:40 Pixel
2002-04-18 2:17 ` John Max Skaller
2002-04-18 10:19 ` Pixel
2002-04-18 12:09 ` Pixel
2002-04-18 12:52 ` Jacques Garrigue
2002-04-18 13:03 ` Pixel
2002-04-18 18:58 ` james woodyatt
2002-04-18 22:44 ` Pixel
2002-04-18 22:57 ` james woodyatt
2002-04-18 23:31 ` Pixel
2002-04-19 0:21 ` Remi VANICAT
2002-04-19 0:51 ` james woodyatt [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=A3677512-532F-11D6-9686-000502DB38F5@wetware.com \
--to=jhw@wetware.com \
--cc=caml-list@inria.fr \
--cc=vanicat@labri.u-bordeaux.fr \
/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