Ad
  • Custom User Avatar

    never saw abs before) thanks

  • Custom User Avatar

    This solution is very clever and uses Swift's functional programming capabilities to create an elegant one-liner. However, it can be inefficient for large numbers as it creates an infinite sequence.The solutions employ bit manipulation techniques (user8436785 and Swagger1337) are more efficient and do not suffer from the performance hit associated with large numbers.

  • Default User Avatar

    Hi there! Is is possible for you to explain this line of code in a bit more human way? I am still very new to Swift and I would like to understand what actually does this abs, reduce(1,*) :)) Thanks in advance for that!

  • Default User Avatar

    @suic. Seems to be working now :-). Many thanks for the quick turnaround.

  • Default User Avatar

    Thanks, it's fixed now. :) Sorry, it takes me time to develop a method which eliminates these issues while creating Haskell translations.

    Regards,

    suic

  • Default User Avatar

    @suic @SteffenVogel - Thanks for looking into this. I am now getting a different error. It passes the 'Run Examples' still but fails on 'Attempt' with the following error:

    /tmp/haskell1161118-18-1xmytx4.pq5qld6lxr/Main.hs:33:32:
    Not in scope: `value'
    Perhaps you meant value' (line 40)

    /tmp/haskell1161118-18-1xmytx4.pq5qld6lxr/Main.hs:34:32:
    Not in scope: `value'
    Perhaps you meant value' (line 40)

    /tmp/haskell1161118-18-1xmytx4.pq5qld6lxr/Main.hs:35:32:
    Not in scope: `value'
    Perhaps you meant value' (line 40)

    /tmp/haskell1161118-18-1xmytx4.pq5qld6lxr/Main.hs:35:43:
    Not in scope: `value'
    Perhaps you meant value' (line 40)

    Cheers,
    Preston

  • Default User Avatar

    @plspalding: Thanks, you're right. The reference implementation used in random tests was incomplete/incorrect. I've fixed it. Try now.

    Regards, suic

  • Default User Avatar

    Hey suic,
    could you please review the issue from "plspalding" with this kata?
    Thanks. :-)

  • Default User Avatar

    @suic: Can you review this?

  • Default User Avatar

    I am currently having a failure with a test case in Haskell:

    Falsifiable (after 4 tests and 3 shrinks):
    Nothing
    Just "1"

    From my understanding, I should be treating the Nothing as an empty string and the Just "1" as an empty string because it contains a character that isn't a letter. I have copied this code into a .hs file and ran the commands in ghci and my method returns True for this test.

    So I do: compare' (Just "1") Nothing and get the answer True. From my understanding this is correct. However I am still getting a failure. Any help would be appreciated!