generateBindingFromGenerator :: NameGenerator -> (Binding, NameGenerator)
generateBindingFromGenerator g = (h, g')
  where
    taken = g ^. takenNames
    (h, t) =
        case dropWhile (`HS.member` taken) (g ^. simpleNameList) of
            (x:xs) -> (x, xs)
            [] -> error "Simple names is empty, this should be impossible"
    g' = g & simpleNameList .~ t & takenNames %~ HS.insert h
generateBindingFromGenerator :: NameGenerator -> (Binding, NameGenerator)
generateBindingFromGenerator g = (h, g')
  where
    taken = g ^. takenNames
    (h, t) =
        case dropWhile (`HS.member` taken) (g ^. simpleNameList) of
            (x:xs) -> (x, xs)
            [] -> error "Simple names is empty, this should be impossible"
    g' = g & simpleNameList .~ t & takenNames %~ HS.insert h
generateBindingFromGenerator g = (h, g')
  where
    taken = g ^. takenNames
    (h, t) =
        case dropWhile (`HS.member` taken) (g ^. simpleNameList) of
            (x:xs) -> (x, xs)
            [] -> error "Simple names is empty, this should be impossible"
    g' = g & simpleNameList .~ t & takenNames %~ HS.insert h