Ad
  • Custom User Avatar

    This kata only seems to work on GHC 8.2.

  • Custom User Avatar

    Is this kata broken? The default test suite is complaining about a missing main.

  • Custom User Avatar

    It's also doing too much work.

  • Custom User Avatar

    I think it would be a good idea to explicitly import the functions in the tests.

    I defined "nil" in my implementation to make things a little easier, but I found that the final tests also defined this, so there was a name collision!

  • Custom User Avatar

    Guido hates the return type being dependent on argument values. That's why even 8/2 is 4.0 in sane Pythons, not 4. Although, of course, there is an exception. Can you tell what it is? :-]

  • Custom User Avatar

    This is a really nice solution!

    My only qualm with it is that uniform is a partial function, so this solution would cause a runtime error when given an empty string.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Oh good, I'm not crazy.

    Please fix this!

  • Custom User Avatar

    Yeah, you're right about the Codewars grouping! The main one that shows up lacks the spacing, though! I assume this was the first such solution.

    Take care! :)

  • Custom User Avatar

    You mean that you'd rather have abs (x1-x2) instead of abs(x1-x2). That's right, it would be much more natural in Haskell. In fact, I think that's what I wrote, but I think that codewars ignores white space when grouping solutions.

  • Custom User Avatar

    Having parenthesis right beside the function call in Haskell seems so strange to me! Nothing wrong with it, just don't see it much.

    but since this is an easier problem if any of you are new to haskell it's worth noting that function calls don't actually require parenthesis like they do in other programming languages (such as Python, C, etc.)

    f x

    instead of

    f(x)

    is perfectly fine :). It's nice because you get less noise with all of the parenthesis. I'm sure lots of you know about this, but sometimes when people format things like this they're secretly trying to make Haskell one of their other favourite programming languages ;).

    Cheers!

  • Custom User Avatar

    *Edit*: Sorry, completely misinterpreted your comment. I've added an issue to the kata and will add the 0 test as soon as #163 gets fixed.

  • Custom User Avatar

    Given the definition of perfect square in this Kata this solution is actually not correct. You should have n >= 0 because 0 is a perfect square in this problem! :)

  • Custom User Avatar

    Kind of annoying having this expect "f(x) = x + -1" instead of "f(x) = x - 1".

    Seems like it would be better to do the latter, since this is the format which is suggested by the description...

    "the function will always be in the format "nx +/- m", 'x +/- m', 'nx', 'x' or 'm'"

    I assumed that the output function would follow the same. There are not sufficient test cases by default to discern what output is desired in these cases, I think!

    Otherwise this was cute :).

  • Custom User Avatar

    My issue is with the specification. I don't see why this function shouldn't just handle an empty string by returning an empty string anyway. Why make the function less general for no particular reason? It seems better practice to me to handle the case with the empty string.

  • Loading more items...