From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 81C777F30A for ; Fri, 8 Mar 2013 14:56:08 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of philippe.veber@gmail.com) identity=pra; client-ip=74.125.82.170; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="philippe.veber@gmail.com"; x-sender="philippe.veber@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of philippe.veber@gmail.com designates 74.125.82.170 as permitted sender) identity=mailfrom; client-ip=74.125.82.170; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="philippe.veber@gmail.com"; x-sender="philippe.veber@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-we0-f170.google.com) identity=helo; client-ip=74.125.82.170; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="philippe.veber@gmail.com"; x-sender="postmaster@mail-we0-f170.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Am4BAHbtOVFKfVKqiGdsb2JhbABDxEyBUQgWDgEBAQoJFBQEJIItAQUnGQEbHQEDDAYFBAcDOCEBAREBBQEcBhOIAAEDD50fjDKCe4RZChknDVmIIgEFDIw4gkgHg0ADkw6BZYFgi1qDNhYphC4 X-IPAS-Result: Am4BAHbtOVFKfVKqiGdsb2JhbABDxEyBUQgWDgEBAQoJFBQEJIItAQUnGQEbHQEDDAYFBAcDOCEBAREBBQEcBhOIAAEDD50fjDKCe4RZChknDVmIIgEFDIw4gkgHg0ADkw6BZYFgi1qDNhYphC4 X-IronPort-AV: E=Sophos;i="4.84,807,1355094000"; d="scan'208";a="6115398" Received: from mail-we0-f170.google.com ([74.125.82.170]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 08 Mar 2013 14:56:08 +0100 Received: by mail-we0-f170.google.com with SMTP id z53so1048107wey.15 for ; Fri, 08 Mar 2013 05:56:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=gqzO5MaLU8HBR8AP3ASh64b3038mXC7xyGdxkbQF8X0=; b=bwwzhbJKbZeYOkF7miTI0oBMBo+EVh+PaiTKVa2fD2Klw/5sxB4BXVAR1ZRONUkMgw JiwGW3XmcNnuNhVWehEn7KKQ9onfLeiOZKCZANABCmlwuxM2iqXF6UY2XJ+RYS+A2rOR ClpN20NFqHNXoynNHGVQc2ocGwJsH93gJS47ywwm1l8ClW6ltoZpFUNRN5QoKN805SUN +JegdBAz7nGLwJzFLJnooR4kNsOgioc/470rpnbMslsjR5l6/R0Q+CYpn6qV2EwZR4V1 ojM568RqN/N5j/jRMg9dqsf+w1YdH4e8pso3/x6sjmQAXZoMLadScN7/iYcMjF6YqriX SBmg== X-Received: by 10.180.75.177 with SMTP id d17mr4045097wiw.16.1362750967617; Fri, 08 Mar 2013 05:56:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.87.230 with HTTP; Fri, 8 Mar 2013 05:55:47 -0800 (PST) In-Reply-To: References: From: Philippe Veber Date: Fri, 8 Mar 2013 14:55:47 +0100 Message-ID: To: Lukasz Stafiniak Cc: caml users Content-Type: multipart/alternative; boundary=f46d043c811e57a52604d76a2f8c X-Validation-by: philippe.veber@gmail.com Subject: Re: [Caml-list] Signals of signals in react --f46d043c811e57a52604d76a2f8c Content-Type: text/plain; charset=ISO-8859-1 2013/3/8 Lukasz Stafiniak > > > > On Fri, Mar 8, 2013 at 10:43 AM, Philippe Veber wrote: > >> Dear functional-reactive camlers, >> >> In order to change the dependencies between signals dynamically, one can >> use the switch function whose type is: >> >> utop $ React.S.switch;; >> - : ?eq:('a -> 'a -> bool) -> 'a React.signal -> 'a React.signal >> React.event -> 'a React.signal = >> >> However I often find myself wanting to write signals of signals, and I >> wrote the following definition to cope with them: >> >> val bind_s : 'a React.signal -> ('a -> 'b React.signal) -> 'b > > > "Bind" is the basic building block of the Froc library: > > val bind : > ?eq:('a -> 'a -> bool) -> > 'b Froc.behavior -> > ('b -> 'a Froc.behavior) -> 'a Froc.behavior > > I know I'm not answering your question... > You do, at least partially: now I know this style is natural at least in one FRP library. Too bad it's not the one I use :o). --f46d043c811e57a52604d76a2f8c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

2013/3/8 Lukasz Stafiniak <lukstafi@gm= ail.com>



On Fri, Mar 8, 2013 at 10:43 AM, Philippe Veber <= span dir=3D"ltr"><philippe.veber@gmail.com> wrote:
Dear functional-reactive camlers,

In order to chang= e the dependencies between signals dynamically, one can use the switch func= tion whose type is:

utop $ React.S.switch;;
- : ?eq:('a -> 'a -> bool) -&g= t; 'a React.signal -> 'a React.signal React.event -> 'a R= eact.signal =3D <fun>

However I often find myself wanting to write signals of signals, and I = wrote the following definition to cope with them:

val bind_s : 'a React.signal = -> ('a -> 'b React.signal) -> 'b

"Bind" is the basic building block of t= he Froc library:

val bind :
=A0 ?eq:('a -> 'a -> bool) ->
=A0 'b Froc.behavior ->
=A0 ('b -> 'a Froc.behavior) -> 'a Froc.behavior

=A0I know I'm not answering your question..= .

You do, at least partially:= =A0 now I know this style is natural at least in one FRP library. Too bad i= t's not the one I use :o).

--f46d043c811e57a52604d76a2f8c--