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.
This is tail recursive. However, Haskell doesn't need tail recursion to make its execution more memory-saving, due to its non-strict evaluation.
Since
randomIO
generates uniformly distributed numbers between [0,1], the(1 -) <$>
part is redundant, IMO.The
drop 1 res
part is incorrect. Since you append one element tores
when '(' is encountered, you should remove it from the tail ofres
when ')' is encountered, namelyinit res
.Sorry I didn't implement
sepBy
correctly. Now it works. Thank you :DI've clicked "Run sample tests" hundreds of times and the results were all green. But "Attempt" just gives me the error message. Shouldn't the test case
Should work when there're multiple parameters
in sectionWhen there's no lambda
beinvoke(a, b)
? How can the error message requires me returnLeft "Hugh?"
?When I run sample tests, my solution worked just fine. But when I click
attempt
, the same test case "When there's no lambda >> Should work when there're multiple parameters" doesn't work, the error message says I should returnLeft "Hugh?"
instead ofRight "f(a)"
. How would that happen?