{-  Exploring Languages with Interprters and Functional Programming
    Chapter 9 -- Recursion Styles Haskell Examples -- Smoke Test
    Copyright (C) 2018, H. Conrad Cunningham

1234567890123456789012345678901234567890123456789012345678901234567890

2016-07-27: Separated test driver from module?
2017-08-25: Revised for for 2017 textbook Chapter 3
2018-06-07: Revised for 2018 textbook Chapter 9
2018-07-04: Removed fact4/fact6 testing; see ../Ch04/TestFactorial.hs;
            Added testing of f and g
            Added copyright notice

-}

module TestRecursionStyles
where

import RecursionStyles
-- import Expt4

-- Data for testing of exponentiation functions
bases  = [2,3,6]
powers = [0,1,2,3,4,5,6,7,8,9,10,20]

-- Testing of expt
result_expt = [ expt b n | b <- bases, n <- powers ]

-- Testing of expt2
result_expt2 = [ expt2 b n | b <- bases, n <- powers ]

-- Testing of expt3
result_expt3 = [ expt3 b n | b <- bases, n <- powers ]

-- Testing of expt4
-- result_expt4'  = [ expt4  b n | b <- bases, n <- powers ]

main =
    do
        putStrLn ("fib  10      = " ++ show (fib   10))
        putStrLn ("fib2 10      = " ++ show (fib2  10))
        putStrLn ("result_expt  = " ++ show result_expt)
        putStrLn ("result_expt2 = " ++ show result_expt2)
        putStrLn ("result_expt3 = " ++ show result_expt3)
--      putStrLn ("result_expt4 = " ++ show result_expt4)
        putStrLn ("f [1..10]    = " ++ show (f [1..10]))
        putStrLn ("g 0          = " ++ show (g 0))
        putStrLn ("g 1          = " ++ show (g 1))
        putStrLn ("g 1          = " ++ show (g 2))
        putStrLn ("g 3          = " ++ show (g 3))
        putStrLn ("g 4          = " ++ show (g 4))
        putStrLn ("g 5          = " ++ show (g 5))




