Article View: fa.caml
Article #143Re: [Caml-list] using infix operators/functions in modules when not using "open"
From: Haoyang Wang
Date: Thu, 26 Apr 2012 23:02
Date: Thu, 26 Apr 2012 23:02
27 lines
3989 bytes
3989 bytes
On Apr 26, 2012, at 3:36 PM, ocamllist.robertwork@spamgourmet.com wrote:
> I'm a OCaml newbie. I don't understand how to use infix functions that are in modules when I don't want to use "open".
>
> I did discover http://xahlee.org/ocaml/functions.html which explains that an infix operator can be used as a prefix. So, this format:
>
> ((Module.(op)) "foo" "bar")
>
> does seem to work. But, intuitively, it seems like:
>
> "foo" Module.(op) "bar"
>
> would work -- it doesn't.
>
> Is there a way to keep the infix notation?
>
> Thanks.
Module.("foo" (op) "bar")
--
Caml-list mailing list. Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
Technical Details
Message-ID:
<fa.M6cVL/vUGSfNoz3BI3kTRG8al/c@ifi.uio.no>Path:
arc1-ca.pugleaf.net!r9ni102221pbh.0!nntp.google.com!news2.google.com!goblin3!goblin1!goblin.stu.neva.ru!uio.no!nntp.uio.no!.POSTED!not-for-mailReferences:
<fa.ofhQjxcsFv94sv/nWA+yTdO/Akc@ifi.uio.no>Show Full Headers
Complete Article Headers
X-Google-Thread: ff861,b3875ae36b84daab
X-Google-NewGroupId: yes
X-Google-Attributes: gidc0fe4b917e,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Received: by 10.68.230.98 with SMTP id sx2mr2923454pbc.1.1335481336454;
Thu, 26 Apr 2012 16:02:16 -0700 (PDT)
Path: arc1-ca.pugleaf.net!r9ni102221pbh.0!nntp.google.com!news2.google.com!goblin3!goblin1!goblin.stu.neva.ru!uio.no!nntp.uio.no!.POSTED!not-for-mail
From: Haoyang Wang <hywang@pobox.com>
Newsgroups: fa.caml
Subject: Re: [Caml-list] using infix operators/functions in modules when not using "open"
Date: Thu, 26 Apr 2012 23:02:16 UTC
Organization: Internet mailing list
Lines: 28
Sender: Haoyang Wang <lego395@gmail.com>
Message-ID: <fa.M6cVL/vUGSfNoz3BI3kTRG8al/c@ifi.uio.no>
References: <fa.ofhQjxcsFv94sv/nWA+yTdO/Akc@ifi.uio.no>
NNTP-Posting-Host: mail-jess.uio.no
Mime-Version: 1.0 (Apple Message framework v1257)
X-Trace: readme.uio.no 1335481336 29134 129.240.7.9 (26 Apr 2012 23:02:16 GMT)
X-Complaints-To: abuse@uio.no
NNTP-Posting-Date: Thu, 26 Apr 2012 23:02:16 +0000 (UTC)
To: caml-list@inria.fr
X-IronPort-AV: E=Sophos;i="4.75,487,1330902000";
d="scan'208";a="155827110"
X-Authentication-Warning: walapai.inria.fr: sympa set sender to caml-list-owner@inria.fr using -f
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AqkBAGfSmU/RVdIykGdsb2JhbABFgx2uTQgiAQEBAQkJDQcUBCOCCQEBAQMBEgIsATkDAQsBBQVGNAEFARwZIoddAwYFC5xuCo8WhUEnDYlNAQULjg6CQmMEiGONGoERhGOIbD2BWIJT
X-IronPort-AV: E=Sophos;i="4.75,487,1330902000";
d="scan'208";a="141777610"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=sender:content-type:mime-version:subject:from:in-reply-to:date
:content-transfer-encoding:message-id:references:to:x-mailer;
bh=CyPyqkCLSvqE3Iw1E/ljYrbNAboylQIyBeC3jQxrej4=;
b=HzFwfXMVTID1dkNSAETod9b3sVsNA4J1krPz/g0zHnqeFym4OoKyEX6gr+iQNxhZUT
/JVqwmj/lj/D2wwXLcN2MUcuZbY9vnpIKcbaIBRMeECdLdly4dA860vJxLlWJBxfO6LP
qJ2NoBA6vnfaEqXSheMNZUMP0OazVpj4w12SRT4Wdonq01U6BTVZo5Vo9IxBn5FAnoxG
ROxv773SYMadiwOCUfj5JP/9dmepfYDurYCne9fZYC0G8IhFBV5HrO9smEnL3ijKaDmM
FQ9Of7hi9ZwaH9+UliDT4P57/HH+ryozBr8fjNer7uopGJ+57LU4rn4v1wM9VtM7bkbj
pSjA==
In-Reply-To: <CAN2fQM6PmfgkBspx1Js0yq8r2hbtd15mhvDXQ6tUcmAL46q=rw@mail.gmail.com>
X-Mailer: Apple Mail (2.1257)
X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id q3QN1w0j012078
X-Sequence: 3973
List-Id: <caml-list.inria.fr>
List-Archive: <https://sympa-roc.inria.fr/wws/arc/caml-list>
List-Help: <mailto:sympa@inria.fr?subject=help>
List-Owner: <mailto:caml-list-request@inria.fr>
List-Post: <mailto:caml-list@inria.fr>
List-Subscribe: <mailto:sympa@inria.fr?subject=subscribe%20caml-list>
List-Unsubscribe: <mailto:sympa@inria.fr?subject=unsubscribe%20caml-list>
Original-Date: Thu, 26 Apr 2012 16:01:46 -0700
Original-Message-Id: <3C0F509D-8590-4D45-A586-83630088C7B5@pobox.com>
Original-References: <CAN2fQM6PmfgkBspx1Js0yq8r2hbtd15mhvDXQ6tUcmAL46q=rw@mail.gmail.com>
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit