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 677AD80211 for ; Thu, 19 Oct 2017 15:38:30 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=mail@matej-kosik.net; spf=SoftFail smtp.mailfrom=mail@matej-kosik.net; spf=SoftFail smtp.helo=postmaster@matej-kosik.net Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of mail@matej-kosik.net) identity=pra; client-ip=145.239.83.105; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mail@matej-kosik.net"; x-sender="mail@matej-kosik.net"; x-conformance=sidf_compatible Received-SPF: SoftFail (mail2-smtp-roc.national.inria.fr: domain of mail@matej-kosik.net is inclined to not designate 145.239.83.105 as permitted sender) identity=mailfrom; client-ip=145.239.83.105; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mail@matej-kosik.net"; x-sender="mail@matej-kosik.net"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: SoftFail (mail2-smtp-roc.national.inria.fr: domain of postmaster@matej-kosik.net is inclined to not designate 145.239.83.105 as permitted sender) identity=helo; client-ip=145.239.83.105; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mail@matej-kosik.net"; x-sender="postmaster@matej-kosik.net"; x-conformance=sidf_compatible; x-record-type="v=spf1" IronPort-PHdr: =?us-ascii?q?9a23=3AL02g/RYbqDDFCUWyQA7glan/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZpsuybnLW6fgltlLVR4KTs6sC0LWG9f24EUU7or+/81k6OKRWUBEEjc?= =?us-ascii?q?hE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i76wCAfACr/NBZ4?= =?us-ascii?q?Y6HcUs6X1pzvlrP6x5qGaAxNgH+5YKhuBBSwtwTY8McM0qV4LaNk7xLVr3kAWO?= =?us-ascii?q?OkQGAgcVeanhLU486s8Zwm8CNLuvFn8cNcB/apN58kRKBVWWx1e1s+49fm4Fya?= =?us-ascii?q?FVOC?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DbCQA7quhZZGlT75FdHgYMGQYMgzRkA?= =?us-ascii?q?2sng3qLE6ZyghQHJooiQhYBAQEBAQEBAQEBAQOBD4I4JAGCagSBLwJTGQgBAYo?= =?us-ascii?q?gDKp1gW06i0MKBYMvgluDEohUgkiCYQWhU4Q/giGBAY8JiWuHM5ctJgQsQ4EZg?= =?us-ascii?q?QUKgy6CCwwBgkh0imYBAQE?= X-IPAS-Result: =?us-ascii?q?A0DbCQA7quhZZGlT75FdHgYMGQYMgzRkA2sng3qLE6ZyghQ?= =?us-ascii?q?HJooiQhYBAQEBAQEBAQEBAQOBD4I4JAGCagSBLwJTGQgBAYogDKp1gW06i0MKB?= =?us-ascii?q?YMvgluDEohUgkiCYQWhU4Q/giGBAY8JiWuHM5ctJgQsQ4EZgQUKgy6CCwwBgkh?= =?us-ascii?q?0imYBAQE?= X-IronPort-AV: E=Sophos;i="5.43,401,1503352800"; d="asc'?scan'208";a="297008415" Received: from 105.ip-145-239-83.eu (HELO matej-kosik.net) ([145.239.83.105]) by mail2-smtp-roc.national.inria.fr with ESMTP; 19 Oct 2017 15:38:29 +0200 Received: from [192.168.1.10] (adsl-dyn234.78-99-243.t-com.sk [78.99.243.234]) by matej-kosik.net (Postfix) with ESMTPSA id C6C032306F for ; Thu, 19 Oct 2017 15:38:28 +0200 (CEST) To: caml-list@inria.fr From: =?UTF-8?B?TWF0ZWogS2/FocOtaw==?= Openpgp: id=1CD41D0A52319DC7ABC1B79F50AFFA128CE48649; url=http://matej-kosik.net/doc/kosik.asc Message-ID: <72565dd8-08e0-0fd3-a3df-6742e1957ec3@matej-kosik.net> Date: Thu, 19 Oct 2017 15:38:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="P2HuRLqF4DCv2HgpACoM37XXgqalawdbf" Subject: [Caml-list] beginner question about pattern matching This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --P2HuRLqF4DCv2HgpACoM37XXgqalawdbf Content-Type: multipart/mixed; boundary="GLAwCnp0c6fmfkChAF0liHOIWFO4spkD5"; protected-headers="v1" From: =?UTF-8?B?TWF0ZWogS2/FocOtaw==?= To: caml-list@inria.fr Message-ID: <72565dd8-08e0-0fd3-a3df-6742e1957ec3@matej-kosik.net> Subject: beginner question about pattern matching --GLAwCnp0c6fmfkChAF0liHOIWFO4spkD5 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi, I am trying to do simple pattern matching of these values: https://github.com/ocaml/ocaml/blob/trunk/parsing/parsetree.mli#L145 What I would like to do is: | [Rtag the_whole_4_tuple] -> the_whole_4_tuple However, when I try to do that, I am getting: Error: The constructor Rtag expects 4 argument(s), but is applied here to 1 argument(s) This: | [Rtag (f1,f2,f3,f4)] -> f1,f2,f3,f4 of course works but (regardless of the chosen bound variable names), it loo= ks amateurish. What's the right way to do this? (I would like just to bind a 4-tuple and then return it) (Apologies in advance for a stupid question.) --GLAwCnp0c6fmfkChAF0liHOIWFO4spkD5-- --P2HuRLqF4DCv2HgpACoM37XXgqalawdbf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEHNQdClIxncerwbefUK/6EozkhkkFAlnoqtMACgkQUK/6Eozk hkl5MxAAq6y4oC9Wqbka82VpwjY2aWI36O070UTsl7onvxCenmdfPM9T6sMkMIp6 IAJyAzlE9xMTp0evZC6pel4GOo2Ikbv2ip78zRArbnrEzmMdxY/LcRC86hM3QfLW 79uxbW9EPconyf2U5Mt8VPDJtxM5RJdsW8hd+mY8pIw3Y4gxvWu3tG/bCSx9h+as b9k6bF6zKes5OY2SufT1Nj66eHiSrlGMsk1pV29WBDk94ZEeyDGNqvjdicmfu/B6 KP9zVLoHChHDzBmhNvzf8hpT91odS630DRg9Zr/1s+Z3CHwPK115ASSmmkgguWHU c52dfIs/vo5ZKqnD2eZ5rXkcE2dK80qEypdsnL4+ohp/BOYl8vib+Wi4C3I11jtv QAPs8VN1GUxG4IaoYLMHqSDlqBCY3vkuWKXDoeXhNVHlMnD6SuYlWrzKNLZLv3Mg r8sqTgcErt6RlQxg/AIdbAeXxknhGz5CEB2xgKKx+/jkB1l0KydN/2iZH6J1Jjpa 8SM2jgLs1fXL2n23ZuYWrS3yjuq+jFSQphNNdIg+eCyZCnj5Ynl73Ht9jcEs7dYq YC7+WcIQrrt84nuhtIXhsYGEsgGglNT2up/In5uWPjzXxSfbNrwfGkoTggGN3poW +FVhOMppPungnK5ZOXeDwDFsJDQR9ZXbivf+b9SbQlLmq0fvF3U= =fVad -----END PGP SIGNATURE----- --P2HuRLqF4DCv2HgpACoM37XXgqalawdbf--