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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id 8A9D67ED1A for ; Fri, 18 May 2012 22:05:31 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao4BACGqtk/RVdi2kGdsb2JhbABFtAEIIgEBAQEJCQ0HFAQjghYBAQQSAhMZATgBAwwBBQULOyEBEgEFARwGEwgah14DC54RCQOPFIUdJw2JTAEFDIoGhjMDlSCKfIMePYFTgjY X-IronPort-AV: E=Sophos;i="4.75,618,1330902000"; d="scan'208";a="158924630" Received: from mail-qc0-f182.google.com ([209.85.216.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-MD5; 18 May 2012 22:05:30 +0200 Received: by qcsg15 with SMTP id g15so3417259qcs.27 for ; Fri, 18 May 2012 13:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=KDAJOyqo/jrANYv6QRXf3ZMW6iKDAfHwrvyUghyryD8=; b=YiOSa0LDKPhNu42dIXGmp/kSJYHt+7LGo5AJ7ZUn+xNIwqFqmIdq6DFDzSlAUd93yw R2mDgwiAJOZGZsFaGP7d0Ju22eD8qxdUdWQKG9/EBKxSQeAmR3bMc0sJtDoZPSKkxb8F ilSnwRJ94YpjHfLY0oaVMoE/YhAegeBoHh15/w0anRq928xTNiRBtFk1AJ4NfGYuaolI z3jCPhJ9pGq5n2swWXYInyEttXkjULuSWNesSLGYM+XRSpReU4RUIbpSBri/YNeZ/Raj VcRY1VOLjIwUj/amH/+P2sCnl6jmD0p2+5IgzKHSh3eHCJ/Oe3zSrEaI3Ao/kcWnBo7J lr8A== MIME-Version: 1.0 Received: by 10.229.135.208 with SMTP id o16mr6103784qct.120.1337371529944; Fri, 18 May 2012 13:05:29 -0700 (PDT) Sender: nicolas.braudsantoni@gmail.com Received: by 10.224.174.10 with HTTP; Fri, 18 May 2012 13:05:29 -0700 (PDT) In-Reply-To: References: <87d36bnafe.fsf@frosties.localnet> <4FB669B4.6000200@ens-lyon.org> Date: Fri, 18 May 2012 22:05:29 +0200 X-Google-Sender-Auth: uTn9MjRw7S7hnBo74bdCHX2e4n0 Message-ID: From: Nicolas Braud-Santoni To: Gabriel Scherer Cc: David.Teller@ens-lyon.org, Yitzhak Mandelbaum , OCaml mailing list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Validation-by: nicolas@braud-santoni.eu Subject: Re: [Caml-list] optional functions in modules It's quite different : the exception will be thrown whenever the function is applied. However, I can't find how to fix this without loosing polymorphism right no= w. 2012/5/18 Gabriel Scherer : > You can regain that polymorphism at a moderate efficiency cost by eta-exp= anding: > > =A0 let mmap2 f =3D match mmap with | None -> failwith "Nope" | Some x ->= x f;; > =A0 val mmap2 : ('a -> 'b) -> 'a list -> 'b list =3D