jamesjwood/replaceimports icon
public
Published on 3/14/2025
replaceImports

Replace purescript imports with fully qualified ones

Prompts
replaceImports
Replace purescript imports with fully qualified ones
We are working in PureScript in @currentFile. 
1. Change all the imports to be fully qualified and aliased witjh the fully qualified name. e.g. change import "AppM.Language.Error as Err" to "import AppM.Language.Error as AppM.Language.Error"
  - However, do not do this for imports that include symbols e.g. import Type.Row (type (+)). Leave these as they are.
  - Do not alter the "import Prelude" line, this can be left as is.
2. Change all the imports that specify a specific function to import so that they import the whole module using the fully qualified name as an alias. e.g. change import "AppM.Language.Error (ERROR)" to "import AppM.Language.Error as AppM.Language.Error". 
3. Update all the references withing the code to use the new fully qualified names.
3. In the case that their are duplicate imports, remove them and use the fully qualified import instead