+import Data.List
+
+-- | 'the' ensures that all the elements of the list are identical
+-- and then returns that unique element
+the :: Eq a => [a] -> a
+the (x:xs)
+ | all (x ==) xs = x
+ | otherwise = error "GHC.Exts.the: non-identical elements"
+the [] = error "GHC.Exts.the: empty list"
+
+-- | The 'sortWith' function sorts a list of elements using the
+-- user supplied function to project something out of each element
+sortWith :: Ord b => (a -> b) -> [a] -> [a]
+sortWith f = sortBy (\x y -> compare (f x) (f y))