7 kyu

You Shall Not Parse!

Description
Loading description...
Parsing
Algorithms
  • Please sign in or sign up to leave a comment.
  • akar-0 Avatar

    Description is not clear about the criterions. Apparently we should accept leading zeros, that's not obvious and some languages reject this. We must also reject float shaped strings. This should be stated. Moreover tests logs are not informative enough: Expected False but got True, they should give the input. As far as I know one cannot print stuff in Haskell.

  • user6720290 Avatar

    I am new to Haskell, I want to print some of the input strings so I know what test cases I am failing. How can I do this?

    • Kacarott Avatar

      You've probably figured this out by now, but in case others are reading, you can print out strings for debugging using Debug.Trace however the downside is that prints will not be grouped with the specific test assertions, so figuring out specifically which input caused the fail can still be difficult.

  • DestyNova Avatar

    +1 for "throw a gigantic paddy".

  • nickie Avatar

    This comment has been hidden.

  • alphaq Avatar

    "-" is supposed to parse to a valid integer according to the reference implementation. However, this isn't specified, and is at least an edge case, if not a bug in the reference implementation.

  • surtich Avatar

    Your tests are not checking that "-" is a invalid number.

  • mtthw123 Avatar

    I suggest adding a test case with something like "--123" - assuming that isn't meant to parse a simple recursive solution might trip up over that. (And if it is meant to parse my solution definitely will).

  • bkaes Avatar

    This comment has been hidden.