blob: b051d8bba7298961858a517cc016063ed62a0929 (
plain) (
tree)
|
|
import Data.Char (isLetter, isDigit)
identifier :: String -> Bool
identifier [] = False
identifier (c:xc) = isLetter c && loop xc
where loop [] = True
loop ('-':c:xc) = (isLetter c || isDigit c) && loop xc
loop (c:xc) = (isLetter c || isDigit c) && loop xc
|