caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
To: guillaume.yziquel@citycable.ch
Cc: caml-list@inria.fr
Subject: Re: Obj.magic and existential types.
Date: Fri, 19 Jun 2009 20:21:34 +0200	[thread overview]
Message-ID: <E5AC49FA-C6C1-4C2C-99F2-2C15C0668E74@erratique.ch> (raw)
In-Reply-To: <4A3BCE1A.3010403@citycable.ch>


Le 19 juin 09 à 19:42, Guillaume Yziquel a écrit :

> But the result is rather interesting. It can record a flow of  
> computations, and recompute them only when upstream data has been  
> modified:

Not directly responding to your question but you are looking for  
functional reactive programming (frp).

http://erratique.ch/software/react

I rewrote your example below with react (no magic used).

Best,

Daniel

 > ocaml react.cmo
         Objective Caml version 3.11.0

# open React;;
# let n, set_n = S.create 1;;
val n : int React.signal = <abstr>
val set_n : int -> unit = <fun>
# let m = S.map (fun x -> x + 1) n ;;
val m : int React.signal = <abstr>
# S.value m;;
- : int = 2
# set_n 3;;
- : unit = ()
# S.value m;;
- : int = 4







  reply	other threads:[~2009-06-19 18:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-19 17:42 Guillaume Yziquel
2009-06-19 18:21 ` Daniel Bünzli [this message]
2009-06-19 18:30   ` Guillaume Yziquel
2009-06-19 18:37     ` Daniel Bünzli
2009-06-19 18:47   ` [Caml-list] " Jake Donham
2009-06-20  8:30     ` Daniel Bünzli
2009-06-21 18:08       ` Jake Donham
2009-06-21 18:39         ` Yaron Minsky
2009-06-22  0:03         ` Daniel Bünzli
2009-06-22  9:19           ` Benjamin Canou
2009-06-22 17:02           ` Jake Donham
2009-06-23  0:24             ` Daniel Bünzli
2009-06-23  0:34               ` Jake Donham
2009-06-23  2:22               ` Jake Donham

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=E5AC49FA-C6C1-4C2C-99F2-2C15C0668E74@erratique.ch \
    --to=daniel.buenzli@erratique.ch \
    --cc=caml-list@inria.fr \
    --cc=guillaume.yziquel@citycable.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).