Ad
  • Custom User Avatar

    How do I know if I did it the inteded way?

  • Custom User Avatar

    Bleh. I didn't know lenses before I started, and I still dont know how most of the lensy things I just wrote work. This was frustrating; basically just blindly following types, with no intuition. What is a Protofunctor? What is a "witness"? Some crazy category theory stuff I guess?

    Towards the end of it, I was just motivated by sunk cost (and wanting to complain about how annoying it was).

    The last Iso problem is untested (so I could have left it blank), and I have no idea what "coerce" was about but it seemed to be happy with it as bottom, so I didn't touch it.

    Side note: Either is not traversable in this version of haskell, so I implemented it myself.

  • Custom User Avatar

    The instructions are not clear for someone who has not played bowling before. Specifically, I could not figure out how 2 or 3 balls are chosen in the 10th frame, and had to go spend a half hour looking up rules.

    I suggest adding something like this:

    If the player gets a strike on the tenth frame, they get two bonus balls, that only count towards the bonus score for that strike, not towards a frame score. Similarly, if they get a spare, they get one such bonus ball.

    This was rather frustrating to deal with, and has nothing to do with programming.

  • Custom User Avatar

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

  • Custom User Avatar

    So I notice that all the top solutions don't check for empty string. Are "empty strings" not considered a valid string, or is that just not a test we care about?

      describe "Empty string tests" $ do
        it "Doesn't play banjo..." $ do
          areYouPlayingBanjo "" `shouldBe` " does not play banjo"
    
  • Custom User Avatar

    You don't need to go low level or recursive for it though, just save the lengths in a tuple instead of recomputing them.

    Admittedly, my solution pulled in Arrows, which is also kinda silly.

  • Custom User Avatar

    Wouldn't this have a pretty terrible time complexity? The lengths are not going to be cached, right?