newid :: Int -> State IdxSet Idx
newid i = do
    curMax <- get
    modify (\max -> (nid i [] max))
    return (curMax !! i)

-- |Returns the id in the map list if it exists. if it does not, creates a new one 
-- |adds it to the map
newid :: Int -> State IdxSet Idx
newid i = do
    curMax <- get
    modify (\max -> (nid i [] max))
    return (curMax !! i)

-- |Returns the id in the map list if it exists. if it does not, creates a new one 
-- |adds it to the map
newid i = do
    curMax <- get
    modify (\max -> (nid i [] max))
    return (curMax !! i)

-- |Returns the id in the map list if it exists. if it does not, creates a new one 
-- |adds it to the map