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 9AFD87EE99 for ; Mon, 23 Dec 2013 20:25:08 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of avatar@hot.ee) identity=pra; client-ip=129.217.4.42; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="avatar@hot.ee"; x-sender="avatar@hot.ee"; x-conformance=sidf_compatible Received-SPF: SoftFail (mail2-smtp-roc.national.inria.fr: domain of avatar@hot.ee is inclined to not designate 129.217.4.42 as permitted sender) identity=mailfrom; client-ip=129.217.4.42; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="avatar@hot.ee"; x-sender="avatar@hot.ee"; 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@waldorf.cs.uni-dortmund.de) identity=helo; client-ip=129.217.4.42; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="avatar@hot.ee"; x-sender="postmaster@waldorf.cs.uni-dortmund.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlgEAJ6NuFKB2QQqgGdsb2JhbABZhxm3chYOAQEJFgc+gk8EgQcCBRMOAhECLC0IAQGHawEUBKJGjw+SIwyHNIEpjhmCWIFIBJ5XjwM X-IPAS-Result: AlgEAJ6NuFKB2QQqgGdsb2JhbABZhxm3chYOAQEJFgc+gk8EgQcCBRMOAhECLC0IAQGHawEUBKJGjw+SIwyHNIEpjhmCWIFIBJ5XjwM X-IronPort-AV: E=Sophos;i="4.95,538,1384297200"; d="scan'208";a="50216029" Received: from waldorf.cs.uni-dortmund.de ([129.217.4.42]) by mail2-smtp-roc.national.inria.fr with ESMTP; 23 Dec 2013 20:25:07 +0100 Received: from postamt.cs.uni-dortmund.de (postamt [129.217.4.40]) by waldorf.cs.uni-dortmund.de with ESMTP id rBNJP7XQ004219 for ; Mon, 23 Dec 2013 20:25:07 +0100 (MET) Received: from tango.site (89-235-238-97.saturn.infonet.ee [89.235.238.97]) (authenticated bits=0) by postamt.cs.uni-dortmund.de (8.12.6/8.12.6) with ESMTP id rBNJP6c3023860 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 23 Dec 2013 20:25:06 +0100 (MET) Message-ID: <52B88E12.20002@hot.ee> Date: Mon, 23 Dec 2013 21:25:06 +0200 From: Misha Aizatulin User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: caml-list@inria.fr X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Validation-by: avatar@hot.ee Subject: [Caml-list] Pattern match fall-through for GADTs hi all, I decided to give GADTs a go and realized that I don't know how to make pattern matches fall through in a familiar fashion. The code [1] below gets accepted but [2] does not. Is there anything I can do to avoid spelling out the same case several times? Best, Misha [1] type 'a t = | I1 : int t | I2 : int t | B1 : bool t | B2 : bool t let f (type a) (t : a t) = match t with | I1 -> 0 | I2 -> 0 | B1 -> 1 | B2 -> 1 [2] let f (type a) (t : a t) = match t with | I1 | I2 -> 0 | B1 | B2 -> 1