module S08 (
  -- * Exercises 4 and 6
  -- | See <../solutions/s08.pdf>.

  -- * Exercise 3
  range',
  -- * Exercise 5
  splitAt'
  ) where

range' = rng []
  where
    rng acc m n | m > n     = acc
                | otherwise = rng (n:acc) m (n-1)

splitAt' :: Int -> [a] -> ([a], [a])
splitAt' i xs | i <= 0 = ([], xs)
splitAt' i []          = ([], [])
splitAt' i (x:xs)      = (x:ys, zs)
  where (ys, zs) = splitAt' (i-1) xs