Mixing Lens operations with "original" operations
I wouldn't say there's anything like a proscription against doing so, but as a non-user of lens I can't say it helps me understand what's going on. I'm also not sure that your data structure is complex enough to warrant using lens in this case, functions out of base tend to produce a pretty concise solution on their own when properly deployed.

I haven't tested this, but I think it's equivalent.

import Control.Monad.State
import Data.Map
import Safe (atMay) -- "safe".Safe.atMay :: [a] -&gt; Int -&gt; Maybe a

getUniqueIdent :: String -&gt; State (Map String Int) (Maybe String)
getUniqueIdent typeName =
  do indices &lt;- get
     modify $ adjust succ typeName
     return $ do identifiers &lt;- Data.Map.lookup typeName typeNameMap
                 uniqueIndex &lt;- Data.Map.lookup typeName indices
                 identifiers `atMay` uniqueIndex