Browse thread
more on frp (was Re: [Caml-list] Re: Recursion on React.events)
-
Daniel_BĂĽnzli
-
Aaron Bohannon
-
Daniel_BĂĽnzli
- Aaron Bohannon
-
Daniel_BĂĽnzli
- Rich Neswold
-
Aaron Bohannon
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2009-12-10 (05:01) |
From: | Aaron Bohannon <bohannon@s...> |
Subject: | Re: more on frp (was Re: [Caml-list] Re: Recursion on React.events) |
On Wed, Dec 9, 2009 at 11:16 PM, Daniel Bünzli <daniel.buenzli@erratique.ch> wrote: >> 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). I apologize. I read your message too quickly and thought that you were using "last_keysym" to define "istr". (And I chose the word because it was part of "FRP". :) > 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. Yes, (I think) I did understand what the type "time -> 'a option" was trying to represent. It just doesn't seem a very good match for the concept. It would appear (from the type) that events could have nonzero duration, but that doesn't match my intuition of events. - Aaron