Ad
  • Custom User Avatar

    This is tail recursive. However, Haskell doesn't need tail recursion to make its execution more memory-saving, due to its non-strict evaluation.

  • Custom User Avatar

    Since randomIO generates uniformly distributed numbers between [0,1], the (1 -) <$> part is redundant, IMO.

  • Custom User Avatar

    The drop 1 res part is incorrect. Since you append one element to res when '(' is encountered, you should remove it from the tail of res when ')' is encountered, namely init res.

  • Custom User Avatar

    Sorry I didn't implement sepBy correctly. Now it works. Thank you :D

  • Custom User Avatar

    I've clicked "Run sample tests" hundreds of times and the results were all green. But "Attempt" just gives me the error message. Shouldn't the test case Should work when there're multiple parameters in section When there's no lambda be invoke(a, b) ? How can the error message requires me return Left "Hugh?" ?

  • Custom User Avatar

    When I run sample tests, my solution worked just fine. But when I click attempt, the same test case "When there's no lambda >> Should work when there're multiple parameters" doesn't work, the error message says I should return Left "Hugh?" instead of Right "f(a)". How would that happen?