aboutsummaryrefslogtreecommitdiffstats
path: root/utils.hs
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2021-12-20 11:25:34 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2021-12-20 12:28:20 +0200
commit47a2c42249aab79dd2aec4554d3387d2b47ced21 (patch)
treeb36ad2d28f6432ebe1e5d01772a519f7b4ac97d0 /utils.hs
parent247d7534c247f19be84c0984581279ef5545b1e6 (diff)
Day 19
Diffstat (limited to 'utils.hs')
-rw-r--r--utils.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils.hs b/utils.hs
index fb1ea96..e7e0d4b 100644
--- a/utils.hs
+++ b/utils.hs
@@ -8,9 +8,9 @@ import Control.Applicative (ZipList (ZipList, getZipList))
infixr 6 $>
-splitOn :: (Char -> Bool) -> String -> [String]
+splitOn :: (a -> Bool) -> [a] -> [[a]]
splitOn p s = case dropWhile p s of
- "" -> []
+ [] -> []
s' -> w : splitOn p s''
where
(w, s'') = break p s'