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.
This comment is hidden because it contains spoiler information about the solution
Is there any place you can reference that unrolls this lazyness for us? I find it hard to tell that it's using laziness.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Cool, I love these things that lazines brings :) Thanks for explanation.
No it shouldn't this is because for an empty list
minimum
is never evaluated asdelete
will handle the case of an empty list without touching it's first argument.Will this not break with empty list?
λ> minimum []
*** Exception: Prelude.minimum: empty list
I chose
inject
instead ofvalue
. Do you think it makes sense to prevent uses of all not already defined functions? Is it even possible with the hidden function?I guess you're right. I'm going to change it.
It's fine if you want to forbid
Control.Applicative
. However, you should mention this at some point in the description. If a user wants to cheat, (s)he can simply search forApplicative
and take the default implementations of<$
,<*
,*>
and so on.Well, the
hidden
isn't about those, who don't know what they're doing, but those, who've already written parsers, right? That being said, you could check whether there are already katas onFunctor
,Applicative
andAlterantive
. If there aren't any, one could create additional small katas, which ultimately lead to katas like this, where one needs to implement the correct instance. But that's just over the top of my head.How about the following names instead:
Ha, almost forgot about that one. I was all for it, until now, haha. Guess I have to rename some things and forbid usage of the
Applicative
versions. What do you think?Sorry to disappoint you, you're too qualified. My intention was to teach people how to implement
Applicative
, and some combinators of it, in the first place, without letting them know what they're doing. This way they invented it by themselves. That is the reason I did not include it, otherwise it would be very easy, don't you think?Sorry that I'm flooding your kata's discourse page, but that's the last one (hopefully): the AMP will break your kata, as
<*>
will be ambigous in future versions of GHC:NOTE: This might or might not be a general Codewars problem, as I haven't seen the test cases yet. That being said, your current
Control.Applicative
test throws an exception, even thoughControl.Applicative
isn't used anymore.I will update this comment as soon as I've rewritten my submission - again.
EDIT1: Apparently, this is unrelated to your kata. Instead, there seems to be some hickup in
hidden
. I'll try to reproduce the behaviour tomorrow with a smaller example.Loading more items...