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.
system give 6 seconds to run this test. maybe you can try again.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I can't get the tests (or solution) to run fast enough. I wrote an optimizing system that runs simple (+-<>) loops in one step and runs the test suite in 0.1080 seconds on my machine - and it still times out on CodeWars. Would it be possible to have a compilation option? I think the Haskell Control.Lens package doesn't do that well in interpreted mode.
I'm getting the input [0, 1], which is labeled as [1, 1]. My code is not amused.
(It would also explode on [1, 1], but for a different reason.)
This comment is hidden because it contains spoiler information about the solution
Whilst useful, I think the
_Left
and_Right
exercises are a bit too hard, especially since the types are pretty hard to read, and it's non-obvious what thosePrism
s are al about.Did you consider monomorphing the
p
to->
(assuming that's possible)? This might make types easier to grok. If not, maybe adding another example of ap
instance could be useful.A beauty of this Kata is that it's a great first encounter with Van Larhoven lenses itself.
I added a test case, thanks!
My hope was that would be the case. The "lens use functions" reveal a lot of type information. I could have written them to take types quantified over the functor and profunctor, but that is both non-standard and harder to type-tetris.
I disagree, this is doable by pure type-tetris, with no previous knowledge of the theory.
The test cases don't cover
_Right
.The goal is precisely to drive people to learn more about van Laarhoven lenses :)
People who haven't encountered Van Larhoven lenses will be unable to succeed.