diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2021-12-11 16:35:10 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2021-12-11 16:56:28 +0200 |
| commit | 51842c43509f0c5d31d80ecc4ac87c5a36ac3928 (patch) | |
| tree | d02af11d535976b6eb49166885ceb3b2c713e311 /utils.hs | |
| parent | a5b217240c57f89e3d483a940041efda9a8ee97c (diff) | |
Day 11
Diffstat (limited to 'utils.hs')
| -rw-r--r-- | utils.hs | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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 |
