{-  Exploring Languages with Interpreters and Functional Programming
    Copyright (C) 2018, H. Conrad Cunningham

1234567890123456789012345678901234567890123456789012345678901234567890

    2018-05-29: Recreated from book Chapter 2

    ghci Counting
    main

-}

module Counting
    (counter, main)
where
    counter :: Int -> Int -> String 
    counter count maxc
        | count <= maxc = show count ++ "\n"
                          ++ counter (count+1) maxc 
        | otherwise     = ""

    main = do
        putStr (counter 0 10)
