I want to split a list on 1 element and take the rest of the list in the second of the tuple and return that.
like this: *> split [1,2,3,2] gives [(1,[2,3,2]),(2,[1,3,2]),(3,[1,2,2]),(2,[1,2,3])]
I tried some code like this but it keeps giving me errors. Can someone help me out with this?
split :: [Int] -> [(Int,[Int])]
split [] = []
split (x:xs) = (map (x:) (map snd (split xs))) ++ [(x,[])]
Thx!