re: Daily Challenge #99 - Balance the Scales VIEW POST

re: Haskell Note: I'm really unsure about what I have done since I'm pretty new to Haskell and that there are no expected result for the test cases (o...

Just spent a few moments reading through your code. Here is some feedback I have, but I'm also kinda new so don't take it too seriously.

  1. You should consider converting the first input array to a 2-tuple. You use it as a tuple in equalizer so having the type be a tuple will make the code clearer. It also forces you to do a little bit of input validation, which is always nice :D

  2. Some functions don't have a great name. Specifically, equalizer and combinationPairs. Personally, they should probably be verbs. combinations = combinePairs weights sounds a bit nicer, in my opinion.

Also, I like the use of applicative functors for the combinePairs function :)


Thanks for taking some time to help me on my journey.

code of conduct - report abuse