Commit 7e4c6988 authored by simonmar's avatar simonmar
Browse files

[project @ 2002-10-15 13:17:40 by simonmar]

Move looksLikeModuleName here from InterativeUI, so we can use it elsewhere.
parent 0da818ee
......@@ -44,6 +44,9 @@ module Util (
unzipWith,
global,
-- module names
looksLikeModuleName,
) where
#include "../includes/config.h"
......@@ -64,6 +67,8 @@ import qualified List ( elem, notElem )
import List ( zipWith4 )
#endif
import Char ( isUpper, isAlphaNum )
infixr 9 `thenCmp`
\end{code}
......@@ -782,3 +787,12 @@ Global variables:
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}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment