newId :: (Int -> b) -> Getting Int (GNG a) Int -> StGNG a b
newId c serial = do
    d <- State.gets $ c . (^.serial)
    State.modify (&nodeSerial %~ inc)
    return d
  where
    inc :: Int -> Int
    inc = fromIntegral . (1+) . (fromIntegral::Int -> Integer)
newId :: (Int -> b) -> Getting Int (GNG a) Int -> StGNG a b
newId c serial = do
    d <- State.gets $ c . (^.serial)
    State.modify (&nodeSerial %~ inc)
    return d
  where
    inc :: Int -> Int
    inc = fromIntegral . (1+) . (fromIntegral::Int -> Integer)
newId c serial = do
    d <- State.gets $ c . (^.serial)
    State.modify (&nodeSerial %~ inc)
    return d
  where
    inc :: Int -> Int
    inc = fromIntegral . (1+) . (fromIntegral::Int -> Integer)