firstAvailableID :: Clients -> Int
firstAvailableID = f 1 . sort . IM.keys . byUid
  where
    f n (x:xs)
        | n == x    = f (succ n) xs
        | otherwise = n
    f n _ = n
firstAvailableID :: Clients -> Int
firstAvailableID = f 1 . sort . IM.keys . byUid
  where
    f n (x:xs)
        | n == x    = f (succ n) xs
        | otherwise = n
    f n _ = n
firstAvailableID = f 1 . sort . IM.keys . byUid
  where
    f n (x:xs)
        | n == x    = f (succ n) xs
        | otherwise = n
    f n _ = n