Ad
  • Custom User Avatar

    Getting odds and evens swapped? Your list has 2,3,4,5,6 appearing odd number of times, the kata states there will be exactly one that appears an odd number of times. And yes, this trick only works if the input follows the rule.

  • Custom User Avatar

    Not these issues so much now, seems to have been replaced by the 6000ms timeout being pretty random; same deterministic code, same deterministic tests, sometimes it times out, sometimes it doesn't. That's only one kata (translation) though so not great sample size.

  • Custom User Avatar

    't' is the first character that repeats, 'e' is the character the repeats first

  • Custom User Avatar

    Haskell tests seem really unreliable, maybe about 4 out of 5 attempts or more seem to result in "Unknown error" or some timeout (not the 6000ms one)

  • Custom User Avatar
    1. It's just that isn't fn a keyword not an identifier, and you can't normally name your variables as keywords can you? If fn is accepted as variable or function name then things like fn + 1 and fn f and fn f + 1 should also be accepted, but I suspect that might trip existing solutions. Either way a test or two would make it less ambiguous.
    2. Right. I was probably thinking fn f fn => fn + 1 -- should be an error again because fn is a keyword.
  • Custom User Avatar

    In that case maybe it's not really a performance issue. Could it be simply getting into good old infinite loop? There's only so fast you can run those...

  • Custom User Avatar

    shrug I'm guessing a solution that passed all the tests helped getting through the translation process. FWIW there's two more in addition to that so this is doable.

    Are you sure you've addressed the right performance issues? A language like Befunge accesses the input grid an awful lot, a lot more than it can output and the most basic datatypes aren't always that great for performance.

  • Custom User Avatar

    Actually the Haskell tests have expected/actual values swapped, sorry about that. I don't know about fixing that though, I don't see any way to make edits to my translation, only to translate it to a new language.

  • Custom User Avatar

    It would be helpful to know which packages are available, e.g. while parsec isn't installed polyparse is.

  • Custom User Avatar

    Which version of hspec is it? I'm trying to use 'pendingWith' for a nicer behavior when test setup fails, but Test.Hspec isn't exporting it nor 'pending'?

  • Custom User Avatar

    I think the tests could cover few more corner cases, e.g. each of the following should probably be throwing errors

    (fn = 1)
    (fn f => 1)
    fn f => fn + 1
    fn fn => 1
    fn f a a => a
    
  • Custom User Avatar

    The "works for random strings" test seems wrong. Apparently returning Nothing for invalid regexps "a(" and "a)" is failing, is the test expecting Str [Normal 'a', Normal ')'] by any chance?