diff options
Diffstat (limited to 'utils.hs')
| -rw-r--r-- | utils.hs | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -30,4 +30,10 @@ 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 + (first, rest) = splitAt n list + +splitToPair :: (Show a) => (a -> Bool) -> [a] -> ([a], [a]) +splitToPair f lst = + let x' = takeWhile (not . f) lst + y' = dropWhile (not . f) lst $> drop 1 + in (x', y') |
