square :: Int -> Int square x = x * x sumUpList :: (Num a) => [a] -> a sumUpList [] = 0 sumUpList (x:xs) = x + sumUpList xs isPrime :: Integer -> Bool isPrime k = null [ x | x <- [2..k `div` 2], k `mod` x == 0] isOdd :: Int -> Int isOdd x = x `mod` 2 powerOf :: Int -> Int -> Int powerOf x y = x^y interesting :: (Ord a) => [a] -> [a] interesting [] = [] interesting (x:xs) = (interesting l) ++ [x] ++ (interesting g) where l = filter (< x) xs g = filter (>= x) xs