module QSum( qsum ) where

{- | 
   Module       :       QSum
   Description  :       Computating digit sum
   Copyright    :       (c) Thomas Lang
   License      :       BSD3

   Stability    :       stable
   Portability  :       portable

This module contains the function 'qsum'.
This function will take an Integer and 
calculates it's digit sum.
 -}
qsum :: Integer -> Integer
qsum n | n < 10    = n
       | otherwise = (n `mod` 10) + (qsum $ n `div` 10)
