Move looksLikeModuleName here from InterativeUI, so we can use it elsewhere.
unzipWith,
global,
+
+ -- module names
+ looksLikeModuleName,
) where
#include "../includes/config.h"
import List ( zipWith4 )
#endif
+import Char ( isUpper, isAlphaNum )
+
infixr 9 `thenCmp`
\end{code}
global :: a -> IORef a
global a = unsafePerformIO (newIORef a)
\end{code}
+
+Module names:
+
+\begin{code}
+looksLikeModuleName [] = False
+looksLikeModuleName (c:cs) = isUpper c && all isAlphaNumEx cs
+
+isAlphaNumEx c = isAlphaNum c || c == '_' || c == '.'
+\end{code}