From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr 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 75CB680043 for ; Tue, 18 Oct 2016 16:21:04 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=goswin-v-b@web.de; spf=Pass smtp.mailfrom=goswin-v-b@web.de; spf=None smtp.helo=postmaster@mout.web.de Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=pra; client-ip=212.227.15.3; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of goswin-v-b@web.de designates 212.227.15.3 as permitted sender) identity=mailfrom; client-ip=212.227.15.3; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.web.de) identity=helo; client-ip=212.227.15.3; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="postmaster@mout.web.de"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3Aej6BGxcwvQardVZou64RuDK8lGMj4u6mDksu8pMi?= =?us-ascii?q?zoh2WeGdxc29Yx7h7PlgxGXEQZ/co6odzbGH6ea9BSdev97B6ClEK8McEUddyI?= =?us-ascii?q?0/pE8JPo2sMQXDNvnkbig3ToxpdWRO2DWFC3VTA9v0fFbIo3e/vnY4ExT7Mhdp?= =?us-ascii?q?dKyuQtaBx5f/6+fn8JTWZ0BMhSGhSbJ0NhS/6wvL5ecMho43BaEq1RrP6mVPfa?= =?us-ascii?q?x8325kKEiXmAm0ssi354Fi9WFO/vgJ6MNKF6n3KfdrBYdEBSgrZjhmrPbgsgPO?= =?us-ascii?q?GFOC?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0AVAQC0LgZYhwMP49RcHQEFAQsBFwEXA?= =?us-ascii?q?QYBgwUBAQEBAaYpjAWIM4IIhiICggA5EwEBAQEBAQEBAQEBEgEBAQgNCQkZL4I?= =?us-ascii?q?yGIIYAQEEOk8LGAklDwUoiGsBHr44H4QNAQEIAgElixKEGHuCZIIvBZoGj3mJZ?= =?us-ascii?q?gqGEIx7hAAgAYQUgWCJRgEBAQ?= X-IPAS-Result: =?us-ascii?q?A0AVAQC0LgZYhwMP49RcHQEFAQsBFwEXAQYBgwUBAQEBAaY?= =?us-ascii?q?pjAWIM4IIhiICggA5EwEBAQEBAQEBAQEBEgEBAQgNCQkZL4IyGIIYAQEEOk8LG?= =?us-ascii?q?AklDwUoiGsBHr44H4QNAQEIAgElixKEGHuCZIIvBZoGj3mJZgqGEIx7hAAgAYQ?= =?us-ascii?q?UgWCJRgEBAQ?= X-IronPort-AV: E=Sophos;i="5.31,362,1473112800"; d="scan'208";a="241284505" Received: from mout.web.de ([212.227.15.3]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Oct 2016 16:21:03 +0200 Received: from frosties.localnet ([78.43.233.192]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0MddGu-1cJfsp1A56-00POc8 for ; Tue, 18 Oct 2016 16:21:03 +0200 Received: from mrvn by frosties.localnet with local (Exim 4.87) (envelope-from ) id 1bwVGI-0005eT-IQ for caml-list@inria.fr; Tue, 18 Oct 2016 16:21:02 +0200 Date: Tue, 18 Oct 2016 16:21:02 +0200 From: Goswin von Brederlow To: caml-list@inria.fr Message-ID: <20161018142102.GA21704@frosties> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-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L23 xsR0pM16/vLV1ziur+y3jSzravrdw90Qfdm7kCceaaJb5naN14w7Cj4rVgg= Subject: Re: [Caml-list] Segfault with open GADTs On Tue, Oct 18, 2016 at 11:52:40AM -0200, Andre Nathan wrote: > On 10/18/2016 11:10 AM, Pierrick Couderc wrote: > > Hi, > > > > It is supposed to work, but it seems thepattern-matching compiler does > > not detect that M0.to_string is non exhaustive, thus it does not add a > > Match_Failure in case the variant is unknown. With extensible variants, > > a pattern matching is only exhaustive if you provide a wildcard or a > > variable for variants added afterwards. > > > Indeed, if I add a catch-all branch in M0.to_string then the code in > that branch is run, with no segfault. > > But I guess my original idea of extending the type doesn't really work > as I hoped, since with nested expressions like that, I'd need to find a > way for M0.to_string to call back M1.to_string when a `T` is found. > > Back to the drawing board... > > Thanks, > Andre You can pass along the outermost to_string to all to_string functions so they can restart from the outside when they recurse. MfG Goswin