I had to implement the haskell map function to work with church lists which are defined as following:

```
type Churchlist t u = (t->u->u)->u->u

```

In lambda calculus, lists are encoded as following:

```
[] := λc. λn. n
[1,2,3] := λc. λn. c 1 (c 2 (c 3 n))

```

The sample solution of this exercise is:

```
mapChurch :: (t->s) -> (Churchlist t u) -> (Churchlist s u)
mapChurch f l = \c n -> l (c.f) n

```

I have NO idea how this solution works and I don't know how to create such a function. I have already experience with lambda calculus and church numerals, but this exercise has been a big headache for me and I have to be able to understand and solve such problems for my exam next week. Could someone please give me a good source where I could learn to solve such problems or give me a little guidance on how it works?