splitByIndices :: [a] -> [Int] -> [[a]]
splitByIndices xs is = go xs (zipWith subtract (0:is) is) where
go [] _ = []
go xs (i:is) = let (a, b) = splitAt i xs in a : go b is
go xs _ = [xs]
This of course produces incorrect results when the indices aren't strictly increasing. You could enforce this condition with:
import Data.List
enforce :: [Int] -> [Int]
enforce = map head . group . sort
and then you can use enforce is
instead of is
.