How about this:
splitAt' = \n -> \xs -> (take n xs, drop n xs)
Some tests:
> splitAt' 3 [1..10] > ([1,2,3],[4,5,6,7,8,9,10]) > splitAt' 0 [1..10] > ([],[1,2,3,4,5,6,7,8,9,10]) > splitAt' 3 [] > ([],[]) > splitAt' 11 [1..10] > ([1,2,3,4,5,6,7,8,9,10],[]) > splitAt' 2 "haskell" > ("ha","skell")
jimmyt
source share