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.
x:xs needs to be wrapped in parentheses
I've read about a proposal. But it doesn't matter, since my argument was of hypothetical nature. The
Show
class is used to produce a text representation of a value, which can be easily read back in with theRead
class, and nothing more.Isn't
2e4 :: Fractional a => a
per section 2.5? Do you have a link for2e4 :: Num a => a
? Also, section 9 specifiesinstance Show Integer
asshowsPrec = showSigned showInt
, which shows an integral number in base 10.That's exactly the point. And what if they allow
20000
to be written as a new kind of literal2e4
, then it could also be reflected in theShow
instance.People make assumptions about things, which probably will not hold. Bad code style.
You can even eta reduce that snippet to
digits = map digitToInt . show
. Either way, this will fail on negative input, such as-1234563
.