summaryrefslogtreecommitdiff
path: root/95-99/96.hs
diff options
context:
space:
mode:
Diffstat (limited to '95-99/96.hs')
-rw-r--r--95-99/96.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/95-99/96.hs b/95-99/96.hs
new file mode 100644
index 0000000..b051d8b
--- /dev/null
+++ b/95-99/96.hs
@@ -0,0 +1,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