caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Guillaume Yziquel <guillaume.yziquel@citycable.ch>
To: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
Cc: OCaml List <caml-list@inria.fr>
Subject: Re: Recursion on React.events.
Date: Wed, 09 Dec 2009 19:24:00 +0100	[thread overview]
Message-ID: <4B1FEB40.5050801@citycable.ch> (raw)
In-Reply-To: <91a3da520912082353m5c75f307j6f9542877d84841f@mail.gmail.com>

Daniel Bünzli a écrit :
>> Daniel Bünzli's module is great, but sometimes a bit rough
>> to get by, specifically on examples such as this one.
> 
> I would just like to point out that this has nothing to do with the
> module per se but understanding frp in general and this is the reason
> why I went to great length to document the semantics for each of the
> combinators I provide --- something most frp libraries won't bother to
> do, leaving you with testing or looking into the implementation for
> understanding things when tricky simulateneity issues arise.

I appreciate the documentation effort you put up. Really.

> Thus to understand why your event didn't work you could have done the
> following. Provided you understand the notations given here :
> 
> http://erratique.ch/software/react/doc/React#sem

I do. I've done quite a lot of maths after all, and this doesn't 
frighten me.

> Since we have [schedule st]_st = Some (), by the semantics of E.map we
> have [ee]_st = Some ev. Thus we are in the second case of the semantics
> of E.switch (see doc) and the semantics of the switch reduces to the
> semantics of ev, i.e.

Maybe I was looking in the wrong place, but I haven't found "the second 
case of the semantics of E.switch" on your website. In fact, the way I 
learned about React.E.switch was from the .mli-style webpage on your 
website, and by trial and error.

> Pure equational reasoning, it's not that hard, or is it ?

Less than semi-algebraic geometry.

More seriously, the point was not understanding why it failed. I came to 
the same conclusions from empirical evidence. The point was how to 
overcome it.

And while I do not doubt that your documentation is rather explicit, I 
was nevertheless confused by your fixed point operators, and thus rather 
reluctant to use them.

The example on your website:

> let history ?(eq = ( = )) s = 
>   let push v = function 
>     | [] -> [ v ] 
>     | v' :: _ as l when eq v v' -> l
>     | l -> v :: l  
>   in
>   let define h = 
>     let h' = S.l2 push s h in 
>     h', h'
>   in
>   S.fix [] define

One thing that really troubles me, is that I do not understand why 
define returns a couple of two identical element. And the typing of 
E.fix is rather confusing:

> val fix : ('a React.event -> 'a React.event * 'b) -> 'b

Why do we return a 'b type with E.fix?

While the webpage mentions this dependence on the value at t-dt, it's 
quite hard to infer from the use of the fix point operator in the 
example how it's really supposed to behave and to be called.

Clarifying these issues would be welcome.

All the best,

-- 
      Guillaume Yziquel
http://yziquel.homelinux.org/


  parent reply	other threads:[~2009-12-09 18:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-09  2:40 Guillaume Yziquel
2009-12-09  3:22 ` Guillaume Yziquel
2009-12-09  4:25 ` Daniel Bünzli
2009-12-09 18:47   ` Guillaume Yziquel
2009-12-10  8:39     ` Daniel Bünzli
2009-12-09  7:53 ` Daniel Bünzli
2009-12-09 11:23   ` [Caml-list] " Richard Jones
2009-12-09 18:01     ` Guillaume Yziquel
2009-12-10  3:38       ` Daniel Bünzli
2009-12-10 22:24         ` Guillaume Yziquel
2009-12-11 12:16           ` Jérémie Dimino
2009-12-09 18:24   ` Guillaume Yziquel [this message]
2009-12-10  8:24     ` Daniel Bünzli
2009-12-10 21:41       ` Guillaume Yziquel
2009-12-11  1:22         ` Daniel Bünzli

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=4B1FEB40.5050801@citycable.ch \
    --to=guillaume.yziquel@citycable.ch \
    --cc=caml-list@inria.fr \
    --cc=daniel.buenzli@erratique.ch \
    /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).