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.
I wonder how its expressiveness compares with other languages.
Just beginning learning Haskell and this is just marvelous. It's really like they say: Experienced Haskell programmers tend to write less code, not more.
How would I learn such things? Should I finally start to write a real application with a framework which forces me to learn stuff..? I'd really appreciate some recommendations, especially those with free resources, since I'm not in a position to spend a lot of money right now.
L M A O
How can it be deduced that
sort x
will be memoized?A great lesson by example! I won't forget how to use mapM, not after this...
Agreed, I modified tests to check the Euclidean division property.
sort x
will be cached.I cannot see the failing string. This is driving me crazy!
Church Numeral had fold different than those of list.
There is arguably no good definition for
toInteger
, though it depends on what you expect it to do. It cannot be a (non-trivial) ring homomorphism, for instance.For
quotRem
, you ought to at least test the Euclidean division property: that the norm of r is less than the norm of the divisor.Thank you for pointing this out. No, there is a good definition. The test suite was incomplete. Just added a new test
The tests for the
Integral
instance don't really validate that it's a good definition. Probably because there arguably is no good definition.The following passes:
This comment is hidden because it contains spoiler information about the solution
I didn't hear about eta-conversion, I will study. About point-free I read again and again, but what I can't agree - someone says "Look, with points your code is more clear and nice", but in fact, it really leads to obfuscation.
You can think of it as partial application, at least with
anagrams w
, but the correct term is actually η-reduction.The Haskellwiki contains an article on pointfree, which might interest you. Note that while pointfree-style is sometimes succinct, it can also lead to obfuscation.
Loading more items...