Ad
  • Custom User Avatar

    system give 6 seconds to run this test. maybe you can try again.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    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.

  • Default User Avatar

    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.)

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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 those Prisms 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 a p instance could be useful.

  • Custom User Avatar

    A beauty of this Kata is that it's a great first encounter with Van Larhoven lenses itself.

  • Custom User Avatar

    I added a test case, thanks!

  • Custom User Avatar

    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.

  • Custom User Avatar

    I disagree, this is doable by pure type-tetris, with no previous knowledge of the theory.

  • Custom User Avatar

    The test cases don't cover _Right.

  • Custom User Avatar

    The goal is precisely to drive people to learn more about van Laarhoven lenses :)

  • Default User Avatar

    People who haven't encountered Van Larhoven lenses will be unable to succeed.