Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
The general form ended up working for me, I did have to mess with the ordering though
This comment is hidden because it contains spoiler information about the solution
same comments as on your other translation, plus:
random tests give unreadable failure messages to beginner solvers.
forAllBlind
, a custom generator, andTest.HUnit.assertEqual
should be able to give good failure messages. If you want an example, I just fixed up https://www.codewars.com/kata/5865918c6b569962950002a1/haskell ( you should be able to solve that rather quickly if you havent yet ).for an 8kyu kata, please show inputs in failure messages ( look into Test.HUnit.assertEqual ).
also, please factor out the reference solution from the random tests ( for maintainability ).
ooh, and make imports and exports from the user solution module explicit. imagine a scenario where solver exports
it
accidentally. importhelpAlex
only to the test module, and exporthelpAlex
only from the initial solution. help beginners develop good habits.Puzzling out leading-0 edge cases was interesting.
Cool concept, tests are annoying though.
I don't like that certain simplifications are required,
such as tan(x)' equaling 1 + tan^2(x) rather than sec^2(x).
Also (* x x) is rejected because of (^ x 2).
More nitpicky:
f(x)^g(x) => (g'(x)ln(f(x))+g(x)f'(x)/f(x))(f(x)^g(x)) is the general form (which works for monomials as well)
but I needed to hardcode in the specific monomial form to pass some tests.
That may be an interesting problem on its own:
Check if two functions that only use: constants 'x' + - * / ^ cos sin tan exp ln
are equal.
Though idk if that's even possible/decidable.