Ad
  • Default User Avatar

    It's working now! Thanks very much.

  • Default User Avatar

    Haha, left isNothing in from debugging it months ago :) Completely useless now thankfully

  • Custom User Avatar

    Hi, I'm the original author of this Kata (Ruby version). Author of the haskell version didn't understand this Kata properly, and indeed added a DFS version instead of BFS.

    I have learned haskell to fix this. I added a BFS solution and a correct buildTree (thanks to @nickie for providing one). Please take a look again.

    Thanks,
    Karol

  • Custom User Avatar

    This has been reported several times, but the author isn't active anymore. See the issues by @muesli4, @karoyakani, @knotman90, @Thom, @lisphacker and @pcapriotti.

  • Default User Avatar

    Your first haskell test case is wrong. The tree looks like this


    2
    8 3
    9 1 4 5

    (Just (TreeNode {
    left = Just (TreeNode
    {left = Just (TreeNode
    {left = Nothing,
    right = Nothing,
    value = 9}),
    right = Just (TreeNode
    {left = Nothing,
    right = Nothing,
    value = 1}),
    value = 8}),
    right = Just (TreeNode
    {left = Just (TreeNode
    {left = Nothing,
    right = Nothing,
    value = 4}),
    right = Just (TreeNode
    {left = Nothing,
    right = Nothing,
    value = 5}),
    value = 3}),
    value = 2}))

  • Default User Avatar

    manhattanDistance( [1, 1], [1, 1] ) => returns 0

    is the example provided for JS users.
    (The description wasn't modified for Haskell)

  • Default User Avatar

    manhattanDistance( [1, 1], [1, 1] ) => returns 0

    should be manhattanDistance (1,1) (1,1)
    etc.