summaryrefslogtreecommitdiff
path: root/95-99/96.hs
blob: b051d8bba7298961858a517cc016063ed62a0929 (plain) (blame)
1
2
3
4
5
6
7
8
9
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