what do you think of removing the implicit qualified FastString import, so you have to explicitly import FastString?

currently about 86 modules using F/SLIT already import FastString

[EMAIL PROTECTED] /U/m/u/ghc-HEAD> grep -rl '\<SLIT\>\|\<FSLIT\>' compiler/|xargs grep -l 'import.*FastString'|wc -l
86

and 81 would need the import added

[EMAIL PROTECTED] /U/m/u/ghc-HEAD> grep -rl '\<SLIT\>\|\<FSLIT\>' compiler/|xargs grep -L 'import.*FastString'|wc -l
81

and about 12 have some sort of _unused with FS.something in the type (none use FS.xxx for the purpose of using FastString functionality, luckily)

[EMAIL PROTECTED] /U/m/u/ghc-HEAD> grep -r '\<FS\.' compiler/|wc -l
13

and 4 have a #define to eliminate the error or warning from importing FastString

[EMAIL PROTECTED] /U/m/u/ghc-HEAD> grep -r '\<COMPILING_FAST_STRING\>\|\<FAST_STRING_NOT_NEEDED\>' compiler/|wc -l
5



In other words, about 16 pieces of junk removed and 81 needed imports added... but GHC modules usually import lots of what they need, so why not? _ILIT already needs to be imported from FastTypes.



Also, I'm thinking of changing all the things like

import GHC.IOBase
to
import GHC_EXTS.IOBase

with this in HsVersions.h:

/* This makes it easier to test building without GHC extensions,
 * used in import statements such as "import GHC_EXTS.IOBase", to
 * provide distinguishment from the GHC API's module GHC */
#ifdef __GLASGOW_HASKELL__
#define GHC_EXTS GHC
#else
/* let it be an error */
#endif

seem okay? useless? bad? It would mean the macro should be used whenever GHC.* is imported (with this GHC.* meaning the non-portable stuff in package base), which would be impossible to enforce automatically (if it was possible then I wouldn't really need to make this change!)


~Isaac

_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to