Ad
  • Default User Avatar

    let rs = runParser p cs in if length rs == 1 then ...

    Imagine a highly ambigious parser that finds millions or even infite parses. This expression will first count them all before seeing it is not length 1, which may take (very) long.

    If you use a pattern match to check if the list is length 1, it will stop after finding a second parse.

  • Default User Avatar

    Then Codewars must be serving you with an old version of the kata. I have had people on my other katas complain about tests with completely different values from what I see when I edit the kata. Not sure what to do in this case.

  • Custom User Avatar

    I still have that issue

  • Default User Avatar

    Closing issue

  • Default User Avatar

    Ok guys, I think I have managed to get this patched up. It seems the 500 limit is per language and not for entire kata! The TAB was sitting in the Complete Solution and in the Test and Example cases. Not sure what the author did there.

  • Default User Avatar
  • Default User Avatar

    If I had a dollar everytime someone raised this exact same issue. Sorry mate, cant fix this, more than 500 people have completed the kata. Rule imposed by Codewars.

  • Custom User Avatar

    There's a tab character in the Test.hs for this problem.
    To be more specific, the system will never allow a solution being submitted because a simple stderr:
    STDERR:
    /tmp/haskell117027-18-yv6ht6.z39lr3sor/Codewars/G/Persistence/Test.hs:4:17: Warning:
    Tab character
    This tab character is exist in both client side example test code and server side test code, and the system misinterpreted the meaning of GHC warning and considered it as a error from the player.
    The tab character is right after the statement "import Data.Char" and should be removed in order to make the problem working again.