elementAt :: [a] -> Int -> a
elementAt xs k
    | n < k     = undefined
    | otherwise = xs !! (k-1)
    where n = length xs

-- Problem 4
-- Find the number of elements of a list. 
elementAt :: [a] -> Int -> a
elementAt xs k
    | n < k     = undefined
    | otherwise = xs !! (k-1)
    where n = length xs

-- Problem 4
-- Find the number of elements of a list. 
elementAt xs k
    | n < k     = undefined
    | otherwise = xs !! (k-1)
    where n = length xs

-- Problem 4
-- Find the number of elements of a list. 