From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id CA894E0128 for ; Wed, 31 Aug 2022 15:49:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=QPMcHTpjtOTb3yOFe/P7WB4upgHRa83L92qy5HAstpA=; b=eYNHs+a9v7E7lOxb7TxvIV0Ty6HELRE01uv7OpcAC8+Kq7/MhoWMTK2X 8eDgomXJDxtV+zELrmejU4NaPUWkPe6e2eZeK3d0i4p18vmudLl5Trfdb NUYFRe96k0zFre098X99rippXyEFoLEEtHOM43T0dvqwmLI9qKaHY2ygN 4=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=francois.pottier@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="5.93,278,1654552800"; d="scan'208";a="50714443" Received: from 91-175-127-215.subs.proxad.net (HELO MacBook-Pro-5.local) ([91.175.127.215]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2022 15:49:39 +0200 To: Andreas Rossberg , Peter Thiemann Cc: caml-list@inria.fr References: <25e68e2c-04d2-7764-e189-00812c08a34a@inria.fr> <8078ad33-f220-b233-4863-06ce30cc8cff@inria.fr> <2C890C66-F8F7-402C-B88E-587C3E21DE89@mpi-sws.org> <99c919e0-95aa-2c4f-7240-71486da1fb65@inria.fr> <9C63A771-E4AD-42E4-A889-56CB1FFB563E@mpi-sws.org> From: =?UTF-8?Q?Fran=c3=a7ois_Pottier?= Message-ID: Date: Wed, 31 Aug 2022 15:49:38 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <9C63A771-E4AD-42E4-A889-56CB1FFB563E@mpi-sws.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] coinductive data types Le 31/08/2022 à 11:41, Andreas Rossberg a écrit : > yes, I think they are different things. With (nominal) algebraic data types: > >   type peano = Z | S of peano >   type nat = Z | S of nat >   let f (x : peano) : nat = x   -- type error > > But with iso-recursive types: > >   type peano = mu peano. 1 + peano >   type nat = mu nat. 1 + nat >   let f (x : peano) : nat = x   -- ok Good point! Indeed, in the second example, peano and nat are plain abbreviations for the same type (which happens to be a recursive type), up to alpha-equivalence. So, not even an explicit coercion is needed to convert x from peano to nat. -- François Pottier francois.pottier@inria.fr http://cambium.inria.fr/~fpottier/