genFunctions :: Int -> IO String
genFunctions n = genFuncs' [1..n] "empty"
    where
        genFuncs' [] prev = return prev
        genFuncs' xs prev = let x = 2 * (head xs)
                                n = "a" ++ (show x)
                            in do
                                putStrLn $ mkFunction prev n x
                                genFuncs' (tail xs) n
genFunctions :: Int -> IO String
genFunctions n = genFuncs' [1..n] "empty"
    where
        genFuncs' [] prev = return prev
        genFuncs' xs prev = let x = 2 * (head xs)
                                n = "a" ++ (show x)
                            in do
                                putStrLn $ mkFunction prev n x
                                genFuncs' (tail xs) n
genFunctions n = genFuncs' [1..n] "empty"
    where
        genFuncs' [] prev = return prev
        genFuncs' xs prev = let x = 2 * (head xs)
                                n = "a" ++ (show x)
                            in do
                                putStrLn $ mkFunction prev n x
                                genFuncs' (tail xs) n