From 51842c43509f0c5d31d80ecc4ac87c5a36ac3928 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sat, 11 Dec 2021 16:35:10 +0200 Subject: Day 11 --- utils.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'utils.hs') 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 -- cgit v1.3