I'm trying to build a function that takes a given number of arguments and always return the same value.
This is a part of an homework. There is a hint provided:
The "k-way T" is a function that takes k arguments and always returns T. A "0-way T" is just T.
Where k is provided as Church Numeral and T is the lambda expression for True (\x.\y.x).
The complete task is to provide an lambda expression that computes an k-way OR function. Where the number of 'boolean' arguments is provided before the 'boolean' arguments. e.g:
((OR 3) F T F)
But for now I'm trying to create that takes k arguments and returns always T. The k is provided as first argument.
((TRUE 2) T F) == T
So basically I wan't to create a function that has one more argument for each church numeral 'iteration'.
But somehow I'm completely stuck.
Can I do that with only an church numeral? Or do I need recursion (Y-Combinator)?
In general: Are there any good tools (e.g for visualization) that support the creation of lambda expressions.
I'm really astonished about the power of the lambda calculus and I really want to learn it. But I don't know how...
Thanks in advance