From: "Daniel Bünzli" <daniel.buenzli@epfl.ch>
To: OCaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Fwd: "ocaml_beginners"::[] Trouble combining polymorphic classes and polymorphic methods
Date: Wed, 28 Feb 2007 04:23:27 +0100 [thread overview]
Message-ID: <8DF1B76F-AE3B-43F2-9034-7CF47277EE7B@epfl.ch> (raw)
In-Reply-To: <1172627876.19033.85.camel@rosella.wigram>
Le 28 févr. 07 à 02:57, skaller a écrit :
> After all a nominal type is just a structural type with
> a unique tag representing its unique name.
What you miss here is the _process_ behind nominal types.
(paraphrasing Jacques) Types are not precise enough to define the
semantic of a function, multiplication and addition have the same
type but in many cases you cannot exchange one for the other. With
that respect structural typing is a fallacy, it is not because types
match that you can replace a function by another.
With a nominal type the programmer signals explicitely its intent to
support a semantic. Notably you cannot use a function in a given
context if it was not designed for that purpose which sounds
fascistic but makes sense from a software development point of view.
Structural typing would make sense if it involved the weakest
invariants a function. But for now, because of the poor information
types give about semantics, structural typing is just bureaucratic
compliance whereas nominal typing is a semantic contract --- whether
actually fulfilled or not is another (undecidable) question.
Daniel
next prev parent reply other threads:[~2007-02-28 3:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <301730110702251747y72ae9fbdqd33bd8d08293cbe3@mail.gmail.com>
2007-02-27 21:22 ` Geoffrey Romer
2007-02-28 0:23 ` [Caml-list] " Jacques Garrigue
2007-02-28 1:18 ` Lukasz Stafiniak
2007-02-28 1:34 ` Jacques Garrigue
2007-02-28 1:57 ` skaller
2007-02-28 3:23 ` Daniel Bünzli [this message]
2007-02-28 4:01 ` Jacques Garrigue
2007-02-28 5:09 ` skaller
2007-02-28 13:47 ` Daniel Bünzli
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=8DF1B76F-AE3B-43F2-9034-7CF47277EE7B@epfl.ch \
--to=daniel.buenzli@epfl.ch \
--cc=caml-list@inria.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