Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Is a Cow an Animal?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Remi VANICAT <vanicat@l...>
Subject: Re: [Caml-list] Is a Cow an Animal?
james woodyatt <> 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

Rémi Vanicat
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: