caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: ocamllist.robertwork@spamgourmet.com
To: caml-list@inria.fr
Subject: [Caml-list] using infix operators/functions in modules when not using "open"
Date: Thu, 26 Apr 2012 15:36:46 -0700	[thread overview]
Message-ID: <CAN2fQM6PmfgkBspx1Js0yq8r2hbtd15mhvDXQ6tUcmAL46q=rw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 447 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 754 bytes --]

             reply	other threads:[~2012-04-26 22:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-26 22:36 ocamllist.robertwork [this message]
2012-04-26 23:01 ` Haoyang Wang
2012-04-27  0:28   ` Anthony Tavener
2012-04-27  6:57   ` Gabriel Scherer
2012-04-27  8:30     ` Goswin von Brederlow

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='CAN2fQM6PmfgkBspx1Js0yq8r2hbtd15mhvDXQ6tUcmAL46q=rw@mail.gmail.com' \
    --to=ocamllist.robertwork@spamgourmet.com \
    --cc=caml-list@inria.fr \
    /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).