From: David Baelde <david.baelde@gmail.com>
To: Martin Koch <mak@issuu.com>
Cc: Mihamina Rakotomandimby <mihamina@rktmb.org>, caml-list@inria.fr
Subject: Re: [Caml-list] polymorphism in general
Date: Tue, 27 Dec 2011 08:44:40 +0100 [thread overview]
Message-ID: <CAFqqUFEuyTFnvM4DLZX1ZiQje+bRMp=Fyag7o6aSVpBtGT2K4g@mail.gmail.com> (raw)
In-Reply-To: <CACyk+CLz1SUo9QqAK+3id2A7J9VyR=aWBaAnZXFLiiYNPbdK8Q@mail.gmail.com>
Hi,
I would say that any value whose type contains a generalized type
variable ('a, 'b, etc.) is polymorphic.
The empty list (of type 'a list) is polymorphic:
let empty = [] in (1::empty, "2"::empty)
And so is the function always returning the empty list, even though it
has no polymorphic argument:
let empty () = []
My 2 cents,
--
David
prev parent reply other threads:[~2011-12-27 7:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-23 8:30 Mihamina Rakotomandimby
2011-12-23 10:07 ` Martin Koch
2011-12-27 7:44 ` David Baelde [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='CAFqqUFEuyTFnvM4DLZX1ZiQje+bRMp=Fyag7o6aSVpBtGT2K4g@mail.gmail.com' \
--to=david.baelde@gmail.com \
--cc=caml-list@inria.fr \
--cc=david.baelde@ens-lyon.org \
--cc=mak@issuu.com \
--cc=mihamina@rktmb.org \
/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