From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: caml-list@inria.fr
Subject: Re: [Caml-list] function vs. parser
Date: Fri, 14 Sep 2001 14:50:24 +0200 [thread overview]
Message-ID: <01091414551800.23904@ice> (raw)
In-Reply-To: <B1E4D3274D57D411BE8400D0B783FF322E8700@exchange1.cswv.com>
On Thu, 13 Sep 2001, Krishnaswami, Neel wrote:
>Anyway, for some Caml-related content, is there a way to use qualified
>paths and infix notation together?
>
>I mean, if I have:
>
> module Foo = struct let (+++) x y = List.append x y end
>
>Right now I have to write
>
> Foo.(+++) [1; 2] [3; 4]
>
>Is there any way I can write something like
>
> [1; 2] Foo.+++ [3; 4]
>
>without using open or rebinding the Foo module's function in the local
>namespace?
As far as I know, it is not possible.
As a workaround, I use sometimes a submodule only for operators:
module Foo = struct
let foo x y = ...
module Operators = struct
let (+++) = foo
end
end
So you can open only the Foo.Operators module, and have more control over the
namespace.
Gerd
--
----------------------------------------------------------------------------
Gerd Stolpmann Telefon: +49 6151 997705 (privat)
Viktoriastr. 45
64293 Darmstadt EMail: gerd@gerd-stolpmann.de
Germany
----------------------------------------------------------------------------
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
next prev parent reply other threads:[~2001-09-14 12:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-13 21:49 Krishnaswami, Neel
2001-09-14 12:50 ` Gerd Stolpmann [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-09-13 18:09 Krishnaswami, Neel
2001-09-13 20:55 ` Brian Rogoff
2001-09-13 8:20 SooHyoung Oh
2001-09-13 8:48 ` Daniel de Rauglaudre
2001-09-13 14:13 ` Brian Rogoff
2001-09-13 16:09 ` Daniel de Rauglaudre
2001-09-13 16:50 ` Brian Rogoff
2001-09-13 16:51 ` Pierre Weis
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=01091414551800.23904@ice \
--to=info@gerd-stolpmann.de \
--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