You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _site/0-book/unit-2/section-6/0-functor-monad.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,4 +26,5 @@ This unified view reveals an elegant symmetry in how we can obtain our desired m
26
26
- The **Monad** approach (lower path) obtains `g` by using `bind` to transform a Kleisli arrow `f` into a container mapper function `g` / `bind f`
27
27
28
28
Both paths provide us with what we ultimately want - a function `g` that can map between containers. The difference lies in our starting point: we can begin with either a regular function or a Kleisli arrow, and both paths will lead us to the container mapper function we seek.
Copy file name to clipboardExpand all lines: _site/0-book/unit-5/section-3/1-map.md
+20-22Lines changed: 20 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ const numbers = Timeline(5);
22
22
// Pass a function: (x: number) => string
23
23
const labels =numbers.map(x=>`Score: ${x}`);
24
24
25
-
console.log(labels.at(Now)); // "Score: 5"
25
+
console.log(labels.at(Now)); // "Score: 5"share
26
26
27
27
// When the source is updated, labels is automatically updated as well
28
28
numbers.define(Now, 100);
@@ -35,19 +35,7 @@ When you call `map`, a **Dependency** is registered internally between the two `
35
35
36
36
The dependency created by `map` is **Static**. Once you define the relationship `labels = numbers.map(...)`, the rule itself—the transformation of the value—does not change later.
This simple concept of a "static dependency" is the foundation for understanding the "dynamic" dependencies constructed by `bind` and `using`, which will be introduced later.
Copy file name to clipboardExpand all lines: _site/0-book/unit-5/section-3/3-bind.md
+38-16Lines changed: 38 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,19 +121,25 @@ The benefits of this `bind` approach are numerous.
121
121
122
122
As a common approach, trying to define `B` and `C` separately with `.map` and then combining them to create `D` gives rise to the "problematic structure" of a diamond. However, by using `bind`, the dependency graph changes fundamentally.
There are no longer intermediate `timelineB` or `timelineC`, and the diamond structure itself is never formed. Therefore, problems like glitches and multiple updates **cannot structurally occur**. This is a solution on a different level: not fixing a problem after it occurs, but **choosing a superior design where the problem does not arise**.
In this structure, every time `A` is updated, the function passed to `bind` is executed only once, and `D` is calculated only once. This is highly efficient.
135
+
136
+
#### 3. Complete Elimination of Transactional Processing
137
+
138
+
Even more importantly, the **complex
139
+
134
140
#### 2. Execution Efficiency
135
141
136
-
In this structure, every time `A` is updated, the function passed to `bind` is executed only once, and `D` is calculated only once. This is highly efficient.
142
+
In this structure, every time `A` is updated, the function passed to `bind` is executed only once, and `D` is calculated only once. This is highly efficient.
137
143
138
144
#### 3. Complete Elimination of Transactional Processing
Copy file name to clipboardExpand all lines: src/content/docs/en/book/unit-5/section-3/1-map.md
+2-14Lines changed: 2 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ const numbers = Timeline(5);
25
25
// Pass a function: (x: number) => string
26
26
const labels =numbers.map(x=>`Score: ${x}`);
27
27
28
-
console.log(labels.at(Now)); // "Score: 5"
28
+
console.log(labels.at(Now)); // "Score: 5"share
29
29
30
30
// When the source is updated, labels is automatically updated as well
31
31
numbers.define(Now, 100);
@@ -38,19 +38,7 @@ When you call `map`, a **Dependency** is registered internally between the two `
38
38
39
39
The dependency created by `map` is **Static**. Once you define the relationship `labels = numbers.map(...)`, the rule itself—the transformation of the value—does not change later.
This simple concept of a "static dependency" is the foundation for understanding the "dynamic" dependencies constructed by `bind` and `using`, which will be introduced later.
Copy file name to clipboardExpand all lines: src/content/docs/en/book/unit-5/section-3/3-bind.md
+13-7Lines changed: 13 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,19 +123,25 @@ The benefits of this `bind` approach are numerous.
123
123
124
124
As a common approach, trying to define `B` and `C` separately with `.map` and then combining them to create `D` gives rise to the "problematic structure" of a diamond. However, by using `bind`, the dependency graph changes fundamentally.
There are no longer intermediate `timelineB` or `timelineC`, and the diamond structure itself is never formed. Therefore, problems like glitches and multiple updates **cannot structurally occur**. This is a solution on a different level: not fixing a problem after it occurs, but **choosing a superior design where the problem does not arise**.
In this structure, every time `A` is updated, the function passed to `bind` is executed only once, and `D` is calculated only once. This is highly efficient.
137
+
138
+
#### 3. Complete Elimination of Transactional Processing
139
+
140
+
Even more importantly, the **complex
141
+
136
142
#### 2. Execution Efficiency
137
143
138
-
In this structure, every time `A` is updated, the function passed to `bind` is executed only once, and `D` is calculated only once. This is highly efficient.
144
+
In this structure, every time `A` is updated, the function passed to `bind` is executed only once, and `D` is calculated only once. This is highly efficient.
139
145
140
146
#### 3. Complete Elimination of Transactional Processing
0 commit comments