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 710167F20B for ; Thu, 7 Feb 2013 20:59:25 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of martin.jambon@ens-lyon.org) identity=pra; client-ip=66.111.4.29; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="martin.jambon@ens-lyon.org"; x-sender="martin.jambon@ens-lyon.org"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of martin.jambon@ens-lyon.org) identity=mailfrom; client-ip=66.111.4.29; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="martin.jambon@ens-lyon.org"; x-sender="martin.jambon@ens-lyon.org"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@out5-smtp.messagingengine.com) identity=helo; client-ip=66.111.4.29; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="martin.jambon@ens-lyon.org"; x-sender="postmaster@out5-smtp.messagingengine.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApcBAPcFFFFCbwQdlGdsb2JhbAA8CcBqFg4BAQEBCQsJCRQEI4IfAQEFJxEIOAEBDwsYCRYPCQMCAQIBRQYNAQcBAYgNrDqEQY5/Bo0bhEGIaZMrjgM X-IPAS-Result: ApcBAPcFFFFCbwQdlGdsb2JhbAA8CcBqFg4BAQEBCQsJCRQEI4IfAQEFJxEIOAEBDwsYCRYPCQMCAQIBRQYNAQcBAYgNrDqEQY5/Bo0bhEGIaZMrjgM X-IronPort-AV: E=Sophos;i="4.84,623,1355094000"; d="scan'208";a="1883166" Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 07 Feb 2013 20:59:24 +0100 Received: from compute3.internal (compute3.nyi.mail.srv.osa [10.202.2.43]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 53AB520A5D; Thu, 7 Feb 2013 14:59:24 -0500 (EST) Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160]) by compute3.internal (MEProxy); Thu, 07 Feb 2013 14:59:24 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=LHQ0GBs4mu30RdhM2qS+Vo KpC14=; b=pFoH5ew7Qo7WHPGXr4vPIGrQ8VwBlKLDLY/AJQGHii0FWCNsC41hGf dcphx3kNMB3mRW3+ZpvlZJHUqoFmg3QPjd6r0toaqpMnOC1SveoJ5efbCGW+vATm E5zKalV4sy9YEl/dOKGelHxdDSbCaABsmzCmMudqrE46mb/eK+Pvo= X-Sasl-enc: DLs12cs7EQymV2g8h1LYHNFitLSLZzn7PCbL4ldF1AOW 1360267163 Received: from [192.168.1.123] (unknown [50.76.32.210]) by mail.messagingengine.com (Postfix) with ESMTPA id A23078E0959; Thu, 7 Feb 2013 14:59:23 -0500 (EST) Message-ID: <51140799.3090908@ens-lyon.org> Date: Thu, 07 Feb 2013 11:59:21 -0800 From: Martin Jambon User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: Ashish Agarwal CC: Caml List References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] use identity for default function On 02/07/2013 11:22 AM, Ashish Agarwal wrote: > 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? What's wrong with the following: let foo ~f x = ... let fooi ?(f = fun x -> x) x = foo ~f x Martin