I'm trying to understand how Haskell evalutes sep [1, 2, 3, 4, 5]
to get ([1, 3], [2, 4, 5])
where:
sep [ ] = ([ ], [ ])
sep [x] = ([ ], [x])
sep (x1:x2:xs) = let (is, ps) = sep xs in (x1:is, x2:ps)
I start like this:
sep [1, 2, 3, 4, 5] = let (is, ps) = sep [3, 4, 5] in (1:is, 2:ps)
but then?