Question: I am a relative haskell newbie and am trying to create a list of tuples with an equation I named `splits` that arises from a single list originally, like this:

```
splits [1..4] --> [ ([1],[2,3,4]), ([1,2],[3,4]), ([1,2,3],[4]) ]

```

or

```
splits "xyz" --> [ ("x","yz"), ("xy","z") ]

```

Creating a list of tuples that take 1, then 2, then 3 elements, etc. I figured out I should probably use the take/drop functions, but this is what I have so far and I'm running into a lot of type declaration errors... Any ideas?

```
splits :: (Num a) => [a] -> [([a], [a])]

splits [] = error "shortList"

splits [x]
       | length [x] <= 1 = error "shortList"
       | otherwise = splits' [x] 1
         where splits' [x] n = [(take n [x], drop n [x])] + splits' [x] (n+1)

```

Answer: 
```
splits [] = []
splits [_] = []
splits (x:xs) = ([x], xs) : map (\(ys, zs) -> (x:ys, zs)) (splits xs)

```
There is a built in function that kind of does a part of what you want:

```
splitAt :: Int -> [a] -> ([a], [a])

```

which does what it looks like it would do:

```
> splitAt 2 [1..4]
([1,2],[3,4])

```

Using this function, you can just define splits like this:

```
splits xs = map (flip splitAt xs) [1..length xs - 1]

```