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 random also generates whitespace-only inputs sometimes.
So e.g. I'm getting:
The inputs
'␣'
,'␣␣'
,'␣␣␣'
... clearly violate the task description:The input
foo␣␣bar
is also not allowed by the spec. Yet still is occasionally given in the random test suite.And of course, the test is being nay darn strict about the (unspecified) rules of whitespace processing. Couldn't it
assert actual.strip() == expected.strip()
at least?... So nah thanks, I'll just skip this kata.
This is so mad but to tell the truth I had the same kata idea and I fully support it.
Hey, lolisa. You don't have to understand category theory to grok the Category typeclass in Haskell. It's just a typeclass with some laws and some operators for composition. Very cool to mess with though as you can 'break' — uhhh, I mean improve — a lot of things!
https://hackage.haskell.org/package/base-4.14.0.0/docs/Control-Category.html
I am not very good with cat theory. I dont see how it can help, maybe you can point me to some example?
A suggestion: would love to see an Isomorphism-style kata where you'd have to write a
Category
instance forISO
or something else -- and thanks to that, leverage some wicked cool machinery to achieve something useful.What has really kicked me in this kata: the realization that I could code every ISO by hand, as explicit
(ltr, rtl)
pairs with convoluted messy definitions ofltr, rtl
-- but I didn't have to, because Haskell could build those functions automatically, just by following my high-level proofs. Isn't this amazing!So, perhaps this insight could be reached from another angle: by offering the choice to hand-code a huge monster term VS to derive that same term by type magic.
Nice kata, I got new insights while completing it, enjoyed so much. In particular, ponder this (non-spoiler) question:
Also enjoyed: rewriting some of lolisa's definitions to choose a slightly simpler axiom system.