Version française
Home     About     Download     Resources     Contact us    
Browse thread
[ANN] concurrent cell supports FRP(beta)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Satoshi Ogasawara <ogasawara@i...>
Subject: [ANN] concurrent cell supports FRP(beta)
Hi list,

New beta release of concurrent cell supports thread safe FRP(Functional 
Reactive Programming).

 concurrent cell versoin 3.0 beta
https://forge.ocamlcore.org/frs/?group_id=42&release_id=227

There are two new modules Frp.TimeVaryReact and Frp.TimeVaryEvent 
consists of a type and functions as follows:

  module rec TimeVaryReact : sig
    type 'a t
    val make : ?src:'a Mbox.t -> 'a -> 'a t * ('a -> unit)
    val return : 'a -> 'a t
    val read : 'a t -> 'a
    val map : ('a -> 'b) -> 'a t -> 'b t
    val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t
    val app : ('a -> 'b) t -> 'a t -> 'b t
    val join : 'a t t -> 'a t
    val switch : 'a t -> 'a t TimeVaryEvent.t -> 'a t
    val bind : 'a t -> ('a -> 'b t) -> 'b t
    val accum : 'a -> ('a -> 'a) TimeVaryEvent.t -> 'a t
    val fold : ('a -> 'b -> 'a) -> 'a -> 'b TimeVaryEvent.t -> 'a t
    val changes : ?eq:('a -> 'a -> bool) -> 'a t -> 'a TimeVaryEvent.t
    val history : int -> 'a t -> 'a list t
  end
  and TimeVaryEvent : sig
    type 'a t
    val make : ?src:'a Mbox.t -> unit -> 'a t * ('a -> unit)
    val map : ('a -> 'b) -> 'a t -> 'b t
    val listen : ('a -> unit) -> 'a t -> unit
    val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t
    val merge : 'a t -> 'a t -> 'a t
    val filter : ('a -> bool) -> 'a t -> 'a t
    val fmap : ('a -> 'b option) -> 'a t -> 'b t
    val join : 'a t t -> 'a t
    val accum : 'a -> ('a -> 'a) t -> 'a t
    val fold : ('a -> 'b -> 'a) -> 'a  -> 'b t -> 'a t
    val select : 'a t list -> 'a t
    val switch : 'a t -> 'a t t -> 'a t
    val history : int -> 'a t -> 'a list t
    val with_prev : 'a t -> ('a * 'a) t
    val changes : ?eq:('a -> 'a -> bool) -> 'a t -> 'a t
  end

This implementation based on this paper. (thanks to Conal Elliott) 
http://conal.net/papers/simply-reactive/

I intend to release version 3.0.0 after checking memory leaks, speed and 
bugs.

Regards
  ogasawara