allocDomainID :: ModelTranslation L2.L2DomainID
allocDomainID = do
  newID <- L2.l2NextDomain <$> getL2Model
  modifyL2Model $ \mod -> mod { L2.l2NextDomain = (\(L2.L2DomainID n) -> L2.L2DomainID (n + 1)) newID }
  return newID

-- | Finds a symbol, using the scoped resolution rules and a custom function to
--   check each namespace for a symbol of the appropriate type. Fails with an error
--   appropriate for the end user if the symbol cannot be found.
allocDomainID :: ModelTranslation L2.L2DomainID
allocDomainID = do
  newID <- L2.l2NextDomain <$> getL2Model
  modifyL2Model $ \mod -> mod { L2.l2NextDomain = (\(L2.L2DomainID n) -> L2.L2DomainID (n + 1)) newID }
  return newID

-- | Finds a symbol, using the scoped resolution rules and a custom function to
--   check each namespace for a symbol of the appropriate type. Fails with an error
--   appropriate for the end user if the symbol cannot be found.
allocDomainID = do
  newID <- L2.l2NextDomain <$> getL2Model
  modifyL2Model $ \mod -> mod { L2.l2NextDomain = (\(L2.L2DomainID n) -> L2.L2DomainID (n + 1)) newID }
  return newID

-- | Finds a symbol, using the scoped resolution rules and a custom function to
--   check each namespace for a symbol of the appropriate type. Fails with an error
--   appropriate for the end user if the symbol cannot be found.