Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Christophe TROESTLER <Christophe.Troestler+ocaml@umh.ac.be>
To: bluestorm.dylc@gmail.com
Cc: jeremy1@gmail.com, caml-list@yquem.inria.fr, fw@deneb.enyo.de
Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml?
Date: Mon, 09 Aug 2010 01:00:18 +0200 (CEST)	[thread overview]
Message-ID: <20100809.010018.162167882947021471.Christophe.Troestler+ocaml@umons.ac.be> (raw)
In-Reply-To: <AANLkTimoAn8PNOW2X+eTYPQneKQertH-K__Q63mU9T7x@mail.gmail.com>

On Sun, 8 Aug 2010 23:47:20 +0200, bluestorm wrote:
> 
> >> > > Is there a better approach to polymorphic equality floating around?
> >> >
> >> > Besides type classes?  I'm not sure.  It's probably possible to remove
> >> > this feature from the language, with a little bit of syntactic
> >> > overhead to pass around a matching comparison function.
> >>
> >> Yes for instance the very concise local opening notation comes in handy
> >> here:
> >>
> >> if Int.(x = 42) then ... else ...
> >
> > That's very nice.  I don't think type classes are conservative enough for
> > this project, but this comes very close indeed.
> > I haven't really had a chance to explore OCaml 3.12 yet, as it came out
> > while I was working on this, but I will give this serious consideration.
> 
> This approach is very nice indeed, but to make it practical you have
> to have one of the two following features :
> - a more restricted form of "open" statement that does not blindly
> import *all* the module values

This is possible to do with Delimited Overloading (pa_do):
http://pa-do.forge.ocamlcore.org/

> - nested modules
> 
> The other way to solve the problem is to put the dangerous infix
> operators into a submodule, eg. Infix or Ops. You have a Int module
> with int-specific functions that are not likely to silently conflict
> with values of other modules, and an Int.Infix module meant to be used
> in that "local open" form : Int.Infix(x + 1 = 2).

This is possible to "import" the overloaded functions form a submodule
but has to be done by hand for the moment because there is no
consensus on what the name of the submodule should be.

My 0.02€,
C.


  reply	other threads:[~2010-08-08 23:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-06  4:04 Jeremy Bem
2010-08-06 13:50 ` [Caml-list] " Eray Ozkural
2010-08-08 17:59 ` Florian Weimer
2010-08-08 18:44   ` Jeremy Bem
2010-08-08 18:52     ` Florian Weimer
2010-08-08 19:39       ` Jeremy Bem
2010-08-09 11:55         ` Nicolas Pouillard
2010-08-11 13:00         ` Jon Harrop
2010-08-08 20:53       ` Nicolas Pouillard
2010-08-08 20:59         ` Jeremy Bem
2010-08-08 21:47           ` bluestorm
2010-08-08 23:00             ` Christophe TROESTLER [this message]
2010-08-08 23:29             ` Jeremy Bem
2010-08-11 13:02               ` Jon Harrop
2010-08-12  0:21                 ` Jeremy Bem
2010-08-12 23:14                   ` Jon Harrop
2010-08-09 13:10             ` David House
2010-08-09 14:03               ` Nicolas Pouillard
2010-08-08 20:52     ` Nicolas Pouillard
2010-08-11 12:56     ` Jon Harrop
2010-08-09  6:37 ivan chollet
2010-08-09 10:54 ` Cedric Cellier
2010-08-09 15:00 ` ivan chollet
2010-08-09 15:03 ` ivan chollet
2010-08-11 13:19 ` Jon Harrop
2010-08-11 16:12   ` philippe
2010-08-12  6:56   ` ivan chollet

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=20100809.010018.162167882947021471.Christophe.Troestler+ocaml@umons.ac.be \
    --to=christophe.troestler+ocaml@umh.ac.be \
    --cc=bluestorm.dylc@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=fw@deneb.enyo.de \
    --cc=jeremy1@gmail.com \
    /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