recursivelyImportExternalScopedUnit :: L2.L2Model -> L2.Identifier -> L2.L2ScopedUnitID -> ModelTranslation L2.L2ScopedUnitID
recursivelyImportExternalScopedUnit m ident (targetSUID@(L2.L2ScopedUnitID suname _)) =
  (setScopedUnitName suname) <$>
  (cacheWrapExternalImport mtsForeignToLocalScopedUnit (\x m -> m {mtsForeignToLocalScopedUnit = x}) $
     \foreignMod foreignURL targetSUID -> do
       newSUID <- L2.l2NextScopedUnitID <$> getL2Model
       modifyL2Model $ \mod -> mod {
         L2.l2NextScopedUnitID = (\(L2.L2ScopedUnitID _ i) -> L2.L2ScopedUnitID "unnamed!" (i + 1)) newSUID
         }
       return newSUID
  ) m ident targetSUID
recursivelyImportExternalScopedUnit :: L2.L2Model -> L2.Identifier -> L2.L2ScopedUnitID -> ModelTranslation L2.L2ScopedUnitID
recursivelyImportExternalScopedUnit m ident (targetSUID@(L2.L2ScopedUnitID suname _)) =
  (setScopedUnitName suname) <$>
  (cacheWrapExternalImport mtsForeignToLocalScopedUnit (\x m -> m {mtsForeignToLocalScopedUnit = x}) $
     \foreignMod foreignURL targetSUID -> do
       newSUID <- L2.l2NextScopedUnitID <$> getL2Model
       modifyL2Model $ \mod -> mod {
         L2.l2NextScopedUnitID = (\(L2.L2ScopedUnitID _ i) -> L2.L2ScopedUnitID "unnamed!" (i + 1)) newSUID
         }
       return newSUID
  ) m ident targetSUID
recursivelyImportExternalScopedUnit m ident (targetSUID@(L2.L2ScopedUnitID suname _)) =
  (setScopedUnitName suname) <$>
  (cacheWrapExternalImport mtsForeignToLocalScopedUnit (\x m -> m {mtsForeignToLocalScopedUnit = x}) $
     \foreignMod foreignURL targetSUID -> do
       newSUID <- L2.l2NextScopedUnitID <$> getL2Model
       modifyL2Model $ \mod -> mod {
         L2.l2NextScopedUnitID = (\(L2.L2ScopedUnitID _ i) -> L2.L2ScopedUnitID "unnamed!" (i + 1)) newSUID
         }
       return newSUID
  ) m ident targetSUID