caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
To: Aaron Bohannon <bohannon@seas.upenn.edu>
Cc: Richard Jones <rich@annexia.org>, OCaml List <caml-list@inria.fr>
Subject: Re: more on frp (was Re: [Caml-list] Re: Recursion on React.events)
Date: Thu, 10 Dec 2009 12:16:51 +0800	[thread overview]
Message-ID: <91a3da520912092016g58f320as79561ae722b3fb61@mail.gmail.com> (raw)
In-Reply-To: <c413fcb70912091033x43d771afl252801eceac0d272@mail.gmail.com>

> Your example perfectly illustrates what makes understanding FRP hard:
> when I type the string "programming", should I expect to get a signal
> with a value of "programming" or "programing"?

Note, you don't get any signal here, we are talking about an _event_.
So the sequence of event occurences you will see is 'p', 'r', 'o',
'g', 'r', 'a', 'm', 'm', 'i', 'n', 'g'. Now if you fold over these
occurences as I suggested to make a string signal, the sequence of
changes in the signal you will see is "", "p", "pr", "pro", "prog",
"progr", "progra", "program", "programm", "programmi", "programmin",
"programming" (you could have chosen a shorter word, that was painful
to write).

> Signals without events have an semantics that seems straightforward
> (to me).  But I have very little intuition for events, as represented
> by a type such as "time -> 'a option", and their conversion to and
> from signals.

I'm not sure but maybe your problem is just a terminology thing.
Because in frp what is called an event confusignly represents many
events, it represents event occurences of a kind of event (e.g. the
keystrokes of a keyboard).

So the function time -> 'a option returns a value if there's an
occurence of the event at that time (e.g. if the
user pressed a key at that time) and None otherwise.

> Also, I like the idea of making different choices for what "time" is,
> but doesn't the semantics of FRP depend on time being continuous?

I wouldn't say it "depends", it makes you believe, that's the way you
should think about when you program. But in the programming world
everything is eventually discrete and your primitive input is giving
the pace. Have a read at the section "Continuity" there :

http://erratique.ch/software/react/doc/React#sigsem

Best,

Daniel


  reply	other threads:[~2009-12-10  4:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-09 16:43 Daniel Bünzli
2009-12-09 18:33 ` Aaron Bohannon
2009-12-10  4:16   ` Daniel Bünzli [this message]
2009-12-10  5:01     ` Aaron Bohannon
2009-12-12 15:04 ` Rich Neswold

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=91a3da520912092016g58f320as79561ae722b3fb61@mail.gmail.com \
    --to=daniel.buenzli@erratique.ch \
    --cc=bohannon@seas.upenn.edu \
    --cc=caml-list@inria.fr \
    --cc=rich@annexia.org \
    /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).