Create unit test for Util module

This commit is contained in:
2021-11-08 11:12:09 +01:00
parent 42b2eb5e41
commit 66dad8ea00
5 changed files with 69 additions and 7 deletions

View File

@@ -63,6 +63,7 @@ controlChar x = case x of
explode :: (Foldable f) => (a -> Bool) -> f a -> [[a]]
explode predicate xs = filter (not . null) $ foldr split [[]] xs
where
split _ [] = []
split y (ys:yss)
| predicate y = []:ys:yss
| otherwise = (y:ys):yss
| otherwise = (y:ys):yss