Browse Source

Improve code prettiness

Julian Ospald 4 years ago
parent
commit
29df3d710a
No account linked to committer's email address
3 changed files with 7 additions and 7 deletions
  1. 1
    1
      VL2/content/VL2_filter2.tex
  2. 3
    3
      VL2/content/VL2_fold1.tex
  3. 3
    3
      VL2/content/VL2_map2.tex

+ 1
- 1
VL2/content/VL2_filter2.tex View File

@@ -6,7 +6,7 @@ filter :: (a -> Bool) -> [a] -> [a]
6 6
 \pause
7 7
 \begin{haskellcode}
8 8
 filter :: (a -> Bool) -> [a] -> [a]
9
-filter f [] = []
9
+filter f []   = []
10 10
 filter f (x:xs)
11 11
   | f x       = x : filter f xs
12 12
   | otherwise = filter f xs

+ 3
- 3
VL2/content/VL2_fold1.tex View File

@@ -6,20 +6,20 @@ sum :: [Int] -> Int
6 6
 \pause
7 7
 \begin{haskellcode}
8 8
 sum :: [Int] -> Int
9
-sum [] = 0
9
+sum []     = 0
10 10
 sum (x:xs) = x + sum xs
11 11
 \end{haskellcode}
12 12
 \pause
13 13
 \ifger{Oder das Produkt:}{Or the product:}
14 14
 \begin{haskellcode}
15 15
 prod :: [Int] -> Int
16
-prod [] = 1
16
+prod []     = 1
17 17
 prod (x:xs) = x * prod xs
18 18
 \end{haskellcode}
19 19
 \pause
20 20
 \ifger{Oder die Länge:}{Or the length:}
21 21
 \begin{haskellcode}
22 22
 length :: [a] -> Int
23
-length [] = 0
23
+length []     = 0
24 24
 length (x:xs) = 1 + length xs
25 25
 \end{haskellcode}

+ 3
- 3
VL2/content/VL2_map2.tex View File

@@ -1,7 +1,7 @@
1 1
 \ifger{Lösung:}{Solution:}
2 2
 \begin{haskellcode}
3 3
 addTwo :: [Int] -> [Int]
4
-addTwo [] = []
4
+addTwo []     = []
5 5
 addTwo (x:xs) = (x + 2) : addTwo xs
6 6
 \end{haskellcode}
7 7
 \pause
@@ -9,14 +9,14 @@ addTwo (x:xs) = (x + 2) : addTwo xs
9 9
 \pause
10 10
 \begin{haskellcode}
11 11
 square :: [Int] -> [Int]
12
-square [] = []
12
+square []     = []
13 13
 square (x:xs) = (x * x) : square xs
14 14
 \end{haskellcode}
15 15
 \pause
16 16
 \ifger{Jetzt wollen wir den Betrag jedes Elements:}{Now we want the absolute of every element:}
17 17
 \begin{haskellcode}
18 18
 absList :: [Int] -> [Int]
19
-absList [] = []
19
+absList []     = []
20 20
 absList (x:xs) = (abs x) : absList xs
21 21
 \end{haskellcode}
22 22
 \pause