Skip to content

Commit bdffa67

Browse files
committed
Cleanup
1 parent 4a6c776 commit bdffa67

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

src/main/worksheets/f_Functions/a_different_shapes_1_def.sc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,3 @@ def multipleSum(multiple: Int, x: Int, y: Int) = {
2424
}
2525

2626
multipleSum(3, 2, 2)
27-
28-
FunctionWrapper.square _ andThen double

src/main/worksheets/f_Functions/currying_1_intro.sc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,19 @@
22

33
def sum(x: Int, y: Int) = x + y
44
def sumCurried(x: Int)(y: Int) = x + y
5+
6+
7+
def acceptString(s: String, pred: String => Boolean): Boolean = pred(s)
8+
9+
acceptString("Hello World", seq => seq.length > 1)
10+
acceptString("Hello World", seq => seq.length < 100)
11+
12+
def acceptStringCurried(s: String)(pred: String => Boolean): Boolean = pred(s)
13+
14+
acceptStringCurried("Hello World") {
15+
seq => seq.length > 1
16+
}
17+
18+
acceptStringCurried("Hello World") {
19+
seq => seq.length < 100
20+
}

0 commit comments

Comments
 (0)