Haskell: Splitting list into tuple of two new lists
问题 I am having difficulty figuring out how to split a list of Ints into a tuple containing two new lists, such that every element (starting with first) goes into the first list and every other element in the second. Like so: split [] = ([],[]) split [1] = ([1],[]) split [1,2] = ([1],[2]) split [1,2,3] = ([1,3],[2]) split [1,2,3,4] = ([1,3],[2,4]) I'm trying to accomplish this recursively(with guards) and only using the single argument xs This is my approach that keeps getting error messages: