From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 167CB824B2 for ; Tue, 4 Sep 2018 08:23:14 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=asmadeus77@gmail.com; spf=Pass smtp.mailfrom=asmadeus@notk.org; spf=None smtp.helo=postmaster@nautica.notk.org Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of asmadeus77@gmail.com) identity=pra; client-ip=91.121.71.147; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="asmadeus@notk.org"; x-sender="asmadeus77@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of asmadeus@notk.org designates 91.121.71.147 as permitted sender) identity=mailfrom; client-ip=91.121.71.147; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="asmadeus@notk.org"; x-sender="asmadeus@notk.org"; 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@nautica.notk.org) identity=helo; client-ip=91.121.71.147; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="asmadeus@notk.org"; x-sender="postmaster@nautica.notk.org"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AuCPBnBIompZsBSVyvdmcpTZWNBhigK39O0sv0rFi?= =?us-ascii?q?tYgeK//xwZ3uMQTl6Ol3ixeRBMOHs60C07KempujcFRI2YyGvnEGfc4EfD4+ou?= =?us-ascii?q?JSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgpp?= =?us-ascii?q?POT1HZPZg9iq2+yo9JDffwdFiCChbb9uMR67sRjfus4KjIV4N60/0AHJonxGe+?= =?us-ascii?q?RXwWNnO1eelAvi68mz4ZBu7T1et+ou+MBcX6r6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?= =?us-ascii?q?W6KmTtZ5hxepqAy8zKBofLONpn8o8Kn73d0w3NX90Ako/GUtXcuY2mCJCWpzmz?= =?us-ascii?q?FQHmJk7OVEuUV4j2y7/+14jvhfTIwB4fpUTgYxPNjayPB5TdfoVVCZcw=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0ABBQCHI45b/5NHeVtaDgwBAQEBAQIBA?= =?us-ascii?q?QEBCAEBAQGDTloLfyiDcpRBTwEBAQaBSYg0Gwdlg1lPiDaCBQUeCAGIEBkHAQQ?= =?us-ascii?q?yFgECAQECAQEBAQFsHAyCNSQBgl4GIwQ1HRALGgIFEw4CAg8FDwkxgzWBaAELE?= =?us-ascii?q?QuidnsWBQEXhloKGYEKgXIFgQuJTYEQgQeDdi6DGwOEYTGCBCICgScBAZosAQY?= =?us-ascii?q?CAYFBBIRviToiCY5QiyeIPoFIAy6BVU0jUIEegU6HP4haPD0wAXoBAYxXAQE?= X-IPAS-Result: =?us-ascii?q?A0ABBQCHI45b/5NHeVtaDgwBAQEBAQIBAQEBCAEBAQGDTlo?= =?us-ascii?q?LfyiDcpRBTwEBAQaBSYg0Gwdlg1lPiDaCBQUeCAGIEBkHAQQyFgECAQECAQEBA?= =?us-ascii?q?QFsHAyCNSQBgl4GIwQ1HRALGgIFEw4CAg8FDwkxgzWBaAELEQuidnsWBQEXhlo?= =?us-ascii?q?KGYEKgXIFgQuJTYEQgQeDdi6DGwOEYTGCBCICgScBAZosAQYCAYFBBIRviToiC?= =?us-ascii?q?Y5QiyeIPoFIAy6BVU0jUIEegU6HP4haPD0wAXoBAYxXAQE?= X-IronPort-AV: E=Sophos;i="5.53,328,1531778400"; d="scan'208";a="277608061" Received: from nautica.notk.org ([91.121.71.147]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2018 08:23:13 +0200 Received: by nautica.notk.org (Postfix, from userid 1001) id ACB5CC01A; Tue, 4 Sep 2018 08:23:12 +0200 (CEST) Date: Tue, 4 Sep 2018 08:22:57 +0200 From: Dominique Martinet To: Francois BERENGER Cc: caml-list Message-ID: <20180904062257.GA29189@nautica> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [Caml-list] Strange online ocamldoc for Scanf Francois BERENGER wrote on Tue, Sep 04, 2018: > It seems type signatures are truncated. > > For example in: > https://caml.inria.fr/pub/docs/manual-ocaml/libref/Scanf.html > > val sscanf : string -> ('a, 'b, 'c, 'd) scanner > > I would expect sscanf to take three arguments, not one. The documentation is correct (and you also are correct that sscanf takes three arguments, but...) ('a, 'b, 'c, 'd) scanner is itself a function taking two arguments, as defined a bit later in the page: type ('a, 'b, 'c, 'd) scanner = ('a, Scanning.in_channel, 'b, 'c, 'a -> 'd, 'd) format6 -> 'c Basically, to use the example on the page with sscanf "x = 1" "%s = %i" f, sscanf "x = 1" return a scanner to which you can apply a pattern and a function - ultimately that is three arguments as you describe, but thanks to currying after applying one argument you get anther function. This is useful because basically you do not care if the scanner comes from 'sscanf "x = 1"' or 'scanf' or 'bscanf some_channel' -- all three are equivalent scanners Cheers, -- Dominique Martinet | Asmadeus (what am I doing here?)