From 64106c4d3d4ddba8c7bc2af75376e6d3d3d75601 Mon Sep 17 00:00:00 2001 From: Date: Mon, 29 Jun 2015 20:16:15 +0000 Subject: Update documentation --- carboxyl/lift/fn.lift0.html | 102 ++++++++++++++++++++++++ carboxyl/lift/fn.lift1.html | 102 ++++++++++++++++++++++++ carboxyl/lift/fn.lift2.html | 102 ++++++++++++++++++++++++ carboxyl/lift/fn.lift3.html | 102 ++++++++++++++++++++++++ carboxyl/lift/fn.lift4.html | 102 ++++++++++++++++++++++++ carboxyl/lift/index.html | 173 +++++++++++++++++++++++++++++++++++++++++ carboxyl/lift/sidebar-items.js | 1 + 7 files changed, 684 insertions(+) create mode 100644 carboxyl/lift/fn.lift0.html create mode 100644 carboxyl/lift/fn.lift1.html create mode 100644 carboxyl/lift/fn.lift2.html create mode 100644 carboxyl/lift/fn.lift3.html create mode 100644 carboxyl/lift/fn.lift4.html create mode 100644 carboxyl/lift/index.html create mode 100644 carboxyl/lift/sidebar-items.js (limited to 'carboxyl/lift') diff --git a/carboxyl/lift/fn.lift0.html b/carboxyl/lift/fn.lift0.html new file mode 100644 index 0000000..f7fd88e --- /dev/null +++ b/carboxyl/lift/fn.lift0.html @@ -0,0 +1,102 @@ + + + + + + + + + + carboxyl::lift::lift0 - Rust + + + + + + + + + + + + + + + +
+

Function carboxyl::lift::lift0 + + [] + + [src]

+
pub fn lift0<A, F>(f: F) -> Signal<A> where F: Fn() -> A + Send + Sync + 'static

Lift a 0-ary function.

+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/carboxyl/lift/fn.lift1.html b/carboxyl/lift/fn.lift1.html new file mode 100644 index 0000000..5f7204d --- /dev/null +++ b/carboxyl/lift/fn.lift1.html @@ -0,0 +1,102 @@ + + + + + + + + + + carboxyl::lift::lift1 - Rust + + + + + + + + + + + + + + + +
+

Function carboxyl::lift::lift1 + + [] + + [src]

+
pub fn lift1<A, B, F>(f: F, sa: &Signal<A>) -> Signal<B> where A: Send + Sync + Clone + 'static, B: Send + Sync + Clone + 'static, F: Fn(A) -> B + Send + Sync + 'static

Lift a unary function.

+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/carboxyl/lift/fn.lift2.html b/carboxyl/lift/fn.lift2.html new file mode 100644 index 0000000..8fbae6d --- /dev/null +++ b/carboxyl/lift/fn.lift2.html @@ -0,0 +1,102 @@ + + + + + + + + + + carboxyl::lift::lift2 - Rust + + + + + + + + + + + + + + + +
+

Function carboxyl::lift::lift2 + + [] + + [src]

+
pub fn lift2<A, B, C, F>(f: F, sa: &Signal<A>, sb: &Signal<B>) -> Signal<C> where A: Send + Sync + Clone + 'static, B: Send + Sync + Clone + 'static, C: Send + Sync + Clone + 'static, F: Fn(A, B) -> C + Send + Sync + 'static

Lift a binary function.

+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/carboxyl/lift/fn.lift3.html b/carboxyl/lift/fn.lift3.html new file mode 100644 index 0000000..2501d07 --- /dev/null +++ b/carboxyl/lift/fn.lift3.html @@ -0,0 +1,102 @@ + + + + + + + + + + carboxyl::lift::lift3 - Rust + + + + + + + + + + + + + + + +
+

Function carboxyl::lift::lift3 + + [] + + [src]

+
pub fn lift3<F, A, B, C, Ret>(f: F, ca: &Signal<A>, cb: &Signal<B>, cc: &Signal<C>) -> Signal<Ret> where F: Fn(A, B, C) -> Ret + Send + Sync + 'static, A: Send + Sync + Clone + 'static, B: Send + Sync + Clone + 'static, C: Send + Sync + Clone + 'static, Ret: Send + Sync + Clone + 'static

Lift a ternary function.

+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/carboxyl/lift/fn.lift4.html b/carboxyl/lift/fn.lift4.html new file mode 100644 index 0000000..ca930a1 --- /dev/null +++ b/carboxyl/lift/fn.lift4.html @@ -0,0 +1,102 @@ + + + + + + + + + + carboxyl::lift::lift4 - Rust + + + + + + + + + + + + + + + +
+

Function carboxyl::lift::lift4 + + [] + + [src]

+
pub fn lift4<F, A, B, C, D, Ret>(f: F, ca: &Signal<A>, cb: &Signal<B>, cc: &Signal<C>, cd: &Signal<D>) -> Signal<Ret> where F: Fn(A, B, C, D) -> Ret + Send + Sync + 'static, A: Send + Sync + Clone + 'static, B: Send + Sync + Clone + 'static, C: Send + Sync + Clone + 'static, D: Send + Sync + Clone + 'static, Ret: Send + Sync + Clone + 'static

Lift a quarternary function.

+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/carboxyl/lift/index.html b/carboxyl/lift/index.html new file mode 100644 index 0000000..57f4038 --- /dev/null +++ b/carboxyl/lift/index.html @@ -0,0 +1,173 @@ + + + + + + + + + + carboxyl::lift - Rust + + + + + + + + + + + + + + + +
+

Module carboxyl::lift + + [] + + [src]

+

Lifting of n-ary functions.

+ +

A lift maps a function on values to a function on signals. Given a function of +type F: Fn(A, B, …) -> R and signals of types Signal<A>, Signal<B>, … the +lift! macro creates a Signal<R>, whose content is computed using the +function.

+ +

Currently lift is only implemented for functions with up to four arguments. +This limitation is due to the current implementation strategy (and maybe +limitations of Rust's type system), but it can be increased to arbitrary but +finite arity if required.

+ +

Example

+let sink_a = Sink::new();
+let sink_b = Sink::new();
+let product = lift!(
+    |a, b| a * b,
+    &sink_a.stream().hold(0),
+    &sink_b.stream().hold(0)
+);
+assert_eq!(product.sample(), 0);
+sink_a.send(3);
+sink_b.send(5);
+assert_eq!(product.sample(), 15);
+
+

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + +
lift0 +

Lift a 0-ary function.

+ +
lift1 +

Lift a unary function.

+ +
lift2 +

Lift a binary function.

+ +
lift3 +

Lift a ternary function.

+ +
lift4 +

Lift a quarternary function.

+ +
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/carboxyl/lift/sidebar-items.js b/carboxyl/lift/sidebar-items.js new file mode 100644 index 0000000..2b8d168 --- /dev/null +++ b/carboxyl/lift/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"fn":[["lift0","Lift a 0-ary function."],["lift1","Lift a unary function."],["lift2","Lift a binary function."],["lift3","Lift a ternary function."],["lift4","Lift a quarternary function."]]}); \ No newline at end of file -- cgit v1.2.3