- #1
Horse
- 35
- 0
Homework Statement
I have two lambda expressions. Triblelist should trible every element in a list eg 1234 to 111222333444. N_th_list should do it n times. The problem is to give some value of n to n_th_list to receive triblelist. How can you do it? Help is really appreciated!
Homework Equations
triblelist = \list. ((fold F) nil ) list,
where F = \a b . cell a (cell a (cell a b))
n_th_list = \n list. ((fold (F n)) nil ) list,
where F = Y (\i .\n a b. n b (\p. cell a (i p a b)))
The Attempt at a Solution
It may be that my equations are wrong. I am not sure of n_th_list. The Y combinator confuses me. I have a bad habit of expanding everything, the calculations really get messy. How should I proceed?