From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id A673BBC37 for ; Thu, 10 Dec 2009 06:01:36 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhwBAB8PIEvRVdiwkGdsb2JhbACULoZ3PwEBAQEJCQwHEwOqJDCFISKIRwECAwWEJwSLJw X-IronPort-AV: E=Sophos;i="4.47,372,1257116400"; d="scan'208";a="39602644" Received: from mail-px0-f176.google.com ([209.85.216.176]) by mail3-smtp-sop.national.inria.fr with ESMTP; 10 Dec 2009 06:01:31 +0100 Received: by pxi6 with SMTP id 6so5604703pxi.0 for ; Wed, 09 Dec 2009 21:01:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=h7ZL2G9N9Ofu0b/YqprQrdx3zSrxhcy/VMBgzU2b8i4=; b=bqniz36MKeXPk8ZpL4DDMIXdOrVXMogA+n97BFzxgSCAvZr9H0b6OhiNMkB/DJU/gs cXFCPGRH6IFsZO3+uNKWeeD3MN9OVqK/g5Qop33Oz4CSSkCAVfszmsWujvju7HxHOEr8 bLr1tl+dJ6ZgeRDldqeZvek0+PKGq/+82upBI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=kVY/PppqL+KlQPT9Goy9AJXTfD5FUjqVJezeBwBLjsP3j2LBcuBlc3jdIDq9Z4tgty vDu6BOiR1YYH1uGH4arNLJWqdaxKD/zqJci1Dx7qP1LY0/7MLJ6TUzNLo503a6FEULWE lr3o3dzWU1DTILejQQu/kpAiMm+K4c/E1D6lI= MIME-Version: 1.0 Sender: aaron678@gmail.com Received: by 10.142.6.10 with SMTP id 10mr1790182wff.48.1260421290228; Wed, 09 Dec 2009 21:01:30 -0800 (PST) In-Reply-To: <91a3da520912092016g58f320as79561ae722b3fb61@mail.gmail.com> References: <91a3da520912090843n451b5592x27105b353ef7c65b@mail.gmail.com> <91a3da520912092016g58f320as79561ae722b3fb61@mail.gmail.com> Date: Thu, 10 Dec 2009 00:01:30 -0500 X-Google-Sender-Auth: 70a63246d759d0ab Message-ID: Subject: Re: more on frp (was Re: [Caml-list] Re: Recursion on React.events) From: Aaron Bohannon To: =?ISO-8859-1?Q?Daniel_B=FCnzli?= Cc: Richard Jones , OCaml List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; recursion:01 bunzli:01 buenzli:01 occurences:01 'o':01 'n':01 occurences:01 occurence:01 2009:98 programmi:98 wrote:01 upenn:01 caml-list:01 'g':01 'g':01 On Wed, Dec 9, 2009 at 11:16 PM, Daniel B=FCnzli 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