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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 5D75BBC37 for ; Thu, 10 Dec 2009 09:24:38 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhwBAHg+IEvRVdvkkGdsb2JhbACEJZcAPwEBAQEJCQwHEwOpCIFZhUaIaQECAwWBKoIqUwSCfRuIDw X-IronPort-AV: E=Sophos;i="4.47,374,1257116400"; d="scan'208";a="38338419" Received: from mail-ew0-f228.google.com ([209.85.219.228]) by mail2-smtp-roc.national.inria.fr with ESMTP; 10 Dec 2009 09:24:38 +0100 Received: by ewy28 with SMTP id 28so980852ewy.17 for ; Thu, 10 Dec 2009 00:24:38 -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; bh=Y68cp089H4PXlvuJDz0s/cvGZuu7lN38y3CcvKRZmXg=; b=NRFpgjlXx9ky4KUq89F2tctYpoTyxl+0Tzpj/iP+zkuMK3LYqvJZPHUEr/T29KQyCh AUB/HCAs7JzW/vrL2gN6pWBML64eivbJLuxPUjDdk0DlMFKK/ktkHgEHUInpD+tdeyDO PQj+l882gw3T1mziB9xe1G/eX40ELcMCl62zA= 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; b=J6l+N8fJ10QwKbjKipUqjBnXfmNjuHT5C1meiDNJTd3INq+C4QKCnjDbrz4Rk/a6UC ZjBFG6u2SLc0SG9SDHvsACmfp/RdLW+39D2ypH3opNWlqnfc6nCrqACtrith95M02Dph W4BxkEn60f4yk4RfdCpVjaI/Z8JRONfnetJ5M= MIME-Version: 1.0 Sender: daniel.c.buenzli@gmail.com Received: by 10.213.0.139 with SMTP id 11mr3997810ebb.86.1260433477906; Thu, 10 Dec 2009 00:24:37 -0800 (PST) In-Reply-To: <4B1FEB40.5050801@citycable.ch> References: <4B1F0E3A.3040907@citycable.ch> <91a3da520912082353m5c75f307j6f9542877d84841f@mail.gmail.com> <4B1FEB40.5050801@citycable.ch> Date: Thu, 10 Dec 2009 16:24:37 +0800 X-Google-Sender-Auth: 7e7455a735faac5d Message-ID: <91a3da520912100024x5273462bs960efaebd6dff1@mail.gmail.com> Subject: Re: Recursion on React.events. From: =?UTF-8?Q?Daniel_B=C3=BCnzli?= To: guillaume.yziquel@citycable.ch Cc: OCaml List Content-Type: text/plain; charset=UTF-8 X-Spam: no; 0.00; recursion:01 buenzli:01 semantics:01 val:01 recursive:01 typing:01 delayed:01 define:02 define:02 snip:02 usefull:02 confusing:02 confusing:02 element:03 daniel:04 > Maybe I was looking in the wrong place, but I haven't found "the second case > of the semantics of E.switch" on your website. In fact, the way I learned > about React.E.switch was from the .mli-style webpage on your website, and by > trial and error. Here : http://erratique.ch/software/react/doc/React.E.html#VALswitch Second bullet. > One thing that really troubles me, is that I do not understand why define > returns a couple of two identical element. And the typing of E.fix is rather > confusing: > >> val fix : ('a React.event -> 'a React.event * 'b) -> 'b Yes it's confusing. It's here to allow to define mutually recursive definitions and still expose them to the outside world. It is also usefull if you have other values that depend on the delayed value and you want to expose them to the outside world. There are example of this in the breakout.ml example. [snip] I tried to rexeplain E.fix and S.fix but I came up with what's written in their documentation sorry. Daniel