-- ===================================
-- Ex. 2
-- ===================================

doubleSecond :: [Integer] -> [Integer]
doubleSecond xs = ds xs 0
    where
        ds :: [Integer] -> Integer -> [Integer]
        ds [] n     = []
        ds (y:ys) n   
            | odd  n    = (y*2) : (ds ys (n+1))  
            | otherwise = y : (ds ys (n+1)) 


-- ===================================
-- Ex. 3
-- ===================================
doubleSecond :: [Integer] -> [Integer]
doubleSecond xs = ds xs 0
    where
        ds :: [Integer] -> Integer -> [Integer]
        ds [] n     = []
        ds (y:ys) n   
            | odd  n    = (y*2) : (ds ys (n+1))  
            | otherwise = y : (ds ys (n+1)) 


-- ===================================
-- Ex. 3
-- ===================================
doubleSecond xs = ds xs 0
    where
        ds :: [Integer] -> Integer -> [Integer]
        ds [] n     = []
        ds (y:ys) n   
            | odd  n    = (y*2) : (ds ys (n+1))  
            | otherwise = y : (ds ys (n+1)) 


-- ===================================
-- Ex. 3
-- ===================================