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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 70C6B7EF37 for ; Tue, 4 Aug 2015 11:21:48 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=pra; client-ip=212.227.15.14; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of goswin-v-b@web.de designates 212.227.15.14 as permitted sender) identity=mailfrom; client-ip=212.227.15.14; receiver=mail3-smtp-sop.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 (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.web.de) identity=helo; client-ip=212.227.15.14; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="postmaster@mout.web.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AKAQCmg8BVlA4P49RbyTwCgTFMAQEBAQEBEgEBAQEHDQkJEg8uhCQBAQQnE08LGAklDwUoiEwBGcQrH4VvAQsgi0+FDxeDAYEUAQSUe4xOiE4MkH2EJYM5AQEB X-IPAS-Result: A0AKAQCmg8BVlA4P49RbyTwCgTFMAQEBAQEBEgEBAQEHDQkJEg8uhCQBAQQnE08LGAklDwUoiEwBGcQrH4VvAQsgi0+FDxeDAYEUAQSUe4xOiE4MkH2EJYM5AQEB X-IronPort-AV: E=Sophos;i="5.15,607,1432591200"; d="scan'208";a="141976674" Received: from mout.web.de ([212.227.15.14]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 04 Aug 2015 11:21:31 +0200 Received: from frosties.localnet ([95.208.221.151]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0MNt8d-1ZU0WX1zD9-007QMY for ; Tue, 04 Aug 2015 11:21:30 +0200 Received: from mrvn by frosties.localnet with local (Exim 4.84) (envelope-from ) id 1ZMYPZ-0001ut-Q7 for caml-list@inria.fr; Tue, 04 Aug 2015 11:21:29 +0200 Date: Tue, 4 Aug 2015 11:21:29 +0200 From: Goswin von Brederlow To: caml-list@inria.fr Message-ID: <20150804092129.GB5689@frosties> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-ID: V03:K0:IO7ICOottd6d7NIpbpEbLmHO0tMy4ra9tZZaaNeFSnF2d73rG+Q nWxFsExwEVQfdY8FBD7SnGIfNXxAbVcYMuO3xB2YywNVpETicwHrHKYa3r5utKz778V+jHr fOe8ieIQi8IIiCEYaw/Jpc1ZTE5+iJ24ZUglUzE69QE6uJII4zMYu+hGhHLQLs1oD2mst4j 0JSw1bJ9SMYKQ3evgqJcQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:cOinKhoPcKs=:T6rltVWH6fiGEHvnMc3xTP LXzTuGGegzzE9vE3jF9vL+m1yg0uyNEZm++R4C9/x4PeF2qtsGD7NjkCbYKkL7fp4LFvRXX58 TeMTqaQY8BV3f/+wB0GjFD8jJX4M7UiPNNIkmrhpOa2jUTc72D6hfuipH7SF76u8ck+4yK+j1 MH4lOANA7gkNPuEITC5Q328fTEmE1XbjBTzfHMofQdtEbZ6NfJe+AFNQeK2dr/zz3yaCSyekC jXW8Mfytflk1+bkDrgLLzE7xLFpp2RNzSotavrLFDCSrLgSPaW9XQgG3DxaIgFttm8P481Hd4 GhIUDyLaHMo55Xqwe20pR9IS9uerDY9s0b5XaRRZbsfp1dDTxRw/GM2tYFo7BmwOzy7AJFwl9 FPYvuv6yyi1XiSAOcEXirTILyNX1llvQD3+G6Fg64byEjp1WjqcVgFivaOf2wOjI9jDEjwsku AJ8B2ZaHqB6FGXicOZjy+KLeUCHI0PGnWdlwswv76vlN3ovHwuTU3yHYtigZt1YjD5w/bx/ZC N6TEqjEUZvhWVMd2P+tNAYTI3tmKc0n0Gadcdcmy+zs/FM684QHoT8WoGpz+nxyU/LwsJsp6m san/xLSTdBTmgW7bFvLqUCW/au91OmovBitZhqrwUpyKD+j0M6z9hxoy2m7FIPg2diOSVNODy CwlQbz/jNMXrRv6hTzgJRwE8bWsUo1l3PUG4ITqGS3c8urg== Subject: Re: [Caml-list] selecting GADT parameter On Fri, Jul 31, 2015 at 09:48:13AM -0400, Ashish Agarwal wrote: > I have: > > type _ t = > | Foo1 : 'a * int -> int t > | Foo2 : 'a * string -> 'a t > > but I really want to merge these two cases. I want the return type to be > based on the second arg when the second arg is int, and be based on the > first arg otherwise. Any way to accomplish that? Say you had (imaginary syntax): type _ t = | Foo : 'a * int -> int t | Foo : 'a * string -> 'a t let x1 = Foo (1, 1) : int t let x2 = Foo (1, "x") : int t match (x : int t) with | Foo (a, b) -> ... What is the type of (a, b) now? Is it (int, int) or (int, string)? MfG Goswin