Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I accidentally implemented
mult
aspow
and didn't realise because the test case formult
said it was correct (2*2
,2^2
)For Python, it's very common for you to get an error due to the maximum recursion depth.
sys.setrecursionlimit
.Test case has issue
expected your code to be in Lambda Calculus form
offending line: "add = m => n => f => x => m(f)(n(f)(x))"
C++ translation has been transferred for completeness from duplicate kata Church numbers, which is meant for removal.
You get the
Number
type, but not the constructor ( note that you do get the deconstructor ).No, you are not supposed to use the constructor. Not a kata issue.
This kata stays.
This kata stays.
Python translation
I tried using the constructor and ran into this, too.
You don't need the constructor, though.
The kata is solvable with just the provided imports, so I don't think this is an issue.
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/142.
Please join the discussion to help us identify duplicate kata and retire them.
Haskell version raised error:
"Data constructor not in scope: Number :: (p0 -> p1 -> p1) -> Number"
So, am I not supposed use Number constructor in the code?
LC translation
Ah ok, thank you, that helps. I'll look for the easier lamdba questions. I just finished my first 4kyu kata(a different one), it was tough, glad to know it's supposed to be that much harder than 6kyu.
For what it's worth, I was using JS. Thanks for the help :)
If you've never heard of Lambda Calculus before, it should not come as a complete surprise you'd have trouble solving a
4kyu
kata.You don't mention in which language you're solving; any language in which Lambda Calculus is embedded may make things more complicated, but even if you're solving directly in Lambda Calculus, there's still nuances of the compiler and the syntax.
The kata doesn't even attempt to explain Church numerals; it assumes quite a lot of domain knowledge actually. Maybe it's actually worth
4kyu
. :PIf you have specific questions, don't hesitate to ask. If you're completely groping in the dark, this just is not the kata for you ( yet ). There are other kata that do a better job of introducing Lambda Calculus and datatype encodings.
I've never heard of lambda calculus before. I researched it for a while and entered what I thought would be the correct answer and syntext, it throws errors but doesn't tell me anything aside from that. I feel the examples in the discription doesn't help and the test program just tells me if everything is correct or not but no details.
I guess my questions are: Is it obvious what it's asking for and the syntex it wants it in? Is the test program discriptive and helpful but i'm not understanding how to use it? If either of these are yes could someone give me some tips for understanding it?
Loading more items...