coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Marco Servetto <marco.servetto AT gmail.com>
- To: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] injectivity of inductive type implies False
- Date: Fri, 3 Mar 2017 19:47:04 +0700
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=marco.servetto AT gmail.com; spf=Pass smtp.mailfrom=marco.servetto AT gmail.com; spf=None smtp.helo=postmaster AT mail-yw0-f178.google.com
- Ironport-phdr: 9a23:a8KLYR8G7SHR4f9uRHKM819IXTAuvvDOBiVQ1KB+2uMcTK2v8tzYMVDF4r011RmSDNidsK4P17Ce8/i5HzdfsdDZ6DFKWacPfiFGoP1epxYnDs+BBB+zB9/RRAt+Iv5/UkR49WqwK0lfFZW2TVTTpnqv8WxaQU2nZkImbtjyT8TZiN3y3OSv8bXSZR9JjXyze/k6eB6xtEDastQcqYpkMKc4jBXT9ChmYeNTkEZhP1mU1y3x/Nm94IJku3BVsugq8IhbXL/kcrgkSpRXCT0nNyY+48i95kqLdheG+nZJCjZeqRFPGQWQtBw=
> The tension between structural and nominal typing is an old one. I would
> nominal typing as an extension [..] a nominal type is a type
> with a name (or a stamp) and that there is an implicit coercion between
> nominal types and types.
While many seams to fancy this encoding of nominal type, this approach
is failing to capture their most important feature: allowing proper
development using libraries (or just different teams).
This is hard in structural typing since it logically assumes that any
method/field name to have a global meaning.
In practice, this prevents from any semantic preserving "method
rename" refactor to be applied. The names of fields/methods are like
global variables that can not be alpha-renamed, and that seams to go
against the most fundamental principles of functional programming.
Note how putting fancy contracts on methods does not help here, since
the empty contract would still be a subtype of the chosen one, still
preventing alpha renaming (in a library setting)
Nominal(sub) typing in its purest form allows for each method to be
introduced in exactly one point (and possibly overridden/implemented
somewhere else)
In this way, that method name is properly logically scoped under such
(for example) interface declaration.
(Yes, Java and other "nominal" languages have some issues here and
there still preventing proper alpha renaming... :-( )
- Re: [Coq-Club] injectivity of inductive type implies False, Cristóbal Camarero Coterillo, 02/28/2017
- Re: [Coq-Club] injectivity of inductive type implies False, Abhishek Anand, 03/01/2017
- <Possible follow-up(s)>
- Re: [Coq-Club] injectivity of inductive type implies False, Cristóbal Camarero Coterillo, 03/02/2017
- Re: [Coq-Club] injectivity of inductive type implies False, Thorsten Altenkirch, 03/03/2017
- Re: [Coq-Club] injectivity of inductive type implies False, Marco Servetto, 03/03/2017
- Re: [Coq-Club] injectivity of inductive type implies False, Greg Morrisett, 03/03/2017
- Re: [Coq-Club] injectivity of inductive type implies False, Thorsten Altenkirch, 03/17/2017
- Re: [Coq-Club] injectivity of inductive type implies False, Marco Servetto, 03/20/2017
- Re: [Coq-Club] injectivity of inductive type implies False, Thorsten Altenkirch, 03/17/2017
- Re: [Coq-Club] injectivity of inductive type implies False, Greg Morrisett, 03/03/2017
- Re: [Coq-Club] injectivity of inductive type implies False, Marco Servetto, 03/03/2017
- Re: [Coq-Club] injectivity of inductive type implies False, Thorsten Altenkirch, 03/03/2017
Archive powered by MHonArc 2.6.18.