summaryrefslogtreecommitdiffstats
path: root/src/utils.hs
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2022-01-29 23:11:03 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2022-01-29 23:11:03 +0200
commit649319b1dafb130801638c5a156e37d9e865ba5c (patch)
tree7bc633565d87c3bbebc7c67f6bbda10db6c13f21 /src/utils.hs
parent4d1a0eea5a433724764b4178d16fcb50d1c2b6bc (diff)
Implement strings as phrases of chars
Diffstat (limited to 'src/utils.hs')
-rw-r--r--src/utils.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utils.hs b/src/utils.hs
index 7618f5b..beff25e 100644
--- a/src/utils.hs
+++ b/src/utils.hs
@@ -31,5 +31,10 @@ isIntStr str =
Just _ -> True
Nothing -> False
+isCharStr str =
+ case str of
+ ['\'', c, '\''] -> True
+ _ -> False
+
breakOn :: (a -> Bool) -> [a] -> ([a], [a])
breakOn cond xs = break cond xs $> B.second (drop 1)