caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gabriel Kerneis <kerneis@pps.jussieu.fr>
To: Martin Jambon <martin.jambon@ens-lyon.org>
Cc: Ashish Agarwal <agarwal1975@gmail.com>, Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] use identity for default function
Date: Thu, 7 Feb 2013 21:12:58 +0100	[thread overview]
Message-ID: <20130207201258.GB28009@kerneis.info> (raw)
In-Reply-To: <51140799.3090908@ens-lyon.org>

On Thu, Feb 07, 2013 at 11:59:21AM -0800, Martin Jambon wrote:
> On 02/07/2013 11:22 AM, Ashish Agarwal wrote:
> >val foo : ?f:('a -> 'b) -> 'a -> 'b
> 
> What's wrong with the following:

It does not have the requested type (for fooi).

> let foo ~f x = ...
val foo : f:('a -> 'b) -> 'a -> 'b = <fun>

> let fooi ?(f = fun x -> x) x = foo ~f x
val fooi : ?f:('a -> 'a) -> 'a -> 'a = <fun>

-- 
Gabriel

  reply	other threads:[~2013-02-07 20:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-07 19:22 Ashish Agarwal
2013-02-07 19:53 ` Jeff Meister
2013-02-07 20:04   ` AW: " Gerd Stolpmann
2013-02-07 20:06   ` Gabriel Kerneis
2013-02-09 13:13   ` Goswin von Brederlow
2013-02-09 20:10     ` Jeff Meister
2013-02-07 19:59 ` Martin Jambon
2013-02-07 20:12   ` Gabriel Kerneis [this message]
2013-02-07 20:57   ` Ashish Agarwal
2013-02-08  2:47 ` Jacques Garrigue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130207201258.GB28009@kerneis.info \
    --to=kerneis@pps.jussieu.fr \
    --cc=agarwal1975@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=martin.jambon@ens-lyon.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).