aboutsummaryrefslogtreecommitdiffstats
path: root/utils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'utils.hs')
-rw-r--r--utils.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/utils.hs b/utils.hs
index 0ba4bcb..740a58f 100644
--- a/utils.hs
+++ b/utils.hs
@@ -25,4 +25,9 @@ removeAt :: [Int] -> [b] -> [b]
removeAt is xs = mapWithIndex id xs $> filter (\(i', _) -> i' `notElem` is) .> map snd
slice :: Int -> Int -> [a] -> [a]
-slice from to xs = take (to - from + 1) (drop from xs) \ No newline at end of file
+slice from to xs = take (to - from + 1) (drop from xs)
+
+splitEvery _ [] = []
+splitEvery n list = first : splitEvery n rest
+ where
+ (first, rest) = splitAt n list \ No newline at end of file