-- | Length check, enabled when `debug` = `True`.
-- 
--   Check that the second integer is greater or equal to `0' and less or equal
--   than the first integer. If the not then `error` with the `String`.
--
checkLen :: String -> Int -> Int -> a -> a
checkLen loc n i v 
  | debug      
  = if i >= 0 && i <= n 
        then v 
        else errorOfBounds loc n i

  | otherwise  = v
checkLen :: String -> Int -> Int -> a -> a
checkLen loc n i v 
  | debug      
  = if i >= 0 && i <= n 
        then v 
        else errorOfBounds loc n i

  | otherwise  = v
checkLen loc n i v 
  | debug      
  = if i >= 0 && i <= n 
        then v 
        else errorOfBounds loc n i

  | otherwise  = v