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 comment is hidden because it contains spoiler information about the solution
thanks to @mak.e
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
FWIW I think this is a great way to demonstrate some limitations of Haskell, as powerful its type system can be. Often laws are enforced in our heads only, but they're extremely important for reasoning with code. Thanks to the creator and those who gave hints!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This taught me that GHC is our friend, and to (at least kinda) think about the type unification process when reading error messages. I don't know if it'd help more people attempt this, but may some links or exposition about GADTs would help?
This comment is hidden because it contains spoiler information about the solution
I think this checks if a number is odd, not if it's a power of two. For example,
12 % 2
is equal to0
, yieldingTrue
but12
is not a power of two.This comment is hidden because it contains spoiler information about the solution