Haskell/Solutions/Lists II

Note that, for our current purposes, it is indifferent whether to use  or , so don't worry if you have used one and the solutions below the other.

Rebuilding lists
1.

2.

3.

4.

5.

The function
1. A handful of variations for each function will be shown below, in a single block:

2. One possible solution:

N.B.: the RLE example is inspired from a blog post by Don Stewart on the same subject. If you are curious, check Don's post for a neat solution which likely won't not be immediately understandable, as it uses some things we didn't see yet.

Tips and tricks
1. Both  and   have the same value. This is possible because Haskell is a lazy language, thus in both cases the result is only evaluated as needed.

2.