Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Pixel <pixel@mandrakesoft.com>
To: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] simple typing question
Date: 04 Jul 2002 01:24:33 +0200	[thread overview]
Message-ID: <lyn0t8bdji.fsf@leia.mandrakesoft.com> (raw)
In-Reply-To: <20020703104944V.garrigue@kurims.kyoto-u.ac.jp>

Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp> writes:

[...]

> Another problem is that it is asymmetric: partial applications could
> be polymorphic, but not results containing several functions:
> 
> let both f = (List.map f, List.iter f)

sorry, i don't understand that pb.


[...]

> let toggle r x = let old = !r in r := x; old
> let make_toggle () = let r = ref [] in toggle r

or worse:

let make_toggle toggle = let r = ref [] in toggle r

no way to know how many parameters toggle can have, so no easy way to
eta-expand. I think it *can* be done at evaluation time, but I'm not
sure.

so my response to Francois Pottier was wrong:

>> >   # let apply f x = f x;;
>> >   val apply : ('a -> 'b) -> 'a -> 'b = <fun>
>> > 
>> > ... You can write applications of `apply' with any
>> > numbers of arguments.
>> 
>> you're right... but this isn't a problem for the stuff i'm talking.
>> 
>> If "wrapping-restoring-eta-equivalence" is done based on the number of
>> parameters *before* instanciation of type variables, it will do.

which was wrong: (even if Francois didn't bother telling :)

# let id f = print_string "foo" ; f

no simple way to eta-expand. Once again, I think it *can* be done at
evaluation time...

[...]

> So, this seems unlikely such changes would go through.

i'm aware of this :)


I wanted to note that partial application semantic is somewhat nasty
when combined with eager evaluation, and that syntactically &
typefully separating functions-returning-functions and
partially-applied-functions could ease understanding.

One way to do this is to add sugar for partial application of tuples,
and having tuples the *default* way of passing parameters.
(once again http://merd.net/choices_syntax.html :)


Thanks!
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2002-07-03 23:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-02  4:14 Michael Vanier
2002-07-02  9:14 ` Pierre Weis
2002-07-02  9:49   ` Michael Vanier
2002-07-02 11:29     ` Daniel de Rauglaudre
2002-07-02 11:42     ` Xavier Leroy
2002-07-02 18:57       ` Pixel
2002-07-02 20:59         ` Pierre Weis
2002-07-03  0:39           ` Pixel
2002-07-03  1:49             ` Jacques Garrigue
2002-07-03 23:24               ` Pixel [this message]
2002-07-03  7:51             ` Francois Pottier
2002-07-03 11:25               ` Pixel
2002-07-03 18:10       ` Lauri Alanko
2002-07-02 14:56     ` 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=lyn0t8bdji.fsf@leia.mandrakesoft.com \
    --to=pixel@mandrakesoft.com \
    --cc=caml-list@inria.fr \
    --cc=garrigue@kurims.kyoto-u.ac.jp \
    /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