rearrange

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2022-12-02 14:27:47 +05:30
parent 5fe3ea5567
commit 75ab2f6cf6
5 changed files with 25 additions and 16 deletions

11
Lib.hs Normal file
View File

@@ -0,0 +1,11 @@
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
)
[[]]