module Exercise_5 where import Data.List (partition) {- G2 -} iter :: Int -> (a -> a) -> a -> a iter n f x = undefined pow :: Int -> Int -> Int pow n k = undefined drop' :: Int -> [a] -> [a] drop' k xs = undefined replicate' :: Int -> a -> [a] replicate' n x = undefined {- G3 -} partition_rec :: (a -> Bool) -> [a] -> ([a], [a]) partition_rec f xs = undefined partition_filter :: (a -> Bool) -> [a] -> ([a], [a]) partition_filter f xs = undefined prop_partition_rec = undefined prop_partition_filter = undefined {- H1 -} {- Wettbewerbsaufgabe von Blatt 4 -} type DistanceTable = [(String, Integer, String)] table :: DistanceTable table = [("Cape Town", 1660, "Durban"), ("Cape Town", 1042, "East London"), ("Cape Town", 1402, "Johannesburg"), ("Durban", 667, "East London"), ("Durban", 598, "Johannesburg"), ("East London", 992, "Johannesburg")] {-WETT-} isDistanceTableSane :: DistanceTable -> Bool isDistanceTableSane tab = undefined {-TTEW-} {- H2 -} fixpoint :: (a -> a -> Bool) -> (a -> a) -> a -> a fixpoint eq f x = undefined {- H3 -} comp :: Eq b => [(a, b)] -> [(b, c)] -> [(a, c)] comp r1 r2 = undefined trancl :: Ord a => [(a, a)] -> [(a, a)] trancl r = undefined trancl' :: Ord a => [(a, a)] -> [(a, a)] trancl' r = undefined {- H4 -} mapIndex :: (Integer -> a -> b) -> [a] -> [b] mapIndex f xs = undefined