Skip to content
/ signal Public

Functional Reactive Programming implementation for Rust

Notifications You must be signed in to change notification settings

14427/signal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

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)));

About

Functional Reactive Programming implementation for Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages