recursivelyImportExternalScopedValue :: L2.L2Model -> L2.Identifier -> L2.L2ScopedValueID -> ModelTranslation L2.L2ScopedValueID
recursivelyImportExternalScopedValue = cacheWrapExternalImport mtsForeignToLocalScopedValue (\x m -> m {mtsForeignToLocalScopedValue = x}) $
                                      \foreignMod foreignURL targetSVID -> do
  newSVID <- L2.l2NextScopedValueID <$> getL2Model
  modifyL2Model $ \mod -> mod {
    L2.l2NextScopedValueID = (\(L2.L2ScopedValueID i) -> L2.L2ScopedValueID (i + 1)) newSVID
    }
  return newSVID
recursivelyImportExternalScopedValue :: L2.L2Model -> L2.Identifier -> L2.L2ScopedValueID -> ModelTranslation L2.L2ScopedValueID
recursivelyImportExternalScopedValue = cacheWrapExternalImport mtsForeignToLocalScopedValue (\x m -> m {mtsForeignToLocalScopedValue = x}) $
                                      \foreignMod foreignURL targetSVID -> do
  newSVID <- L2.l2NextScopedValueID <$> getL2Model
  modifyL2Model $ \mod -> mod {
    L2.l2NextScopedValueID = (\(L2.L2ScopedValueID i) -> L2.L2ScopedValueID (i + 1)) newSVID
    }
  return newSVID
recursivelyImportExternalScopedValue = cacheWrapExternalImport mtsForeignToLocalScopedValue (\x m -> m {mtsForeignToLocalScopedValue = x}) $
                                      \foreignMod foreignURL targetSVID -> do
  newSVID <- L2.l2NextScopedValueID <$> getL2Model
  modifyL2Model $ \mod -> mod {
    L2.l2NextScopedValueID = (\(L2.L2ScopedValueID i) -> L2.L2ScopedValueID (i + 1)) newSVID
    }
  return newSVID