isTypeId, isValueId

Serge D. Mechveliani mechvel at
Sun Oct 5 04:55:22 EDT 2008


I need to implement the functions   
                        isTypeId, isValueId  :: String -> Bool

which check whether the argument fits respectively the syntax of a 
type identifier  and  of a  value identifier  -- in the Haskell-98 syntax
for a program.
The argument is produced by  lexLots. For example, my program applies
  lexLots "ab-(f_21 <Ab:c" -->   
                             -- I expect: 
                             ["ab", "-", "(", "f_21", "<", "Ab", ":", "c"]
                           -- 1               2            3          4

Then, I think, only (1), (2), (3) and (4) are type or value identifiers ...

What is the most regular expression for  isTypeId, isValueId ?
I presume to consider first the Standard library, and if fail, then the GHC 

Thank you in advance for your advice.


Serge Mechveliani
mechvel at

More information about the Glasgow-haskell-users mailing list