diff --git a/exampleCode/lecture8/sort.hs b/exampleCode/lecture8/sort.hs
new file mode 100644
index 0000000000000000000000000000000000000000..b8056d3287f1a5a4f42898b088c4ff8db8fa0af4
--- /dev/null
+++ b/exampleCode/lecture8/sort.hs
@@ -0,0 +1,32 @@
+module Main where
+
+import Data.List
+import Test.QuickCheck
+
+-- Sorting twice changes nothing
+prop_idempotency :: Ord a => [a] -> Bool
+prop_idempotency xs = qsort xs == qsort (qsort xs)
+
+-- Sorting doesn't change the length
+prop_len :: Ord a => [a] -> Bool
+prop_len xs = length xs == length (qsort xs)
+
+-- Sorted result is a permutation of input
+prop_perm :: Ord a => [a] -> Bool
+prop_perm xs = (qsort xs) `elem` (permutations xs)
+
+-- Sorting produces sorted list
+prop_sort :: Ord a => [a] -> Bool
+prop_sort = isSorted . qsort
+  where
+    isSorted :: Ord a => [a] -> Bool
+    isSorted []       = True
+    isSorted [x]      = True
+    isSorted (x:y:zs) = (x <= y) && isSorted (y:zs)
+
+qsort :: Ord a => [a] -> [a]
+qsort []     = []
+qsort (p:xs) = (qsort lesser) ++ p:(qsort greater)
+  where
+    lesser  = filter (< p) xs
+    greater = filter (>= p) xs
diff --git a/lecture7.pdf b/lecture7.pdf
index 9c9b17b17c43a20e05c170448699fd3ab7eb5e78..33526ab133b6ae8420cd342d03ed5a361e91d13c 100644
Binary files a/lecture7.pdf and b/lecture7.pdf differ