Splitting a list by predicate
Welcome to the Haskell community :)
Haskellers like composition. Your logic is composed of 2 parts:
splitWhen :: (a -&gt; Bool) -&gt; [a] -&gt; [[a]]

toTuple :: [[a]] -&gt; ([a], [a])


Let's address splitWhen first.
E.g. splitWhen (== '2') &quot;132342245&quot; should be [&quot;13&quot;, &quot;33&quot;, &quot;&quot;, &quot;45&quot;].
To illustrate how it works:
initial state: (unconsumed input: &quot;132332245&quot;, aggregator: [&quot;&quot;])
step 1: (current input: '1', unconsumed input: &quot;32342245&quot;, aggregator: [&quot;1&quot;])
step 2: (current input: '3', unconsumed input:  &quot;2332245&quot;, aggregator: [&quot;13&quot;])
step 3: (current input: '2', unconsumed input:   &quot;332245&quot;, aggregator: [&quot;13&quot;,&quot;&quot;])
step 4: (current input: '3', unconsumed input:    &quot;32245&quot;, aggregator: [&quot;13&quot;,&quot;3&quot;])
step 5: (current input: '3', unconsumed input:     &quot;2245&quot;, aggregator: [&quot;13&quot;,&quot;33&quot;])
step 5: (current input: '2', unconsumed input:      &quot;245&quot;, aggregator: [&quot;13&quot;,&quot;33&quot;, &quot;&quot;])
step 6: (current input: '2', unconsumed input:       &quot;45&quot;, aggregator: [&quot;13&quot;,&quot;33&quot;, &quot;&quot;, &quot;&quot;])
step 7: (current input: '4', unconsumed input:        &quot;5&quot;, aggregator: [&quot;13&quot;,&quot;33&quot;, &quot;&quot;, &quot;4&quot;])
step 8: (current input: '5', unconsumed input:         &quot;&quot;, aggregator: [&quot;13&quot;,&quot;33&quot;, &quot;&quot;, &quot;45&quot;])

There are many ways to write this in Haskell, for example if we call the above logic f:
splitWhen :: (a -&gt; Bool) -&gt; [a] -&gt; [[a]]
splitWhen p xs = f xs [] -- the initial aggregator
    where f [] agg = [agg]
          f (y : ys) agg = if p y
                           then agg : f ys [] -- we are ignoring the element here
                           else f ys (agg ++ [y]) -- put y into the aggregator


Notice the pattern match (y : ys), they are the current input and unconsumed input.

Notice the recursive function call of f.



toTuple is trivial:
toTuple :: [[a]] -&gt; ([a], [a])
toTuple [] = ([], [])
toTuple [xs] = (xs, [])
toTuple (xs:ys:_) = (xs, ys)


Finally the exiting part - function composition:
splitAtPredicate :: (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
splitAtPredicate p = toTuple . splitWhen p

or if you are not yet comfortable with the pointfree style
splitAtPredicate :: (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
splitAtPredicate p xs = toTuple . splitWhen p xs

Because Haskell's lazy nature, splitAtPredicate will stop when it finds the second element that satisfies the predicate, as we have enough data to construct the pair.
To put everything together:
splitWhen :: (a -&gt; Bool) -&gt; [a] -&gt; [[a]]
splitWhen p xs = f xs [] -- the initial aggregator
    where f [] agg = [agg]
          f (y : ys) agg = if p y
                           then agg : f ys [] -- we are ignoring the element here
                           else f ys (agg ++ [y]) -- put y into the aggregator

toTuple :: [[a]] -&gt; ([a], [a])
toTuple [] = ([], [])
toTuple [xs] = (xs, [])
toTuple (xs:ys:_) = (xs, ys)

splitAtPredicate :: (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
splitAtPredicate p = toTuple . splitWhen p

Hope that helps :) And again welcome to the Haskell world.
If you haven't done it already, checkout https://hoogle.haskell.org , you'll love it :)