hlGetLoop :: (Int -> IO (String, Int)) -> Int -> IO String
hlGetLoop f n
 | n <= 0    = return ""
 | otherwise = do (str, len) <- f n
                  rest <- hlGetLoop f (n - len)
                  return (str ++ rest)

-- XXX This is now rather misnamed:
hlGetLoop :: (Int -> IO (String, Int)) -> Int -> IO String
hlGetLoop f n
 | n <= 0    = return ""
 | otherwise = do (str, len) <- f n
                  rest <- hlGetLoop f (n - len)
                  return (str ++ rest)

-- XXX This is now rather misnamed:
hlGetLoop f n
 | n <= 0    = return ""
 | otherwise = do (str, len) <- f n
                  rest <- hlGetLoop f (n - len)
                  return (str ++ rest)

-- XXX This is now rather misnamed: