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.
Can someone please explain me this piece of code? what is id?
Yesn't,
Char
is an instance ofOrd
where the characters are ordered by their unicode codepoint. It does not really "threat them as they were numbers" but deep down at some point everything is an int eventually.wait, Haskell treats chars the same way as if they were numbers? like, he automatically converts char to number like ord() in python?
Yep, there was nothing about returning in requirements. So even shorter is possible :)
retern is not need there
You can encode maybe as well
They are the arguments of the function, like in any other program (python
def f(xs):
). But sometimes it is possible to not write them, like here, if we can write the code in pure terms of functions combinations. It's hard to explain clearly (and I'm far from being comfortable in Haskell) but try to practice on easy katas and look at others solutions, try to reuse them... With Haskell installed on your computer you can run a very handy interpreter that allows to do tiny tests easily.can someone explain this. Very new to haskell.
I am wondering why "xs" or any form of agruement is being used before the equal sign?
Ah this is basically the exact same approach I took, but with much less fanfare and ceremony, which ultimately results in a cleaner presentation anyway. Nice!
so cool!
Really cool approach. It's these kinds of code that made me learn haskell at first. Doing simple things the simple way
Could do
go (0::Word8)
and eliminate the need for
mod
No, siempre hay una forma mas redusida jajaj
.
It's fixed now. Please confirm.
Loading more items...