everyNth n xs = everyNth' 1 n xs
  where
    everyNth' :: Int -> Int -> [a] -> [a]
    everyNth' _ _ [] = []
    everyNth' cur n (x:xs)
      | cur == n  = x : everyNth' 1 n xs
      | otherwise = everyNth' (cur+1) n xs
everyNth n xs = everyNth' 1 n xs
  where
    everyNth' :: Int -> Int -> [a] -> [a]
    everyNth' _ _ [] = []
    everyNth' cur n (x:xs)
      | cur == n  = x : everyNth' 1 n xs
      | otherwise = everyNth' (cur+1) n xs
everyNth n xs = everyNth' 1 n xs
  where
    everyNth' :: Int -> Int -> [a] -> [a]
    everyNth' _ _ [] = []
    everyNth' cur n (x:xs)
      | cur == n  = x : everyNth' 1 n xs
      | otherwise = everyNth' (cur+1) n xs