Skip to content

Commit 9c641e2

Browse files
committed
Lesson 11 rename
1 parent 2abd1bc commit 9c641e2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

examples/lazy-box.js renamed to examples/11-lazy-box.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
// leaving old Box for comparison
2-
const Box = x => (
3-
{
2+
const Box = x => ({
43
map: f => Box(f(x)),
54
fold: f => f(x),
6-
inspect: () => `Box(${x})`
7-
}
8-
)
5+
inspect: _ => `Box(${x})`,
6+
})
97

10-
// wraps a function without executing its call
8+
// wraps a function returning value without executing its call
119
const LazyBox = g => ({
1210

1311
// compose with f from outside
14-
map: f => LazyBox( () => f(g()) ),
12+
map: f => LazyBox( _ => f(g()) ),
1513

1614
// compose and evaluate
1715
fold: f => f(g())

0 commit comments

Comments
 (0)