Ad
  • Custom User Avatar

    The haskell tests are totally broken; there are several solutions that just return a static string that succeed. Please fix!

  • Custom User Avatar

    I hit that mine too with my first implementation of pass1(), and was a little frustrated that the tree wasn't accepted and I had to refactor.

    That said, and to be fair, the grammar for expression and term does define the order the tree should be built in, altough it could be a nice gesture to explicitly state the associativity in the description too.

  • Custom User Avatar

    But your tree does not seem to conform to the associativity described with the grammar syntax? The grammar does not allow for expression on the right.

  • Custom User Avatar

    Honestly pretty disappointed that the tests only accept a certian tree for pass1. I really like the way I implemented it with the tree going the other way but now I have to refactor everything to get it going the other way and I'm having a really tough time of it.

    for example 1+2+3+4

    right: Add (Add (Add (Imm 1) (Imm 2)) (Imm 3)) (Imm 4)

    wrong: Add (Imm 1) (Add (Imm 2) (Add (Imm 3) (Imm 4)))

  • Custom User Avatar
  • Custom User Avatar

    I just finished my solution and I have a habit of working on these without even looking at the function definition. I was surprised when I saw it using Text instead of String but ultimately it was very easy to adapt my solution to use Text instead. Text also has a few more useful functions than String, but I had to install the package to work with it on my machine. For what it's worth, I think Text is fine.

  • Default User Avatar

    I was being rude. But clearly that's a joke. Well, half joke and half truth. Because I was devastated seeing other people's ultra short code without even being able to understand them.

    Don't take it seriously man. We need some laughter climbing the programming mountain, the Haskell mountain!

  • Custom User Avatar

    That's a bit rude, but not really. I'm a beginner to haskell and this is the solution that made sense to me. It just means I have more to learn :)

  • Default User Avatar

    You must be devasted seeing other people's short code :)