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 517AD7F20B for ; Thu, 7 Feb 2013 20:23:16 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of agarwal1975@gmail.com) identity=pra; client-ip=209.85.128.173; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="agarwal1975@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of agarwal1975@gmail.com designates 209.85.128.173 as permitted sender) identity=mailfrom; client-ip=209.85.128.173; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="agarwal1975@gmail.com"; 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@mail-ve0-f173.google.com) identity=helo; client-ip=209.85.128.173; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="postmaster@mail-ve0-f173.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlQBAO/9E1HRVYCtkWdsb2JhbAA8CcBiCBYOAQEBAQkJDQcSKYIWNxkBGx4DEggBAgVdAREBBQEWDIgRAQMPni2CcIw0gnuEYAoZJw1ZiHcBBQyND4RBA4hmjTuOcBYphEE X-IPAS-Result: AlQBAO/9E1HRVYCtkWdsb2JhbAA8CcBiCBYOAQEBAQkJDQcSKYIWNxkBGx4DEggBAgVdAREBBQEWDIgRAQMPni2CcIw0gnuEYAoZJw1ZiHcBBQyND4RBA4hmjTuOcBYphEE X-IronPort-AV: E=Sophos;i="4.84,623,1355094000"; d="scan'208";a="1456687" Received: from mail-ve0-f173.google.com ([209.85.128.173]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 07 Feb 2013 20:16:09 +0100 Received: by mail-ve0-f173.google.com with SMTP id oz10so2655858veb.18 for ; Thu, 07 Feb 2013 11:23:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:from:date:message-id:subject:to :content-type; bh=YW6+4C39bJQiiwBAj+5/CzhTFGl3ut/RU4AAhiaeAR4=; b=q+Sa2oEd268b2fmw4v139q2OqN2P1avyu5L8wkpESAndihmKs45Ylx8Htv+a7GrD5j 4uEwj0ENviAOAe5EjTVN9ffVNBiEOyw175Ww6VIiKCK2NoJik0ERD1jmySQD2QNqMCcs C5gmxVbP6svxaEFXQFLjpWYX9uf50JhIxrzV0noUIvsr8jLrYlwLLUfEzIypGI8j/1Pl f3w3XLgjCgBwCLf73RQntGqdiCyZwingnHCuazGQJ64e9T+F4Uu+xWqotRApfjAdeZeY F6Ghr+5lLWmEhPOmaU9SCxsKht7yF2Xv5eGfyj8FE+Xf36IS1aD/1y8QVQutaQXecOKv 8GUA== X-Received: by 10.58.28.169 with SMTP id c9mr3317228veh.5.1360264994364; Thu, 07 Feb 2013 11:23:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.58.200.226 with HTTP; Thu, 7 Feb 2013 11:22:54 -0800 (PST) From: Ashish Agarwal Date: Thu, 7 Feb 2013 14:22:54 -0500 Message-ID: To: Caml List Content-Type: multipart/alternative; boundary=047d7b6da95aca1ebe04d5275f78 Subject: [Caml-list] use identity for default function --047d7b6da95aca1ebe04d5275f78 Content-Type: text/plain; charset=ISO-8859-1 I'd like to implement val foo : ?f:('a -> 'b) -> 'a -> 'b where the default for f is identity. Is there now a way to do this with all the new features of OCaml? --047d7b6da95aca1ebe04d5275f78 Content-Type: text/html; charset=ISO-8859-1 I'd like to implement

val foo : ?f:('a -> 'b) -> 'a -> 'b

where the default for f is identity. Is there now a way to do this with all the new features of OCaml?

--047d7b6da95aca1ebe04d5275f78--