Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Functional Reactive Programming implementation for Rust
Rust
branch: master

Update README.md

Add link to rust website
latest commit a905559f7b
@14427 authored
Failed to load latest commit information.
README.md
signal.rs
time.rs Remove stream, fix time

README.md

signal

Functional Reactive Programming implementation for Rust

Currently a WIP

Inspired by Elm

Examples

Hello World:

let hello = constant(~"Hello world");
hello.lift(|msg| io::println(msg) );

Clock:

let clock = &every(1000); // Send a signal every 1000 milliseconds

let counter = count(clock);

counter.lift(|n| io::println("Have received %d ticks", n));

Concurrency:

let (a, b, c, d) = ( constant(10), constant(20), constant(30), constant(40) );

let s1 = a.lift(|x| x*2);
let s2 = b.lift(|x| x*2);
let s3 = lift2(&c, &d, |a, b| a+b);

lift3(&s1, &s2, &s3, |x, y, z| io::println(fmt!("%d + %d + %d = %d", x, y, z, x+y+z)));
Something went wrong with that request. Please try again.