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.
Yes, the input validation was removed.
The tests now only pass valid inputs.
Either remove the requirement and only pass valid arguments, or have solvers throw an
Error
when encountering this.Passig invalid arguments breaks this promise. In general, input validation doesn't add to kata. In real life situations, validating inputs may be useful, but for kata, simplify the task ( input validation never is the primary task anyway ), and promise us valid input. Preferably explicitly, so we know we can focus on the essential task.
Accepting multiple encodings of arguments essentially has the same problem: it doesn't add to the kata, and just distracts from the essential task.
Was the input validation removed? Might be nice to mention that. I fully agree with removing it BTW, but I am confused now.
Needs more random tests. Some tests with randomly chosen input functions as well, at least ( you can just do some random calculations that always succeed in those functions ).
I think it's a lot better! It can be better still, I think, but I have hopes for this one.
Suic, what is your opinion? Does this have a place on CW and is it down to the details now? Or is it really not different enough?
pipeline
is passed binary functions, but returns a unary one. Make that explicit?Also, the last input function should have the identity function as its
next
. Also make that explicit? That also explains whypipeline()
should returnid
. People who don't know Monoids, not knowing any better, might passnull
instead ofid
.This really should be part the spec:
pipeline()
should return the identity function. It should therefore be in the description proper, not hidden away in the examples.Adding some more structure to the description may help us, and yourself as well, fully comprehend it. You might have sections
Task
,Examples
andInspiration
, withTask
containing all of the specs and none of the examples. Keep different things separated.I would suggest to have
pipeline
accept either(...fns)
or anArray
ofFunction
s, not both. Why complicate things?Callers can easily add or remove a pair of square brackets, you're not really making things easier on them, and it's not essential to the function composition.
I'd suggest passing an
Array
; it's the cleanest way to pass in a single, consistently typed object that may contain zero or more consistently typed objects ( i.e. functions ). ( It also makes some translations easier. )It has been in Draft in the interim. So he must have republished it.
There have been changes ( it has a different name at least ); I'll see if I want to update my rating.
I refactored the description.
The kata is still published.
try to replace
function snailArr
by closure$snailArr = function(){}
or declare the functionfunction
outside of the of the
snail
function. :)Java programmer detected.
Duplicate.
Simple Pig Latin
I guess you should improve the tests and description.
The test should cover:
Ex:
['b','x','a','j']
Ex:
['m','i','a','j','m']
Loading more items...