fetchRepos :: MonadHttp m
  => Text              -- ^ Github organization name
  -> m [Repository]
fetchRepos orgName = do
  numberOfRepos <- fetchNumberOfRepos orgName
  let pages = countPages numberOfRepos
  repos <- forM [1..pages] (fetchReposByPage orgName)
  return $ concat repos
  where
    countPages numberOfRepos =
      ceiling $ toFloat numberOfRepos / toFloat perPage
    toFloat = fromIntegral :: (Natural -> Float)
fetchRepos :: MonadHttp m
  => Text              -- ^ Github organization name
  -> m [Repository]
fetchRepos orgName = do
  numberOfRepos <- fetchNumberOfRepos orgName
  let pages = countPages numberOfRepos
  repos <- forM [1..pages] (fetchReposByPage orgName)
  return $ concat repos
  where
    countPages numberOfRepos =
      ceiling $ toFloat numberOfRepos / toFloat perPage
    toFloat = fromIntegral :: (Natural -> Float)
fetchRepos orgName = do
  numberOfRepos <- fetchNumberOfRepos orgName
  let pages = countPages numberOfRepos
  repos <- forM [1..pages] (fetchReposByPage orgName)
  return $ concat repos
  where
    countPages numberOfRepos =
      ceiling $ toFloat numberOfRepos / toFloat perPage
    toFloat = fromIntegral :: (Natural -> Float)