Skip to content

Commit a9c6958

Browse files
committed
Initial exercises
0 parents  commit a9c6958

4 files changed

+32
-0
lines changed

FunWithFunctions.hs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
waxOn = x * 5
2+
where
3+
z = 7
4+
y = z + 8
5+
x = y ^ 2
6+
7+
triple x = x * 3
8+
9+
waxOff x = triple x

FunctionWithLet.hs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module FunctionWithLet where
2+
3+
printInc2 n = let plusTwo = n + 2
4+
in print plusTwo

FunctionWithWhere.hs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module FunctionWithWhere where
2+
3+
printInc n = print plusTwo
4+
where plusTwo = n + 2

WherePractice.hs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ex1 = x * 3 + y
2+
where
3+
x = 3
4+
y = 1000
5+
6+
ex2 = x * 5
7+
where
8+
y = 10
9+
x = 10 * 5 + y
10+
11+
ex3 = z / x + y
12+
where
13+
x = 7
14+
y = negate x
15+
z = y * 10

0 commit comments

Comments
 (0)