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: 
The Haskell-y approach is to use the `inits` and `tails` functions from `Data.List`:

```
inits [1,2,3,4] = [ [],        [1],     [1,2], [1,2,3], [1,2,3,4] ]
tails [1,2,3,4] = [ [1,2,3,4], [2,3,4], [3,4], [4],     [] ]

```

We then just zip these two lists together and drop the first pair:

```
splits xs = tail $ zip (inits xs) (tails xs)

```

or equivalently, drop the first element of each of the constituent lists first:

```
          = zip (tail (inits xs)) (tail (tails xs))

```
You have several mistakes.

You don't need to have `Num a` class for `a`.

use `[]` or `[x]` as pattern, but not a variable, use `xs` instead.

Use `++` instead of `+` for concatenating lists.

In our case use `(:)` to add list to value instead of `++`.

Add stop for recursion, like additional variable `maxn` to `splits'`

```
splits :: [a] -> [([a], [a])]
splits [] = error "shortList"
splits xs
       | lxs <= 1 = error "shortList"
       | otherwise = splits' xs 1 lxs
         where
           lxs = length xs
           splits' xs n maxn 
               | n > maxn  = []
               | otherwise = (take n xs, drop n xs) : splits' xs (n+1) maxn

```