Files
AoC2022/Lib.hs
Amneesh Singh 75ab2f6cf6 rearrange
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2022-12-02 16:03:09 +05:30

12 lines
192 B
Haskell

module Lib (split) where
split :: Eq a => a -> [a] -> [[a]]
split del =
foldr
( \c (x : xs) ->
if c == del
then [] : x : xs
else (c : x) : xs
)
[[]]