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 09563E0133 for ; Tue, 30 Aug 2022 09:24:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=subject:to:references:from:message-id:date:mime-version: in-reply-to:content-transfer-encoding; bh=Cw4Bs/rnxkLwZuy3mx/B+LmUDneLRNdA+Wd+w1eB6ZI=; b=KowHP3kAsjWElivhX4onLh6rweUOD54V9nKXdEiIFws8nd8RHJ6SqrOJ lqk+hBqPyBeXvVYGkLp7X6f3Es+Eo17d25lvVEOYd7TBk+YyJiW9e/S1V tZdp+qbScvowVn4Iovq0Cb0I0as6Ji6OtV6nidkBo+tTYJ1bJhs1eRMeF I=; 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,274,1654552800"; d="scan'208";a="50456229" Received: from wifi-pro-82-062.paris.inria.fr ([128.93.82.62]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2022 09:24:11 +0200 To: Aaron Gray , OCaML Mailing List References: From: =?UTF-8?Q?Fran=c3=a7ois_Pottier?= Message-ID: <25e68e2c-04d2-7764-e189-00812c08a34a@inria.fr> Date: Tue, 30 Aug 2022 09:24:10 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] coinductive data types Hello, Le 29/08/2022 à 17:43, Aaron Gray a écrit : > Does either ML or OCaML have coinductive data types ? And if so could > you please point me at the/some appropriate documentation on them. ML and OCaml have algebraic data types, which are recursive (that is, more general than inductive and co-inductive types). Algebraic data type definitions are not subject to a positivity restriction, and algebraic data types can be constructed and deconstructed by recursive functions, which are not subject to a termination check. If you want to see a typical example of a "co-inductive" data structure encoded in OCaml, I suggest to have a look at "sequences", which can be described as potentially infinite lists: https://v2.ocaml.org/api/Seq.html -- François Pottier francois.pottier@inria.fr http://cambium.inria.fr/~fpottier/