recursivelyImportExternalScopedDomain :: L2.L2Model -> L2.Identifier -> L2.L2ScopedDomainID -> ModelTranslation L2.L2ScopedDomainID
recursivelyImportExternalScopedDomain m ident (targetSUID@(L2.L2ScopedDomainID suname _)) =
  (setScopedDomainName suname) <$>
  (cacheWrapExternalImport mtsForeignToLocalScopedDomain (\x m -> m {mtsForeignToLocalScopedDomain = x}) $
     \foreignMod foreignURL targetSUID -> do
       newSUID <- L2.l2NextScopedDomainID <$> getL2Model
       modifyL2Model $ \mod -> mod {
         L2.l2NextScopedDomainID = (\(L2.L2ScopedDomainID _ i) -> L2.L2ScopedDomainID "unnamed!" (i + 1)) newSUID
         }
       return newSUID
  ) m ident targetSUID
recursivelyImportExternalScopedDomain :: L2.L2Model -> L2.Identifier -> L2.L2ScopedDomainID -> ModelTranslation L2.L2ScopedDomainID
recursivelyImportExternalScopedDomain m ident (targetSUID@(L2.L2ScopedDomainID suname _)) =
  (setScopedDomainName suname) <$>
  (cacheWrapExternalImport mtsForeignToLocalScopedDomain (\x m -> m {mtsForeignToLocalScopedDomain = x}) $
     \foreignMod foreignURL targetSUID -> do
       newSUID <- L2.l2NextScopedDomainID <$> getL2Model
       modifyL2Model $ \mod -> mod {
         L2.l2NextScopedDomainID = (\(L2.L2ScopedDomainID _ i) -> L2.L2ScopedDomainID "unnamed!" (i + 1)) newSUID
         }
       return newSUID
  ) m ident targetSUID
recursivelyImportExternalScopedDomain m ident (targetSUID@(L2.L2ScopedDomainID suname _)) =
  (setScopedDomainName suname) <$>
  (cacheWrapExternalImport mtsForeignToLocalScopedDomain (\x m -> m {mtsForeignToLocalScopedDomain = x}) $
     \foreignMod foreignURL targetSUID -> do
       newSUID <- L2.l2NextScopedDomainID <$> getL2Model
       modifyL2Model $ \mod -> mod {
         L2.l2NextScopedDomainID = (\(L2.L2ScopedDomainID _ i) -> L2.L2ScopedDomainID "unnamed!" (i + 1)) newSUID
         }
       return newSUID
  ) m ident targetSUID