Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Michael <michipili@gmail.com>
To: Xavier Leroy <Xavier.Leroy@inria.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Writing Awk in OCaml
Date: Tue, 30 Jul 2013 19:57:39 +0200	[thread overview]
Message-ID: <51F7FE93.4080508@gmail.com> (raw)
In-Reply-To: <51F662B2.7070102@inria.fr>

Hello Xavier,

Xavier Leroy wrote:
> On 2013-07-28 10:43, Michael wrote:
>> With the above signature, we can write (1)
>>
>> bind u f1: row -> state -> stat
>> bind (bind v f1) f2 : row -> state -> stat
>>
>> But it would be quite nice to be able to write the following expressions so
>> that they are defined and correctly type (2):
>>
>> bind u f1 : row -> state -> state
>> bind v f1 f2 : row -> state -> state
>>
>> Is there any way to rewrite things so that the cumbersome (1) can be replaced
>> by the slick (2) ?
> Just use a left-associative infix symbol for "bind", it will be real slick:
>
>     let (++) = bind
>
>     v ++ f1 ++ f2     (* i.e. bind (bind  v f1) f2  *)
>
> Hope this helps,
>
thank you very much for your answer, it is nearly perfect!  It has
however a drawback: I thought I had found a plausible alibi to learn how
to produce and use these strange variadics!  It looks like I have to
find something else. :)

Best regards,
Michael


      reply	other threads:[~2013-07-30 17:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-28  8:43 Michael
2013-07-29 12:40 ` Xavier Leroy
2013-07-30 17:57   ` Michael [this message]

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=51F7FE93.4080508@gmail.com \
    --to=michipili@gmail.com \
    --cc=Xavier.Leroy@inria.fr \
    --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