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.
( not all of these are done in this fork; I was mostly playing with the random generator )
void
thing, but showcase it in the example solution )The reference solution is actually unnecessary. I'll be editing that in.
Also, I saw no reason to punish users with symbols and scribbles; using letters only looks much more friendly. The JS original does the same, but shouts at solvers; using lowercase only looks, again, much more friendly.
No you can't. Even if you could, it should be forbidden; modifying inputs is bad bad bad.
This doesn't make much sense. It would be much more helpful to specify that
a
can be greater thanb
.If you were writing a complete stack including
NonEmptyT
, the implementation could probably be made to not need an outerListGen
, right?I've been playing with it for several hours. It's a lovely piece of work! :]
Writing a custom monolithic
newtype
probably often ( I think ) allows optimisations that a stack doesn't. And looking atASCIIStringT NonEmptyList
, thatASCIIStringT
had bettermap
to ASCII instead offilter
to it, or it's not guaranteed to maintain the non-empty invariant. Interactions may do unexpected things ..If I'm extending QuickCheck, I'd go whole hog, write a
NonEmptyT
as well, and throw in an innermostIdentity
. If it's worth doing at all, it's worth taking it all the way toIdentity
, and possibly beyond.If you wanted
SortedList (NonEmptyList Int)
, this wouldn't work; you'd still have to define your ownSorted
likeDistinct
here.If
Sorted
andNonEmpty
were defined ( somewhat, not exactly ) likeDistinct
here, you could useSortedT (DistinctT (NonEmptyT (Identity Int))
. That's where I was going with "transformer-like"newtype
s ( which would then have to bedata
s, defeating the purpose ).How would
Sorted (Distinct (NonEmptyList Int))
look? What's here, and thennewtype Sorted
,instance Wraps (Distinct (NonEmptyList))
? It doesn't look very scalable, the boilerplate explodes. It's already quite a bit more than the originalforAll
. That has no shrinking, but that can be added withforAllShrink
and ashrink
that's no larger than it is here. All the rest basically expands onnub <$> listOf1 arbitrary
.This comment is hidden because it contains spoiler information about the solution
That's an issue. Reraising as such.
Description should not specify sorting to determine the minimum. Don't encourage bad coding.
Specifying the transformation on the first value before telling solvers to return said first value is better description authoring.
approved
( Haskell )
random tests do not guarantee list length >= 3. update.
approved by someone
Object.keys
doesn't work on an iterable object ( well, it does, but it doesn't do what you want it to do ). You have to iterate it. Follow the link in the description and read up on the protocol.This question was already answered here.
Not a kata issue. Closing.
I wish that too. It was originally not even supposed to be a puzzle, but people kept perceiving it as such.
Can we let it be now? I'm not changing it anyway. It is what it is, and opinions are divided. Feel free to vote your conscience.
Loading more items...